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['send'])) {
|
||||||
if(isset($_POST['pseudo']) AND !empty($_POST['pseudo']) AND isset($_POST['perm']) AND !empty($_POST['perm'])) {
|
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']);
|
$pseudo = htmlspecialchars($_POST['pseudo']);
|
||||||
$perm = htmlspecialchars($_POST['perm']);
|
$perm = htmlspecialchars($_POST['perm']);
|
||||||
|
|
||||||
|
@ -108,15 +108,12 @@ if(isset($_POST['send'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($pseudo) <= 50) {
|
if(strlen($pseudo) <= 50) {
|
||||||
echo("len");
|
|
||||||
$req = $db->prepare("SELECT id FROM admin WHERE pseudo = ?");
|
$req = $db->prepare("SELECT id FROM admin WHERE pseudo = ?");
|
||||||
$req->execute(array($pseudo));
|
$req->execute(array($pseudo));
|
||||||
$pseudo_exist = $req->rowCount();
|
$pseudo_exist = $req->rowCount();
|
||||||
echo("count");
|
|
||||||
if ($pseudo_exist == 0) {
|
if ($pseudo_exist == 0) {
|
||||||
$req = $db->prepare("INSERT INTO admin(pseudo, perm) VALUES(?, ?)");
|
$req = $db->prepare("INSERT INTO admin(pseudo, perm) VALUES(?, ?)");
|
||||||
$req->execute(array($pseudo, $perm_int));
|
$req->execute(array($pseudo, $perm_int));
|
||||||
echo("exec");
|
|
||||||
header('refresh:0');
|
header('refresh:0');
|
||||||
} else {
|
} else {
|
||||||
$error = "pseudo déja utilisé";
|
$error = "pseudo déja utilisé";
|
||||||
|
|
Loading…
Reference in a new issue