Ajout fonctionnement de la possibilité globale d'éditer ou pas

This commit is contained in:
Caribana
2018-04-09 21:11:13 +02:00
parent 093e50187a
commit 242dfa74c8
2 changed files with 19 additions and 3 deletions

View File

@@ -8,11 +8,19 @@ require_once 'vendor/autoload.php';
$aid = $_GET['aid'];
$isAdmin = $_SESSION['admin']==1;
$isEditable = $_SESSION['allowedit']==1;
if(!$userid) {
syslog(LOG_ERR, "Unauthorized access to form page aid:$aid from : {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
header('Location: accred_list');
die();
}
if(!$isAdmin && $isEditable!=1) {
syslog(LOG_ERR, "Unauthorized access to form page aid by non editable user :$aid from : {$_SERVER['REMOTE_ADDR']} ({$_SERVER['HTTP_USER_AGENT']})");
header('Location: accred_list');
die();
}
$uname = $_SESSION['name'];
if($_POST['btncancel']) {
header('Location: accred_list');