diff --git a/admin_updates.php b/admin_updates.php index 0e15b7e5..fc122982 100644 --- a/admin_updates.php +++ b/admin_updates.php @@ -18,8 +18,6 @@ define('AREA', 'admin'); require ("./lib/init.php"); -if($page == '') $page = 'overview'; - if($page == 'overview') { $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_updates"); @@ -30,11 +28,11 @@ if($page == 'overview') && $_POST['send'] == 'send') { - echo getTemplate("update/update_start"); + eval("echo \"" . getTemplate("update/update_start") . "\";"); include_once('./install/updatesql.php'); - echo getTemplate("update/update_end"); + eval("echo \"" . getTemplate("update/update_end") . "\";"); updateCounters(); inserttask('1'); diff --git a/index.php b/index.php index a0462eaf..faee0337 100644 --- a/index.php +++ b/index.php @@ -33,33 +33,31 @@ if($action == '') if($action == 'login') { if(isset($_POST['send']) - && $_POST['send'] == 'send') + && $_POST['send'] == 'send') { $loginname = validate($_POST['loginname'], 'loginname'); $password = validate($_POST['password'], 'password'); - - if(!hasUpdates($version)) + + $row = $db->query_first("SELECT `loginname` AS `customer` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `loginname`='" . $db->escape($loginname) . "'"); + + if($row['customer'] == $loginname) { - $row = $db->query_first("SELECT `loginname` AS `customer` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `loginname`='" . $db->escape($loginname) . "'"); - - if($row['customer'] == $loginname) - { - $table = "`" . TABLE_PANEL_CUSTOMERS . "`"; - $uid = 'customerid'; - $adminsession = '0'; - $is_admin = false; - } - else - { - $is_admin = true; - } + $table = "`" . TABLE_PANEL_CUSTOMERS . "`"; + $uid = 'customerid'; + $adminsession = '0'; + $is_admin = false; } else + { + $is_admin = true; + } + + if(hasUpdates($version) && $is_admin == false) { redirectTo('index.php'); exit; } - + if($is_admin) { if(hasUpdates($version)) @@ -78,7 +76,7 @@ if($action == 'login') { $row = $db->query_first("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `loginname`='" . $db->escape($loginname) . "'"); } - + if($row['admin'] == $loginname) { $table = "`" . TABLE_PANEL_ADMINS . "`"; @@ -95,7 +93,7 @@ if($action == 'login') $userinfo = $db->query_first("SELECT * FROM $table WHERE `loginname`='" . $db->escape($loginname) . "'"); if($userinfo['loginfail_count'] >= $settings['login']['maxloginattempts'] - && $userinfo['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])) + && $userinfo['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])) { redirectTo('index.php', Array('showmessage' => '3'), true); exit; @@ -120,7 +118,7 @@ if($action == 'login') } if(isset($userinfo['userid']) - && $userinfo['userid'] != '') + && $userinfo['userid'] != '') { $s = md5(uniqid(microtime(), 1)); @@ -202,13 +200,12 @@ if($action == 'login') $message = $lng['error']['errorsendingmail']; break; } - + $update_in_progress = ''; if(hasUpdates($version)) { - $update_in_progress_msg = $lng['update']['updateinprogress_onlyadmincanlogin']; - $update_in_progress = getTemplate("updateinprogress"); - } + $update_in_progress = $lng['update']['updateinprogress_onlyadmincanlogin']; + } eval("echo \"" . getTemplate("login") . "\";"); } @@ -217,7 +214,7 @@ if($action == 'login') if($action == 'forgotpwd') { if(isset($_POST['send']) - && $_POST['send'] == 'send') + && $_POST['send'] == 'send') { $adminchecked = false; $loginname = validate($_POST['loginname'], 'loginname'); @@ -239,7 +236,7 @@ if($action == 'forgotpwd') $user = $db->fetch_array($result); if(($adminchecked && $settings['panel']['allow_preset_admin'] == '1') - || $adminchecked == false) + || $adminchecked == false) { if($user !== false) { diff --git a/install/install.php b/install/install.php index b0f587e1..17c1f403 100644 --- a/install/install.php +++ b/install/install.php @@ -632,7 +632,6 @@ if(isset($_POST['installstep']) `domains_used` = 0, `domains_see_all` = 1, `change_serversettings` = 1, - `edit_billingdata` = 1, `diskspace` = -1024, `diskspace_used` = 0, `mysqls` = -1, diff --git a/install/updatesql.php b/install/updatesql.php index 4cc291ae..342c79ee 100644 --- a/install/updatesql.php +++ b/install/updatesql.php @@ -34,7 +34,7 @@ if(!isset($settings['panel']['frontend']) || (substr($settings['panel']['version'], 0, 3) == '1.0' && $settings['panel']['version'] != '1.0.10')) { $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0 to 1.0.10"); - include_once ('./updates/syscp/1.0/update_1.0_1.0.10.inc.php'); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.0/update_1.0_1.0.10.inc.php')); } /** @@ -44,7 +44,7 @@ if(!isset($settings['panel']['frontend']) if($settings['panel']['version'] == '1.0.10') { $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0.10 to 1.2-beta1"); - include_once ('./updates/syscp/1.0/update_1.0.10_1.2-beta1.inc.php'); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.0/update_1.0.10_1.2-beta1.inc.php')); } /** @@ -54,7 +54,7 @@ if(!isset($settings['panel']['frontend']) if(substr($settings['panel']['version'], 0, 3) == '1.2') { $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2-beta1 to 1.2.19"); - include_once ('./updates/syscp/1.2/update_1.2-beta1_1.2.19.inc.php'); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.2/update_1.2-beta1_1.2.19.inc.php')); } /** @@ -64,7 +64,7 @@ if(!isset($settings['panel']['frontend']) if(substr($settings['panel']['version'], 0, 6) == '1.2.19') { $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2.19 to 1.4"); - include_once ('./updates/syscp/1.2/update_1.2.19_1.4.inc.php'); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.2/update_1.2.19_1.4.inc.php')); } /** @@ -74,7 +74,7 @@ if(!isset($settings['panel']['frontend']) if(substr($settings['panel']['version'], 0, 3) == '1.4') { $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4"); - include_once ('./updates/syscp/1.4/update_1.4.inc.php'); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.4/update_1.4.inc.php')); } /** @@ -87,7 +87,7 @@ if(!isset($settings['panel']['frontend']) * From now on, these update-scripts will not * do their work on their own...they will ask! */ - include_once ('./updates/froxlor/upgrade_syscp.inc.php'); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/upgrade_syscp.inc.php')); } @@ -95,7 +95,7 @@ if(isFroxlor()) { if(isFroxlorVersion('0.9-r0')) { - include_once ('./updates/froxlor/0.9/update_0.9.inc.php'); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php')); } } diff --git a/lib/functions/froxlor/function.updateFunctions.php b/lib/functions/froxlor/function.updateFunctions.php index 18790cf7..177afc6f 100644 --- a/lib/functions/froxlor/function.updateFunctions.php +++ b/lib/functions/froxlor/function.updateFunctions.php @@ -118,6 +118,12 @@ function showUpdateStep($task = null, $needs_status = true) global $updatelog; // output + echo $task; + + if(!$needs_status) + { + echo "
"; + } $updatelog->logAction(ADM_ACTION, LOG_WARNING, $task); } @@ -136,7 +142,27 @@ function lastStepStatus($status = -1) { global $updatelog; + switch($status) + { + case 0: + $status_sign = '[OK]'; + $status_color = '1dcd00'; + break; + case 1: + $status_sign = '[??]'; + $status_color = 'db7100'; + break; + case 2: + $status_sign = '[!!]'; + $status_color = 'ff0000'; + break; + default: + $status_sign = '[unknown]'; + $status_color = '000000'; + break; + } // output + echo "".$status_sign.""; if($status == -1) { diff --git a/templates/main.css b/templates/main.css index 100fa0db..3dca842f 100644 --- a/templates/main.css +++ b/templates/main.css @@ -436,3 +436,10 @@ TR.RowOverSelected { margin-right: 3px; background-color: #C6DEFF; } + +.update_progess +{ + padding: 2em; + text-align: left; +} +