Authenticate and check for superuser on all /super pages

This commit is contained in:
james 2010-07-15 19:52:44 +00:00
parent ce9bb827ef
commit 5207e193fc
10 changed files with 22 additions and 8 deletions

View File

@ -23,7 +23,7 @@
<?
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'super');
superuser_required();
//make sure backup/restore folder exists, and htaccess it to deny access
if(!file_exists("../data/backuprestore"))

View File

@ -24,7 +24,7 @@
<?
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'super');
superuser_required();
send_header("Conferences Setup",
array('Committee Main' => 'committee_main.php',

View File

@ -24,7 +24,7 @@
<?
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'super');
superuser_required();
send_header("Science In A Box Super Configuration",
array('Committee Main' => 'committee_main.php')

View File

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

View File

@ -22,6 +22,8 @@
?>
<?
require("../common.inc.php");
require("../user.inc.php");
superuser_required();
$level=0;

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', 'super');
superuser_required();
send_header("Year Rollover",
array('Committee Main' => 'committee_main.php',
'System Setup' => 'super/index.php')

View File

@ -24,7 +24,7 @@
<?
require("../common.inc.php");
require_once("../user.inc.php");
user_auth_required('committee', 'config');
superuser_required();
send_header("SFIAB/SOIAB Super Configuration",
array('Committee Main' => 'committee_main.php')

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', 'super');
superuser_required();
//get the category, and if nothing is chosen, default to Global
if($_GET['category']) $category=$_GET['category'];

View File

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

View File

@ -658,4 +658,16 @@ function user_fair_login($u)
$_SESSION['fairs_id'] = $u['fairs_id'];// == 'yes') ? true : false;
}
function superuser_required() {
//first, they have to be logged in
user_auth_required();
//next, they need superuser
if($_SESSION['superuser']!="yes") {
send_header("Superuser access required");
send_footer();
exit;
}
}
?>