Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP8 Decoder for SourceGuardian Encoder)
- *
- * @ Version : 8.1.0.9
- * @ Author : DeZender
- * @ Release on : 27.10.2023
- * @ Official site : http://DeZender.Net
- *
- */
- namespace App\Http\Controllers;
- class SecurityController extends BaseController
- {
- use \App\Traits\CheckUpdates;
- public function type_licencia(\Illuminate\Http\Request $request)
- {
- set_time_limit(0);
- $licencia = $request->get('licencia');
- $host = $_SERVER['HTTP_HOST'];
- $url = 'https://licencia.smartisp.us/?edd_action=activate_license&item_id=1646&license=' . $licencia . '&url=' . $host . '&ts=' . time() . '';
- if (!empty($licencia)) {
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
- $response = curl_exec($ch);
- curl_close($ch);
- if (!$response) {
- return ['status' => 201, 'success' => 'error', 'memssage' => 'Por favor intente más tarde'];
- }
- else {
- $array = json_decode($response, true);
- if ($array['license'] == 'invalid') {
- return ['status' => 201, 'success' => 'error', 'memssage' => 'Licencia invalida'];
- }
- else if ($array['license'] == 'valid') {
- $now = new \DateTime();
- $global = \App\Models\GlobalSetting::first();
- $global->license = 11111;
- $global->license_id = $licencia;
- $global->status = 'ac';
- $global->last_update = $now->format('Y-m-d');
- $global->save();
- $log = new \App\libraries\Slog();
- $log->save('Agrego la licencia con exito', 'info');
- return ['status' => 200, 'success' => 'error', 'memssage' => 'Licencia registrada exitosamente'];
- }
- else if ($array['license'] == 'expired') {
- return ['status' => 205, 'success' => 'error', 'memssage' => 'Licencia expirada'];
- }
- }
- }
- }
- public function postActivate(\Illuminate\Http\Request $request)
- {
- set_time_limit(0);
- $licencia = $request->get('licencia');
- $host = $_SERVER['HTTP_HOST'];
- $status_res = $this->type_licencia($request);
- if ($status_res['status'] == 205) {
- return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia expirada']);
- }
- if ($status_res['status'] == 200) {
- return json_encode(['status' => 200, 'success' => 'error', 'memssage' => 'Licencia registrada exitosamente']);
- }
- $url = 'https://licencia.smartisp.us/?edd_action=activate_license&item_id=61&license=' . $licencia . '&url=' . $host . '&ts=' . time() . '';
- if (!empty($licencia)) {
- $id = \Illuminate\Support\Facades\Auth::user()->id;
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
- $response = curl_exec($ch);
- curl_close($ch);
- if (!$response) {
- return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Por favor intente más tarde']);
- }
- else {
- $array = json_decode($response, true);
- if (!isset($array['price_id'])) {
- $price_ident = 17;
- }
- else {
- $price_ident = $array['price_id'];
- }
- if ($array['license'] == 'invalid') {
- return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia invalida']);
- }
- else if ($array['license'] == 'valid') {
- $now = new \DateTime();
- $global = \App\Models\GlobalSetting::first();
- $global->license = $price_ident;
- $global->license_id = $licencia;
- $global->status = 'ac';
- $global->last_update = $now->format('Y-m-d');
- $global->save();
- $log = new \App\libraries\Slog();
- $log->save('Agrego la licencia con exito', 'info');
- return json_encode(['status' => 200, 'success' => 'error', 'memssage' => 'Licencia registrada exitosamente']);
- }
- else if ($array['license'] == 'expired') {
- return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia expirada']);
- }
- else {
- return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Licencia invalida']);
- }
- }
- }
- else {
- return json_encode(['status' => 404, 'success' => 'error', 'memssage' => 'Campo de licencia vacio']);
- }
- }
- public static function cant_clientes_api($id_pago)
- {
- set_time_limit(0);
- $url = 'http://apicantidadcliente.smartisp.us/?token_url=NhjsdbJBjj25484SC5CD5C4DC454SDSD455X8C&id_precio=' . $id_pago . '&ts=' . time() . '';
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
- $response = curl_exec($ch);
- ................................................................
- ...........................................
- ...................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement