Guest User

Untitled

a guest
Sep 28th, 2024
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 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. $request->validate(['licencia' => 'required']);
  66. $licencia = $request->get('licencia');
  67. $host = $_SERVER['HTTP_HOST'];
  68. ................................................................
  69. ........................................
  70. ......................
Advertisement
Add Comment
Please, Sign In to add comment