forked from rebillar/site-accueil-insa
test
This commit is contained in:
parent
f2184d74dc
commit
929dcb7a10
1 changed files with 1 additions and 4 deletions
|
@ -88,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'] >= 4) {
|
||||
if($user['perm'] >= 3) {
|
||||
$pseudo = htmlspecialchars($_POST['pseudo']);
|
||||
$perm = htmlspecialchars($_POST['perm']);
|
||||
|
||||
|
@ -108,15 +108,12 @@ if(isset($_POST['send'])) {
|
|||
}
|
||||
|
||||
if(strlen($pseudo) <= 50) {
|
||||
echo("len");
|
||||
$req = $db->prepare("SELECT id FROM admin WHERE pseudo = ?");
|
||||
$req->execute(array($pseudo));
|
||||
$pseudo_exist = $req->rowCount();
|
||||
echo("count");
|
||||
if ($pseudo_exist == 0) {
|
||||
$req = $db->prepare("INSERT INTO admin(pseudo, perm) VALUES(?, ?)");
|
||||
$req->execute(array($pseudo, $perm_int));
|
||||
echo("exec");
|
||||
header('refresh:0');
|
||||
} else {
|
||||
$error = "pseudo déja utilisé";
|
||||
|
|
Loading…
Reference in a new issue