diff --git a/admin/admin.css b/admin/admin.css index 2ff2a37..0cbe9ed 100644 --- a/admin/admin.css +++ b/admin/admin.css @@ -46,6 +46,9 @@ nav ul li:hover { nav ul li.green { border-bottom: 1px solid green; } +nav ul li.yellow { + border-bottom: 1px solid #3498DB; +} nav ul li.orange { border-bottom: 1px solid orange; } diff --git a/admin/enigma.php b/admin/enigma.php index 0143b32..7cf8b47 100644 --- a/admin/enigma.php +++ b/admin/enigma.php @@ -1,7 +1,7 @@ query("SELECT * FROM enigma WHERE id = 1"); $r = $req -> fetchAll(PDO::FETCH_ASSOC); if(isset($_POST['send'])) { - if($user['perm'] >= 2) { + if($user['perm'] >= 3) { if(isset($_POST['answer']) AND !empty($_POST['answer'])) { $ans = htmlspecialchars($_POST['answer']); $req = $db->prepare("UPDATE enigma SET answer = ? WHERE id = 1"); diff --git a/admin/gestion_des_acces.php b/admin/gestion_des_acces.php index 19f04b0..1cd35bc 100644 --- a/admin/gestion_des_acces.php +++ b/admin/gestion_des_acces.php @@ -1,13 +1,13 @@ = 2) { + if($user['perm'] >= 3) { $del = (int) htmlspecialchars($_GET['del']); if($del != 1) { @@ -22,7 +22,7 @@ if(isset($_GET['del']) AND !empty($_GET['del'])) if(isset($_GET['gda']) AND !empty($_GET['gda'])) { - if($user['perm'] >= 2) { + if($user['perm'] >= 3) { $gda = (int) htmlspecialchars($_GET['gda']); @@ -36,15 +36,31 @@ if(isset($_GET['gda']) AND !empty($_GET['gda'])) } } +if(isset($_GET['ville']) AND !empty($_GET['ville'])) +{ + if($user['perm'] >= 3) { + + $ville = (int) htmlspecialchars($_GET['ville']); + + if($ville != 1) { + $req = $db->prepare('UPDATE admin SET perm = ? WHERE id =?'); + $req->execute(array(1,$ville)); + header('Location: gestion_des_acces.php'); + } else { + $error = "On ne peut pas modifier le grade du superutilisateur sauf manuellement dans la base de données !"; + } + } +} + if(isset($_GET['bur']) AND !empty($_GET['bur'])) { - if($user['perm'] >= 2) { + if($user['perm'] >= 3) { $bur = (int) htmlspecialchars($_GET['bur']); if($bur != 1) { $req = $db->prepare('UPDATE admin SET perm = ? WHERE id =?'); - $req->execute(array(1,$bur)); + $req->execute(array(2,$bur)); header('Location: gestion_des_acces.php'); } else { $error = "On ne peut pas modifier le grade du superutilisateur sauf manuellement dans la base de données !"; @@ -54,13 +70,13 @@ if(isset($_GET['bur']) AND !empty($_GET['bur'])) if(isset($_GET['adm']) AND !empty($_GET['adm'])) { - if($user['perm'] >= 2) { + if($user['perm'] >= 3) { $adm = (int) htmlspecialchars($_GET['adm']); if($adm != 1) { $req = $db->prepare('UPDATE admin SET perm = ? WHERE id =?'); - $req->execute(array(2,$adm)); + $req->execute(array(3,$adm)); header('Location: gestion_des_acces.php'); } else { $error = "On ne peut pas modifier le grade du superutilisateur sauf manuellement dans la base de données !"; @@ -72,7 +88,7 @@ if(isset($_GET['adm']) AND !empty($_GET['adm'])) if(isset($_POST['send'])) { if(isset($_POST['pseudo']) AND !empty($_POST['pseudo']) AND isset($_POST['perm']) AND !empty($_POST['perm'])) { - if($user['perm'] >= 2) { + if($user['perm'] >= 3) { $pseudo = htmlspecialchars($_POST['pseudo']); $perm = htmlspecialchars($_POST['perm']); @@ -86,6 +102,9 @@ if(isset($_POST['send'])) { case "v2": $perm_int = 2; break; + case "v3": + $perm_int = 3; + break; } if(strlen($pseudo) <= 50) { @@ -121,8 +140,9 @@ if(isset($_POST['send'])) { @@ -149,12 +169,15 @@ if(isset($_POST['send'])) {