Advertisement
Guest User

Untitled

a guest
Sep 28th, 2021
94
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.87 KB | None
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13. defined('BASEPATH') || exit('No direct script access allowed');
  14.  
  15. class Ajax extends CI_Controller
  16. {
  17. public function __construct()
  18. {
  19. parent::__construct();
  20. $this->load->driver('cache', ['adapter' => 'file', 'backup' => 'file']);
  21. }
  22.  
  23. public function xss($par)
  24. {
  25. return $this->security->xss_clean($par);
  26. }
  27.  
  28. public function service()
  29. {
  30. if (strtolower(@$_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
  31. exit('Yanlış yerdesin deli kanli');
  32. }
  33.  
  34. $type = $this->input->post('type', true);
  35.  
  36. if ($type) {
  37. switch ($type) {
  38. case 'security':
  39. echo json_encode(['video_top' => ADS_VIDEO_TOP, 'video_bot' => ADS_VIDEO_BOT, 'video_top_m' => ADS_M_VIDEO_TOP, 'video_bot_m' => ADS_M_VIDEO_BOT, 'video_before' => ADS_VIDEO_BEFORE, 'video_after' => ADS_VIDEO_AFTER, 'header' => ADS_HEADER]);
  40. break;
  41. case 'login':
  42. $resp = NULL;
  43. $error = NULL;
  44. $publickey = $this->setting->google_sitekey;
  45. $privatekey = $this->setting->google_secretkey;
  46.  
  47. if (true) {
  48. $response = json_decode(file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $privatekey . '&response=' . $this->input->post('recaptcha_response_field', true) . '&remoteip=' . $_SERVER['REMOTE_ADDR']));
  49.  
  50. if (true) {
  51. $username = $this->xss($this->input->post('username', true));
  52. $password = $this->xss($this->input->post('password', true));
  53. $remember = $this->xss($this->input->post('remember', true));
  54. if ($username && $password) {
  55. if ($this->webService) {
  56. $result = $this->dataManager->clearRequest()->doSingleRequest('login', ['username' => $username, 'password' => $password]);
  57. $token = $result['result']['token'];
  58.  
  59. if (!empty($token)) {
  60. $user = json_decode(json_encode($result['result']['user']));
  61. $sessions = ['login' => true, 'user_name' => $user->username, 'user_id' => $user->id, 'user_type' => 1, 'user_email' => $user->email, 'user_avatar' => $user->profile_url, 'name' => $user->first_name, 'experiance' => 1, 'level' => 1];
  62. $this->session->set_userdata($sessions);
  63. set_cookie('X-User-Token', $token, 12960000);
  64. $json['success'] = lang('err_4_1');
  65. }
  66. else {
  67. $json['errors'] = lang('err_4_2');
  68. }
  69.  
  70. echo json_encode($json);
  71. exit();
  72. }
  73.  
  74. if (filter_var($username, FILTER_VALIDATE_EMAIL)) {
  75. $result = $this->my_model->get('users', ['u_email' => $username], 'row');
  76. }
  77. else {
  78. $result = $this->my_model->get('users', ['u_username' => $username], 'row');
  79. }
  80.  
  81. if ($result) {
  82. if ((EPOSTA_OK_STATUS == 1) || (EPOSTA_OK_STATUS == 0) || (EPOSTA_OK_STATUS == 2)) {
  83. $hash_pw = $result->u_password;
  84. if ($this->user_m->hash_verify($password, $hash_pw) || ($result->u_password == '')) {
  85. $user_id = $result->u_id;
  86. $banned_check = $this->my_model->get('user_ban_list', ['u_id' => $user_id], 'row');
  87.  
  88. if ($banned_check) {
  89. $now_time = strtotime(date('Y-m-d H:i:s'));
  90. $left_time = $banned_check->b_left_time;
  91. }
  92. if (!$banned_check || ($banned_check && ($left_time <= $now_time))) {
  93. $u_id = $result->u_id;
  94. $me_ip = $this->input->ip_address();
  95.  
  96. if (!$this->my_model->loggedin()) {
  97. $sessions = ['login' => true, 'user_name' => $result->u_username, 'user_id' => $result->u_id, 'user_type' => $result->u_type, 'user_email' => $result->u_email, 'user_avatar' => $result->u_avatar, 'name' => $result->u_name, 'experiance' => $result->u_experiance, 'level' => $result->u_level];
  98. $this->session->set_userdata($sessions);
  99. $json['success'] = lang('err_4_1');
  100. $cookie_data = $result->u_username . '|' . $result->u_password;
  101. $encookie = $this->my_model->encrypt($cookie_data);
  102.  
  103. if ($remember) {
  104. set_cookie('oturum', $encookie, time() + 86400);
  105. }
  106.  
  107. $statData = ['u_status' => 1];
  108. $this->my_model->update('users', $statData, ['u_id' => $result->u_id]);
  109. }
  110. else {
  111. $json['success'] = lang('err_4_1');
  112. }
  113. }
  114. else if ($this->session->userdata('language') == 'en') {
  115. $json['errors'] = 'this account has been punished by ' . date('d-m-Y H:i:s', $banned_check->b_left_time) . (' due to ' . $banned_check->b_desc . '.');
  116. }
  117. else {
  118. $json['errors'] = 'Bu hesap ' . date('d-m-Y H:i:s', $banned_check->b_time) . (' tarihinde ' . $banned_check->b_desc . ' sebebiyle cezalandırılmıştır. ') . date('d-m-Y H:i:s', $banned_check->b_left_time) . ' tarihinde cezası sona ericektir.';
  119. }
  120. }
  121. else {
  122. $json['errors'] = lang('err_4_2');
  123. }
  124. }
  125. else {
  126. $json['errors'] = lang('err_4_3');
  127. }
  128. }
  129. else {
  130. $json['errors'] = lang('err_4_4');
  131. }
  132. }
  133. }
  134. else {
  135. $json['errors'] = lang('up_1');
  136. }
  137. }
  138. else {
  139. $json['errors'] = lang('up_1');
  140. }
  141.  
  142. echo json_encode($json);
  143. break;
  144. case 'register':
  145. $this->load->model('mail_m');
  146. $this->output->set_content_type('application/json');
  147. $rules = 'trim|required';
  148. $this->form_validation->set_rules('username', 'Kullanıcı adı', $rules . '|min_length[3]|max_length[16]');
  149. $this->form_validation->set_rules('email', 'E-posta', $rules . '|valid_email');
  150. ...........................................................................
  151. ...........................................
  152. ....................
Advertisement
RAW Paste Data Copied
Advertisement