Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <?php
  2. INDEX_LINKER || die();
  3.  
  4. $sys = registry::register('sys');
  5. $locale = registry::register('locale');
  6.  
  7. starting('Logowanie', 'Logowanie');
  8.  
  9. $response = $_POST["g-recaptcha-response"];
  10.  
  11. $url = 'https://www.google.com/recaptcha/api/siteverify';
  12. $data = array(
  13. 'secret' => '',
  14. 'response' => $_POST["g-recaptcha-response"]
  15. );
  16.  
  17. $options = array(
  18. 'http' => array (
  19. 'content' => http_build_query($data)
  20. )
  21. );
  22.  
  23. $context = stream_context_create($options);
  24. $verify = file_get_contents($url, false, $context);
  25. $captcha_success=json_decode($verify);
  26.  
  27. require_once'inc/modules/_func/login.php';
  28. $_pass = clearstr($_POST['pass']);
  29. $_user = clearstr($_POST['login']);
  30. $_ip = $_SERVER['REMOTE_ADDR'];
  31.  
  32. if ($_POST['login'] == "" and $_POST['pass'] == "")
  33. {
  34. viewInfo('Wprowadź dane i spróbuj ponownie!');
  35. }
  36. else
  37. {
  38. if ($captcha_success->success==false) {
  39. viewInfo('Weryfkacja captcha nie została potwierdzona');
  40. } else if ($captcha_success->success==true) {
  41. $_usr = getUser($_user, $_pass);
  42. if(mysqli_num_rows($_usr))
  43. {
  44. $r = mysqli_fetch_array($_usr);
  45.  
  46. if($r['status'] != 'LEAVE')
  47. {
  48. if(strtotime($r['availDt']) >= time())
  49. {
  50. add_log_login(0, $_user);
  51. displayBan($r['id']);
  52. }
  53. else
  54. {
  55. viewInfo('Logowanie na strone jest chwilowo wyłączone');
  56. }
  57. }
  58. }
  59. }
  60. }
  61. ending();
  62. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement