We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b737a34c authored by P. J. McDermott's avatar P. J. McDermott

Catch more User::__construct() Exceptions.

All Nixtape views now catch Exceptions thrown by the User class's
constructor.
parent 5a4759fd
......@@ -43,6 +43,10 @@ if(isset($_COOKIE['session_id'])) {
} else {
$logged_in = true;
$username = uniqueid_to_username($row['userid']);
$this_user = new User($username);
try {
$this_user = new User($username);
} catch (Exception $e) {
$err = 1;
}
}
}
......@@ -100,7 +100,14 @@ if ($_POST['submit'])
{
if ($_POST['owner'] != $group->owner->username)
{
$new_owner = new User($_POST['owner']);
try {
$new_owner = new User($_POST['owner']);
} catch (Exception $e) {
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Cannot assign group ownership to someone who does not exist!');
$smarty->display('error.tpl');
die();
}
if (! $group->memberCheck($new_owner))
{
......
......@@ -42,7 +42,9 @@ if ($_REQUEST['country'])
$res = $adodb->GetAll($q);
foreach($res as &$row) {
$userlist[] = new User($row['username'], $row);
try {
$userlist[] = new User($row['username'], $row);
} catch (Exception $e) {}
}
$smarty->assign('country', strtoupper($_REQUEST['country']));
......
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