mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
#272: Cronjob timestamps for resellers
This commit is contained in:
parent
0995f9d3cc
commit
15bff6b3db
@ -870,7 +870,7 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR'] == $ip) {
|
||||
|
||||
}
|
||||
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronCloud`=UNIX_TIMESTAMP() WHERE `resellerid`=0 LIMIT 1");
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronCloud`=UNIX_TIMESTAMP()");
|
||||
$query->execute();
|
||||
|
||||
} else {
|
||||
|
@ -239,7 +239,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
} else {
|
||||
$runJobs = false;
|
||||
}
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronJobs`=UNIX_TIMESTAMP() WHERE `resellerid`=0 LIMIT 1");
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronJobs`=UNIX_TIMESTAMP()");
|
||||
$query->execute();
|
||||
}
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronReboot`=UNIX_TIMESTAMP() WHERE `resellerid`=0 LIMIT 1");
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronReboot`=UNIX_TIMESTAMP()");
|
||||
$query->execute();
|
||||
|
||||
} else {
|
||||
|
@ -107,6 +107,6 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
unset($rootServer);
|
||||
}
|
||||
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronUpdates`=UNIX_TIMESTAMP() WHERE `resellerid`=0 LIMIT 1");
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronUpdates`=UNIX_TIMESTAMP()");
|
||||
$query->execute();
|
||||
}
|
@ -109,8 +109,8 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
foreach ($query2->fetchall(PDO::FETCH_ASSOC) as $row2) {
|
||||
$shutdownempty = $row2['shutdownempty'];
|
||||
$shutdownemptytime = $row2['shutdownemptytime'];
|
||||
$firstcheck='00-00-'.round(2*(strtotime($row2['lastcheck'])-strtotime($row2['oldcheck']))/60);
|
||||
$firstchecktime=date('d-G-i');
|
||||
$firstcheck = '00-00-' . round(2 * (strtotime($row2['lastcheck']) - strtotime($row2['oldcheck'])) / 60);
|
||||
$firstchecktime = date('d-G-i');
|
||||
}
|
||||
if (isset($shutdownempty)) {
|
||||
$resellersettings[$resellerid] = array('shutdownempty' => $shutdownempty,'shutdownemptytime' => $shutdownemptytime,'firstchecktime' => $firstchecktime,'firstcheck' => $firstcheck,'brandname' => $row['brandname'], 'noservertag' => $row['noservertag'], 'nopassword' => $row['nopassword'], 'tohighslots' => $row['tohighslots'], 'down_checks' => $row['down_checks']);
|
||||
@ -738,7 +738,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
$sd = $connection->ServerDetails($virtualserver_id);
|
||||
$newtrafficdata=round(($sd['connection_filetransfer_bytes_sent_total']+$sd['connection_filetransfer_bytes_received_total']) / 1024);
|
||||
|
||||
if ($resellersettings[$resellerid]['firstchecktime']<$resellersettings[$resellerid]['firstcheck']) {
|
||||
if (isset($resellersettings[$resellerid]['firstchecktime']) and isset($resellersettings[$resellerid]['firstcheck']) and $resellersettings[$resellerid]['firstchecktime'] < $resellersettings[$resellerid]['firstcheck']) {
|
||||
$filetraffic = 0;
|
||||
}
|
||||
|
||||
@ -971,7 +971,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
}
|
||||
}
|
||||
flush();
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronStatus`=UNIX_TIMESTAMP() WHERE `resellerid`=0 LIMIT 1");
|
||||
$query = $sql->prepare("UPDATE `settings` SET `lastCronStatus`=UNIX_TIMESTAMP()");
|
||||
$query->execute();
|
||||
} else {
|
||||
header('Location: login.php');
|
||||
|
@ -266,17 +266,13 @@ if ($loguserip!='localhost') {
|
||||
|
||||
$ewInstallPath = EASYWIDIR;
|
||||
|
||||
$elements = (!empty($ewInstallPath) and strpos($ui->escaped('REQUEST_URI', 'server'), $ewInstallPath) === false) ? preg_split('/\//', $ui->escaped('REQUEST_URI', 'server'),-1,PREG_SPLIT_NO_EMPTY) : preg_split('/\//',substr($ui->escaped('REQUEST_URI', 'server'),strlen($ewInstallPath)),-1,PREG_SPLIT_NO_EMPTY);
|
||||
$elements = (!empty($ewInstallPath) and strpos($ui->escaped('REQUEST_URI', 'server'), $ewInstallPath) === false) ? preg_split('/\//', $ui->escaped('REQUEST_URI', 'server'), -1, PREG_SPLIT_NO_EMPTY) : preg_split('/\//',substr($ui->escaped('REQUEST_URI', 'server'), strlen($ewInstallPath)), -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
if (isset($seo) and $seo== 'Y' and isset($elements[0])) {
|
||||
|
||||
$page_detect_language = $elements[0];
|
||||
|
||||
if (substr($ui->escaped('REQUEST_URI', 'server'),-1) != '/' and !$ui->w('site',50, 'get')) {
|
||||
$throw404 = true;
|
||||
}
|
||||
|
||||
if (!preg_match('/^[a-z]{2}+$/', $elements[0]) and !$ui->w('site',50, 'get')) {
|
||||
if (!preg_match('/^[a-z]{2}+$/', $elements[0]) and !$ui->w('site', 50, 'get')) {
|
||||
$throw404 = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user