Moved allowedit to accred_config config file
This commit is contained in:
parent
a62b9c265b
commit
7f97a60334
@ -5,7 +5,8 @@ return [
|
|||||||
'name' => 'accred19',
|
'name' => 'accred19',
|
||||||
'user' => 'accred',
|
'user' => 'accred',
|
||||||
'pass' => 'accred19',
|
'pass' => 'accred19',
|
||||||
'year' => '2019'
|
'year' => '2019',
|
||||||
|
'editmode' => '0' // Allow edit by normal users, set to 0 to disable
|
||||||
];
|
];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ require_once 'vendor/autoload.php';
|
|||||||
$aid = $_GET['aid'];
|
$aid = $_GET['aid'];
|
||||||
$isAdmin = $_SESSION['admin']==1;
|
$isAdmin = $_SESSION['admin']==1;
|
||||||
|
|
||||||
$isEditable = $_SESSION['allowedit']==1;
|
$isEditable = $cfg['editmode']==1;
|
||||||
if(!$userid) {
|
if(!$userid) {
|
||||||
syslog(LOG_ERR, "Unauthorized access to form page aid:$aid from : {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
|
syslog(LOG_ERR, "Unauthorized access to form page aid:$aid from : {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
|
||||||
echo "<script type='text/javascript'> document.location = 'accred_list'; </script>";
|
echo "<script type='text/javascript'> document.location = 'accred_list'; </script>";
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
$_SESSION['state'] = $token;
|
$_SESSION['state'] = $token;
|
||||||
$userid = $_SESSION['uid'];
|
$userid = $_SESSION['uid'];
|
||||||
$isAdmin = $_SESSION['admin']==1;
|
$isAdmin = $_SESSION['admin']==1;
|
||||||
$isEditable = $_SESSION['allowedit']==1;
|
$isEditable = $cfg['editmode']==1;
|
||||||
// Bail out if not logged in
|
// Bail out if not logged in
|
||||||
if($userid=='') {
|
if($userid=='') {
|
||||||
header("location: index?");
|
header("location: index?");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user