diff --git a/actions/admin/settings/000.version.php b/actions/admin/settings/000.version.php index 8c76f7fa..94e77add 100644 --- a/actions/admin/settings/000.version.php +++ b/actions/admin/settings/000.version.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/110.accounts.php b/actions/admin/settings/110.accounts.php index 589d1d1c..2287406c 100644 --- a/actions/admin/settings/110.accounts.php +++ b/actions/admin/settings/110.accounts.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/120.system.php b/actions/admin/settings/120.system.php index 9a105908..52784f7f 100644 --- a/actions/admin/settings/120.system.php +++ b/actions/admin/settings/120.system.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/130.webserver.php b/actions/admin/settings/130.webserver.php index 690c6f9e..fe2b8f34 100644 --- a/actions/admin/settings/130.webserver.php +++ b/actions/admin/settings/130.webserver.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/140.statistics.php b/actions/admin/settings/140.statistics.php index 9c6c5368..c3a1ebb1 100644 --- a/actions/admin/settings/140.statistics.php +++ b/actions/admin/settings/140.statistics.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/150.mail.php b/actions/admin/settings/150.mail.php index 561fb288..e2ed498f 100644 --- a/actions/admin/settings/150.mail.php +++ b/actions/admin/settings/150.mail.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/160.nameserver.php b/actions/admin/settings/160.nameserver.php index 55fd9841..e50ac994 100644 --- a/actions/admin/settings/160.nameserver.php +++ b/actions/admin/settings/160.nameserver.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/170.logger.php b/actions/admin/settings/170.logger.php index 47b76b0b..e8f99adb 100644 --- a/actions/admin/settings/170.logger.php +++ b/actions/admin/settings/170.logger.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/180.dkim.php b/actions/admin/settings/180.dkim.php index b3c263dc..a4658559 100644 --- a/actions/admin/settings/180.dkim.php +++ b/actions/admin/settings/180.dkim.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/185.spf.php b/actions/admin/settings/185.spf.php index f175800f..ab949417 100644 --- a/actions/admin/settings/185.spf.php +++ b/actions/admin/settings/185.spf.php @@ -11,7 +11,7 @@ * @copyright (c) the authors * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/190.ticket.php b/actions/admin/settings/190.ticket.php index f1d0ca2e..027d9dae 100644 --- a/actions/admin/settings/190.ticket.php +++ b/actions/admin/settings/190.ticket.php @@ -1,17 +1,19 @@ - * @license GPLv2 http://files.syscp.org/misc/COPYING.txt - * @package Panel + * @author Florian Lippert (2003-2009) + * @author Froxlor team (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/200.aps.php b/actions/admin/settings/200.aps.php index 1bc0205f..937dd550 100644 --- a/actions/admin/settings/200.aps.php +++ b/actions/admin/settings/200.aps.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/actions/admin/settings/210.security.php b/actions/admin/settings/210.security.php index 813c8be7..a3a4e9da 100644 --- a/actions/admin/settings/210.security.php +++ b/actions/admin/settings/210.security.php @@ -13,7 +13,7 @@ * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Language + * @package Settings * @version $Id$ */ diff --git a/admin_cronjobs.php b/admin_cronjobs.php new file mode 100644 index 00000000..2685477b --- /dev/null +++ b/admin_cronjobs.php @@ -0,0 +1,54 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Panel + * @version $Id: $ + */ + +define('AREA', 'admin'); + +require_once("./lib/init.php"); + +if(isset($_POST['id'])) +{ + $id = intval($_POST['id']); +} +elseif(isset($_GET['id'])) +{ + $id = intval($_GET['id']); +} + +if($page == 'cronjobs' +&& $userinfo['customers'] != '0') +{ + if($action == '') + { + $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_cronjobs"); + } + elseif($action == 'new') + { + + } + elseif($action == 'edit' + && $id != 0) + { + + } + elseif($action == 'delete' + && $id != 0) + { + + } +} + +?> diff --git a/install/froxlor.sql b/install/froxlor.sql index 09269f03..ca3a5b0e 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -930,7 +930,7 @@ CREATE TABLE IF NOT EXISTS `cronjobs_run` ( `id` bigint(20) NOT NULL auto_increment, `cronfile` varchar(250) NOT NULL, `lastrun` int(15) NOT NULL DEFAULT '0', - `interval` INTERVAL DEFAULT '5M', + `interval` varchar(100) DEFAULT '5 MINUTES', PRIMARY KEY (`id`) ) ENGINE=MyISAM; @@ -938,11 +938,11 @@ CREATE TABLE IF NOT EXISTS `cronjobs_run` ( # Dumping data for table `panel_phpconfigs` # -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (1, 'cron_tasks.php', '5M'); -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (2, 'cron_legacy.php', '5M'); -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (3, 'cron_apsinstaller.php', '5M'); -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (4, 'cron_autoresponder.php', '5M'); -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (5, 'cron_apsupdater.php', '1H'); -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (6, 'cron_traffic.php', '1D'); -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (7, 'cron_used_tickets_reset.php', '1M'); -INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (8, 'cron_ticketarchive.php', '1M'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (1, 'cron_tasks.php', '5 MINUTES'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (2, 'cron_legacy.php', '5 MINUTES'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (3, 'cron_apsinstaller.php', '5 MINUTES'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (4, 'cron_autoresponder.php', '5 MINUTES'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (5, 'cron_apsupdater.php', '1 HOUR'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (6, 'cron_traffic.php', '1 DAY'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (7, 'cron_used_tickets_reset.php', '1 MONTH'); +INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (8, 'cron_ticketarchive.php', '1 MONTH'); diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 2a5c9de9..b72bf122 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -106,18 +106,18 @@ if($settings['panel']['frontend'] == 'froxlor' `id` bigint(20) NOT NULL auto_increment, `cronfile` varchar(250) NOT NULL, `lastrun` int(15) NOT NULL DEFAULT '0', - `interval` INTERVAL DEFAULT '5M', + `interval` varchar(100) DEFAULT '5 MINUTES', PRIMARY KEY (`id`) ) ENGINE=MyISAM;"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (1, 'cron_tasks.php', '5M');"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (2, 'cron_legacy.php', '5M');"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (3, 'cron_apsinstaller.php', '5M');"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (4, 'cron_autoresponder.php', '5M');"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (5, 'cron_apsupdater.php', '1H');"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (6, 'cron_traffic.php', '1D');"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (7, 'cron_used_tickets_reset.php', '1M');"); - $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (8, 'cron_ticketarchive.php', '1M');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (1, 'cron_tasks.php', '5 MINUTES');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (2, 'cron_legacy.php', '5 MINUTES');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (3, 'cron_apsinstaller.php', '5 MINUTES');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (4, 'cron_autoresponder.php', '5 MINUTES');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (5, 'cron_apsupdater.php', '1 HOUR');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (6, 'cron_traffic.php', '1 DAY');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (7, 'cron_used_tickets_reset.php', '1 MONTH');"); + $db->query("INSERT INTO `cronjobs_run` (`id`, `cronfile`, `interval`) VALUES (8, 'cron_ticketarchive.php', '1 MONTH');"); // set new version diff --git a/lib/functions/froxlor/function.getIntervalOptions.php b/lib/functions/froxlor/function.getIntervalOptions.php new file mode 100644 index 00000000..d81c2cae --- /dev/null +++ b/lib/functions/froxlor/function.getIntervalOptions.php @@ -0,0 +1,34 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Settings + * @version $Id: $ + */ + +function getIntervalOptions() +{ + global $db, $lng; + + $query = "SELECT DISTINCT `interval` FROM `" . TABLE_PANEL_CRONRUNS . "` ORDER BY `interval` ASC;"; + $result = $db->query($query); + $cron_intervals = array(); + + $cron_intervals['0'] = $lng['panel']['off']; + + while($row = $db->fetch_array($result)) + { + $cron_intervals[$row['interval']] = $row['interval']; + } + + return $cron_intervals; +} diff --git a/lib/functions/filedir/function.getNextCronjobs.php b/lib/functions/froxlor/function.getNextCronjobs.php similarity index 58% rename from lib/functions/filedir/function.getNextCronjobs.php rename to lib/functions/froxlor/function.getNextCronjobs.php index afa27b27..d83cc3fa 100644 --- a/lib/functions/filedir/function.getNextCronjobs.php +++ b/lib/functions/froxlor/function.getNextCronjobs.php @@ -24,5 +24,26 @@ */ function getNextCronjobs() { - // SELECT `interval`, `lastrun` FROM `".PANEL_TABLE_CRONRUNS."` + $sql = "SELECT `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND ("; + /* + * 5M - 5 minute cronjob (reqular) + */ + $intervals = getIntervalOptions(); + + $x = 0; + foreach($intervals as $name => $ival) + { + if($name == '0') continue; + + if($x == 0) { + $sql.= 'DATE_ADD(FROM_UNIXTIME(`lastrun`), INTERVAL '.$ival.') <= CURDATE()'; + } else { + $sql.= ' OR DATE_ADD(UNIX_TIMESTAMP(`lastrun`), INTERVAL '.$ival.') <= CURDATE()'; + } + $x++; + } + + $sql.= ');'; + + $result = $db->query($query); } diff --git a/lib/functions/froxlor/function.includeCronjobs.php b/lib/functions/froxlor/function.includeCronjobs.php index f42fb60d..d68692d9 100644 --- a/lib/functions/froxlor/function.includeCronjobs.php +++ b/lib/functions/froxlor/function.includeCronjobs.php @@ -22,5 +22,6 @@ function includeCronjobs($debugHandler) if($cronjobs !== false) { // [...] + $cron_path = dirname(__FILE__).'/../../../scripts/jobs/'; } } diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 8fa66eb6..44ff12a3 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -48,6 +48,7 @@ define('TABLE_APS_INSTANCES', 'aps_instances'); define('TABLE_APS_SETTINGS', 'aps_settings'); define('TABLE_APS_TASKS', 'aps_tasks'); define('TABLE_APS_TEMP_SETTINGS', 'aps_temp_settings'); +define('TABLE_PANEL_CRONRUNS', 'cronjobs_run'); // APS constants diff --git a/lng/english.lng.php b/lng/english.lng.php index caa163e3..f930aa66 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1259,5 +1259,6 @@ $lng['autoresponder']['date_from'] = 'Start date'; $lng['autoresponder']['date_until'] = 'End date'; $lng['autoresponder']['startenddate'] = 'Start/end date'; $lng['panel']['not_activated'] = 'not activated'; +$lng['panel']['off'] = 'off'; ?> diff --git a/lng/german.lng.php b/lng/german.lng.php index 166c1097..fb647024 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1239,5 +1239,6 @@ $lng['autoresponder']['date_from'] = 'Start-Datum'; $lng['autoresponder']['date_until'] = 'End-Datum'; $lng['autoresponder']['startenddate'] = 'Start/End-Datum'; $lng['panel']['not_activated'] = 'Nicht aktiviert'; +$lng['panel']['off'] = 'aus'; ?>