Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. if(isset($_POST['login_submit']) && !Config::isLogged()) {
  2.  
  3. if(strlen($_POST['username']) && strlen($_POST['password']))
  4.  
  5. {
  6.  
  7. $wcodero = Config::$g_con->prepare('SELECT `id`,`IP` FROM `users` WHERE `name` = ? AND `password` = ?');
  8.  
  9. $wcodero->execute(array($_POST['username'],$_POST['password']));
  10.  
  11. if($wcodero->rowCount()) {
  12.  
  13. $account = $wcodero->fetch(PDO::FETCH_OBJ);
  14.  
  15. $c = Config::$g_con->prepare("SELECT `Text` FROM `wcode_editables` WHERE `Form` = 'login' AND `Text` = 'secured'"); $c->execute();
  16.  
  17. if($c->rowCount()) {
  18.  
  19. if($account->IP == $_SERVER['REMOTE_ADDR']) {
  20.  
  21. Config::createSN("success","You've been logged in with success!");
  22.  
  23. $_SESSION['account_panel'] = $account->id;
  24.  
  25. } else Config::createSN("info","Your IP must be the same as the one you had last time in game!"); //nu apare mesajul
  26.  
  27. } else {
  28.  
  29. Config::createSN("success","You've been logged in with success!");
  30.  
  31. $_SESSION['account_panel'] = $account->id;
  32.  
  33. }
  34.  
  35. }
  36.  
  37. else Config::createSN("danger","Please provide valid username and password!");
  38.  
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement