Ajout possibilité de bloquer globalement les éditions
This commit is contained in:
parent
3be4c739d5
commit
093e50187a
@ -14,6 +14,8 @@ syslog(LOG_INFO, "Logout ".$_SESSION['uid']." / ". $_SESSION['name']. " from : {
|
||||
$_SESSION['uid']='';
|
||||
$_SESSION['admin']='';
|
||||
$_SESSION['name']='';
|
||||
$_SESSION['allowedit'] = '';
|
||||
|
||||
closelog();
|
||||
die();
|
||||
|
||||
@ -21,7 +23,7 @@ die();
|
||||
$id_token = $_POST['idtoken'];
|
||||
|
||||
$admins = array('106388451999977183087' => 'Y', // Jess
|
||||
'113391142723644034553x' => 'Y' // Lars
|
||||
'113391142723644034553' => 'Y' // Lars
|
||||
|
||||
);
|
||||
$client = new Google_Client(['client_id' => '538635499162-g21v86gk87qm863u03er6vnm3q15bl82.apps.googleusercontent.com']);
|
||||
@ -30,6 +32,7 @@ if ($payload) {
|
||||
$userid = $payload['sub'];
|
||||
// If request specified a G Suite domain:
|
||||
$domain = $payload['hd'];
|
||||
|
||||
if($domain=='caribana.ch') {
|
||||
// Associate user info to session si we can use it later
|
||||
$_SESSION['uid'] = $userid;
|
||||
@ -38,6 +41,8 @@ if ($payload) {
|
||||
$_SESSION['name'] = $payload['name'];
|
||||
// Is this user admin
|
||||
$_SESSION['admin'] = '';
|
||||
// Set to 1 to allow noramle users to add new entries en edit existing
|
||||
$_SESSION['allowedit'] = 1;
|
||||
if( array_key_exists($userid, $admins)) {
|
||||
$_SESSION['admin'] = 1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user