Current time: 04-25-2024, 11:53 AM Hello There, Guest! (LoginRegister)


Thread Closed 
[HowTO] add cronjob on Debian Lenny Improved
Author Message
xtc007 Offline
Junior Member
*

Posts: 26
Joined: Dec 2009
Reputation: 0
Post: #21
RE: [HowTO] add cronjob on Debian Lenny Improved
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
(This post was last modified: 01-05-2010 03:45 PM by xtc007.)
01-05-2010 03:29 PM
Find all posts by this user
MasterTH Offline
Member
***

Posts: 570
Joined: Feb 2009
Reputation: 4
Post: #22
RE: [HowTO] add cronjob on Debian Lenny Improved
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


Attached File(s) Thumbnail(s)
   
(This post was last modified: 01-07-2010 03:21 PM by MasterTH.)
01-07-2010 03:19 PM
Find all posts by this user
xtc007 Offline
Junior Member
*

Posts: 26
Joined: Dec 2009
Reputation: 0
Post: #23
RE: [HowTO] add cronjob on Debian Lenny Improved
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


Attached File(s)
.zip  cronjobs_overview.zip (Size: 1.59 KB / Downloads: 40)
(This post was last modified: 01-07-2010 03:53 PM by xtc007.)
01-07-2010 03:47 PM
Find all posts by this user
xtc007 Offline
Junior Member
*

Posts: 26
Joined: Dec 2009
Reputation: 0
Post: #24
RE: [HowTO] add cronjob on Debian Lenny Improved
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
01-18-2010 02:14 PM
Find all posts by this user
oizo.pl Offline


Posts: 1
Joined: May 2010
Reputation: 0
Post: #25
RE: [HowTO] add cronjob on Debian Lenny Improved
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
(This post was last modified: 08-02-2010 07:45 AM by oizo.pl.)
08-01-2010 08:34 PM
Find all posts by this user
WuChEn Offline
Junior Member
*

Posts: 192
Joined: Feb 2009
Reputation: 2
Post: #26
RE: [HowTO] add cronjob on Debian Lenny Improved
Any updates for 1.0.7 ??

Greatz WuChEn
01-06-2011 02:45 AM
Visit this user's website Find all posts by this user
pandjie Offline


Posts: 1
Joined: Jun 2011
Reputation: 0
Post: #27
blank page after instalation
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
06-05-2011 11:43 AM
Find all posts by this user
mr.x Offline
Development Team
*****
Dev Team

Posts: 232
Joined: Nov 2006
Reputation: 3
Post: #28
RE: blank page after instalation
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
06-05-2011 04:20 PM
Find all posts by this user
Thread Closed 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)