- adding overview for admin_cronjobs (planned for 1.0);

- added 'isactive' for cronjobs so the admin can deactivate them (planned for 1.0);
- re-adding 'panel_diskspace' and 'panel_diskspace_admins' to install/froxlor.sql;
- show only 'logout' and 'froxlor update' in menulist when files have been updated and db is not up to date;
- bugixing success.tpl (closing <a>-tag);
This commit is contained in:
Michael Kaufmann (d00p)
2010-01-27 09:19:19 +00:00
parent 883963d2e2
commit f0379e26cc
13 changed files with 211 additions and 8 deletions

View File

@@ -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
*/
}
}

View File

@@ -32,6 +32,7 @@ if($page == 'overview')
include_once('./install/updatesql.php');
$redirect_url = 'admin_index.php';
eval("echo \"" . getTemplate("update/update_end") . "\";");
updateCounters();

View File

@@ -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;

View File

@@ -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;");

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -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'],

View File

@@ -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 <strong>%newversion</strong>. The installed version is <strong>%curversion</strong>.<br /><br />Customers will not be able to log in until the update has been finished.<br /><strong>Proceed?</strong>';
$lng['update']['noupdatesavail'] = '<strong>You already have the latest Froxlor version.</strong>';
$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';
?>

View File

@@ -1245,5 +1245,11 @@ $lng['update']['update'] = 'Froxlor Aktualisierung';
$lng['update']['proceed'] = 'Ausf&uuml;hren';
$lng['update']['update_information'] = 'Die Froxlor Dateien wurden aktualisiert. Neue Version ist <strong>%newversion</strong>. Die bisher installierte Version ist <strong>%curversion</strong><br /><br />Ein Kunden-Login ist vor Abschluss des Aktualisierungsvorganges nicht m&oouml;glich.<br /><strong>Aktualisierung ausf&uuml;hren?</strong>';
$lng['update']['noupdatesavail'] = '<strong>Ihre Froxlor-Version ist aktuell.</strong>';
$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&uuml;gen';
?>

View File

@@ -0,0 +1,30 @@
$header
<form action="$filename" method="post">
<input type="hidden" name="s" value="$s"/>
<input type="hidden" name="page" value="$page"/>
<table cellpadding="5" cellspacing="0" border="0" align="center" class="maintable">
<tr>
<td class="maintitle_search_left" colspan="4"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['admin']['cron']['cronsettings']}</b></td>
<td class="maintitle_search_right" colspan="2">{$searchcode}</td>
</tr>
<tr>
<td class="field_display_border_left">{$lng['cron']['cronname']}&nbsp;&nbsp;{$arrowcode['c.cronfile']}</td>
<td class="field_display">{$lng['cron']['lastrun']}&nbsp;&nbsp;{$arrowcode['c.lastrun']}</td>
<td class="field_display">{$lng['cron']['interval']}&nbsp;&nbsp;{$arrowcode['c.interval']}</td>
<td class="field_display">{$lng['cron']['isactive']}&nbsp;&nbsp;{$arrowcode['c.isactive']}</td>
<td class="field_display_search" colspan="2">{$sortcode}</td>
</tr>
$crons
<if $pagingcode != ''>
<tr>
<td class="field_display_border_left" colspan="6" style=" text-align: center; ">{$pagingcode}</td>
</tr>
</if>
<tr>
<td class="field_display_border_left" colspan="6"><a href="$filename?page=$page&amp;action=add&amp;s=$s">{$lng['admin']['cron']['add']}</a></td>
</tr>
</table>
</form>
<br />
<br />
$footer

View File

@@ -0,0 +1,8 @@
<tr class="" onmouseover="this.className='RowOverSelected';" onmouseout="this.className='';">
<td class="field_name_border_left">{$row['cronfile']}</td>
<td class="field_name">{$row['lastrun']}</td>
<td class="field_name">{$row['interval']}</td>
<td class="field_name">{$row['isactive']}</td>
<td class="field_name"><a href="$filename?s=$s&amp;page=$page&amp;action=edit&amp;id={$row['id']}">{$lng['panel']['edit']}</a></td>
<td class="field_name"><a href="$filename?s=$s&amp;page=$page&amp;action=delete&amp;id={$row['id']}">{$lng['panel']['delete']}</a></td>
</tr>

View File

@@ -1,6 +1,9 @@
</div>
</td>
</tr>
<tr>
<td class="field_name"><a href="{$redirect_url}">{$lng['success']['clickheretocontinue']}</a></td>
</tr>
</table>
<br />
<br />

View File

@@ -5,7 +5,7 @@ $header
</tr>
<tr>
<td class="field_name_center_noborder"><img src="images/info.png" alt="" /></td>
<td class="field_name">$success_message<if $redirect_url != ''><br /><a href="{$redirect_url}">{$lng['success']['clickheretocontinue']}</if></td>
<td class="field_name">$success_message<if $redirect_url != ''><br /><a href="{$redirect_url}">{$lng['success']['clickheretocontinue']}</a></if></td>
</tr>
</table>
<br />