diff --git a/interface/web/sites/templates/cron_list.htm b/interface/web/sites/templates/cron_list.htm index 57aa4298ba9d3ffe2b2d00ab990778dd9c4b42f2..63c4895e3953cf92ef29104a1a72d02caccdb26f 100644 --- a/interface/web/sites/templates/cron_list.htm +++ b/interface/web/sites/templates/cron_list.htm @@ -20,6 +20,7 @@ <tr> <th class="tbl_col_active" scope="col"><tmpl_var name="active_txt"></th> <th class="tbl_col_server_id" scope="col"><tmpl_var name="server_id_txt"></th> + <th class="tbl_col_parent_domain_id" scope="col"><tmpl_var name="parent_domain_id_txt"></th> <th class="tbl_col_run_min" scope="col"><tmpl_var name="run_min_txt"></th> <th class="tbl_col_run_hour" scope="col"><tmpl_var name="run_hour_txt"></th> <th class="tbl_col_run_mday" scope="col"><tmpl_var name="run_mday_txt"></th> @@ -31,11 +32,12 @@ <tr> <td class="tbl_col_active"><select name="search_active">{tmpl_var name='search_active'}</select></td> <td class="tbl_col_server_id"><select name="search_server_id">{tmpl_var name='search_server_id'}</select></td> - <td class="tbl_col_run_min"><input type="text" name="search_run_min" size="3" value="{tmpl_var name='search_run_min'}" /></td> - <td class="tbl_col_run_hour"><input type="text" name="search_run_hour" size="3" value="{tmpl_var name='search_run_hour'}" /></td> - <td class="tbl_col_run_mday"><input type="text" name="search_run_mday" size="3" value="{tmpl_var name='search_run_mday'}" /></td> - <td class="tbl_col_run_month"><input type="text" name="search_run_month" size="3" value="{tmpl_var name='search_run_month'}" /></td> - <td class="tbl_col_run_wday"><input type="text" name="search_run_wday" size="3" value="{tmpl_var name='search_run_wday'}" /></td> + <td class="tbl_col_parent_domain_id"><select name="search_parent_domain_id">{tmpl_var name='search_parent_domain_id'}</select></td> + <td class="tbl_col_run_min"><input type="text" name="search_run_min" size="1" value="{tmpl_var name='search_run_min'}" /></td> + <td class="tbl_col_run_hour"><input type="text" name="search_run_hour" size="1" value="{tmpl_var name='search_run_hour'}" /></td> + <td class="tbl_col_run_mday"><input type="text" name="search_run_mday" size="1" value="{tmpl_var name='search_run_mday'}" /></td> + <td class="tbl_col_run_month"><input type="text" name="search_run_month" size="1" value="{tmpl_var name='search_run_month'}" /></td> + <td class="tbl_col_run_wday"><input type="text" name="search_run_wday" size="1" value="{tmpl_var name='search_run_wday'}" /></td> <td class="tbl_col_command"><input type="text" name="search_command" value="{tmpl_var name='search_command'}" /></td> <td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="submitForm('pageForm','sites/cron_list.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td> </tr> @@ -45,6 +47,7 @@ <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> <td class="tbl_col_active"><a href="#" onClick="loadContent('sites/cron_edit.php?id={tmpl_var name='id'}');"><img src="themes/{tmpl_var name='theme'}/icons/{tmpl_var name='_active_'}" border="0" /></a></td> <td class="tbl_col_server_id"><a href="#" onClick="loadContent('sites/cron_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="server_id"}</a></td> + <td class="tbl_col_parent_domain_id"><a href="#" onClick="loadContent('sites/cron_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="parent_domain_id"}</a></td> <td class="tbl_col_run_min"><a href="#" onClick="loadContent('sites/cron_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="run_min"}</a></td> <td class="tbl_col_run_hour"><a href="#" onClick="loadContent('sites/cron_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="run_hour"}</a></td> <td class="tbl_col_run_mday"><a href="#" onClick="loadContent('sites/cron_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="run_mday"}</a></td> diff --git a/server/plugins-available/cron_plugin.inc.php b/server/plugins-available/cron_plugin.inc.php index 9b6099d7f6aa7735e12d5946dc5decfed0b1bc39..d1e31d13c303df7753ad42d42fbda0b72adb6899 100644 --- a/server/plugins-available/cron_plugin.inc.php +++ b/server/plugins-available/cron_plugin.inc.php @@ -191,7 +191,7 @@ class cron_plugin { $chr_cmd_count = 0; //* read all active cron jobs from database and write them to file - $cron_jobs = $app->db->queryAllRecords("SELECT `run_min`, `run_hour`, `run_mday`, `run_month`, `run_wday`, `command`, `type` FROM `cron` WHERE `parent_domain_id` = ".intval($this->parent_domain["domain_id"]) . " AND `active` = 'y'"); + $cron_jobs = $app->db->queryAllRecords("SELECT c.`run_min`, c.`run_hour`, c.`run_mday`, c.`run_month`, c.`run_wday`, c.`command`, c.`type`, `web_domain`.`domain` as `domain` FROM `cron` as c INNER JOIN `web_domain` ON `web_domain`.`domain_id` = c.`parent_domain_id` WHERE c.`parent_domain_id` = ".intval($this->parent_domain["domain_id"]) . " AND c.`active` = 'y'"); if($cron_jobs && count($cron_jobs) > 0) { foreach($cron_jobs as $job) { if($job['run_month'] == '@reboot') { @@ -216,10 +216,10 @@ class cron_plugin { } if($job['type'] == 'chrooted') { - $chr_cron_content .= $command . "\n"; + $chr_cron_content .= $command . "\t#{$job['domain']}\n"; $chr_cmd_count++; } else { - $cron_content .= $command . "\n"; + $cron_content .= $command . "\t#{$job['domain']}\n"; $cmd_count++; } }