forked from science-ation/science-ation
Fix logging in and switching conferences, man, this is becoming a mess
This commit is contained in:
parent
e03902bbec
commit
81f3f3235a
@ -209,7 +209,8 @@ if(is_array($nav)) {
|
||||
?>
|
||||
<ul class="primarynav">
|
||||
<?
|
||||
/*
|
||||
//if they arent logged in, we need _some_ sort of navigation
|
||||
if(!is_array($_SESSION['roles'])) {
|
||||
if ($config['website']) {
|
||||
if ($config['website_name']) {
|
||||
echo "<li><a href=\"{$config['website']}\">{$config['website_name']}</a></li>";
|
||||
@ -236,6 +237,9 @@ if(is_array($nav)) {
|
||||
|
||||
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/important_dates.php\">".i18n("Important Dates").'</a></li>';
|
||||
echo $registrationconfirmationlink;
|
||||
}
|
||||
|
||||
/*
|
||||
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/register_participants.php\">".i18n("Participant Registration").'</a></li>';
|
||||
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?type=judge\">".i18n("Judges Registration").'</a></li>';
|
||||
if($config['volunteer_enable'] == 'yes') {
|
||||
|
@ -759,6 +759,9 @@ function try_login($user, $pass)
|
||||
|
||||
function user_conference_load($accounts_id,$conferences_id) {
|
||||
global $config;
|
||||
if(! ($accounts_id && $conferences_id))
|
||||
return $config['SFIABDIRECTORY']."/index.php";
|
||||
|
||||
/* Use the active conference to find the user id to load */
|
||||
/* FIXME: Need to be able to handle the case where there is no
|
||||
* active conference, but one step at a time */
|
||||
|
@ -108,14 +108,27 @@ if(isset($_SESSION['accounts_id'])) {
|
||||
$val=null;
|
||||
|
||||
if($val=user_conference_load($accounts_id,$_SESSION['conferences_id'])) {
|
||||
header("Location: $status");
|
||||
}
|
||||
} else if($_GET['action']=="switchconference") {
|
||||
//get rid of their current roles, and load their record for the new conference
|
||||
$_SESSION['roles']=array();
|
||||
if($val=user_conference_load($_SESSION['accounts_id'],$_SESSION['conferences_id'])) {
|
||||
header("Location: $val");
|
||||
}
|
||||
else
|
||||
header("Location: ".$config['SFIABDIRECTORY']."/index.php");
|
||||
exit;
|
||||
|
||||
} else if($_GET['action']=="switchconference") {
|
||||
//get rid of their current roles, and load their record for the new conference
|
||||
if(is_array($_SESSION['roles'])) {
|
||||
$_SESSION['roles']=array();
|
||||
if($val=user_conference_load($_SESSION['accounts_id'],$_SESSION['conferences_id'])) {
|
||||
header("Location: $val");
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
header("Location: ".$config['SFIABDIRECTORY']."/index.php");
|
||||
}
|
||||
}
|
||||
else {
|
||||
header("Location: ".$config['SFIABDIRECTORY']."/index.php");
|
||||
}
|
||||
} else if($_GET['action']=='logout') {
|
||||
/* Session keys to skip on logout */
|
||||
$skip = array('debug', 'lang', 'messages');
|
||||
|
Loading…
Reference in New Issue
Block a user