SHOW:
|
|
- or go back to the newest paste.
| 1 | - | <?php |
| 1 | + | <?php |
| 2 | require_once('inc/config.php');
| |
| 3 | ||
| 4 | ||
| 5 | - | |
| 5 | + | |
| 6 | - | |
| 6 | + | |
| 7 | else if(empty($_POST['password'])){header('location: index.php?password=false');}
| |
| 8 | else | |
| 9 | {
| |
| 10 | ||
| 11 | // Vérification des identifiants | |
| 12 | ||
| 13 | $password = hash('md5',$_POST['password']);
| |
| 14 | ||
| 15 | - | $hash = $bdd->query('SELECT * FROM accounts WHERE username = "'.$_POST['user'].'"');
|
| 15 | + | |
| 16 | - | $req = $hash->fetch(); |
| 16 | + | $req = $bdd->prepare('SELECT * FROM samp_accounts WHERE pLogin = :pseudo AND pPassword = :pass');
|
| 17 | $req->execute(array( | |
| 18 | 'pseudo' => $_POST['user'], | |
| 19 | - | $pass = hash('md5',$password.''.$req['salt']);
|
| 19 | + | 'pass' => $password)); |
| 20 | ||
| 21 | $resultat = $req->fetch(); | |
| 22 | ||
| 23 | - | $req = $bdd->prepare('SELECT * FROM accounts WHERE username = :pseudo AND password = :pass');
|
| 23 | + | |
| 24 | if (!$resultat) | |
| 25 | {
| |
| 26 | - | 'pass' => $pass)); |
| 26 | + | |
| 27 | <strong>ATTENTION!</strong> | |
| 28 | Attention ce compte n\'existe pas | |
| 29 | </div> | |
| 30 | '; | |
| 31 | } | |
| 32 | ||
| 33 | else | |
| 34 | {
| |
| 35 | ||
| 36 | ||
| 37 | $_SESSION['admin'] = $resultat['pAdmin']; | |
| 38 | $_SESSION['mappeur'] = $resultat['pMappeur']; | |
| 39 | $_SESSION['dev'] = $resultat['pDev']; | |
| 40 | $_SESSION['id'] = $resultat['pID']; | |
| 41 | $_SESSION['login'] = $_POST['user']; | |
| 42 | $_SESSION['email'] = $resultat['pEmail']; | |
| 43 | $_SESSION['password'] = $_POST['password']; | |
| 44 | - | $_SESSION['admin'] = $resultat['admin']; |
| 44 | + | $_SESSION['key'] = $resultat['ts_key']; |
| 45 | - | $_SESSION['supporter'] = $resultat['supporter']; |
| 45 | + | |
| 46 | - | $_SESSION['vct'] = $resultat['vct']; |
| 46 | + | |
| 47 | - | $_SESSION['mappeur'] = $resultat['mapper']; |
| 47 | + | |
| 48 | - | $_SESSION['admin'] = $resultat['scripter']; |
| 48 | + | echo '<meta http-equiv="refresh" content="2; URL=profil.php">'; |
| 49 | - | $_SESSION['id'] = $resultat['id']; |
| 49 | + | |
| 50 | } | |
| 51 | - | $_SESSION['email'] = $resultat['email']; |
| 51 | + | |
| 52 | } | |
| 53 | ||
| 54 | ||
| 55 | ||
| 56 | ||
| 57 | - | echo '<meta http-equiv="refresh" content="2; URL=main-page.php">'; |
| 57 | + |