Guest User

Untitled

a guest
May 18th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  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.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function cap()
  15. {
  16. if (extension_loaded('gd') && function_exists('gd_info')) {
  17. $image = @imagecreatetruecolor(240, 60);
  18. $background = imagecolorallocate($image, 255, 255, 255);
  19. imagefill($image, 0, 0, $background);
  20. $obf_DTsyNSkmIiI8Oz0KGw8GHTgjDxoINgE = imagecolorallocate($image, 204, 204, 204);
  21. $textcolor = imagecolorallocate($image, 51, 51, 51);
  22.  
  23. for ($i = 0; $i < 6; $i++) {
  24. imagesetthickness($image, rand(1, 3));
  25. imageline($image, 0, rand(0, 60), 240, rand(0, 60), $obf_DTsyNSkmIiI8Oz0KGw8GHTgjDxoINgE);
  26. }
  27.  
  28. $digit = '';
  29.  
  30. for ($x = 15; $x <= 95; $x += 20) {
  31. $digit .= $num = rand(0, 9);
  32. imagechar($image, rand(5, 8), $x, rand(5, 20), $num, $textcolor);
  33. }
  34.  
  35. $_SESSION['recovercapcha'] = $digit;
  36. imagepng($image, root . '/admin/uploads/cap.png');
  37. $obf_DS8UDRY8I1wlLzcEMFwZDwoXKQUEAgE = file_get_contents(root . '/admin/uploads/cap.png');
  38. return base64_encode($obf_DS8UDRY8I1wlLzcEMFwZDwoXKQUEAgE);
  39. }
  40.  
  41. return false;
  42. }
  43.  
  44. session_name('mkwsp6');
  45. session_start();
  46. session_regenerate_id(true);
  47. require_once 'ajax/db/MysqliDb.php';
  48. require_once 'ajax/db/funciones.php';
  49.  
  50. if (!INSTALADO) {
  51. header('Location: /install/');
  52. exit();
  53. }
  54. if (!!INSTALADO && file_exists(root . '/install/index.php')) {
  55. exec('rm -r ' . root . '/install');
  56. }
  57. if (!!INSTALADO && file_exists(root . '/install/index.php')) {
  58. echo '<div style="border: 2px dashed;border-color: #d6203c;padding: 20px;margin: 20px;">' . "\n" . '<h4>ERROR</h4>' . "\n" . 'Elimine la carpeta <b>"install"</b> para poder continuar<br>' . "\n" . 'Puede eliminarlo vía consola ejecuntando el comando: <b>rm -r ' . root . '/install</b>' . "\n" . '</div>';
  59. exit();
  60. }
  61. if (isset($_POST['cap']) && isset($_POST['mail'])) {
  62. if ($_SESSION['recovercapcha'] !== $_POST['cap']) {
  63. $salida = ['estado' => 'error', 'salida' => 'Código capcha incorrecto.', 'img' => cap()];
  64. header('Content-Type: application/json');
  65. echo json_encode($salida, JSON_UNESCAPED_UNICODE);
  66. $db->disconnect();
  67. exit();
  68. }
  69.  
  70. $db->where('estado', 1);
  71. $db->where('correo', nohtml($_POST['mail']));
  72. $us = $db->getOne('login');
  73.  
  74. if (empty($us['id'])) {
  75. $salida = ['estado' => 'error', 'salida' => 'No existe ningún operador con este correo.', 'img' => cap()];
  76. header('Content-Type: application/json');
  77. echo json_encode($salida, JSON_UNESCAPED_UNICODE);
  78. $db->disconnect();
  79. exit();
  80. }
  81.  
  82. $code = token('encode', $us['id'] . time());
  83. $db->where('id', $us['id']);
  84. $db->update('login', ['recover' => $code]);
  85. obf_DQszCRwBLBcSChM3Fj4hXAUbBwQCASI((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on') ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/admin/ajax/resetpwd?t=a&token=' . $code, $us['id']);
  86. $log = 'Solicitud para recuperar contraseña de acceso al portal - Login ID: ' . $us['id'];
  87. addlog($log, 0, 0);
  88. $salida = ['estado' => 'exito', 'salida' => 'Se ha enviado un link a su correo, revise el correo para restablecer su contraseña.', 'img' => cap()];
  89. header('Content-Type: application/json');
  90. .............................................................................................
  91. ........................................................
  92. ......................
Add Comment
Please, Sign In to add comment