Hello
First things apologize for my bad english ..
today i fixed alot cron job delete issues and added 15 mins cron tab
when add cron job with cron manager .. its Okie
then i delete cron job in my panel .. its deleted on panel ..
but still not delete on root SQL DB .. sentora_core => x_cronjobs list
then i delete some core from etc/sentora/panel/modules/cron/code/controller.ext.php
Here how to fix
static function doDeleteCron()
{
global $zdbh;
global $controller;
runtime_csfr:rotect();
$currentuser = ctrl_users::GetUserDetail();
$sql = "SELECT COUNT(*) FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL";
$numrows = $zdbh->prepare($sql);
$numrows->bindParam(':userid', $currentuser['userid']);
if ($numrows->execute()) {
if ($numrows->fetchColumn() <> 0) {
$sql = $zdbh->prepare("SELECT * FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL");
$sql->bindParam(':userid', $currentuser['userid']);
$sql->execute();
while ($rowcrons = $sql->fetch()) {
if (!fs_director::CheckForEmptyValue($controller->GetControllerRequest('FORM', 'inDelete_' . $rowcrons['ct_id_pk'] . ''))) {
$sql2 = $zdbh->prepare("UPDATE x_cronjobs SET ct_deleted_ts=:time WHERE ct_id_pk=:cronid");
<= delete and replace with this =>
$sql2 = $zdbh->prepare("DELETE FROM x_cronjobs WHERE ct_id_pk=:cronid");
$sql2->bindParam(':cronid', $rowcrons['ct_id_pk']);
$sql2->bindParam(':time', time()); <= delete this one
$sql2->execute();
self::WriteCronFile();
self::$ok = TRUE;
return;
}
}
}
}
self::$error = TRUE;
return;
}
15 Mins cronjob added
static function getCreateCron()
add this line under of Every 10 minutes
$line .= "<option value=\"0,15,30,45 * * * *\">" . ui_language::translate("Every 15 minutes") . "</option>";
static function TranslateTiming($timing)
add this line under of Every 10 minutes
if ($timing == "0,15,30,45 * * * *") {
$retval = "Every 15 minutes";
}
//// done ////
If somethings wrong pls help me admin !
First things apologize for my bad english ..
today i fixed alot cron job delete issues and added 15 mins cron tab
when add cron job with cron manager .. its Okie
then i delete cron job in my panel .. its deleted on panel ..
but still not delete on root SQL DB .. sentora_core => x_cronjobs list
then i delete some core from etc/sentora/panel/modules/cron/code/controller.ext.php
Here how to fix
static function doDeleteCron()
{
global $zdbh;
global $controller;
runtime_csfr:rotect();
$currentuser = ctrl_users::GetUserDetail();
$sql = "SELECT COUNT(*) FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL";
$numrows = $zdbh->prepare($sql);
$numrows->bindParam(':userid', $currentuser['userid']);
if ($numrows->execute()) {
if ($numrows->fetchColumn() <> 0) {
$sql = $zdbh->prepare("SELECT * FROM x_cronjobs WHERE ct_acc_fk=:userid AND ct_deleted_ts IS NULL");
$sql->bindParam(':userid', $currentuser['userid']);
$sql->execute();
while ($rowcrons = $sql->fetch()) {
if (!fs_director::CheckForEmptyValue($controller->GetControllerRequest('FORM', 'inDelete_' . $rowcrons['ct_id_pk'] . ''))) {
$sql2 = $zdbh->prepare("UPDATE x_cronjobs SET ct_deleted_ts=:time WHERE ct_id_pk=:cronid");
<= delete and replace with this =>
$sql2 = $zdbh->prepare("DELETE FROM x_cronjobs WHERE ct_id_pk=:cronid");
$sql2->bindParam(':cronid', $rowcrons['ct_id_pk']);
$sql2->bindParam(':time', time()); <= delete this one
$sql2->execute();
self::WriteCronFile();
self::$ok = TRUE;
return;
}
}
}
}
self::$error = TRUE;
return;
}
15 Mins cronjob added
static function getCreateCron()
add this line under of Every 10 minutes
$line .= "<option value=\"0,15,30,45 * * * *\">" . ui_language::translate("Every 15 minutes") . "</option>";
static function TranslateTiming($timing)
add this line under of Every 10 minutes
if ($timing == "0,15,30,45 * * * *") {
$retval = "Every 15 minutes";
}
//// done ////
If somethings wrong pls help me admin !