Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.144.237.87
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
2 /
Console /
Commands /
Delete
Unzip
Name
Size
Permission
Date
Action
AddNew.php
17.39
KB
-rw-r--r--
2021-03-26 07:26
CommonSchedule.php
6.27
KB
-rw-r--r--
2021-03-26 07:26
DoImport.php
3.18
KB
-rw-r--r--
2021-03-26 07:26
Inspire.php
602
B
-rw-r--r--
2021-03-26 07:26
QuantityUpdate.php
3.28
KB
-rw-r--r--
2021-03-26 07:26
Save
Rename
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Mail\Message; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Auth; use Illuminate\Http\Request; use App\Models\apiREST; use App\Models\Metas; use App\Models\Sites; use App\Models\Prices; use Session; use DB; class CommonSchedule extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'common:schedule'; /** * The console command description. * * @var string */ protected $description = 'Обработка крона'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $arMonthNames = array("1"=>"January","2"=>"February","3"=>"March","4"=>"April","5"=>"May","6"=>"June","7"=>"July","8"=>"August","9"=>"September","10"=>"October","11"=>"November","12"=>"December"); $arWeekNames = array("1"=>"monday","2"=>"tuesday","3"=>"wednesday","4"=>"thursday","5"=>"friday","6"=>"saturday","7"=>"sunday"); //$t = strtotime("friday");er //echo date("d.m.Y H:i:s", $t); //$userdata = array("email"=>"argonianin@gmail.com","password"=>"rtyrty"); //Auth::attempt($userdata); Auth::attempt(['email' => 'cron@pickupservice.ru', 'password' => 'Y43Okd9-P']); $veryBegining = strtotime("1 January ".date("Y")); $arCron = DB::table('cron')->where('active',1)->get(); if (count($arCron)>0) { foreach ($arCron as $cron) { if (isset($cron->command) AND isset($cron->schedule)) { $arSchedule = json_decode($cron->schedule); $arHours = $arMinutes = $arWeeks = $arMonths = $arTimes = $arFinalTimes = $arResultTimes = $arTmp = array(); if (!empty($arSchedule->hour)) { foreach ($arSchedule->hour as $hours) { $arHours[] = intval($hours); } } if (!empty($arSchedule->minute)) { foreach ($arSchedule->minute as $minutes) { $arMinutes[] = intval($minutes); } } if (!empty($arSchedule->week)) { foreach ($arSchedule->week as $weeks) { $arWeeks[] = intval($weeks); } } if (!empty($arSchedule->month)) { foreach ($arSchedule->month as $months) { $arMonths[] = intval($months); } } if (!empty($arMinutes)) { foreach ($arMinutes as $minutes) { $arTimes[] = $minutes*60; } } else { $arTimes[] = 0; } if (!empty($arHours)) { foreach ($arHours as $hours) { foreach ($arTimes as $times) { $arTmp[] = $times + $hours * 3600; } } unset($arTimes); $arTimes = $arTmp; unset($arTmp); $arTmp = array(); } if (!empty($arWeeks)) { foreach ($arWeeks as $weeks) { $arFinalTimes[] = $arWeekNames[$weeks]; } } if (!empty($arMonths)) { foreach ($arMonths as $month) { if (!empty($arFinalTimes)) { foreach ($arFinalTimes as $final) { $arTmp[] = $final." ".$arMonthNames[$month]; } } else { $arFinalTimes[] = $arMonthNames[$month]; } } if (!empty($arTmp)) { unset($arFinalTimes); $arFinalTimes = $arTmp; unset($arTmp); $arTmp = array(); } } if (!empty($arFinalTimes)) { foreach ($arFinalTimes as $final_times) { foreach ($arTimes as $times) { $arResultTimes[] = strtotime($final_times) + $times; } } } else { foreach ($arTimes as $times) { $arResultTimes[] = strtotime(date("Y-m-d 00:00:00")) + $times; } } if (!empty($arResultTimes)) { foreach ($arResultTimes as $time) { $arExec = array(); if (time()<=$time+30 AND time()>=$time-30) { $currentTask = DB::table('cron_log')->where(['cron_id'=>$cron->id,'status'=>'0'])->get(); if (count($currentTask)==0) { $cron_log_id = DB::table('cron_log')->insertGetId( ['cron_id' => $cron->id, 'command' => $cron->command, 'status' => 0, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')] ); exec('wget http://nimda.pslocal.pickupservice.ru'.$cron->command, $arExec); DB::table('cron_log')->where('id', $cron_log_id)->where('cron_id' , $cron->id)->update(['status' => 1, 'exec' => serialize($arExec), 'updated_at' => date('Y-m-d H:i:s')]); } } } } } } } } }