git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 157bc241 authored by Mike Sheldon's avatar Mike Sheldon

Update error messages to use the template's page heading

parent fd932bb1
......@@ -57,7 +57,7 @@ function sendEmail($email) {
}
if ($userlevel < 2) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Invalid privileges.');
$smarty->display('error.tpl');
die();
......@@ -66,7 +66,7 @@ if ($userlevel < 2) {
if (isset($action)) {
if ($action == 'invite') {
if (!isset($_GET['email'])) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Missing email.');
$smarty->display('error.tpl');
die();
......@@ -78,8 +78,8 @@ if ($userlevel < 2) {
$adodb->Execute($sql);
}
} else {
$smarty->assign('error', 'Error!');
$smarty->assign('error', 'Missing argument!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Missing argument!');
$smarty->display('error.tpl');
die();
}
......
......@@ -29,14 +29,14 @@ require_once('data/TagCloud.php');
try {
$artist = new Artist(urldecode($_GET['artist']));
} catch (exception $e) {
$smarty->assign('error', 'Artist not found.');
$smarty->assign('pageheading', 'Artist not found.');
$smarty->assign('details', 'The artist '.($_GET['artist']).' was not found in the database.');
$smarty->display('error.tpl');
die();
}
if(!isset($this_user) || !$this_user->manages($artist->name)) {
$smarty->assign('error', 'Permission denied');
$smarty->assign('pageheading', 'Permission denied');
$smarty->assign('error', 'You don\'t have permission to edit this artist\'s details.');
die();
}
......
......@@ -29,7 +29,7 @@ require_once('data/TagCloud.php');
try {
$artist = new Artist(urldecode($_GET['artist']));
} catch (exception $e) {
$smarty->assign('error', 'Artist not found.');
$smarty->assign('pageheading', 'Artist not found.');
$smarty->assign('details', 'The artist '.($_GET['artist']).' was not found in the database.');
$smarty->display('error.tpl');
die();
......
......@@ -24,7 +24,7 @@ require_once ('data/User.php');
require_once ('utils/random_code_generator.php');
if ($logged_in == false) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Not logged in! You shouldn\'t be here!');
$smarty->display('error.tpl');
die ();
......@@ -40,9 +40,8 @@ catch (exception $e) {
exit;
}
if (!$res) {
$error = 'Invalid code.';
$smarty->assign('error', 'Error!');
$smarty->assign('details', $error);
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Invalid code.');
$smarty->display('error.tpl');
die ();
} else {
......
......@@ -27,7 +27,7 @@ require_once('data/TagCloud.php');
if($logged_in == false)
{
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Not logged in! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -40,7 +40,7 @@ if ($_REQUEST['group']=='new')
try {
$result = Group::create(strtolower($_REQUEST['new']), $this_user);
} catch (exception $e) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', $e->getMessage());
$smarty->display('error.tpl');
die();
......@@ -66,7 +66,7 @@ $group = new Group($_REQUEST['group']);
if ($group->owner->name != $this_user->name)
{
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'You don\'t own this group!');
$smarty->display('error.tpl');
die();
......@@ -104,7 +104,7 @@ if ($_POST['submit'])
if (! $group->memberCheck($new_owner))
{
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Cannot assign group ownership to someone who is not a member!');
$smarty->display('error.tpl');
die();
......@@ -158,7 +158,7 @@ if(isset($group->name))
$smarty->assign('owner', $group->owner);
# And display the page.
$smarty->assign('errors', $errors);
$smarty->assign('pageheading', $errors);
$smarty->assign('newform', false);
try {
$aUserTagCloud = $group->tagCloudData();
......@@ -169,7 +169,7 @@ if(isset($group->name))
else
{
$smarty->assign('error', 'Group not found');
$smarty->assign('pageheading', 'Group not found');
$smarty->assign('details', 'Shall I call in a missing peoples report? This shouldn\'t happen.');
$smarty->display('error.tpl');
}
......
......@@ -68,7 +68,7 @@ if ($_REQUEST['country'])
else
{
$smarty->assign('error', 'Location not found');
$smarty->assign('pageheading', 'Location not found');
$smarty->assign('details', 'Shall I call in a missing locations report?');
$smarty->display('error.tpl');
}
......@@ -63,7 +63,7 @@ if(isset($_GET['auth'])) {
catch (exception $e) {
$errors = 'An error occurred.';
$details = $e->getMessage();
$smarty->assign('error', $errors);
$smarty->assign('pageheading', $errors);
$smarty->assign('details', $details);
$smarty->display('error.tpl');
die();
......@@ -130,7 +130,7 @@ if(isset($_POST['register'])) {
reportError('Create user, insert, register.php', $e->getMessage());
$errors .= 'An error occurred.';
$details = $e->getMessage();
$smarty->assign('error', $errors);
$smarty->assign('pageheading', $errors);
$smarty->assign('details', $details);
$smarty->display('error.tpl');
die();
......@@ -148,7 +148,7 @@ if(isset($_POST['register'])) {
reportError('AccountActivation, insert, register.php', $e->getMessage());
$errors .= 'An error occurred.';
$details = $e->getMessage();
$smarty->assign('error', $errors);
$smarty->assign('pageheading', $errors);
$smarty->assign('details', $details);
$smarty->display('error.tpl');
die();
......
......@@ -27,7 +27,7 @@ require_once('data/Server.php');
require_once('data/TagCloud.php');
if(!isset($_GET['tag'])) {
$smarty->assign('error', 'No tag specified');
$smarty->assign('pageheading', 'No tag specified');
$smarty->assign('details', 'You need to specify what tag you wish to view details for.');
$smarty->display('error.tpl');
die();
......@@ -40,7 +40,7 @@ try {
$tagCloud = TagCloud::generateTagCloud('tags', 'artist', 40, $tag, "tag");
$smarty->assign('tagcloud', $tagCloud);
} catch (exception $ex) {
$smarty->assign('error', 'No artists found');
$smarty->assign('pageheading', 'No artists found');
$smarty->assign('details', 'No artists could be found that have been tagged with "' . $tag . '"');
$smarty->display('error.tpl');
die();
......
......@@ -34,7 +34,7 @@ $smarty->assign('album', $album);
try {
$artist = new Artist($track->artist_name);
} catch (exception $e) {
$smarty->assign('error', 'Artist not found.');
$smarty->assign('pageheading', 'Artist not found.');
$smarty->assign('details', 'The artist ' . $track->artist_name . ' was not found in the database.');
$smarty->display('error.tpl');
die();
......
......@@ -26,7 +26,7 @@ require_once('data/TagCloud.php');
if($logged_in == false)
{
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Not logged in! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......
......@@ -27,7 +27,7 @@ require_once('data/TagCloud.php');
if($logged_in == false)
{
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Not logged in! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -193,7 +193,7 @@ if(isset($this_user->name))
else
{
$smarty->assign('error', 'User not found');
$smarty->assign('pageheading', 'User not found');
$smarty->assign('details', 'Shall I call in a missing persons report? This shouldn\'t happen.');
$smarty->display('error.tpl');
}
......
......@@ -28,7 +28,7 @@ require_once('data/Server.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'User not set! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -60,7 +60,7 @@ if(isset($user->name)) {
$smarty->display('user-groups.tpl');
} else {
$smarty->assign('error', 'User not found');
$smarty->assign('pageheading', 'User not found');
$smarty->assign('details', 'Shall I call in a missing persons report?');
$smarty->display('error.tpl');
}
......
......@@ -28,7 +28,7 @@ require_once('utils/arc/ARC2.php');
require_once('utils/human-time.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'User not set! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -37,7 +37,7 @@ if(!isset($_GET['user']) && $logged_in == false) {
$user = new User(urldecode($_GET['user']));
if(! $user->journal_rss ) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'You need an RSS feed set up for your account.');
$smarty->display('error.tpl');
die();
......
......@@ -27,7 +27,7 @@ require_once('data/TagCloud.php');
require_once('data/Server.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'User not set! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -82,7 +82,7 @@ if(isset($user->name)) {
$smarty->display('user-profile.tpl');
} else {
$smarty->assign('error', $error);
$smarty->assign('pageheading', $error);
$smarty->assign('details', 'Shall I call in a missing persons report?');
$smarty->display('error.tpl');
}
......
......@@ -27,7 +27,7 @@ require_once('data/TagCloud.php');
require_once('data/Server.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'User not set! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -77,7 +77,7 @@ if(isset($user->name)) {
$smarty->display('user-recent-tracks.tpl');
} else {
$smarty->assign('error', 'User not found');
$smarty->assign('pageheading', 'User not found');
$smarty->assign('details', 'Shall I call in a missing persons report?');
$smarty->display('error.tpl');
}
......
......@@ -27,7 +27,7 @@ require_once('data/TagCloud.php');
require_once('data/Server.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'User not set! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -57,7 +57,7 @@ if(isset($user->name)) {
$smarty->display('user-station.tpl');
} else {
$smarty->assign('error', $error);
$smarty->assign('pageheading', $error);
$smarty->assign('details', 'Shall I call in a missing persons report?');
$smarty->display('error.tpl');
}
......
......@@ -27,7 +27,7 @@ require_once('data/TagCloud.php');
require_once('data/Statistic.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('error', 'Error!');
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'User not set! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
......@@ -65,7 +65,7 @@ try {
try {
$smarty->assign('toptracks', $user->getTopTracks(40));
} catch (exception $e) {
$smarty->assign('error', 'Couldn\'t get users top tracks!');
$smarty->assign('pageheading', 'Couldn\'t get users top tracks!');
$smarty->assign('details', 'User ' . $user->name . ' doesn\'t seem to have scrobbled anything yet.');
$smarty->display('error.tpl');
die();
......@@ -93,7 +93,7 @@ try {
$smarty->assign('stats', true);
$smarty->display('user-stats.tpl');
} else {
$smarty->assign('error', 'User not found');
$smarty->assign('pageheading', 'User not found');
$smarty->assign('details', 'Shall I call in a missing persons report?');
$smarty->display('error.tpl');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment