diff --git a/accred_config.php b/accred_config.php index d7278831..92f2831e 100644 --- a/accred_config.php +++ b/accred_config.php @@ -5,7 +5,8 @@ return [ 'name' => 'accred19', 'user' => 'accred', 'pass' => 'accred19', - 'year' => '2019' + 'year' => '2019', + 'editmode' => '0' // Allow edit by normal users, set to 0 to disable ]; ?> diff --git a/accred_form.php b/accred_form.php index 2502f058..bd7d0071 100644 --- a/accred_form.php +++ b/accred_form.php @@ -11,7 +11,7 @@ require_once 'vendor/autoload.php'; $aid = $_GET['aid']; $isAdmin = $_SESSION['admin']==1; - $isEditable = $_SESSION['allowedit']==1; + $isEditable = $cfg['editmode']==1; if(!$userid) { syslog(LOG_ERR, "Unauthorized access to form page aid:$aid from : {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})"); echo ""; diff --git a/accred_list.php b/accred_list.php index 218a94bc..0ee240ae 100644 --- a/accred_list.php +++ b/accred_list.php @@ -13,7 +13,7 @@ $_SESSION['state'] = $token; $userid = $_SESSION['uid']; $isAdmin = $_SESSION['admin']==1; - $isEditable = $_SESSION['allowedit']==1; + $isEditable = $cfg['editmode']==1; // Bail out if not logged in if($userid=='') { header("location: index?");