refactor config into config & super pages, 'config' page is now 'conference config' specifically for the conference, all non-conference related tasks are moved to the superuser page

This commit is contained in:
james 2010-06-23 21:18:06 +00:00
parent 1743beb14e
commit c086e7e0bb
16 changed files with 60 additions and 60 deletions

View File

@ -1,14 +1,11 @@
<?
function committee_auth_has_access($access="")
{
function committee_auth_has_access($access="") {
switch($access) {
case 'config': return ($_SESSION['access_config'] == 'yes') ? true : false;
case 'admin': return ($_SESSION['access_admin'] == 'yes') ? true : false;
case 'super': return ($_SESSION['access_super'] == 'yes') ? true : false;
case 'config': return ($_SESSION['access_config'] == 'yes') ? true : false;
case 'admin': return ($_SESSION['access_admin'] == 'yes') ? true : false;
case 'super': return ($_SESSION['access_super'] == 'yes') ? true : false;
}
return false;
}
@ -24,5 +21,4 @@ function committee_status_update(&$u)
return ($u['committee_complete'] == 'yes') ? 'complete' : 'incomplete';
}
?>

View File

@ -40,10 +40,10 @@
if(isset($_SESSION['conferenceid'])) {
echo " <tr>";
if(committee_auth_has_access('config')) {
echo " <td><a href=\"config/index.php\">".theme_icon("configuration")."<br />".i18n("Configuration")."</a></td>";
echo " <td><a href=\"config/index.php\">".theme_icon("configuration")."<br />".i18n("Conference Configuration")."</a></td>";
}
if(committee_auth_has_access('admin')) {
echo " <td><a href=\"admin/index.php\">".theme_icon("administration")."<br />".i18n("Administration")."</a></td>";
echo " <td><a href=\"admin/index.php\">".theme_icon("administration")."<br />".i18n("Conference Administration")."</a></td>";
echo " <td><a href=\"admin/reports.php\">".theme_icon("print/export_reports")."<br />".i18n("My Reports (View/Print/Edit)")."</a></td>";
}
echo " </tr>\n";
@ -61,7 +61,7 @@
if(committee_auth_has_access('super')) {
echo "<br />";
echo "<br />";
echo " <a href=\"super/index.php\">Science In A Box Super Configuration</a><br />";
echo " <a href=\"super/index.php\">System Setup (Superuser)</a><br />";
}

View File

@ -588,6 +588,9 @@ if($_SESSION['users_type'] == 'committee') {
if(committee_auth_has_access("config")){
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/config/\">".i18n("Configuration").'</a></li>';
}
if(committee_auth_has_access("super")){
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/super/\">".i18n("System Setup").'</a></li>';
}
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_login.php?action=logout\">".i18n("Logout").'</a></li>';
} else if($_SESSION['users_type']=="judge") {
echo "<li><a href=\"{$config['SFIABDIRECTORY']}/user_personal.php\">".i18n("My Profile").'</a></li>';

View File

@ -27,7 +27,7 @@
user_auth_required('committee', 'config');
send_header("Dates",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
'Conference Configuration' => 'config/index.php')
,"important_dates"
);

View File

@ -25,18 +25,13 @@
require_once('../common.inc.php');
require_once('../user.inc.php');
user_auth_required('committee', 'config');
if($conference['id']) {
$title=$conference['name']." Logo Image";
$cstr=$conference['id']."-";
}
else {
$title="Fair Logo Image";
$cstr="";
}
$title=$conference['name']." Logo Image";
$cstr=$conference['id']."-";
send_header($title,
array('Committee Main' => 'committee_main.php',
'Configuration' => 'config/index.php'),
'Conference Configuration' => 'config/index.php'),
"images");
if($_POST['action']=="addimage") {

View File

@ -26,7 +26,7 @@
require_once("../user.inc.php");
user_auth_required('committee', 'config');
send_header("Configuration",
send_header("Conference Configuration",
array('Committee Main' => 'committee_main.php')
,"configuration"
);
@ -34,7 +34,6 @@
if($conference['type']=='scienceolympics') {
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"systemvariables.php\">".theme_icon("configuration_variables")."<br />".i18n("System Configuration Variables")."</a></td>";
echo " <td><a href=\"variables.php\">".theme_icon("configuration_variables")."<br />".i18n("Conference Configuration Variables")."</a></td>";
echo " <td><a href=\"dates.php\">".theme_icon("important_dates")."<br />".i18n("Important Dates")."</a></td>";
//echo " <td><a href=\"categories.php\">".theme_icon("project_age_categories")."<br />".i18n("Age Categories")."</a></td>";
@ -46,7 +45,6 @@
else {
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"systemvariables.php\">".theme_icon("configuration_variables")."<br />".i18n("System Configuration Variables")."</a></td>";
echo " <td><a href=\"variables.php\">".theme_icon("configuration_variables")."<br />".i18n("Conference Configuration Variables")."</a></td>";
echo " <td><a href=\"dates.php\">".theme_icon("important_dates")."<br />".i18n("Important Dates")."</a></td>";
echo " <td><a href=\"categories.php\">".theme_icon("project_age_categories")."<br />".i18n("Project Age Categories")."</a></td>";
@ -67,25 +65,5 @@
echo "</table>\n";
}
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"languagepacks.php\">".theme_icon("language_pack_installer")."<br />".i18n("Language Pack Installer")."</a></td>";
echo " <td><a href=\"versionchecker.php\">".theme_icon("new_version_checker")."<br />".i18n("New Version Checker")."</a></td>";
echo " <td></td>\n";
echo " <td></td>\n";
echo " </tr>";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"rollover.php\">".theme_icon("rollover_fair_year")."<br />".i18n("Rollover Fair Year")."</a></td>";
echo " <td><a href=\"rolloverfiscal.php\">".theme_icon("rollover_fiscal_year")."<br />".i18n("Rollover Fiscal Year")."</a></td>";
echo " <td><a href=\"backuprestore.php\">".theme_icon("backup_restore")."<br />".i18n("Database Backup/Restore")."</a></td>";
echo " <td></td>\n";
echo " <td></td>\n";
echo " </tr>";
echo "</table>\n";
send_footer();
?>

View File

@ -55,7 +55,7 @@
send_header("Conference Configuration Variables",
array('Committee Main' => 'committee_main.php',
'Configuration' => 'config/index.php')
'Conference Configuration' => 'config/index.php')
,"configuration_variables"
);

View File

@ -23,7 +23,7 @@
<?
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'config');
user_auth_required('committee', 'super');
//make sure backup/restore folder exists, and htaccess it to deny access
if(!file_exists("../data/backuprestore"))
@ -86,7 +86,7 @@ echo $dump;
else if($_POST['action']=="restore") {
echo send_header("Database Backup/Restore",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
'System Setup' => 'super/index.php')
,"backup_restore"
);
echo i18n("Processing file: %1",array($_FILES['restore']['name']))."<br />\n";
@ -148,7 +148,7 @@ else if($_POST['action']=="restore") {
else if($_POST['action']=="restoreproceed") {
echo send_header("Database Backup/Restore",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
'System Setup' => 'super/index.php')
,"backup_restore"
);
@ -200,7 +200,7 @@ else
{
echo send_header("Database Backup/Restore",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
'System Setup' => 'super/index.php')
,"backup_restore"
);

View File

@ -28,7 +28,7 @@
send_header("Conferences Setup",
array('Committee Main' => 'committee_main.php',
'Science In A Box Super Configuration' => '/super/index.php')
'System Setup' => '/super/index.php')
,"configuration"
);
?>

View File

@ -31,15 +31,35 @@
,"configuration"
);
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"systemvariables.php\">".theme_icon("configuration_variables")."<br />".i18n("System Configuration Variables")."</a></td>";
echo " <td><a href=\"conferences.php\">".theme_icon("conferences")."<br />".i18n("Conferences Setup")."</a></td>";
echo " <td></td>\n";
echo " <td></td>\n";
echo " <td></td>\n";
echo " </tr>";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"languagepacks.php\">".theme_icon("language_pack_installer")."<br />".i18n("Language Pack Installer")."</a></td>";
echo " <td><a href=\"versionchecker.php\">".theme_icon("new_version_checker")."<br />".i18n("New Version Checker")."</a></td>";
echo " <td></td>\n";
echo " <td></td>\n";
echo " </tr>";
echo "</table>\n";
echo "<hr />";
echo "<table class=\"adminconfigtable\">";
echo " <tr>";
echo " <td><a href=\"rollover.php\">".theme_icon("rollover_fair_year")."<br />".i18n("Rollover Fair Year")."</a></td>";
echo " <td><a href=\"rolloverfiscal.php\">".theme_icon("rollover_fiscal_year")."<br />".i18n("Rollover Fiscal Year")."</a></td>";
echo " <td><a href=\"backuprestore.php\">".theme_icon("backup_restore")."<br />".i18n("Database Backup/Restore")."</a></td>";
echo " <td></td>\n";
echo " <td></td>\n";
echo " </tr>";
echo "</table>\n";
send_footer();
?>

View File

@ -24,10 +24,10 @@
<?
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'config');
user_auth_required('committee', 'super');
send_header("Language Packs",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
'System Setup' => 'super/index.php')
,"language_pack_installer"
);

View File

@ -25,10 +25,10 @@
require("../common.inc.php");
require_once("../user.inc.php");
require_once("../config_editor.inc.php");
user_auth_required('committee', 'config');
user_auth_required('committee', 'super');
send_header("Year Rollover",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
'System Setup' => 'super/index.php')
,"rollover_fair_year"
);
?>

View File

@ -1,6 +1,12 @@
<?
//FIXME: I just ripped these out of the fair year rollover since they are no longer tied to the fair year, they are now tied to the FISCAL year, we'll need to implement a new fiscal year rollover mechanism similar to the fairyear rollover
//FIXME: The table names are also wrong since i've now renamed htem all, will fix when the fiscal rollover is implemented
include "../common.inc.php";
send_header("Fiscal Rollover");
echo "not implemented yet";
send_footer();
exit;
echo i18n("Rolling fundraising goals")." <br />";
roll($currentfairyear, $newfairyear, "fundraising",
array("type","name","description","system","goal"));

View File

@ -25,7 +25,7 @@
require("../common.inc.php");
require_once("../user.inc.php");
require_once("../config_editor.inc.php");
user_auth_required('committee', 'config');
user_auth_required('committee', 'super');
//get the category, and if nothing is chosen, default to Global
if($_GET['category']) $category=$_GET['category'];
@ -39,7 +39,7 @@
}
send_header("Configuration - System Variables",
array('Committee Main' => 'committee_main.php',
'Configuration' => 'config/index.php')
'System Setup' => 'config/index.php')
,"configuration_variables"
);

View File

@ -24,10 +24,10 @@
<?
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'config');
user_auth_required('committee', 'super');
send_header("Version Checker",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
'System Setup' => 'super/index.php')
,"new_version_checker"
);

View File

@ -144,10 +144,12 @@
/* Make sure the user we loaded is actually for the current year, if not,
* we need to duplicate the user */
/*
if($u['year'] != $config['FAIRYEAR']) {
$id = user_dupe($u, $config['FAIRYEAR']);
$u = user_load($id);
}
*/
/* Make sure $type is in their types */
if(!in_array($type, $u['types'])) {