ispCP - Board - Support
[HowTO] add cronjob on Debian Lenny Improved - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: [HowTO] add cronjob on Debian Lenny Improved (/thread-9028.html)

Pages: 1 2 3


RE: [HowTO] add cronjob on Debian Lenny Improved - xtc007 - 01-05-2010 03:29 PM

i think we go wrong.... that's not the cronjob are not working, but the cronjob interface....in ispcp.... the interface aren't use the hcrond parameter but the ispcp parameter...

ispcp database user right must be able to work on the table...
the true_domain_id field must be int(10) not null , they are okay?

i think we focus on the bad problem source...

can you put your cronjobs_overview.php take it fronm /var/www/ispcp/gui/clients/ to see if the php structure are okay, or if your system are returning a carriage return or a space where they are not supposed?

xtc007
RTMedia.ca


RE: [HowTO] add cronjob on Debian Lenny Improved - MasterTH - 01-07-2010 03:19 PM

restarted the service everytime to get the new config running Wink
The id field is int(10) and root has every rights to every database..

Here is my php,
Code:
<?php
/*
* (?) 2009, Russia, Moscow
* Serge Obookhoff AKA Hong Lee
* www.data-stream.ru && www.veterinars.ru
* Last Revision at 01/2009
*     Written for ispCP Team (www.isp-control.net) ONLY.
*     Written using the old, dead blanks VHCS.
* All Functions rewritten.
*
* Notice: If you use this script you have own risks.
*
*
* Modified on 29-12-2009 by xtc007
* Functionality added : fixed white square display in top on 1.0.3
* RT Media Inc ~ www.rtmedia.ca
*
*/

require '../include/ispcp-lib.php';

check_login(__FILE__);

$tpl = new pTemplate();
$tpl->define_dynamic('page', Config::get('CLIENT_TEMPLATE_PATH') . '/cronjobs_overview.tpl');
$tpl->define_dynamic('page_message', 'page');
$tpl->define_dynamic('logged_from', 'page');
$tpl->define_dynamic('cronjobs', 'page');

$theme_color = Config::get('USER_INITIAL_THEME');

$tpl->assign(
    array('TR_CLIENT_CRONJOBS_TITLE' => tr('ispCP - Client/Cronjob Manager'),
        'THEME_COLOR_PATH' => "../themes/$theme_color",
        'THEME_CHARSET' => tr('encoding'),
        'ISP_LOGO' => get_logo($_SESSION['user_id'])
        )
    );

# Getting user's right to reading and using  the Jobs





function gen_cron_user(&$tpl, &$sql, $domain) {
#
}

function gen_cron_jobs(&$tpl, &$sql, $user_id) {

    $query = <<<SQL_QUERY
        SELECT
            id, name, lastrun, activ, coment, domain
        FROM
            hcrondtab
        WHERE
            domain = $user_id
        ORDER BY
            id
SQL_QUERY;

    $rs = exec_query($sql, $query, array($user_id));

    if ($rs->RecordCount() == 0) {
        $tpl->assign(
            array('NAME' => tr('Jobs list is empty!'),
                'DESCRIPTION' => '',
                'ACTIVE' => '',
                'LASTRUN' => '',
                'EDIT' => '',
                'DELETE' => ''
                )
            );

    } else {

        $counter = 0;
        while (!$rs->EOF) {
            if ($counter % 2 == 0) {
                $tpl->assign('ITEM_CLASS', 'content');
            } else {
                $tpl->assign('ITEM_CLASS', 'content2');
            }

            if ($rs->fields['activ'] == 1) {$activ = 'Yes';}
            else {$activ = 'No';};
            $lastrun = $rs->fields['lastrun'];
            if ($lastrun == 0 ) {$lastrun = '';}
                else {$lastrun = date("Y-m-d H:i:s",$lastrun);}
            $tpl->assign(
                array('NAME' => $rs->fields['name'],
                    'DESCRIPTION' => $rs->fields['coment'],
                    'LASTRUN' => $lastrun,
                    'ACTIVE' => $activ,
                    'ID'  => $rs->fields['id'],
                    'EDIT' => '<img src="{THEME_COLOR_PATH}/images/icons/edit.png" width="16" height="16" align="absmiddle"> <a href="cronjobs_edit.php?cron_id={ID}" class="link">{TR_EDIT}</a>',
                    'DELETE' => '<img src="{THEME_COLOR_PATH}/images/icons/delete.png" width="16" height="16" border="0" align="absmiddle"> <a href="#" class="link" onclick="action_delete(\'cronjobs_delete.php?cron_id={ID}\', \'{NAME}\')">{TR_DELETE}</a>'
                    )
                );
            $tpl->parse('CRONJOBS', '.cronjobs');
            $rs->MoveNext();
            $counter++;
        }

    }

} // End of gen_cron_job();

/*
*
* static page messages.
*
*/

gen_client_mainmenu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/main_menu_webtools.tpl');
gen_client_menu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/menu_webtools.tpl');

gen_logged_from($tpl);

check_permissions($tpl);

gen_cron_jobs($tpl, $sql, $_SESSION['user_id']);

$tpl->assign(
    array('TR_CRON_MANAGER' => tr('Cronjob Manager'),
        'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete %s?', true, '%s'),
        'TR_CRONJOBS' => tr('Cronjobs'),
        'TR_ACTIVE' => tr('Active'),
        'TR_ACTION' => tr('Active'),
        'TR_EDIT' => tr('Edit'),
        'TR_DELETE' => tr('Delete'),
        'TR_ADD' => tr('Add Cronjob')
        )
    );

gen_page_message($tpl);

$tpl->parse('PAGE', 'page');
$tpl->prnt();

if (Config::get('DUMP_GUI_DEBUG'))
    dump_gui_debug();

unset_messages();

?>

a screenshot from table is attached


RE: [HowTO] add cronjob on Debian Lenny Improved - xtc007 - 01-07-2010 03:47 PM

you didn't have the latest version provided in my how to

you have the line 71-72 and 97-98 they aren't suppose to be here

i don't know where you have take your version but i provide you the good one

copy the provided cronjobs_overview.php in your

/var/www/ispcp/gui/client/ directory

and it will be ok

let me know if all are corrected with the true php file

EDIT: i just have see you have taken the php of koko92_national but probably not the tpl

At this time use the original one, i work on the improvement, when ready i will inform anyone about it,


xtc007
RTMedia.ca


RE: [HowTO] add cronjob on Debian Lenny Improved - xtc007 - 01-18-2010 02:14 PM

Hi all,

i didn't have abandonned the improvement i have to do

Too much job this week, be assured i will do it asap

MasterTH, Your problem are fix with the original php files?

let me know...

xtc007
RTMedia.ca


RE: [HowTO] add cronjob on Debian Lenny Improved - oizo.pl - 08-01-2010 08:34 PM

Hi,

I've noticed that every cronjob is run as a root, so
script file has access to everything... (ex. can read/write
every file Sad)
I want that
cornjob has access only to files which belong
to the user that defined the cronjob.

How to prevent such situation?
Setting in the conf file uid and gid for www-data?
Sorry for the silly question...
I'll be very gratefull for any help.

Using: iscpCP 1.0.5

Regards


RE: [HowTO] add cronjob on Debian Lenny Improved - WuChEn - 01-06-2011 02:45 AM

Any updates for 1.0.7 ??

Greatz WuChEn


blank page after instalation - pandjie - 06-05-2011 11:43 AM

Please help me
after instalation i get blank page in admin panel
i dunno where is the problem, i think all instalation smoothly without any error, but i cant acces my admin panel...
please someone help me...

:sorry for my bad english


RE: blank page after instalation - mr.x - 06-05-2011 04:20 PM

Hi pandjie,

(06-05-2011 11:43 AM)pandjie Wrote:  Please help me
after instalation i get blank page in admin panel
i dunno where is the problem, i think all instalation smoothly without any error, but i cant acces my admin panel...
please someone help me...

:sorry for my bad english

please use the search function before posting new questions.
Please take a look at LINK

BR
Mr.X