forked from science-ation/science-ation
More changes to be able to at least barely use the system again
This commit is contained in:
parent
3766b0a3f6
commit
ec3be0f10f
@ -39,7 +39,7 @@ function user_valid_role($role)
|
|||||||
function user_load($users_id, $accounts_id = false)
|
function user_load($users_id, $accounts_id = false)
|
||||||
{
|
{
|
||||||
/* Load user, join accounts so we also load the email, superuser flag */
|
/* Load user, join accounts so we also load the email, superuser flag */
|
||||||
$query = "SELECT * FROM users JOIN accounts ON accounts.id=users.accounts_id WHERE ";
|
$query = "SELECT users.* FROM users JOIN accounts ON accounts.id=users.accounts_id WHERE ";
|
||||||
if($accounts_id != false) {
|
if($accounts_id != false) {
|
||||||
$accounts_id = intval($accounts_id);
|
$accounts_id = intval($accounts_id);
|
||||||
$query .= "`users`.`accounts_id`='$accounts_id' LIMIT 1";
|
$query .= "`users`.`accounts_id`='$accounts_id' LIMIT 1";
|
||||||
@ -511,10 +511,10 @@ function user_auth_required($all_required = array(), $one_required = array())
|
|||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
unset($_SESSION['request_uri']);
|
unset($_SESSION['request_uri']);
|
||||||
if(!isset($_SESSION['roles']) || !isset($_SESSION['users_id'])) {
|
if(!isset($_SESSION['roles']) || !isset($_SESSION['accounts_id'])) {
|
||||||
message_push(error(i18n("You must login to view that page")));
|
message_push(error(i18n("You must login to view that page")));
|
||||||
$_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
|
$_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
|
||||||
header("location: {$config['SFIABDIRECTORY']}/user_login.php?type=$type");
|
header("location: {$config['SFIABDIRECTORY']}/user_login.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ function api_user_auth_required($all_required = array(), $one_required = array()
|
|||||||
$ok = true;
|
$ok = true;
|
||||||
$ret=array();
|
$ret=array();
|
||||||
|
|
||||||
if(!isset($_SESSION['roles'])) {
|
if(!isset($_SESSION['roles']) || !isset($_SESSION['accounts_id'])) {
|
||||||
$ret['status']="error";
|
$ret['status']="error";
|
||||||
$ret['error']="Not logged in";
|
$ret['error']="Not logged in";
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -156,7 +156,7 @@ case 'save':
|
|||||||
$d = '';
|
$d = '';
|
||||||
$email = $a['email'];
|
$email = $a['email'];
|
||||||
$username_link = ($a['link_username_to_email'] == 'yes') ? 'checked="checked"' : '';
|
$username_link = ($a['link_username_to_email'] == 'yes') ? 'checked="checked"' : '';
|
||||||
$username = $email;
|
$username = $a['username'];
|
||||||
|
|
||||||
if($_SESSION['password_expired'] == true) {
|
if($_SESSION['password_expired'] == true) {
|
||||||
echo error(i18n('Your password has expired. You must choose a new password now.'));
|
echo error(i18n('Your password has expired. You must choose a new password now.'));
|
||||||
|
@ -46,7 +46,7 @@ $tabs = array( 'fairinfo' => array(
|
|||||||
'personal' => array(
|
'personal' => array(
|
||||||
'label' => 'Personal',
|
'label' => 'Personal',
|
||||||
'name' => 'Personal Information',
|
'name' => 'Personal Information',
|
||||||
'types' => array('student','judge','committee','volunteer','sponsor','fair'),
|
'types' => array('teacher','student','judge','committee','volunteer','sponsor','fair'),
|
||||||
'file' => 'user_personal.php',
|
'file' => 'user_personal.php',
|
||||||
'status_func' => 'user_personal_info_status',
|
'status_func' => 'user_personal_info_status',
|
||||||
),
|
),
|
||||||
@ -96,14 +96,14 @@ $tabs = array( 'fairinfo' => array(
|
|||||||
'account' => array(
|
'account' => array(
|
||||||
'label' => 'Account/Login',
|
'label' => 'Account/Login',
|
||||||
'name' => 'Change Username/Email/Password',
|
'name' => 'Change Username/Email/Password',
|
||||||
'types' => array('student','judge','committee','volunteer','sponsor','fair'),
|
'types' => array('teacher','student','judge','committee','volunteer','sponsor','fair'),
|
||||||
'file' => 'user_account.php',
|
'file' => 'user_account.php',
|
||||||
'status_func' => false,
|
'status_func' => false,
|
||||||
),
|
),
|
||||||
'roles' => array(
|
'roles' => array(
|
||||||
'label' => 'Roles',
|
'label' => 'Roles',
|
||||||
'name' => 'Add/Remove Roles',
|
'name' => 'Add/Remove Roles',
|
||||||
'types' => array('student','judge','committee','volunteer','sponsor','fair'),
|
'types' => array('teacher','student','judge','committee','volunteer','sponsor','fair'),
|
||||||
'file' => 'user_roles.php',
|
'file' => 'user_roles.php',
|
||||||
'status_func' => false,
|
'status_func' => false,
|
||||||
),
|
),
|
||||||
@ -137,7 +137,6 @@ if(count($a) == 0) {
|
|||||||
|
|
||||||
send_header(i18n("User Editor").": {$u['name']}");
|
send_header(i18n("User Editor").": {$u['name']}");
|
||||||
|
|
||||||
|
|
||||||
/* Setup tabs */
|
/* Setup tabs */
|
||||||
echo '<div id="tabs">';
|
echo '<div id="tabs">';
|
||||||
echo '<ul>';
|
echo '<ul>';
|
||||||
@ -165,7 +164,7 @@ foreach($tabs as $k=>$t) {
|
|||||||
$index++;
|
$index++;
|
||||||
|
|
||||||
/* Show the tab */
|
/* Show the tab */
|
||||||
$href = "{$t['file']}?id=$id";
|
$href = "{$t['file']}?id=$edit_id";
|
||||||
echo "<li><a href=\"$href\"><span>".i18n($t['label'])."</span></a></li>";
|
echo "<li><a href=\"$href\"><span>".i18n($t['label'])."</span></a></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user