Advertisement
Guest User

Untitled

a guest
May 25th, 2024
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.68 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP8 Decoder for SourceGuardian Encoder)
  6. *
  7. * @ Version : 8.1.0.9
  8. * @ Author : DeZender
  9. * @ Release on : 27.10.2023
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace App\Http\Controllers;
  15.  
  16. class SecurityController extends BaseController
  17. {
  18. use \App\Traits\CheckUpdates;
  19.  
  20. public function type_licencia(\Illuminate\Http\Request $request)
  21. {
  22. set_time_limit(0);
  23. $licencia = $request->get('licencia');
  24. $host = $_SERVER['HTTP_HOST'];
  25. $url = 'https://licencia.smartisp.us/?edd_action=activate_license&item_id=1646&license=' . $licencia . '&url=' . $host . '&ts=' . time() . '';
  26.  
  27. if (!empty($licencia)) {
  28. $ch = curl_init($url);
  29. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  30. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  31. $response = curl_exec($ch);
  32. curl_close($ch);
  33.  
  34. if (!$response) {
  35. return ['status' => 201, 'success' => 'error', 'memssage' => 'Por favor intente más tarde'];
  36. }
  37. else {
  38. $array = json_decode($response, true);
  39.  
  40. if ($array['license'] == 'invalid') {
  41. return ['status' => 201, 'success' => 'error', 'memssage' => 'Licencia invalida'];
  42. }
  43. else if ($array['license'] == 'valid') {
  44. $now = new \DateTime();
  45. $global = \App\Models\GlobalSetting::first();
  46. $global->license = 11111;
  47. $global->license_id = $licencia;
  48. $global->status = 'ac';
  49. $global->last_update = $now->format('Y-m-d');
  50. $global->save();
  51. $log = new \App\libraries\Slog();
  52. $log->save('Agrego la licencia con exito', 'info');
  53. return ['status' => 200, 'success' => 'error', 'memssage' => 'Licencia registrada exitosamente'];
  54. }
  55. else if ($array['license'] == 'expired') {
  56. return ['status' => 205, 'success' => 'error', 'memssage' => 'Licencia expirada'];
  57. }
  58. }
  59. }
  60. }
  61.  
  62. public function postActivate(\Illuminate\Http\Request $request)
  63. {
  64. set_time_limit(0);
  65. $licencia = $request->get('licencia');
  66. $host = $_SERVER['HTTP_HOST'];
  67. $status_res = $this->type_licencia($request);
  68.  
  69. if ($status_res['status'] == 205) {
  70. return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia expirada']);
  71. }
  72.  
  73. if ($status_res['status'] == 200) {
  74. return json_encode(['status' => 200, 'success' => 'error', 'memssage' => 'Licencia registrada exitosamente']);
  75. }
  76.  
  77. $url = 'https://licencia.smartisp.us/?edd_action=activate_license&item_id=61&license=' . $licencia . '&url=' . $host . '&ts=' . time() . '';
  78.  
  79. if (!empty($licencia)) {
  80. $id = \Illuminate\Support\Facades\Auth::user()->id;
  81. $ch = curl_init($url);
  82. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  83. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  84. $response = curl_exec($ch);
  85. curl_close($ch);
  86.  
  87. if (!$response) {
  88. return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Por favor intente más tarde']);
  89. }
  90. else {
  91. $array = json_decode($response, true);
  92.  
  93. if (!isset($array['price_id'])) {
  94. $price_ident = 17;
  95. }
  96. else {
  97. $price_ident = $array['price_id'];
  98. }
  99.  
  100. if ($array['license'] == 'invalid') {
  101. return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia invalida']);
  102. }
  103. else if ($array['license'] == 'valid') {
  104. $now = new \DateTime();
  105. $global = \App\Models\GlobalSetting::first();
  106. $global->license = $price_ident;
  107. $global->license_id = $licencia;
  108. $global->status = 'ac';
  109. $global->last_update = $now->format('Y-m-d');
  110. $global->save();
  111. $log = new \App\libraries\Slog();
  112. $log->save('Agrego la licencia con exito', 'info');
  113. return json_encode(['status' => 200, 'success' => 'error', 'memssage' => 'Licencia registrada exitosamente']);
  114. }
  115. else if ($array['license'] == 'expired') {
  116. return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia expirada']);
  117. }
  118. else {
  119. return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia invalida']);
  120. }
  121. }
  122. }
  123. else {
  124. return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Campo de licencia vacio']);
  125. }
  126. }
  127.  
  128. public static function cant_clientes_api($id_pago)
  129. {
  130. set_time_limit(0);
  131. $url = 'http://apicantidadcliente.smartisp.us/?token_url=NhjsdbJBjj25484SC5CD5C4DC454SDSD455X8C&id_precio=' . $id_pago . '&ts=' . time() . '';
  132. $ch = curl_init($url);
  133. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  134. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  135. $response = curl_exec($ch);
  136. ................................................................
  137. ...........................................
  138. ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement