diff --git a/admin_cronjobs.php b/admin_cronjobs.php index 4237972a..5da2cd92 100644 --- a/admin_cronjobs.php +++ b/admin_cronjobs.php @@ -29,25 +29,80 @@ elseif(isset($_GET['id'])) } if($page == 'cronjobs' -&& $userinfo['customers'] != '0') + || $page == 'overview') { if($action == '') { $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_cronjobs"); + + $fields = array( + 'c.cronfile' => $lng['cron']['cronname'], + 'c.lastrun' => $lng['cron']['lastrun'], + 'c.interval' => $lng['cron']['interval'], + 'c.isactive' => $lng['cron']['isactive'] + ); + $paging = new paging($userinfo, $db, TABLE_PANEL_CRONRUNS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']); + + /* + * @TODO Fix sorting + */ + $crons = ''; + $result = $db->query("SELECT `c`.* FROM `" . TABLE_PANEL_CRONRUNS . "` `c` ORDER BY `cronfile` ASC " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); + $paging->setEntries($db->num_rows($result)); + $sortcode = $paging->getHtmlSortCode($lng); + $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); + $searchcode = $paging->getHtmlSearchCode($lng); + $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s); + + $i = 0; + $count = 0; + + while($row = $db->fetch_array($result)) + { + if($paging->checkDisplay($i)) + { + $row = htmlentities_array($row); + + $row['lastrun'] = date('d.m.Y H:i', $row['lastrun']); + + if((int)$row['isactive'] == 1) + { + $row['isactive'] = $lng['panel']['yes']; + } + else + { + $row['isactive'] = $lng['panel']['no']; + } + + eval("\$crons.=\"" . getTemplate("cronjobs/cronjobs_cronjob") . "\";"); + $count++; + } + + $i++; + } + + eval("echo \"" . getTemplate("cronjobs/cronjobs") . "\";"); + } elseif($action == 'new') { - + /* + * @TODO Finish me + */ } elseif($action == 'edit' && $id != 0) { - + /* + * @TODO Finish me + */ } elseif($action == 'delete' && $id != 0) { - + /* + * @TODO Finish me + */ } } diff --git a/admin_updates.php b/admin_updates.php index 87fdcb16..d3e18240 100644 --- a/admin_updates.php +++ b/admin_updates.php @@ -32,6 +32,7 @@ if($page == 'overview') include_once('./install/updatesql.php'); + $redirect_url = 'admin_index.php'; eval("echo \"" . getTemplate("update/update_end") . "\";"); updateCounters(); diff --git a/install/froxlor.sql b/install/froxlor.sql index 0db19a3d..8f5298d9 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -699,6 +699,49 @@ CREATE TABLE `panel_diskspace_admins` ( # -------------------------------------------------------- +# +# Table structure for table `panel_diskspace` +# + +CREATE TABLE `panel_diskspace` ( + `id` int(11) unsigned NOT NULL auto_increment, + `customerid` int(11) unsigned NOT NULL default '0', + `year` int(4) unsigned zerofill NOT NULL default '0000', + `month` int(2) unsigned zerofill NOT NULL default '00', + `day` int(2) unsigned zerofill NOT NULL default '00', + `stamp` int(11) unsigned NOT NULL default '0', + `webspace` bigint(30) unsigned NOT NULL default '0', + `mail` bigint(30) unsigned NOT NULL default '0', + `mysql` bigint(30) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `customerid` (`customerid`) +) TYPE=MyISAM ; + +# +# Dumping data for table `panel_diskspace` +# + + +# -------------------------------------------------------- + +# +# Table structure for table `panel_diskspace_admins` +# + +CREATE TABLE `panel_diskspace_admins` ( + `id` int(11) unsigned NOT NULL auto_increment, + `adminid` int(11) unsigned NOT NULL default '0', + `year` int(4) unsigned zerofill NOT NULL default '0000', + `month` int(2) unsigned zerofill NOT NULL default '00', + `day` int(2) unsigned zerofill NOT NULL default '00', + `stamp` int(11) unsigned NOT NULL default '0', + `webspace` bigint(30) unsigned NOT NULL default '0', + `mail` bigint(30) unsigned NOT NULL default '0', + `mysql` bigint(30) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `adminid` (`adminid`) +) TYPE=MyISAM ; + # # Table structure for table `panel_languages` # @@ -931,6 +974,7 @@ CREATE TABLE IF NOT EXISTS `cronjobs_run` ( `cronfile` varchar(250) NOT NULL, `lastrun` int(15) NOT NULL DEFAULT '0', `interval` varchar(100) DEFAULT '5 MINUTE', + `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM; 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 2fc370ed..b9c3827b 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -272,6 +272,7 @@ if(isFroxlorVersion('0.9-r3')) `cronfile` varchar(250) NOT NULL, `lastrun` int(15) NOT NULL DEFAULT '0', `interval` varchar(100) DEFAULT '5 MINUTE', + `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM;"); diff --git a/lib/functions/froxlor/function.getNextCronjobs.php b/lib/functions/froxlor/function.getNextCronjobs.php index dfb2e3ae..1da68b8a 100644 --- a/lib/functions/froxlor/function.getNextCronjobs.php +++ b/lib/functions/froxlor/function.getNextCronjobs.php @@ -26,7 +26,7 @@ function getNextCronjobs() { global $db; - $query = "SELECT `id`, `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND ("; + $query = "SELECT `id`, `cronfile` FROM `".TABLE_PANEL_CRONRUNS."` WHERE `interval` <> '0' AND `isactive` = '1' AND ("; $intervals = getIntervalOptions(); diff --git a/lib/init.php b/lib/init.php index c02d31fe..72dbef7a 100644 --- a/lib/init.php +++ b/lib/init.php @@ -322,8 +322,48 @@ if(isset($userinfo['loginname']) if(AREA == 'admin' || AREA == 'customer') { - $navigation_data = loadConfigArrayDir('./lib/navigation/'); - $navigation = buildNavigation($navigation_data[AREA], $userinfo); + if(hasUpdates($version)) + { + /* + * if froxlor-files have been updated + * but not yet configured by the admin + * we only show logout and the update-page + */ + $navigation_data = array ( + 'admin' => array ( + 'index' => array ( + 'url' => 'admin_index.php', + 'label' => $lng['admin']['overview'], + 'elements' => array ( + array ( + 'label' => $lng['menue']['main']['username'], + ), + array ( + 'url' => 'admin_index.php?action=logout', + 'label' => $lng['login']['logout'], + ), + ), + ), + 'server' => array ( + 'label' => $lng['admin']['server'], + 'required_resources' => 'change_serversettings', + 'elements' => array ( + array ( + 'url' => 'admin_updates.php?page=overview', + 'label' => $lng['update']['update'], + 'required_resources' => 'change_serversettings', + ), + ), + ), + ), + ); + $navigation = buildNavigation($navigation_data['admin'], $userinfo); + } + else + { + $navigation_data = loadConfigArrayDir('./lib/navigation/'); + $navigation = buildNavigation($navigation_data[AREA], $userinfo); + } unset($navigation_data); } diff --git a/lib/navigation/00.froxlor.main.php b/lib/navigation/00.froxlor.main.php index 7f02892c..dc19bd9f 100644 --- a/lib/navigation/00.froxlor.main.php +++ b/lib/navigation/00.froxlor.main.php @@ -200,6 +200,15 @@ return array ( 'label' => $lng['admin']['ipsandports']['ipsandports'], 'required_resources' => 'change_serversettings', ), + /* + * @TODO this is for Froxlor-1.0 + * + array ( + 'url' => 'admin_cronjobs.php?page=overview', + 'label' => $lng['admin']['cron']['cronsettings'], + 'required_resources' => 'change_serversettings', + ), + */ array ( 'url' => 'admin_settings.php?page=rebuildconfigs', 'label' => $lng['admin']['rebuildconf'], diff --git a/lng/english.lng.php b/lng/english.lng.php index 827405ad..d8646a4a 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1265,5 +1265,11 @@ $lng['update']['update'] = 'Froxlor Update'; $lng['update']['proceed'] = 'Proceed'; $lng['update']['update_information'] = 'The Froxlor files have been updated to version %newversion. The installed version is %curversion.

Customers will not be able to log in until the update has been finished.
Proceed?'; $lng['update']['noupdatesavail'] = 'You already have the latest Froxlor version.'; +$lng['admin']['cron']['cronsettings'] = 'Cronjob settings'; +$lng['cron']['cronname'] = 'cronjob-name'; +$lng['cron']['lastrun'] = 'last run'; +$lng['cron']['interval'] = 'interval'; +$lng['cron']['isactive'] = 'enabled'; +$lng['admin']['cron']['add'] = 'Add a new cronjob'; ?> diff --git a/lng/german.lng.php b/lng/german.lng.php index 211c7654..5016ec6b 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1245,5 +1245,11 @@ $lng['update']['update'] = 'Froxlor Aktualisierung'; $lng['update']['proceed'] = 'Ausführen'; $lng['update']['update_information'] = 'Die Froxlor Dateien wurden aktualisiert. Neue Version ist %newversion. Die bisher installierte Version ist %curversion

Ein Kunden-Login ist vor Abschluss des Aktualisierungsvorganges nicht m&oouml;glich.
Aktualisierung ausführen?'; $lng['update']['noupdatesavail'] = 'Ihre Froxlor-Version ist aktuell.'; +$lng['admin']['cron']['cronsettings'] = 'Cronjob Einstellungen'; +$lng['cron']['cronname'] = 'Cronjob-Name'; +$lng['cron']['lastrun'] = 'zuletzt gestartet'; +$lng['cron']['interval'] = 'Interval'; +$lng['cron']['isactive'] = 'Aktiv'; +$lng['admin']['cron']['add'] = 'Cronjob hinzufügen'; ?> diff --git a/templates/admin/cronjobs/cronjobs.tpl b/templates/admin/cronjobs/cronjobs.tpl new file mode 100644 index 00000000..26f390a5 --- /dev/null +++ b/templates/admin/cronjobs/cronjobs.tpl @@ -0,0 +1,30 @@ +$header +
+ + + + + + + + + + + + + + + $crons + + + + + + + + +
 {$lng['admin']['cron']['cronsettings']}{$searchcode}
{$lng['cron']['cronname']}  {$arrowcode['c.cronfile']}{$lng['cron']['lastrun']}  {$arrowcode['c.lastrun']}{$lng['cron']['interval']}  {$arrowcode['c.interval']}{$lng['cron']['isactive']}  {$arrowcode['c.isactive']}
{$pagingcode}
{$lng['admin']['cron']['add']}
+
+
+
+$footer diff --git a/templates/admin/cronjobs/cronjobs_cronjob.tpl b/templates/admin/cronjobs/cronjobs_cronjob.tpl new file mode 100644 index 00000000..1c21ef76 --- /dev/null +++ b/templates/admin/cronjobs/cronjobs_cronjob.tpl @@ -0,0 +1,8 @@ + + {$row['cronfile']} + {$row['lastrun']} + {$row['interval']} + {$row['isactive']} + {$lng['panel']['edit']} + {$lng['panel']['delete']} + diff --git a/templates/admin/update/update_end.tpl b/templates/admin/update/update_end.tpl index 227d7ef9..960cda9d 100644 --- a/templates/admin/update/update_end.tpl +++ b/templates/admin/update/update_end.tpl @@ -1,6 +1,9 @@ + + {$lng['success']['clickheretocontinue']} +

diff --git a/templates/misc/success.tpl b/templates/misc/success.tpl index 42e22602..a98c3b6d 100644 --- a/templates/misc/success.tpl +++ b/templates/misc/success.tpl @@ -5,7 +5,7 @@ $header - $success_message
{$lng['success']['clickheretocontinue']}
+ $success_message
{$lng['success']['clickheretocontinue']}