This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Some Edition crontab
#1
[Not Solved] Some Edition crontab
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 

 
PHP Code:
static function doDeleteCron()
    {
        global $zdbh;
        global $controller;
        runtime_csfr::protect();
        $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 above and replace with below
                        $sql2 $zdbh->prepare("DELETE FROM x_cronjobs WHERE ct_id_pk=:cronid");

                        $sql2->bindParam(':cronid'$rowcrons['ct_id_pk']);

                        $sql2->bindParam(':time'time());   // and 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

PHP Code:
$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


PHP Code:
if ($timing == "0,15,30,45 * * * *") {
            $retval "Every 15 minutes";
        



//// done ////

If somethings wrong pls help me admin !
Reply
Thanks given by:
#2
[Not Solved] RE: Some Edition crontab
Cron jobs are saved in the database even after deletion and this is done by design so you can review them for future reference and security.

If you absolutely need to remove these 'reference deletions' then I suggest you install the 'deleted records manager' module and only delete the entries you need to: http://forums.sentora.org/showthread.php?tid=1617

About adding a 15 minute selection, I will have to review the changes but looks OK at first glance  Big Grin
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:


Possibly Related Threads...
Thread Author Replies Views Last Post
Crontab not function CJsent 10 1,969 10-17-2017, 08:55 PM
Last Post: betatester3.0
Some Edition crontab superstarnetworks 2 781 08-15-2017, 01:49 AM
Last Post: superstarnetworks

Forum Jump:


Users browsing this thread: 1 Guest(s)