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
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 

  static function doDeleteCron()
    {
        global $zdbh;
        global $controller;
        runtime_csfr:Tonguerotect();
        $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 !
Reply
Thanks given by:
#2
RE: Some Edition crontab
The addition of the 15min cron selection is OK. Changing how Sentora 'deletes' the cron jobs is not. It is done that way by design. It 'marks' them as deleted rather than completely remove them. This way if a customer is having an issue the admin can look back and see what they are doing wrong and can also be used to see if a client is trying to do something that may damage the server (hacking). If you want to delete older DB entries use the admin module 'Deleted Records Manager' found here: #[MODULE] Deleted Records Manager [ALL-OS]‍ 
I suggest you edit the above to just include the 15 minute cron jog selection Cool
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: superstarnetworks
#3
RE: Some Edition crontab
(08-15-2017, 01:38 AM)TGates Wrote: The addition of the 15min cron selection is OK. Changing how Sentora 'deletes' the cron jobs is not. It is done that way by design. It 'marks' them as deleted rather than completely remove them. This way if a customer is having an issue the admin can look back and see what they are doing wrong and can also be used to see if a client is trying to do something that may damage the server (hacking). If you want to delete older DB entries use the admin module 'Deleted Records Manager' found here: #[MODULE] Deleted Records Manager [ALL-OS]‍ 
I suggest you edit the above to just include the 15 minute cron jog selection Cool

thanks you . i will edit back delete session  Big Grin
Sentora support stay fast    Cool i hope 1.0.4 official release will be out soon  Drunk
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
Some Edition crontab QTVLegend 1 4 ,290 04-26-2018, 01:21 AM
Last Post: TGates
Crontab not function CJsent 10 22 ,587 10-17-2017, 08:55 PM
Last Post: betatester3.0

Forum Jump:


Users browsing this thread: 1 Guest(s)