Commit b9736035b78386d333e944c8a9afaf6a1e7068e9
1 parent
edeb3f35
api/utilisateur/droit
Showing
1 changed file
with
24 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,24 @@ |
1 | +<?php | |
2 | + | |
3 | +require_once("../commun.php"); | |
4 | + | |
5 | +verifierDroit(3); | |
6 | + | |
7 | +if (!(donne("login") && donne("droit"))) { | |
8 | + retour("requete_malformee"); | |
9 | +} | |
10 | + | |
11 | +if (!utilisateurExiste(donne("login"))) { | |
12 | + retour("utilisateur_inconnu"); | |
13 | +} | |
14 | + | |
15 | +$requete = $db->prepare("UPDATE Utilisateurs SET droit=? WHERE login=?"); | |
16 | +$requete->bind_param("ss", $_POST["droit"], $_POST["login"]); | |
17 | +if (!$requete->execute()) { | |
18 | + retour("erreur_bdd", ["message" => $requete->error]); | |
19 | +} | |
20 | +$requete->close(); | |
21 | + | |
22 | +retour("ok"); | |
23 | + | |
24 | +?> | ... | ... |