From 0401e6971a2a7249e8d11390226ac67e41010247 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 22 Dec 2018 08:15:31 +0100 Subject: [PATCH] Revert "refactor global array" This reverts commit c5a58e3f362b977a325572416a7fa65ef272e938. --- 2fa.php | 12 +- admin_admins.php | 22 ++-- admin_apcuinfo.php | 2 +- admin_configfiles.php | 2 +- admin_cronjobs.php | 6 +- admin_customers.php | 26 ++-- admin_domains.php | 70 +++++----- admin_index.php | 46 +++---- admin_ipsandports.php | 12 +- admin_logger.php | 4 +- admin_message.php | 12 +- admin_opcacheinfo.php | 2 +- admin_phpsettings.php | 36 ++--- admin_plans.php | 12 +- admin_settings.php | 22 ++-- admin_templates.php | 38 +++--- admin_traffic.php | 4 +- api_keys.php | 26 ++-- composer.json | 6 +- customer_domains.php | 52 ++++---- customer_email.php | 50 +++---- customer_extras.php | 74 +++++------ customer_ftp.php | 34 ++--- customer_index.php | 70 +++++----- customer_logger.php | 6 +- customer_mysql.php | 16 +-- customer_traffic.php | 4 +- dns_editor.php | 8 +- index.php | 76 +++++------ .../updates/froxlor/0.10/update_0.10.inc.php | 2 +- .../updates/froxlor/0.9/update_0.9.inc.php | 6 +- install/updatesql.php | 2 +- lib/Froxlor/Api/Commands/Mysqls.php | 14 +- lib/Froxlor/Bulk/BulkAction.php | 4 +- lib/Froxlor/Bulk/DomainBulkAction.php | 9 +- lib/Froxlor/Database/Database.php | 4 +- lib/Froxlor/Database/IntegrityCheck.php | 7 +- lib/Froxlor/Domain/IpAddr.php | 6 +- lib/Froxlor/I18N/Lang.php | 27 ---- lib/Froxlor/UI/HTML.php | 12 +- lib/Froxlor/UI/Paging.php | 26 ++-- lib/Froxlor/UI/Response.php | 6 +- lib/Froxlor/User.php | 20 --- .../admin/admin/formfield.admin_edit.php | 10 +- .../admin/domains/formfield.domains_add.php | 12 +- .../admin/domains/formfield.domains_edit.php | 16 +-- .../domains/formfield.domains_edit.php | 2 +- lib/init.php | 34 +++-- lib/navigation/00.froxlor.main.php | 2 +- logfiles_viewer.php | 4 +- ssl_certificates.php | 10 +- templates/Sparkle/2fa/overview.tpl | 6 +- .../Sparkle/admin/admins/admins_admin.tpl | 4 +- .../Sparkle/admin/admins/admins_edit.tpl | 2 +- .../Sparkle/admin/customers/customers.tpl | 4 +- templates/Sparkle/admin/domains/domains.tpl | 4 +- templates/Sparkle/admin/index/index.tpl | 88 ++++++------- .../Sparkle/admin/phpconfig/overview.tpl | 4 +- .../settings/updatecounters_row_admin.tpl | 2 +- .../Sparkle/customer/domains/domainlist.tpl | 4 +- .../customer/domains/domains_domain.tpl | 4 +- .../Sparkle/customer/domains/domains_edit.tpl | 2 +- templates/Sparkle/customer/email/emails.tpl | 4 +- templates/Sparkle/customer/ftp/accounts.tpl | 4 +- templates/Sparkle/customer/index/index.tpl | 124 +++++++++--------- templates/Sparkle/customer/mysql/mysqls.tpl | 4 +- templates/Sparkle/footer.tpl | 2 +- templates/Sparkle/header.tpl | 12 +- 68 files changed, 613 insertions(+), 646 deletions(-) delete mode 100644 lib/Froxlor/I18N/Lang.php diff --git a/2fa.php b/2fa.php index fc9ea66c..d843daf8 100644 --- a/2fa.php +++ b/2fa.php @@ -31,10 +31,10 @@ if (Settings::Get('2fa.enabled') != '1') { // and therefore does not need to require lib/init.php if (AREA == 'admin') { $upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `type_2fa` = :t2fa, `data_2fa` = :d2fa WHERE adminid = :id"); - $uid = \Froxlor\User::getAll()['adminid']; + $uid = $userinfo['adminid']; } elseif (AREA == 'customer') { $upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `type_2fa` = :t2fa, `data_2fa` = :d2fa WHERE customerid = :id"); - $uid = \Froxlor\User::getAll()['customerid']; + $uid = $userinfo['customerid']; } $success_message = ""; @@ -68,7 +68,7 @@ if ($action == 'delete') { $log->logAction(USR_ACTION, LOG_NOTICE, "viewed 2fa::overview"); -if (\Froxlor\User::getAll()['type_2fa'] == '0') { +if ($userinfo['type_2fa'] == '0') { // available types $type_select_values = array( @@ -81,10 +81,10 @@ if (\Froxlor\User::getAll()['type_2fa'] == '0') { foreach ($type_select_values as $_val => $_type) { $type_select .= \Froxlor\UI\HTML::makeoption($_type, $_val); } -} elseif (\Froxlor\User::getAll()['type_2fa'] == '1') { +} elseif ($userinfo['type_2fa'] == '1') { // email 2fa enabled -} elseif (\Froxlor\User::getAll()['type_2fa'] == '2') { +} elseif ($userinfo['type_2fa'] == '2') { // authenticator 2fa enabled - $ga_qrcode = $tfa->getQRCodeImageAsDataUri(\Froxlor\User::getAll()['loginname'], \Froxlor\User::getAll()['data_2fa']); + $ga_qrcode = $tfa->getQRCodeImageAsDataUri($userinfo['loginname'], $userinfo['data_2fa']); } eval("echo \"" . \Froxlor\UI\Template::getTemplate("2fa/overview", true) . "\";"); diff --git a/admin_admins.php b/admin_admins.php index 3df15de6..63fd941f 100644 --- a/admin_admins.php +++ b/admin_admins.php @@ -29,7 +29,7 @@ if (isset($_POST['id'])) { $id = intval($_GET['id']); } -if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +if ($page == 'admins' && $userinfo['change_serversettings'] == '1') { if ($action == '') { @@ -43,7 +43,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' 'traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')', 'deactivated' => $lng['admin']['deactivated'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_ADMINS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_ADMINS, $fields); $admins = ''; $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_ADMINS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); $numrows_admins = Database::num_rows(); @@ -108,7 +108,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' } elseif ($action == 'su') { try { - $json_result = Admins::getLocal(\Froxlor\User::getAll(), array( + $json_result = Admins::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -117,12 +117,12 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' $result = json_decode($json_result, true)['data']; $destination_admin = $result['loginname']; - if ($destination_admin != '' && $result['adminid'] != \Froxlor\User::getAll()['userid']) { + if ($destination_admin != '' && $result['adminid'] != $userinfo['userid']) { $result_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = :userid "); $result = Database::pexecute_first($result_stmt, array( - 'userid' => \Froxlor\User::getAll()['userid'] + 'userid' => $userinfo['userid'] )); $s = md5(uniqid(microtime(), 1)); @@ -152,7 +152,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' } } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Admins::getLocal(\Froxlor\User::getAll(), array( + $json_result = Admins::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -161,7 +161,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' $result = json_decode($json_result, true)['data']; if ($result['loginname'] != '') { - if ($result['adminid'] == \Froxlor\User::getAll()['userid']) { + if ($result['adminid'] == $userinfo['userid']) { \Froxlor\UI\Response::standard_error('youcantdeleteyourself'); } @@ -185,7 +185,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Admins::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + Admins::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -197,7 +197,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' $language_options = ''; foreach ($languages as $language_file => $language_name) { - $language_options .= \Froxlor\UI\HTML::makeoption($language_name, $language_file, \Froxlor\User::getAll()['language'], true); + $language_options .= \Froxlor\UI\HTML::makeoption($language_name, $language_file, $userinfo['language'], true); } $ipaddress = \Froxlor\UI\HTML::makeoption($lng['admin']['allips'], "-1"); @@ -231,7 +231,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' } } elseif ($action == 'edit' && $id != 0) { try { - $json_result = Admins::getLocal(\Froxlor\User::getAll(), array( + $json_result = Admins::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -243,7 +243,7 @@ if ($page == 'admins' && \Froxlor\User::getAll()['change_serversettings'] == '1' if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Admins::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + Admins::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } diff --git a/admin_apcuinfo.php b/admin_apcuinfo.php index a27ad0b9..57f3cba7 100644 --- a/admin_apcuinfo.php +++ b/admin_apcuinfo.php @@ -30,7 +30,7 @@ require './lib/init.php'; $horizontal_bar_size = 950; // 1280px window width -if ($action == 'delete' && function_exists('apcu_clear_cache') && \Froxlor\User::getAll()['change_serversettings'] == '1') { +if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') { apcu_clear_cache(); $log->logAction(ADM_ACTION, LOG_INFO, "cleared APCu cache"); header('Location: ' . $linker->getLink(array( diff --git a/admin_configfiles.php b/admin_configfiles.php index dc019d45..1e14ddcf 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -20,7 +20,7 @@ require './lib/init.php'; use Froxlor\Settings; -if (\Froxlor\User::getAll()['change_serversettings'] == '1') { +if ($userinfo['change_serversettings'] == '1') { if ($action == 'setconfigured') { Settings::Set('panel.is_configured', '1', true); diff --git a/admin_cronjobs.php b/admin_cronjobs.php index 701ee2b6..8b43906d 100644 --- a/admin_cronjobs.php +++ b/admin_cronjobs.php @@ -35,7 +35,7 @@ if ($page == 'cronjobs' || $page == 'overview') { 'c.interval' => $lng['cron']['interval'], 'c.isactive' => $lng['cron']['isactive'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_CRONRUNS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_CRONRUNS, $fields); $crons = ''; $result_stmt = Database::prepare("SELECT `c`.* FROM `" . TABLE_PANEL_CRONRUNS . "` `c` ORDER BY `module` ASC, `cronfile` ASC"); @@ -79,7 +79,7 @@ if ($page == 'cronjobs' || $page == 'overview') { */ } elseif ($action == 'edit' && $id != 0) { try { - $json_result = Cronjobs::getLocal(\Froxlor\User::getAll(), array( + $json_result = Cronjobs::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -89,7 +89,7 @@ if ($page == 'cronjobs' || $page == 'overview') { if ($result['cronfile'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Cronjobs::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + Cronjobs::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } diff --git a/admin_customers.php b/admin_customers.php index 38c77512..8fe4300f 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -29,7 +29,7 @@ if (isset($_POST['id'])) { $id = intval($_GET['id']); } -if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { +if ($page == 'customers' && $userinfo['customers'] != '0') { if ($action == '') { // clear request data unset($_SESSION['requestData']); @@ -48,15 +48,15 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { 'c.traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')' ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_CUSTOMERS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_CUSTOMERS, $fields); $customers = ''; $result_stmt = Database::prepare(" SELECT `c`.*, `a`.`loginname` AS `adminname` FROM `" . TABLE_PANEL_CUSTOMERS . "` `c`, `" . TABLE_PANEL_ADMINS . "` `a` - WHERE " . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " `c`.`adminid` = :adminid AND ") . " + WHERE " . ($userinfo['customers_see_all'] ? '' : " `c`.`adminid` = :adminid AND ") . " `c`.`adminid` = `a`.`adminid` " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); $num_rows = Database::num_rows(); $paging->setEntries($num_rows); @@ -150,7 +150,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { eval("echo \"" . \Froxlor\UI\Template::getTemplate("customers/customers") . "\";"); } elseif ($action == 'su' && $id != 0) { try { - $json_result = Customers::getLocal(\Froxlor\User::getAll(), array( + $json_result = Customers::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -170,7 +170,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { WHERE `userid` = :id AND `hash` = :hash"); $result = Database::pexecute_first($result_stmt, array( - 'id' => \Froxlor\User::getAll()['userid'], + 'id' => $userinfo['userid'], 'hash' => $s )); @@ -209,7 +209,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { } } elseif ($action == 'unlock' && $id != 0) { try { - $json_result = Customers::getLocal(\Froxlor\User::getAll(), array( + $json_result = Customers::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -219,7 +219,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - $json_result = Customers::getLocal(\Froxlor\User::getAll(), array( + $json_result = Customers::getLocal($userinfo, array( 'id' => $id ))->unlock(); } catch (Exception $e) { @@ -238,7 +238,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { } } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Customers::getLocal(\Froxlor\User::getAll(), array( + $json_result = Customers::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -248,7 +248,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - $json_result = Customers::getLocal(\Froxlor\User::getAll(), array( + $json_result = Customers::getLocal($userinfo, array( 'id' => $id, 'delete_userfiles' => (isset($_POST['delete_userfiles']) ? (int) $_POST['delete_userfiles'] : 0) ))->delete(); @@ -270,7 +270,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Customers::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + Customers::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -344,7 +344,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { } elseif ($action == 'edit' && $id != 0) { try { - $json_result = Customers::getLocal(\Froxlor\User::getAll(), array( + $json_result = Customers::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -373,7 +373,7 @@ if ($page == 'customers' && \Froxlor\User::getAll()['customers'] != '0') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Customers::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + Customers::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } diff --git a/admin_domains.php b/admin_domains.php index 20c94c26..b8c8be84 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -32,10 +32,10 @@ if (isset($_POST['id'])) { if ($page == 'domains' || $page == 'overview') { // Let's see how many customers we have $stmt = Database::prepare(" - SELECT COUNT(`customerid`) as `countcustomers` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " WHERE `adminid` = :adminid")); + SELECT COUNT(`customerid`) as `countcustomers` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid")); $params = array(); - if (\Froxlor\User::getAll()['customers_see_all'] == '0') { - $params['adminid'] = \Froxlor\User::getAll()['adminid']; + if ($userinfo['customers_see_all'] == '0') { + $params['adminid'] = $userinfo['adminid']; } $countcustomers = Database::pexecute_first($stmt, $params); $countcustomers = (int) $countcustomers['countcustomers']; @@ -51,17 +51,17 @@ if ($page == 'domains' || $page == 'overview') { 'c.loginname' => $lng['login']['username'], 'd.aliasdomain' => $lng['domains']['aliasdomain'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_DOMAINS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DOMAINS, $fields); $domains = ""; $result_stmt = Database::prepare(" SELECT `d`.*, `c`.`loginname`, `c`.`deactivated`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`standardsubdomain`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` - WHERE `d`.`parentdomainid`='0' " . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid ") . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); + WHERE `d`.`parentdomainid`='0' " . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid ") . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); $params = array(); - if (\Froxlor\User::getAll()['customers_see_all'] == '0') { - $params['adminid'] = \Froxlor\User::getAll()['adminid']; + if ($userinfo['customers_see_all'] == '0') { + $params['adminid'] = $userinfo['adminid']; } Database::pexecute($result_stmt, $params); $numrows_domains = Database::num_rows(); @@ -122,7 +122,7 @@ if ($page == 'domains' || $page == 'overview') { } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Domains::getLocal(\Froxlor\User::getAll(), array( + $json_result = Domains::getLocal($userinfo, array( 'id' => $id, 'no_std_subdomain' => true ))->get(); @@ -142,7 +142,7 @@ if ($page == 'domains' || $page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send' && $alias_check['count'] == 0) { try { - Domains::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + Domains::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -170,7 +170,7 @@ if ($page == 'domains' || $page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Domains::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + Domains::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -183,10 +183,10 @@ if ($page == 'domains' || $page == 'overview') { $customers = \Froxlor\UI\HTML::makeoption($lng['panel']['please_choose'], 0, 0, true); $result_customers_stmt = Database::prepare(" SELECT `customerid`, `loginname`, `name`, `firstname`, `company` - FROM `" . TABLE_PANEL_CUSTOMERS . "` " . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) \Froxlor\User::getAll()['adminid'] . "' ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC"); + FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC"); $params = array(); - if (\Froxlor\User::getAll()['customers_see_all'] == '0') { - $params['adminid'] = \Froxlor\User::getAll()['adminid']; + if ($userinfo['customers_see_all'] == '0') { + $params['adminid'] = $userinfo['adminid']; } Database::pexecute($result_customers_stmt, $params); @@ -195,7 +195,7 @@ if ($page == 'domains' || $page == 'overview') { } $admins = ''; - if (\Froxlor\User::getAll()['customers_see_all'] == '1') { + if ($userinfo['customers_see_all'] == '1') { $result_admins_stmt = Database::query(" SELECT `adminid`, `loginname`, `name` @@ -203,11 +203,11 @@ if ($page == 'domains' || $page == 'overview') { WHERE `domains_used` < `domains` OR `domains` = '-1' ORDER BY `name` ASC"); while ($row_admin = $result_admins_stmt->fetch(PDO::FETCH_ASSOC)) { - $admins .= \Froxlor\UI\HTML::makeoption(\Froxlor\User::getCorrectFullUserDetails($row_admin) . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], \Froxlor\User::getAll()['adminid']); + $admins .= \Froxlor\UI\HTML::makeoption(\Froxlor\User::getCorrectFullUserDetails($row_admin) . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], $userinfo['adminid']); } } - if (\Froxlor\User::getAll()['ip'] == "-1") { + if ($userinfo['ip'] == "-1") { $result_ipsandports_stmt = Database::query(" SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ssl`='0' ORDER BY `ip`, `port` ASC "); @@ -219,7 +219,7 @@ if ($page == 'domains' || $page == 'overview') { SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id` = :ipid ORDER BY `ip`, `port` ASC "); $admin_ip = Database::pexecute_first($admin_ip_stmt, array( - 'ipid' => \Froxlor\User::getAll()['ip'] + 'ipid' => $userinfo['ip'] )); $result_ipsandports_stmt = Database::prepare(" @@ -282,12 +282,12 @@ if ($page == 'domains' || $page == 'overview') { $domains = \Froxlor\UI\HTML::makeoption($lng['domains']['noaliasdomain'], 0, NULL, true); $result_domains_stmt = Database::prepare(" SELECT `d`.`id`, `d`.`domain`, `c`.`loginname` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` - WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid` = 0" . $standardsubdomains . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid") . " + WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid` = 0" . $standardsubdomains . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid") . " AND `d`.`customerid`=`c`.`customerid` ORDER BY `loginname`, `domain` ASC "); $params = array(); - if (\Froxlor\User::getAll()['customers_see_all'] == '0') { - $params['adminid'] = \Froxlor\User::getAll()['adminid']; + if ($userinfo['customers_see_all'] == '0') { + $params['adminid'] = $userinfo['adminid']; } Database::pexecute($result_domains_stmt, $params); @@ -298,7 +298,7 @@ if ($page == 'domains' || $page == 'overview') { $subtodomains = \Froxlor\UI\HTML::makeoption($lng['domains']['nosubtomaindomain'], 0, NULL, true); $result_domains_stmt = Database::prepare(" SELECT `d`.`id`, `d`.`domain`, `c`.`loginname` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` - WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid` = 0 AND `d`.`ismainbutsubto` = 0 " . $standardsubdomains . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid") . " + WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid` = 0 AND `d`.`ismainbutsubto` = 0 " . $standardsubdomains . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid") . " AND `d`.`customerid`=`c`.`customerid` ORDER BY `loginname`, `domain` ASC "); // params from above still valid @@ -347,7 +347,7 @@ if ($page == 'domains' || $page == 'overview') { } elseif ($action == 'edit' && $id != 0) { try { - $json_result = Domains::getLocal(\Froxlor\User::getAll(), array( + $json_result = Domains::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -416,7 +416,7 @@ if ($page == 'domains' || $page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Domains::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + Domains::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -433,7 +433,7 @@ if ($page == 'domains' || $page == 'overview') { WHERE ( (`subdomains_used` + :subdomains <= `subdomains` OR `subdomains` = '-1' ) AND (`emails_used` + :emails <= `emails` OR `emails` = '-1' ) AND (`email_forwarders_used` + :forwarders <= `email_forwarders` OR `email_forwarders` = '-1' ) - AND (`email_accounts_used` + :accounts <= `email_accounts` OR `email_accounts` = '-1' ) " . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " AND `adminid` = :adminid ") . ") + AND (`email_accounts_used` + :accounts <= `email_accounts` OR `email_accounts` = '-1' ) " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid ") . ") OR `customerid` = :customerid ORDER BY `name` ASC "); $params = array( @@ -443,8 +443,8 @@ if ($page == 'domains' || $page == 'overview') { 'accounts' => $email_accounts, 'customerid' => $result['customerid'] ); - if (\Froxlor\User::getAll()['customers_see_all'] == '0') { - $params['adminid'] = \Froxlor\User::getAll()['adminid']; + if ($userinfo['customers_see_all'] == '0') { + $params['adminid'] = $userinfo['adminid']; } Database::pexecute($result_customers_stmt, $params); @@ -462,7 +462,7 @@ if ($page == 'domains' || $page == 'overview') { $result['customername'] = \Froxlor\User::getCorrectFullUserDetails($customer) . ' (' . $customer['loginname'] . ')'; } - if (\Froxlor\User::getAll()['customers_see_all'] == '1') { + if ($userinfo['customers_see_all'] == '1') { if (Settings::Get('panel.allow_domain_change_admin') == '1') { $admins = ''; @@ -510,14 +510,14 @@ if ($page == 'domains' || $page == 'overview') { $result_domains_stmt = Database::prepare(" SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid` = '0' AND `d`.`id` <> :id - AND `c`.`standardsubdomain`<>`d`.`id` AND `c`.`customerid`=`d`.`customerid`" . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid") . " + AND `c`.`standardsubdomain`<>`d`.`id` AND `c`.`customerid`=`d`.`customerid`" . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid") . " ORDER BY `d`.`domain` ASC "); $params = array( 'id' => $result['id'] ); - if (\Froxlor\User::getAll()['customers_see_all'] == '0') { - $params['adminid'] = \Froxlor\User::getAll()['adminid']; + if ($userinfo['customers_see_all'] == '0') { + $params['adminid'] = $userinfo['adminid']; } Database::pexecute($result_domains_stmt, $params); @@ -525,7 +525,7 @@ if ($page == 'domains' || $page == 'overview') { $subtodomains .= \Froxlor\UI\HTML::makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['ismainbutsubto']); } - if (\Froxlor\User::getAll()['ip'] == "-1") { + if ($userinfo['ip'] == "-1") { $result_ipsandports_stmt = Database::query(" SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ssl`='0' ORDER BY `ip`, `port` ASC "); @@ -537,7 +537,7 @@ if ($page == 'domains' || $page == 'overview') { SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id` = :ipid ORDER BY `ip`, `port` ASC "); $admin_ip = Database::pexecute_first($admin_ip_stmt, array( - 'ipid' => \Froxlor\User::getAll()['ip'] + 'ipid' => $userinfo['ip'] )); $result_ipsandports_stmt = Database::prepare(" @@ -681,10 +681,10 @@ if ($page == 'domains' || $page == 'overview') { $customers = \Froxlor\UI\HTML::makeoption($lng['panel']['please_choose'], 0, 0, true); $result_customers_stmt = Database::prepare(" SELECT `customerid`, `loginname`, `name`, `firstname`, `company` - FROM `" . TABLE_PANEL_CUSTOMERS . "` " . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) \Froxlor\User::getAll()['adminid'] . "' ") . " ORDER BY `name` ASC"); + FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY `name` ASC"); $params = array(); - if (\Froxlor\User::getAll()['customers_see_all'] == '0') { - $params['adminid'] = \Froxlor\User::getAll()['adminid']; + if ($userinfo['customers_see_all'] == '0') { + $params['adminid'] = $userinfo['adminid']; } Database::pexecute($result_customers_stmt, $params); diff --git a/admin_index.php b/admin_index.php index 80ad7377..6bc7dfb3 100644 --- a/admin_index.php +++ b/admin_index.php @@ -29,7 +29,7 @@ if ($action == 'logout') { $log->logAction(ADM_ACTION, LOG_NOTICE, "logged out"); $params = array( - 'adminid' => (int) \Froxlor\User::getAll()['adminid'] + 'adminid' => (int) $userinfo['adminid'] ); if (Settings::Get('session.allow_multiple_login') == '1') { @@ -67,9 +67,9 @@ if ($page == 'overview') { SUM(`ftps_used`) AS `ftps_used`, SUM(`subdomains_used`) AS `subdomains_used`, SUM(`traffic_used`) AS `traffic_used` - FROM `" . TABLE_PANEL_CUSTOMERS . "`" . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " WHERE `adminid` = :adminid ")); + FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid ")); $overview = Database::pexecute_first($overview_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); $dec_places = Settings::Get('panel.decimal_places'); @@ -78,9 +78,9 @@ if ($page == 'overview') { $number_domains_stmt = Database::prepare(" SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "` - WHERE `parentdomainid`='0'" . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " AND `adminid` = :adminid")); + WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid")); $number_domains = Database::pexecute_first($number_domains_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); $overview['number_domains'] = $number_domains['number_domains']; @@ -91,7 +91,7 @@ if ($page == 'overview') { if ((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes') || (isset($lookfornewversion) && $lookfornewversion == 'yes')) { try { - $json_result = Froxlor::getLocal(\Froxlor\User::getAll())->checkUpdate(); + $json_result = Froxlor::getLocal($userinfo)->checkUpdate(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -111,13 +111,13 @@ if ($page == 'overview') { } $dec_places = Settings::Get('panel.decimal_places'); - \Froxlor\User::getAll()['diskspace'] = round(\Froxlor\User::getAll()['diskspace'] / 1024, $dec_places); - \Froxlor\User::getAll()['diskspace_used'] = round(\Froxlor\User::getAll()['diskspace_used'] / 1024, $dec_places); - \Froxlor\User::getAll()['traffic'] = round(\Froxlor\User::getAll()['traffic'] / (1024 * 1024), $dec_places); - \Froxlor\User::getAll()['traffic_used'] = round(\Froxlor\User::getAll()['traffic_used'] / (1024 * 1024), $dec_places); - \Froxlor\User::getAll() = \Froxlor\PhpHelper::str_replace_array('-1', $lng['customer']['unlimited'], \Froxlor\User::getAll(), 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains'); + $userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $dec_places); + $userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $dec_places); + $userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $dec_places); + $userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $dec_places); + $userinfo = \Froxlor\PhpHelper::str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains'); - \Froxlor\User::getAll()['custom_notes'] = (\Froxlor\User::getAll()['custom_notes'] != '') ? nl2br(\Froxlor\User::getAll()['custom_notes']) : ''; + $userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : ''; $cron_last_runs = \Froxlor\System\Cronjob::getCronjobsLastRun(); $outstanding_tasks = \Froxlor\System\Cronjob::getOutstandingTasks(); @@ -179,7 +179,7 @@ if ($page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $old_password = \Froxlor\Validate\Validate::validate($_POST['old_password'], 'old password'); - if (! validatePasswordLogin(\Froxlor\User::getAll(), $old_password, TABLE_PANEL_ADMINS, 'adminid')) { + if (! validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_ADMINS, 'adminid')) { \Froxlor\UI\Response::standard_error('oldpasswordnotcorrect'); } @@ -205,8 +205,8 @@ if ($page == 'overview') { \Froxlor\UI\Response::standard_error('newpasswordconfirmerror'); } else { try { - Admins::getLocal(\Froxlor\User::getAll(), array( - 'id' => \Froxlor\User::getAll()['adminid'], + Admins::getLocal($userinfo, array( + 'id' => $userinfo['adminid'], 'admin_password' => $new_password ))->update(); } catch (Exception $e) { @@ -227,8 +227,8 @@ if ($page == 'overview') { if (isset($languages[$def_language])) { try { - Admins::getLocal(\Froxlor\User::getAll(), array( - 'id' => \Froxlor\User::getAll()['adminid'], + Admins::getLocal($userinfo, array( + 'id' => $userinfo['adminid'], 'def_language' => $def_language ))->update(); } catch (Exception $e) { @@ -254,8 +254,8 @@ if ($page == 'overview') { $language_options = ''; $default_lang = Settings::Get('panel.standardlanguage'); - if (\Froxlor\User::getAll()['def_language'] != '') { - $default_lang = \Froxlor\User::getAll()['def_language']; + if ($userinfo['def_language'] != '') { + $default_lang = $userinfo['def_language']; } foreach ($languages as $language_file => $language_name) { @@ -269,8 +269,8 @@ if ($page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $theme = \Froxlor\Validate\Validate::validate($_POST['theme'], 'theme'); try { - Admins::getLocal(\Froxlor\User::getAll(), array( - 'id' => \Froxlor\User::getAll()['adminid'], + Admins::getLocal($userinfo, array( + 'id' => $userinfo['adminid'], 'theme' => $theme ))->update(); } catch (Exception $e) { @@ -296,8 +296,8 @@ if ($page == 'overview') { $theme_options = ''; $default_theme = Settings::Get('panel.default_theme'); - if (\Froxlor\User::getAll()['theme'] != '') { - $default_theme = \Froxlor\User::getAll()['theme']; + if ($userinfo['theme'] != '') { + $default_theme = $userinfo['theme']; } $themes_avail = getThemes(); diff --git a/admin_ipsandports.php b/admin_ipsandports.php index b6880882..6e94e728 100644 --- a/admin_ipsandports.php +++ b/admin_ipsandports.php @@ -43,7 +43,7 @@ if ($page == 'ipsandports' || $page == 'overview') { 'ip' => $lng['admin']['ipsandports']['ip'], 'port' => $lng['admin']['ipsandports']['port'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_IPSANDPORTS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_IPSANDPORTS, $fields); $ipsandports = ''; $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt); @@ -70,7 +70,7 @@ if ($page == 'ipsandports' || $page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports") . "\";"); } elseif ($action == 'delete' && $id != 0) { try { - $json_result = IpsAndPorts::getLocal(\Froxlor\User::getAll(), array( + $json_result = IpsAndPorts::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -82,7 +82,7 @@ if ($page == 'ipsandports' || $page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - IpsAndPorts::getLocal(\Froxlor\User::getAll(), array( + IpsAndPorts::getLocal($userinfo, array( 'id' => $id ))->delete(); } catch (Exception $e) { @@ -104,7 +104,7 @@ if ($page == 'ipsandports' || $page == 'overview') { } elseif ($action == 'add') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - IpsAndPorts::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + IpsAndPorts::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -124,7 +124,7 @@ if ($page == 'ipsandports' || $page == 'overview') { } } elseif ($action == 'edit' && $id != 0) { try { - $json_result = IpsAndPorts::getLocal(\Froxlor\User::getAll(), array( + $json_result = IpsAndPorts::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -136,7 +136,7 @@ if ($page == 'ipsandports' || $page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - IpsAndPorts::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + IpsAndPorts::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } diff --git a/admin_logger.php b/admin_logger.php index e3efda38..f12372aa 100644 --- a/admin_logger.php +++ b/admin_logger.php @@ -21,7 +21,7 @@ require './lib/init.php'; use Froxlor\Database\Database; -if ($page == 'log' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +if ($page == 'log' && $userinfo['change_serversettings'] == '1') { if ($action == '') { $fields = array( 'date' => $lng['logger']['date'], @@ -29,7 +29,7 @@ if ($page == 'log' && \Froxlor\User::getAll()['change_serversettings'] == '1') { 'user' => $lng['logger']['user'], 'text' => $lng['logger']['action'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30); $query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy(); $result_stmt = Database::query($query . ' ' . $paging->getSqlLimit()); $result_cnt_stmt = Database::query($query); diff --git a/admin_message.php b/admin_message.php index b4f6726f..f85ecf6e 100644 --- a/admin_message.php +++ b/admin_message.php @@ -32,11 +32,11 @@ if ($page == 'message') { $log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed panel_message'); if (isset($_POST['send']) && $_POST['send'] == 'send') { - if ($_POST['receipient'] == 0 && \Froxlor\User::getAll()['customers_see_all'] == '1') { + if ($_POST['receipient'] == 0 && $userinfo['customers_see_all'] == '1') { $log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to admins'); $result = Database::query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`"); } elseif ($_POST['receipient'] == 1) { - if (\Froxlor\User::getAll()['customers_see_all'] == '1') { + if ($userinfo['customers_see_all'] == '1') { $log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to ALL customers'); $result = Database::query('SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`"); } else { @@ -45,7 +45,7 @@ if ($page == 'message') { SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "` WHERE `adminid` = :adminid"); Database::pexecute($result, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); } } else { @@ -69,8 +69,8 @@ if ($page == 'message') { 'name' => $row['name'], 'company' => $row['company'] ))); - $mail->From = \Froxlor\User::getAll()['email']; - $mail->FromName = (isset(\Froxlor\User::getAll()['firstname']) ? \Froxlor\User::getAll()['firstname'] . ' ' : '') . \Froxlor\User::getAll()['name']; + $mail->From = $userinfo['email']; + $mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name']; if (! $mail->Send()) { if ($mail->ErrorInfo != '') { @@ -118,7 +118,7 @@ if ($page == 'message') { $action = ''; $receipients = ''; - if (\Froxlor\User::getAll()['customers_see_all'] == '1') { + if ($userinfo['customers_see_all'] == '1') { $receipients .= \Froxlor\UI\HTML::makeoption($lng['panel']['reseller'], 0); } diff --git a/admin_opcacheinfo.php b/admin_opcacheinfo.php index f7b0877b..0224a357 100644 --- a/admin_opcacheinfo.php +++ b/admin_opcacheinfo.php @@ -20,7 +20,7 @@ define('AREA', 'admin'); require './lib/init.php'; -if ($action == 'reset' && function_exists('opcache_reset') && \Froxlor\User::getAll()['change_serversettings'] == '1') { +if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') { opcache_reset(); $log->logAction(ADM_ACTION, LOG_INFO, "reseted OPcache"); header('Location: ' . $linker->getLink(array( diff --git a/admin_phpsettings.php b/admin_phpsettings.php index 34890e08..df8acbcf 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -34,7 +34,7 @@ if ($page == 'overview') { if ($action == '') { try { - $json_result = PhpSettings::getLocal(\Froxlor\User::getAll(), array( + $json_result = PhpSettings::getLocal($userinfo, array( 'with_subdomains' => true ))->listing(); } catch (Exception $e) { @@ -67,11 +67,11 @@ if ($page == 'overview') { if ($action == 'add') { - if ((int) \Froxlor\User::getAll()['change_serversettings'] == 1) { + if ((int) $userinfo['change_serversettings'] == 1) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - PhpSettings::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + PhpSettings::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -110,7 +110,7 @@ if ($page == 'overview') { if ($action == 'delete') { try { - $json_result = PhpSettings::getLocal(\Froxlor\User::getAll(), array( + $json_result = PhpSettings::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -118,12 +118,12 @@ if ($page == 'overview') { } $result = json_decode($json_result, true)['data']; - if ($result['id'] != 0 && $result['id'] == $id && (int) \Froxlor\User::getAll()['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config + if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - PhpSettings::getLocal(\Froxlor\User::getAll(), array( + PhpSettings::getLocal($userinfo, array( 'id' => $id ))->delete(); } catch (Exception $e) { @@ -148,7 +148,7 @@ if ($page == 'overview') { if ($action == 'edit') { try { - $json_result = PhpSettings::getLocal(\Froxlor\User::getAll(), array( + $json_result = PhpSettings::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -156,11 +156,11 @@ if ($page == 'overview') { } $result = json_decode($json_result, true)['data']; - if ($result['id'] != 0 && $result['id'] == $id && (int) \Froxlor\User::getAll()['change_serversettings'] == 1) { + if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - PhpSettings::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + PhpSettings::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -197,7 +197,7 @@ if ($page == 'overview') { if ($action == '') { try { - $json_result = FpmDaemons::getLocal(\Froxlor\User::getAll())->listing(); + $json_result = FpmDaemons::getLocal($userinfo)->listing(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -220,11 +220,11 @@ if ($page == 'overview') { if ($action == 'add') { - if ((int) \Froxlor\User::getAll()['change_serversettings'] == 1) { + if ((int) $userinfo['change_serversettings'] == 1) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - FpmDaemons::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + FpmDaemons::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -254,7 +254,7 @@ if ($page == 'overview') { if ($action == 'delete') { try { - $json_result = FpmDaemons::getLocal(\Froxlor\User::getAll(), array( + $json_result = FpmDaemons::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -266,11 +266,11 @@ if ($page == 'overview') { \Froxlor\UI\Response::standard_error('cannotdeletedefaultphpconfig'); } - if ($result['id'] != 0 && $result['id'] == $id && (int) \Froxlor\User::getAll()['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config + if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - FpmDaemons::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + FpmDaemons::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -293,7 +293,7 @@ if ($page == 'overview') { if ($action == 'edit') { try { - $json_result = FpmDaemons::getLocal(\Froxlor\User::getAll(), array( + $json_result = FpmDaemons::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -301,11 +301,11 @@ if ($page == 'overview') { } $result = json_decode($json_result, true)['data']; - if ($result['id'] != 0 && $result['id'] == $id && (int) \Froxlor\User::getAll()['change_serversettings'] == 1) { + if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - FpmDaemons::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + FpmDaemons::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } diff --git a/admin_plans.php b/admin_plans.php index 35aea12e..e2100ebe 100644 --- a/admin_plans.php +++ b/admin_plans.php @@ -37,15 +37,15 @@ if ($page == '' || $page == 'overview') { 'adminname' => $lng['admin']['admin'], 'p.ts' => $lng['admin']['plans']['last_update'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_PLANS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_PLANS, $fields); $plans = ''; $result_stmt = Database::prepare(" SELECT p.*, a.loginname as adminname FROM `" . TABLE_PANEL_PLANS . "` p, `" . TABLE_PANEL_ADMINS . "` a - WHERE " . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " `p`.`adminid` = :adminid AND ") . " + WHERE " . ($userinfo['customers_see_all'] ? '' : " `p`.`adminid` = :adminid AND ") . " `p`.`adminid` = `a`.`adminid` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); $paging->setEntries(Database::num_rows()); $sortcode = $paging->getHtmlSortCode($lng); @@ -75,7 +75,7 @@ if ($page == '' || $page == 'overview') { 'id' => $id )); - if ($result['id'] != 0 && $result['id'] == $id && (int) \Froxlor\User::getAll()['adminid'] == $result['adminid']) { + if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['adminid'] == $result['adminid']) { if (isset($_POST['send']) && $_POST['send'] == 'send') { $del_stmt = Database::prepare(" @@ -84,7 +84,7 @@ if ($page == '' || $page == 'overview') { 'id' => $id )); - $log->logAction(ADM_ACTION, LOG_INFO, "Plan '" . $result['name'] . "' has been deleted by '" . \Froxlor\User::getAll()['loginname'] . "'"); + $log->logAction(ADM_ACTION, LOG_INFO, "Plan '" . $result['name'] . "' has been deleted by '" . $userinfo['loginname'] . "'"); \Froxlor\UI\Response::redirectTo($filename, array( 'page' => $page, 's' => $s @@ -197,7 +197,7 @@ if ($page == '' || $page == 'overview') { SET `adminid` = :adminid, `name` = :name, `description` = :desc, `value` = :valuearr, `ts` = UNIX_TIMESTAMP(); "); $ins_data = array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'name' => $name, 'desc' => $description, 'valuearr' => json_encode($value_arr) diff --git a/admin_settings.php b/admin_settings.php index 1cb03278..2dd5a0c8 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -29,7 +29,7 @@ Database::needSqlData(); $sql_root = Database::getSqlData(); Database::needRoot(false); -if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +if ($page == 'overview' && $userinfo['change_serversettings'] == '1') { $settings_data = \Froxlor\PhpHelper::loadConfigArrayDir('./actions/admin/settings/'); if (isset($_POST['send']) && $_POST['send'] == 'send') { @@ -95,7 +95,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' eval("echo \$settings_page;"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/settings_form_end") . "\";"); } -} elseif ($page == 'phpinfo' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'phpinfo' && $userinfo['change_serversettings'] == '1') { ob_start(); phpinfo(); $phpinfo = array( @@ -139,7 +139,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' \Froxlor\UI\Response::standard_error($lng['error']['no_phpinfo']); } eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/phpinfo") . "\";"); -} elseif ($page == 'rebuildconfigs' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'rebuildconfigs' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles"); @@ -158,7 +158,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' 'page' => $page )); } -} elseif ($page == 'updatecounters' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'updatecounters' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { @@ -180,7 +180,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' 'page' => $page )); } -} elseif ($page == 'wipecleartextmailpws' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'wipecleartextmailpws' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { @@ -195,7 +195,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' 'page' => $page )); } -} elseif ($page == 'wipequotas' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'wipequotas' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { @@ -212,7 +212,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' 'page' => $page )); } -} elseif ($page == 'enforcequotas' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'enforcequotas' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { // Fetch all accounts $result_stmt = Database::query("SELECT `quota`, `customerid` FROM `" . TABLE_MAIL_USERS . "`"); @@ -253,7 +253,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' 'page' => $page )); } -} elseif ($page == 'integritycheck' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'integritycheck' && $userinfo['change_serversettings'] == '1') { $integrity = new \Froxlor\Database\IntegrityCheck(); if (isset($_POST['send']) && $_POST['send'] == 'send') { $integrity->fixAll(); @@ -271,7 +271,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' eval("\$integritycheck.=\"" . \Froxlor\UI\Template::getTemplate("settings/integritycheck_row") . "\";"); } eval("echo \"" . \Froxlor\UI\Template::getTemplate("settings/integritycheck") . "\";"); -} elseif ($page == 'importexport' && \Froxlor\User::getAll()['change_serversettings'] == '1') { +} elseif ($page == 'importexport' && $userinfo['change_serversettings'] == '1') { // check for json-stuff if (! extension_loaded('json')) { \Froxlor\UI\Response::standard_error('jsonextensionnotfound'); @@ -280,7 +280,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' if (isset($_GET['action']) && $_GET['action'] == "export") { // export try { - $json_result = Froxlor::getLocal(\Froxlor\User::getAll())->exportSettings(); + $json_result = Froxlor::getLocal($userinfo)->exportSettings(); $json_export = json_decode($json_result, true)['data']; } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); @@ -296,7 +296,7 @@ if ($page == 'overview' && \Froxlor\User::getAll()['change_serversettings'] == ' if (isset($_FILES["import_file"]["tmp_name"])) { $imp_content = file_get_contents($_FILES["import_file"]["tmp_name"]); try { - Froxlor::getLocal(\Froxlor\User::getAll(), array( + Froxlor::getLocal($userinfo, array( 'json_str' => $imp_content ))->importSettings(); } catch (Exception $e) { diff --git a/admin_templates.php b/admin_templates.php index eb5a9844..e8be5ca5 100644 --- a/admin_templates.php +++ b/admin_templates.php @@ -67,7 +67,7 @@ if ($action == '') { WHERE `adminid` = :adminid AND `templategroup`='mails' ORDER BY `language`, `varname`"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { @@ -95,7 +95,7 @@ if ($action == '') { WHERE `adminid` = :adminid AND `language`= :lang AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'lang' => $language_name )); @@ -115,7 +115,7 @@ if ($action == '') { SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid` = :adminid AND `templategroup`='files'"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); if (Database::num_rows() != count($file_templates)) { @@ -132,7 +132,7 @@ if ($action == '') { SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid` = :adminid AND `id` = :id"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'id' => $subjectid )); $result = $result_stmt->fetch(PDO::FETCH_ASSOC); @@ -144,7 +144,7 @@ if ($action == '') { WHERE `adminid` = :adminid AND (`id` = :ida OR `id` = :idb)"); Database::pexecute($del_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'ida' => $subjectid, 'idb' => $mailbodyid )); @@ -168,7 +168,7 @@ if ($action == '') { SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid` = :adminid AND `id` = :id"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'id' => $id )); @@ -181,7 +181,7 @@ if ($action == '') { DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid` = :adminid AND `id` = :id"); Database::pexecute($del_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'id' => $id )); $log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $lng['admin']['templates'][$row['varname']] . "'"); @@ -244,7 +244,7 @@ if ($action == '') { WHERE `adminid` = :adminid AND `language` = :lang AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'lang' => $language )); @@ -266,7 +266,7 @@ if ($action == '') { // mail-subject $ins_data = array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'lang' => $language, 'var' => $template . '_subject', 'value' => $subject @@ -275,7 +275,7 @@ if ($action == '') { // mail-body $ins_data = array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'lang' => $language, 'var' => $template . '_mailbody', 'value' => $mailbody @@ -302,7 +302,7 @@ if ($action == '') { `value` = :value"); $ins_data = array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'var' => $template, 'value' => $filecontent ); @@ -327,7 +327,7 @@ if ($action == '') { WHERE `adminid` = :adminid AND `language` = :lang AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'lang' => $language_name )); @@ -337,7 +337,7 @@ if ($action == '') { if (count(array_diff($available_templates, $templates)) > 0) { $add = true; - $language_options .= \Froxlor\UI\HTML::makeoption($language_name, $language_file, \Froxlor\User::getAll()['language'], true, true); + $language_options .= \Froxlor\UI\HTML::makeoption($language_name, $language_file, $userinfo['language'], true, true); $templates = array_diff($available_templates, $templates); @@ -358,7 +358,7 @@ if ($action == '') { SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid` = :adminid AND `templategroup`='files'"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); if (Database::num_rows() == count($file_templates)) { @@ -391,7 +391,7 @@ if ($action == '') { SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid` = :adminid AND `id` = :subjectid"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'subjectid' => $subjectid )); $result = $result_stmt->fetch(PDO::FETCH_ASSOC); @@ -409,13 +409,13 @@ if ($action == '') { // subject Database::pexecute($upd_stmt, array( 'value' => $subject, - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'id' => $subjectid )); // same query but mailbody Database::pexecute($upd_stmt, array( 'value' => $mailbody, - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'id' => $mailbodyid )); @@ -460,7 +460,7 @@ if ($action == '') { SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid` = :adminid AND `id` = :id"); Database::pexecute($result_stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'id' => $id )); @@ -477,7 +477,7 @@ if ($action == '') { WHERE `adminid` = :adminid AND `id` = :id"); Database::pexecute($upd_stmt, array( 'value' => $filecontent, - 'adminid' => \Froxlor\User::getAll()['adminid'], + 'adminid' => $userinfo['adminid'], 'id' => $id )); diff --git a/admin_traffic.php b/admin_traffic.php index b2522bd7..93fe128e 100644 --- a/admin_traffic.php +++ b/admin_traffic.php @@ -79,10 +79,10 @@ if ($page == 'overview' || $page == 'customers') { $customer_name_list_stmt = Database::prepare(" SELECT `customerid`,`company`,`name`,`firstname` FROM `" . TABLE_PANEL_CUSTOMERS . "` - WHERE `deactivated`='0'" . (\Froxlor\User::getAll()['customers_see_all'] ? '' : " AND `adminid` = :id") . " + WHERE `deactivated`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :id") . " ORDER BY name"); Database::pexecute($customer_name_list_stmt, array( - 'id' => \Froxlor\User::getAll()['adminid'] + 'id' => $userinfo['adminid'] )); while ($customer_name = $customer_name_list_stmt->fetch(PDO::FETCH_ASSOC)) { diff --git a/api_keys.php b/api_keys.php index 7c3f3130..691c705c 100644 --- a/api_keys.php +++ b/api_keys.php @@ -33,7 +33,7 @@ $area = AREA; // do the delete and then just show a success-message and the apikeys list again if ($action == 'delete') { if ($id > 0) { - $chk = (AREA == 'admin' && \Froxlor\User::getAll()['customers_see_all'] == '1') ? true : false; + $chk = (AREA == 'admin' && $userinfo['customers_see_all'] == '1') ? true : false; if (AREA == 'customer') { $chk_stmt = Database::prepare(" SELECT c.customerid FROM `" . TABLE_PANEL_CUSTOMERS . "` c @@ -42,9 +42,9 @@ if ($action == 'delete') { "); $chk = Database::pexecute_first($chk_stmt, array( 'id' => $id, - 'cid' => \Froxlor\User::getAll()['customerid'] + 'cid' => $userinfo['customerid'] )); - } elseif (AREA == 'admin' && \Froxlor\User::getAll()['customers_see_all'] == '0') { + } elseif (AREA == 'admin' && $userinfo['customers_see_all'] == '0') { $chk_stmt = Database::prepare(" SELECT a.adminid FROM `" . TABLE_PANEL_ADMINS . "` a LEFT JOIN `" . TABLE_API_KEYS . "` ak ON ak.adminid = a.adminid @@ -52,7 +52,7 @@ if ($action == 'delete') { "); $chk = Database::pexecute_first($chk_stmt, array( 'id' => $id, - 'aid' => \Froxlor\User::getAll()['adminid'] + 'aid' => $userinfo['adminid'] )); } if ($chk !== false) { @@ -71,14 +71,14 @@ if ($action == 'delete') { if (AREA == 'admin') { $cid = 0; } elseif (AREA == 'customer') { - $cid = \Froxlor\User::getAll()['customerid']; + $cid = $userinfo['customerid']; } $key = hash('sha256', openssl_random_pseudo_bytes(64 * 64)); $secret = hash('sha512', openssl_random_pseudo_bytes(64 * 64 * 4)); Database::pexecute($ins_stmt, array( 'key' => $key, 'secret' => $secret, - 'aid' => \Froxlor\User::getAll()['adminid'], + 'aid' => $userinfo['adminid'], 'cid' => $cid )); $success_message = $lng['apikeys']['apikey_added']; @@ -110,13 +110,13 @@ if ($action == 'delete') { if (AREA == 'admin') { $cid = 0; } elseif (AREA == 'customer') { - $cid = \Froxlor\User::getAll()['customerid']; + $cid = $userinfo['customerid']; } Database::pexecute($upd_stmt, array( 'keyid' => $keyid, 'af' => $allowed_from, 'vu' => $valid_until, - 'aid' => \Froxlor\User::getAll()['adminid'], + 'aid' => $userinfo['adminid'], 'cid' => $cid )); echo json_encode(true); @@ -133,17 +133,17 @@ $keys_stmt_query = "SELECT ak.*, c.loginname, a.loginname as adminname WHERE "; $qry_params = array(); -if (AREA == 'admin' && \Froxlor\User::getAll()['customers_see_all'] == '0') { +if (AREA == 'admin' && $userinfo['customers_see_all'] == '0') { // admin with only customer-specific permissions $keys_stmt_query .= "ak.adminid = :adminid "; - $qry_params['adminid'] = \Froxlor\User::getAll()['adminid']; + $qry_params['adminid'] = $userinfo['adminid']; $fields = array( 'a.loginname' => $lng['login']['username'] ); } elseif (AREA == 'customer') { // customer-area $keys_stmt_query .= "ak.customerid = :cid "; - $qry_params['cid'] = \Froxlor\User::getAll()['customerid']; + $qry_params['cid'] = $userinfo['customerid']; $fields = array( 'c.loginname' => $lng['login']['username'] ); @@ -155,7 +155,7 @@ if (AREA == 'admin' && \Froxlor\User::getAll()['customers_see_all'] == '0') { ); } -$paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_API_KEYS, $fields); +$paging = new \Froxlor\UI\Paging($userinfo, TABLE_API_KEYS, $fields); $keys_stmt_query .= $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit(); $keys_stmt = Database::prepare($keys_stmt_query); @@ -183,7 +183,7 @@ if (count($all_keys) == 0) { // my own key $isMyKey = false; - if ($key['adminid'] == \Froxlor\User::getAll()['adminid'] && ((AREA == 'admin' && $key['customerid'] == 0) || (AREA == 'customer' && $key['customerid'] == \Froxlor\User::getAll()['customerid']))) { + if ($key['adminid'] == $userinfo['adminid'] && ((AREA == 'admin' && $key['customerid'] == 0) || (AREA == 'customer' && $key['customerid'] == $userinfo['customerid']))) { // this is mine $isMyKey = true; } diff --git a/composer.json b/composer.json index 277a7deb..441f13f2 100644 --- a/composer.json +++ b/composer.json @@ -49,11 +49,11 @@ "robthree/twofactorauth": "^1.6" }, "require-dev": { - "phpunit/phpunit": "6.*", - "pdepend/pdepend": "^2.5", + "phpunit/phpunit": "6.5.13", + "pdepend/pdepend": "2.5.0", "phpmd/phpmd": "2.6.0", "sebastian/phpcpd": "3.0.1", - "squizlabs/php_codesniffer": "3.*", + "squizlabs/php_codesniffer": "3.3.2", "phploc/phploc": "3.0.1", "theseer/phpdox": "0.11.2", "phpunit/php-invoker": "1.1.4", diff --git a/customer_domains.php b/customer_domains.php index 55f92364..44cc6227 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -44,7 +44,7 @@ if ($page == 'overview') { $fields = array( 'd.domain' => $lng['domains']['domainname'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_DOMAINS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DOMAINS, $fields); $domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isbinddomain`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`letsencrypt`, `d`.`registration_date`, `d`.`termination_date`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` @@ -52,8 +52,8 @@ if ($page == 'overview') { AND `d`.`email_only`='0' AND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($domains_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'], - "standardsubdomain" => \Froxlor\User::getAll()['standardsubdomain'] + "customerid" => $userinfo['customerid'], + "standardsubdomain" => $userinfo['standardsubdomain'] )); $paging->setEntries(Database::num_rows()); $sortcode = $paging->getHtmlSortCode($lng); @@ -167,8 +167,8 @@ if ($page == 'overview') { } foreach ($domain_array as $row) { - if (strpos($row['documentroot'], \Froxlor\User::getAll()['documentroot']) === 0) { - $row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace(\Froxlor\User::getAll()['documentroot'], "/", $row['documentroot'])); + if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) { + $row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot'])); } // get ssl-ips if activated @@ -187,7 +187,7 @@ if ($page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domainlist") . "\";"); } elseif ($action == 'delete' && $id != 0) { try { - $json_result = SubDomains::getLocal(\Froxlor\User::getAll(), array( + $json_result = SubDomains::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -203,7 +203,7 @@ if ($page == 'overview') { if (isset($result['parentdomainid']) && $result['parentdomainid'] != '0' && $alias_check['count'] == 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - SubDomains::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + SubDomains::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -222,10 +222,10 @@ if ($page == 'overview') { \Froxlor\UI\Response::standard_error('domains_cantdeletemaindomain'); } } elseif ($action == 'add') { - if (\Froxlor\User::getAll()['subdomains_used'] < \Froxlor\User::getAll()['subdomains'] || \Froxlor\User::getAll()['subdomains'] == '-1') { + if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - SubDomains::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + SubDomains::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -241,7 +241,7 @@ if ($page == 'overview') { AND `caneditdomain` = '1' ORDER BY `domain` ASC"); Database::pexecute($stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $domains = ''; @@ -259,7 +259,7 @@ if ($page == 'overview') { AND `d`.`customerid`= :customerid ORDER BY `d`.`domain` ASC"); Database::pexecute($domains_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) { @@ -289,13 +289,13 @@ if ($page == 'overview') { } $openbasedir = \Froxlor\UI\HTML::makeoption($lng['domain']['docroot'], 0, NULL, true) . \Froxlor\UI\HTML::makeoption($lng['domain']['homedir'], 1, NULL, true); - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid']); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']); $phpconfigs = ''; $has_phpconfigs = false; - if (isset(\Froxlor\User::getAll()['allowed_phpconfigs']) && ! empty(\Froxlor\User::getAll()['allowed_phpconfigs'])) { + if (isset($userinfo['allowed_phpconfigs']) && ! empty($userinfo['allowed_phpconfigs'])) { $has_phpconfigs = true; - $allowed_cfg = json_decode(\Froxlor\User::getAll()['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY); + $allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY); $phpconfigs_result_stmt = Database::query(" SELECT c.*, fc.description as interpreter FROM `" . TABLE_PANEL_PHPCONFIGS . "` c @@ -323,7 +323,7 @@ if ($page == 'overview') { } elseif ($action == 'edit' && $id != 0) { try { - $json_result = SubDomains::getLocal(\Froxlor\User::getAll(), array( + $json_result = SubDomains::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -331,10 +331,10 @@ if ($page == 'overview') { } $result = json_decode($json_result, true)['data']; - if (isset($result['customerid']) && $result['customerid'] == \Froxlor\User::getAll()['customerid']) { + if (isset($result['customerid']) && $result['customerid'] == $userinfo['customerid']) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - SubDomains::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + SubDomains::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -362,7 +362,7 @@ if ($page == 'overview') { ORDER BY `d`.`domain` ASC"); Database::pexecute($domains_stmt, array( "id" => $result['id'], - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); while ($row_domain = $domains_stmt->fetch(PDO::FETCH_ASSOC)) { @@ -372,14 +372,14 @@ if ($page == 'overview') { if (preg_match('/^https?\:\/\//', $result['documentroot']) && \Froxlor\Validate\Form\Strings::validateUrl($result['documentroot'])) { if (Settings::Get('panel.pathedit') == 'Dropdown') { $urlvalue = $result['documentroot']; - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid']); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']); } else { $urlvalue = ''; - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid'], $result['documentroot'], true); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $result['documentroot'], true); } } else { $urlvalue = ''; - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid'], $result['documentroot']); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $result['documentroot']); } $redirectcode = ''; @@ -440,9 +440,9 @@ if ($page == 'overview') { $phpconfigs = ''; $has_phpconfigs = false; - if (isset(\Froxlor\User::getAll()['allowed_phpconfigs']) && ! empty(\Froxlor\User::getAll()['allowed_phpconfigs'])) { + if (isset($userinfo['allowed_phpconfigs']) && ! empty($userinfo['allowed_phpconfigs'])) { $has_phpconfigs = true; - $allowed_cfg = json_decode(\Froxlor\User::getAll()['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY); + $allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY); $phpconfigs_result_stmt = Database::query(" SELECT c.*, fc.description as interpreter FROM `" . TABLE_PANEL_PHPCONFIGS . "` c @@ -480,9 +480,9 @@ if ($page == 'overview') { $do_insert = isset($_POST['do_insert']) ? (($_POST['do_insert'] == 1) ? true : false) : false; try { if ($do_insert) { - Certificates::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + Certificates::getLocal($userinfo, $_POST)->add(); } else { - Certificates::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + Certificates::getLocal($userinfo, $_POST)->update(); } } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); @@ -522,7 +522,7 @@ if ($page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domain_ssleditor") . "\";"); } -} elseif ($page == 'domaindnseditor' && \Froxlor\User::getAll()['dnsenabled'] == '1' && Settings::Get('system.dnsenabled') == '1') { +} elseif ($page == 'domaindnseditor' && $userinfo['dnsenabled'] == '1' && Settings::Get('system.dnsenabled') == '1') { require_once __DIR__ . '/dns_editor.php'; } elseif ($page == 'sslcertificates') { diff --git a/customer_email.php b/customer_email.php index de851c3b..8a906eb2 100644 --- a/customer_email.php +++ b/customer_email.php @@ -47,13 +47,13 @@ if ($page == 'overview') { 'm.email_full' => $lng['emails']['emailaddress'], 'm.destination' => $lng['emails']['forwarders'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_MAIL_VIRTUAL, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_MAIL_VIRTUAL, $fields); $result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m` LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`) LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`) WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $emailscount = Database::num_rows(); $paging->setEntries($emailscount); @@ -133,7 +133,7 @@ if ($page == 'overview') { WHERE `customerid`= :customerid AND `isemaildomain`='1' ORDER BY `domain` ASC"); Database::pexecute($emaildomains_count_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $emaildomains_count = $emaildomains_count_stmt->fetch(PDO::FETCH_ASSOC); $emaildomains_count = $emaildomains_count['count']; @@ -141,7 +141,7 @@ if ($page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/emails") . "\";"); } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -152,7 +152,7 @@ if ($page == 'overview') { if (isset($result['email']) && $result['email'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Emails::getLocal(\Froxlor\User::getAll(), array( + Emails::getLocal($userinfo, array( 'id' => $id ))->delete(); } catch (Exception $e) { @@ -176,10 +176,10 @@ if ($page == 'overview') { } } } elseif ($action == 'add') { - if (\Froxlor\User::getAll()['emails_used'] < \Froxlor\User::getAll()['emails'] || \Froxlor\User::getAll()['emails'] == '-1') { + if ($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + $json_result = Emails::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -196,7 +196,7 @@ if ($page == 'overview') { AND `isemaildomain`='1' ORDER BY `domain` ASC"); Database::pexecute($result_stmt, array( - "cid" => \Froxlor\User::getAll()['customerid'] + "cid" => $userinfo['customerid'] )); $domains = ''; @@ -224,7 +224,7 @@ if ($page == 'overview') { } } elseif ($action == 'edit' && $id != 0) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -269,7 +269,7 @@ if ($page == 'overview') { } } elseif ($action == 'togglecatchall' && $id != 0) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -278,7 +278,7 @@ if ($page == 'overview') { $result = json_decode($json_result, true)['data']; try { - Emails::getLocal(\Froxlor\User::getAll(), array( + Emails::getLocal($userinfo, array( 'id' => $id, 'iscatchall' => ($result['iscatchall'] == '1' ? 0 : 1) ))->update(); @@ -294,9 +294,9 @@ if ($page == 'overview') { } } elseif ($page == 'accounts') { if ($action == 'add' && $id != 0) { - if (\Froxlor\User::getAll()['email_accounts'] == '-1' || (\Froxlor\User::getAll()['email_accounts_used'] < \Froxlor\User::getAll()['email_accounts'])) { + if ($userinfo['email_accounts'] == '-1' || ($userinfo['email_accounts_used'] < $userinfo['email_accounts'])) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -306,7 +306,7 @@ if ($page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - EmailAccounts::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + EmailAccounts::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -344,7 +344,7 @@ if ($page == 'overview') { } } elseif ($action == 'changepw' && $id != 0) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -355,7 +355,7 @@ if ($page == 'overview') { if (isset($result['popaccountid']) && $result['popaccountid'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - EmailAccounts::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + EmailAccounts::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -380,7 +380,7 @@ if ($page == 'overview') { } } elseif ($action == 'changequota' && Settings::Get('system.mail_quota_enabled') == '1' && $id != 0) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -391,7 +391,7 @@ if ($page == 'overview') { if (isset($result['popaccountid']) && $result['popaccountid'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - EmailAccounts::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + EmailAccounts::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -416,7 +416,7 @@ if ($page == 'overview') { } } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -427,7 +427,7 @@ if ($page == 'overview') { if (isset($result['popaccountid']) && $result['popaccountid'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - EmailAccounts::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + EmailAccounts::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -448,9 +448,9 @@ if ($page == 'overview') { } } elseif ($page == 'forwarders') { if ($action == 'add' && $id != 0) { - if (\Froxlor\User::getAll()['email_forwarders_used'] < \Froxlor\User::getAll()['email_forwarders'] || \Froxlor\User::getAll()['email_forwarders'] == '-1') { + if ($userinfo['email_forwarders_used'] < $userinfo['email_forwarders'] || $userinfo['email_forwarders'] == '-1') { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -461,7 +461,7 @@ if ($page == 'overview') { if (isset($result['email']) && $result['email'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - EmailForwarders::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + EmailForwarders::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -489,7 +489,7 @@ if ($page == 'overview') { } } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Emails::getLocal(\Froxlor\User::getAll(), array( + $json_result = Emails::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -513,7 +513,7 @@ if ($page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - EmailForwarders::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + EmailForwarders::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } diff --git a/customer_extras.php b/customer_extras.php index 29163af9..b9d9a919 100644 --- a/customer_extras.php +++ b/customer_extras.php @@ -52,11 +52,11 @@ if ($page == 'overview') { 'username' => $lng['login']['username'], 'path' => $lng['panel']['path'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_HTPASSWDS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_HTPASSWDS, $fields); $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $paging->setEntries(Database::num_rows()); $sortcode = $paging->getHtmlSortCode($lng); @@ -69,8 +69,8 @@ if ($page == 'overview') { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { if ($paging->checkDisplay($i)) { - if (strpos($row['path'], \Froxlor\User::getAll()['documentroot']) === 0) { - $row['path'] = str_replace(\Froxlor\User::getAll()['documentroot'], "/", $row['path']); + if (strpos($row['path'], $userinfo['documentroot']) === 0) { + $row['path'] = str_replace($userinfo['documentroot'], "/", $row['path']); } $row['path'] = \Froxlor\FileDir::makeCorrectDir($row['path']); $row = \Froxlor\PhpHelper::htmlentities_array($row); @@ -84,7 +84,7 @@ if ($page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate("extras/htpasswds") . "\";"); } elseif ($action == 'delete' && $id != 0) { try { - $json_result = DirProtections::getLocal(\Froxlor\User::getAll(), array( + $json_result = DirProtections::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -95,7 +95,7 @@ if ($page == 'overview') { if (isset($result['username']) && $result['username'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - DirProtections::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + DirProtections::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -104,8 +104,8 @@ if ($page == 'overview') { 's' => $s )); } else { - if (strpos($result['path'], \Froxlor\User::getAll()['documentroot']) === 0) { - $result['path'] = str_replace(\Froxlor\User::getAll()['documentroot'], "/", $result['path']); + if (strpos($result['path'], $userinfo['documentroot']) === 0) { + $result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']); } \Froxlor\UI\HTML::ask_yesno('extras_reallydelete', $filename, array( @@ -118,7 +118,7 @@ if ($page == 'overview') { } elseif ($action == 'add') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - DirProtections::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + DirProtections::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -127,7 +127,7 @@ if ($page == 'overview') { 's' => $s )); } else { - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid']); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']); $htpasswd_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htpasswd_add.php'; $htpasswd_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($htpasswd_add_data); @@ -139,7 +139,7 @@ if ($page == 'overview') { } } elseif ($action == 'edit' && $id != 0) { try { - $json_result = DirProtections::getLocal(\Froxlor\User::getAll(), array( + $json_result = DirProtections::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -150,7 +150,7 @@ if ($page == 'overview') { if (isset($result['username']) && $result['username'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - DirProtections::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + DirProtections::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -159,8 +159,8 @@ if ($page == 'overview') { 's' => $s )); } else { - if (strpos($result['path'], \Froxlor\User::getAll()['documentroot']) === 0) { - $result['path'] = str_replace(\Froxlor\User::getAll()['documentroot'], "/", $result['path']); + if (strpos($result['path'], $userinfo['documentroot']) === 0) { + $result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']); } $result = \Froxlor\PhpHelper::htmlentities_array($result); @@ -192,11 +192,11 @@ if ($page == 'overview') { 'error500path' => $lng['extras']['error500path'], 'options_cgi' => $lng['extras']['execute_perl'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_HTACCESS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_HTACCESS, $fields); $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $paging->setEntries(Database::num_rows()); $sortcode = $paging->getHtmlSortCode($lng); @@ -207,12 +207,12 @@ if ($page == 'overview') { $count = 0; $htaccess = ''; - $cperlenabled = customerHasPerlEnabled(\Froxlor\User::getAll()['customerid']); + $cperlenabled = customerHasPerlEnabled($userinfo['customerid']); while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { if ($paging->checkDisplay($i)) { - if (strpos($row['path'], \Froxlor\User::getAll()['documentroot']) === 0) { - $row['path'] = str_replace(\Froxlor\User::getAll()['documentroot'], "/", $row['path']); + if (strpos($row['path'], $userinfo['documentroot']) === 0) { + $row['path'] = str_replace($userinfo['documentroot'], "/", $row['path']); } $row['path'] = \Froxlor\FileDir::makeCorrectDir($row['path']); $row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']); @@ -230,7 +230,7 @@ if ($page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate("extras/htaccess") . "\";"); } elseif ($action == 'delete' && $id != 0) { try { - $json_result = DirOptions::getLocal(\Froxlor\User::getAll(), array( + $json_result = DirOptions::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -238,10 +238,10 @@ if ($page == 'overview') { } $result = json_decode($json_result, true)['data']; - if (isset($result['customerid']) && $result['customerid'] != '' && $result['customerid'] == \Froxlor\User::getAll()['customerid']) { + if (isset($result['customerid']) && $result['customerid'] != '' && $result['customerid'] == $userinfo['customerid']) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - DirOptions::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + DirOptions::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -254,13 +254,13 @@ if ($page == 'overview') { 'id' => $id, 'page' => $page, 'action' => $action - ), str_replace(\Froxlor\User::getAll()['documentroot'], '/', $result['path'])); + ), str_replace($userinfo['documentroot'], '/', $result['path'])); } } } elseif ($action == 'add') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - DirOptions::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + DirOptions::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -269,8 +269,8 @@ if ($page == 'overview') { 's' => $s )); } else { - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid']); - $cperlenabled = customerHasPerlEnabled(\Froxlor\User::getAll()['customerid']); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']); + $cperlenabled = customerHasPerlEnabled($userinfo['customerid']); $htaccess_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htaccess_add.php'; $htaccess_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($htaccess_add_data); @@ -282,7 +282,7 @@ if ($page == 'overview') { } } elseif (($action == 'edit') && ($id != 0)) { try { - $json_result = DirOptions::getLocal(\Froxlor\User::getAll(), array( + $json_result = DirOptions::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -290,10 +290,10 @@ if ($page == 'overview') { } $result = json_decode($json_result, true)['data']; - if ((isset($result['customerid'])) && ($result['customerid'] != '') && ($result['customerid'] == \Froxlor\User::getAll()['customerid'])) { + if ((isset($result['customerid'])) && ($result['customerid'] != '') && ($result['customerid'] == $userinfo['customerid'])) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - DirOptions::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + DirOptions::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -302,14 +302,14 @@ if ($page == 'overview') { 's' => $s )); } else { - if (strpos($result['path'], \Froxlor\User::getAll()['documentroot']) === 0) { - $result['path'] = str_replace(\Froxlor\User::getAll()['documentroot'], "/", $result['path']); + if (strpos($result['path'], $userinfo['documentroot']) === 0) { + $result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']); } $result['error404path'] = $result['error404path']; $result['error403path'] = $result['error403path']; $result['error500path'] = $result['error500path']; - $cperlenabled = customerHasPerlEnabled(\Froxlor\User::getAll()['customerid']); + $cperlenabled = customerHasPerlEnabled($userinfo['customerid']); /* * $options_indexes = \Froxlor\UI\HTML::makeyesno('options_indexes', '1', '0', $result['options_indexes']); * $options_cgi = \Froxlor\UI\HTML::makeyesno('options_cgi', '1', '0', $result['options_cgi']); @@ -337,7 +337,7 @@ if ($page == 'overview') { if ($action == 'abort' && isset($_POST['send']) && $_POST['send'] == 'send') { $log->logAction(USR_ACTION, LOG_NOTICE, "customer_extras::backup - aborted scheduled backupjob"); try { - CustomerBackups::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + CustomerBackups::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -353,7 +353,7 @@ if ($page == 'overview') { // check whether there is a backup-job for this customer try { - $json_result = CustomerBackups::getLocal(\Froxlor\User::getAll())->listing(); + $json_result = CustomerBackups::getLocal($userinfo)->listing(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -365,7 +365,7 @@ if ($page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - CustomerBackups::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + CustomerBackups::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -376,12 +376,12 @@ if ($page == 'overview') { $action = "abort"; $row = $existing_backupJob['data']; - $row['path'] = \Froxlor\FileDir::makeCorrectDir(str_replace(\Froxlor\User::getAll()['documentroot'], "/", $row['destdir'])); + $row['path'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['destdir'])); $row['backup_web'] = ($row['backup_web'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no']; $row['backup_mail'] = ($row['backup_mail'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no']; $row['backup_dbs'] = ($row['backup_dbs'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no']; } - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid']); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']); $backup_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.backup.php'; $backup_form = \Froxlor\UI\HtmlForm::genHTMLForm($backup_data); $title = $backup_data['backup']['title']; diff --git a/customer_ftp.php b/customer_ftp.php index 0498f6ef..10bbf227 100644 --- a/customer_ftp.php +++ b/customer_ftp.php @@ -46,12 +46,12 @@ if ($page == 'overview') { 'homedir' => $lng['panel']['path'], 'description' => $lng['panel']['ftpdesc'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_FTP_USERS, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_FTP_USERS, $fields); $result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir`, `shell` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $ftps_count = Database::num_rows(); $paging->setEntries($ftps_count); @@ -65,8 +65,8 @@ if ($page == 'overview') { while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) { if ($paging->checkDisplay($i)) { - if (strpos($row['homedir'], \Froxlor\User::getAll()['documentroot']) === 0) { - $row['documentroot'] = str_replace(\Froxlor\User::getAll()['documentroot'], "/", $row['homedir']); + if (strpos($row['homedir'], $userinfo['documentroot']) === 0) { + $row['documentroot'] = str_replace($userinfo['documentroot'], "/", $row['homedir']); } else { $row['documentroot'] = $row['homedir']; } @@ -84,7 +84,7 @@ if ($page == 'overview') { eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts') . "\";"); } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Ftps::getLocal(\Froxlor\User::getAll(), array( + $json_result = Ftps::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -92,10 +92,10 @@ if ($page == 'overview') { } $result = json_decode($json_result, true)['data']; - if (isset($result['username']) && $result['username'] != \Froxlor\User::getAll()['loginname']) { + if (isset($result['username']) && $result['username'] != $userinfo['loginname']) { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Ftps::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + Ftps::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -114,10 +114,10 @@ if ($page == 'overview') { \Froxlor\UI\Response::standard_error('ftp_cantdeletemainaccount'); } } elseif ($action == 'add') { - if (\Froxlor\User::getAll()['ftps_used'] < \Froxlor\User::getAll()['ftps'] || \Froxlor\User::getAll()['ftps'] == '-1') { + if ($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Ftps::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + Ftps::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -126,7 +126,7 @@ if ($page == 'overview') { 's' => $s )); } else { - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid'], '/'); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/'); if (Settings::Get('customer.ftpatdomain') == '1') { $domainlist = array(); @@ -135,7 +135,7 @@ if ($page == 'overview') { $result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`= :customerid"); Database::pexecute($result_domains_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) { @@ -176,7 +176,7 @@ if ($page == 'overview') { } } elseif ($action == 'edit' && $id != 0) { try { - $json_result = Ftps::getLocal(\Froxlor\User::getAll(), array( + $json_result = Ftps::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -187,7 +187,7 @@ if ($page == 'overview') { if (isset($result['username']) && $result['username'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Ftps::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + Ftps::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -196,14 +196,14 @@ if ($page == 'overview') { 's' => $s )); } else { - if (strpos($result['homedir'], \Froxlor\User::getAll()['documentroot']) === 0) { - $homedir = str_replace(\Froxlor\User::getAll()['documentroot'], "/", $result['homedir']); + if (strpos($result['homedir'], $userinfo['documentroot']) === 0) { + $homedir = str_replace($userinfo['documentroot'], "/", $result['homedir']); } else { $homedir = $result['homedir']; } $homedir = \Froxlor\FileDir::makeCorrectDir($homedir); - $pathSelect = \Froxlor\FileDir::makePathfield(\Froxlor\User::getAll()['documentroot'], \Froxlor\User::getAll()['guid'], \Froxlor\User::getAll()['guid'], $homedir); + $pathSelect = \Froxlor\FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $homedir); if (Settings::Get('customer.ftpatdomain') == '1') { $domains = ''; @@ -211,7 +211,7 @@ if ($page == 'overview') { $result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :customerid"); Database::pexecute($result_domains_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) { diff --git a/customer_index.php b/customer_index.php index 62cf49d6..25ea15b2 100644 --- a/customer_index.php +++ b/customer_index.php @@ -27,7 +27,7 @@ if ($action == 'logout') { $log->logAction(USR_ACTION, LOG_NOTICE, 'logged out'); $params = array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] ); if (Settings::Get('session.allow_multiple_login') == '1') { $stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` @@ -54,8 +54,8 @@ if ($page == 'overview') { AND `id` <> :standardsubdomain "); Database::pexecute($domain_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'], - "standardsubdomain" => \Froxlor\User::getAll()['standardsubdomain'] + "customerid" => $userinfo['customerid'], + "standardsubdomain" => $userinfo['standardsubdomain'] )); $domains = ''; @@ -70,49 +70,49 @@ if ($page == 'overview') { // standard-subdomain $stdsubdomain = ''; - if (\Froxlor\User::getAll()['standardsubdomain'] != '0') { + if ($userinfo['standardsubdomain'] != '0') { $std_domain_stmt = Database::prepare(" SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :customerid AND `id` = :standardsubdomain "); $std_domain = Database::pexecute_first($std_domain_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'], - "standardsubdomain" => \Froxlor\User::getAll()['standardsubdomain'] + "customerid" => $userinfo['customerid'], + "standardsubdomain" => $userinfo['standardsubdomain'] )); $stdsubdomain = $std_domain['domain']; } - \Froxlor\User::getAll()['email'] = $idna_convert->decode(\Froxlor\User::getAll()['email']); + $userinfo['email'] = $idna_convert->decode($userinfo['email']); $yesterday = time() - (60 * 60 * 24); $month = date('M Y', $yesterday); // get disk-space usages for web, mysql and mail $usages_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DISKSPACE . "` WHERE `customerid` = :cid ORDER BY `stamp` DESC LIMIT 1"); $usages = Database::pexecute_first($usages_stmt, array( - 'cid' => \Froxlor\User::getAll()['customerid'] + 'cid' => $userinfo['customerid'] )); - \Froxlor\User::getAll()['diskspace'] = round(\Froxlor\User::getAll()['diskspace'] / 1024, Settings::Get('panel.decimal_places')); - \Froxlor\User::getAll()['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places')); - \Froxlor\User::getAll()['mailspace_used'] = round($usages['mail'] / 1024, Settings::Get('panel.decimal_places')); - \Froxlor\User::getAll()['dbspace_used'] = round($usages['mysql'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['mailspace_used'] = round($usages['mail'] / 1024, Settings::Get('panel.decimal_places')); + $userinfo['dbspace_used'] = round($usages['mysql'] / 1024, Settings::Get('panel.decimal_places')); - \Froxlor\User::getAll()['traffic'] = round(\Froxlor\User::getAll()['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places')); - \Froxlor\User::getAll()['traffic_used'] = round(\Froxlor\User::getAll()['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places')); - \Froxlor\User::getAll() = \Froxlor\PhpHelper::str_replace_array('-1', $lng['customer']['unlimited'], \Froxlor\User::getAll(), 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains'); + $userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places')); + $userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places')); + $userinfo = \Froxlor\PhpHelper::str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains'); - \Froxlor\User::getAll()['custom_notes'] = (\Froxlor\User::getAll()['custom_notes'] != '') ? nl2br(\Froxlor\User::getAll()['custom_notes']) : ''; + $userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : ''; $services_enabled = ""; $se = array(); - if (\Froxlor\User::getAll()['imap'] == '1') + if ($userinfo['imap'] == '1') $se[] = "IMAP"; - if (\Froxlor\User::getAll()['pop3'] == '1') + if ($userinfo['pop3'] == '1') $se[] = "POP3"; - if (\Froxlor\User::getAll()['phpenabled'] == '1') + if ($userinfo['phpenabled'] == '1') $se[] = "PHP"; - if (\Froxlor\User::getAll()['perlenabled'] == '1') + if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI"; $services_enabled = implode(", ", $se); @@ -120,7 +120,7 @@ if ($page == 'overview') { } elseif ($page == 'change_password') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $old_password = \Froxlor\Validate\Validate::validate($_POST['old_password'], 'old password'); - if (! \Froxlor\System\Crypt::validatePasswordLogin(\Froxlor\User::getAll(), $old_password, TABLE_PANEL_CUSTOMERS, 'customerid')) { + if (! \Froxlor\System\Crypt::validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_CUSTOMERS, 'customerid')) { \Froxlor\UI\Response::standard_error('oldpasswordnotcorrect'); } @@ -147,8 +147,8 @@ if ($page == 'overview') { } else { // Update user password try { - Customers::getLocal(\Froxlor\User::getAll(), array( - 'id' => \Froxlor\User::getAll()['customerid'], + Customers::getLocal($userinfo, array( + 'id' => $userinfo['customerid'], 'new_customer_password' => $new_password ))->update(); } catch (Exception $e) { @@ -165,8 +165,8 @@ if ($page == 'overview') { AND `username` = :username"); $params = array( "password" => $cryptPassword, - "customerid" => \Froxlor\User::getAll()['customerid'], - "username" => \Froxlor\User::getAll()['loginname'] + "customerid" => $userinfo['customerid'], + "username" => $userinfo['loginname'] ); Database::pexecute($stmt, $params); $log->logAction(USR_ACTION, LOG_NOTICE, 'changed main ftp password'); @@ -187,8 +187,8 @@ if ($page == 'overview') { AND `username` = :username"); $params = array( "password" => $new_webalizer_password, - "customerid" => \Froxlor\User::getAll()['customerid'], - "username" => \Froxlor\User::getAll()['loginname'] + "customerid" => $userinfo['customerid'], + "username" => $userinfo['loginname'] ); Database::pexecute($stmt, $params); } @@ -205,8 +205,8 @@ if ($page == 'overview') { $def_language = \Froxlor\Validate\Validate::validate($_POST['def_language'], 'default language'); if (isset($languages[$def_language])) { try { - Customers::getLocal(\Froxlor\User::getAll(), array( - 'id' => \Froxlor\User::getAll()['customerid'], + Customers::getLocal($userinfo, array( + 'id' => $userinfo['customerid'], 'def_language' => $def_language ))->update(); } catch (Exception $e) { @@ -228,8 +228,8 @@ if ($page == 'overview') { )); } else { $default_lang = Settings::Get('panel.standardlanguage'); - if (\Froxlor\User::getAll()['def_language'] != '') { - $default_lang = \Froxlor\User::getAll()['def_language']; + if ($userinfo['def_language'] != '') { + $default_lang = $userinfo['def_language']; } $language_options = ''; @@ -243,8 +243,8 @@ if ($page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $theme = \Froxlor\Validate\Validate::validate($_POST['theme'], 'theme'); try { - Customers::getLocal(\Froxlor\User::getAll(), array( - 'id' => \Froxlor\User::getAll()['customerid'], + Customers::getLocal($userinfo, array( + 'id' => $userinfo['customerid'], 'theme' => $theme ))->update(); } catch (Exception $e) { @@ -266,8 +266,8 @@ if ($page == 'overview') { )); } else { $default_theme = Settings::Get('panel.default_theme'); - if (\Froxlor\User::getAll()['theme'] != '') { - $default_theme = \Froxlor\User::getAll()['theme']; + if ($userinfo['theme'] != '') { + $default_theme = $userinfo['theme']; } $theme_options = ''; diff --git a/customer_logger.php b/customer_logger.php index b655c674..a3ec785e 100644 --- a/customer_logger.php +++ b/customer_logger.php @@ -35,15 +35,15 @@ if ($page == 'log') { 'user' => $lng['logger']['user'], 'text' => $lng['logger']['action'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30); $query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy(); $result_stmt = Database::prepare($query . ' ' . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - "loginname" => \Froxlor\User::getAll()['loginname'] + "loginname" => $userinfo['loginname'] )); $result_cnt_stmt = Database::prepare($query); Database::pexecute($result_cnt_stmt, array( - "loginname" => \Froxlor\User::getAll()['loginname'] + "loginname" => $userinfo['loginname'] )); $res_cnt = $result_cnt_stmt->fetch(PDO::FETCH_ASSOC); $logs_count = $result_cnt_stmt->rowCount(); diff --git a/customer_mysql.php b/customer_mysql.php index 9cc84aac..bd9d48bf 100644 --- a/customer_mysql.php +++ b/customer_mysql.php @@ -53,11 +53,11 @@ if ($page == 'overview') { 'databasename' => $lng['mysql']['databasename'], 'description' => $lng['mysql']['databasedescription'] ); - $paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_DATABASES, $fields); + $paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DATABASES, $fields); $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()); Database::pexecute($result_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $mysqls_count = Database::num_rows(); $paging->setEntries($mysqls_count); @@ -99,7 +99,7 @@ if ($page == 'overview') { } elseif ($action == 'delete' && $id != 0) { try { - $json_result = Mysqls::getLocal(\Froxlor\User::getAll(), array( + $json_result = Mysqls::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -120,7 +120,7 @@ if ($page == 'overview') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Mysqls::getLocal(\Froxlor\User::getAll(), $_POST)->delete(); + Mysqls::getLocal($userinfo, $_POST)->delete(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -141,10 +141,10 @@ if ($page == 'overview') { } } } elseif ($action == 'add') { - if (\Froxlor\User::getAll()['mysqls_used'] < \Froxlor\User::getAll()['mysqls'] || \Froxlor\User::getAll()['mysqls'] == '-1') { + if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - Mysqls::getLocal(\Froxlor\User::getAll(), $_POST)->add(); + Mysqls::getLocal($userinfo, $_POST)->add(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } @@ -177,7 +177,7 @@ if ($page == 'overview') { } } elseif ($action == 'edit' && $id != 0) { try { - $json_result = Mysqls::getLocal(\Froxlor\User::getAll(), array( + $json_result = Mysqls::getLocal($userinfo, array( 'id' => $id ))->get(); } catch (Exception $e) { @@ -188,7 +188,7 @@ if ($page == 'overview') { if (isset($result['databasename']) && $result['databasename'] != '') { if (isset($_POST['send']) && $_POST['send'] == 'send') { try { - $json_result = Mysqls::getLocal(\Froxlor\User::getAll(), $_POST)->update(); + $json_result = Mysqls::getLocal($userinfo, $_POST)->update(); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } diff --git a/customer_traffic.php b/customer_traffic.php index 9c8604e1..ae2c20c6 100644 --- a/customer_traffic.php +++ b/customer_traffic.php @@ -64,7 +64,7 @@ if (! is_null($month) && ! is_null($year)) { GROUP BY `day` ORDER BY `day` DESC"); $params = array( - "customerid" => \Froxlor\User::getAll()['customerid'], + "customerid" => $userinfo['customerid'], "month" => $month, "year" => $year ); @@ -118,7 +118,7 @@ if (! is_null($month) && ! is_null($year)) { GROUP BY `year` DESC, `month` DESC LIMIT 12"); Database::pexecute($result_stmt, array( - "customerid" => \Froxlor\User::getAll()['customerid'] + "customerid" => $userinfo['customerid'] )); $traffic_complete['http'] = 0; $traffic_complete['ftp'] = 0; diff --git a/dns_editor.php b/dns_editor.php index 6d161725..c1d28546 100644 --- a/dns_editor.php +++ b/dns_editor.php @@ -34,7 +34,7 @@ $content = isset($_POST['record']['content']) ? trim($_POST['record']['content'] $ttl = isset($_POST['record']['ttl']) ? (int) $_POST['record']['ttl'] : 18000; // get domain-name -$domain = \Froxlor\Dns\Dns::getAllowedDomainEntry($domain_id, AREA, \Froxlor\User::getAll()); +$domain = \Froxlor\Dns\Dns::getAllowedDomainEntry($domain_id, AREA, $userinfo); // select all entries $sel_stmt = Database::prepare("SELECT * FROM `" . TABLE_DOMAIN_DNS . "` WHERE domain_id = :did"); @@ -49,7 +49,7 @@ $success_message = ""; // action for adding a new entry if ($action == 'add_record' && ! empty($_POST)) { try { - DomainZones::getLocal(\Froxlor\User::getAll(), array( + DomainZones::getLocal($userinfo, array( 'id' => $domain_id, 'record' => $record, 'type' => $type, @@ -66,7 +66,7 @@ if ($action == 'add_record' && ! empty($_POST)) { $entry_id = isset($_GET['id']) ? (int) $_GET['id'] : 0; if ($entry_id > 0) { try { - DomainZones::getLocal(\Froxlor\User::getAll(), array( + DomainZones::getLocal($userinfo, array( 'entry_id' => $entry_id, 'id' => $domain_id ))->delete(); @@ -122,7 +122,7 @@ foreach ($type_select_values as $_type) { eval("\$record_list=\"" . \Froxlor\UI\Template::getTemplate("dns_editor/list", true) . "\";"); try { - $json_result = DomainZones::getLocal(\Froxlor\User::getAll(), array( + $json_result = DomainZones::getLocal($userinfo, array( 'id' => $domain_id ))->get(); } catch (Exception $e) { diff --git a/index.php b/index.php index ef0e065c..b4efd44c 100644 --- a/index.php +++ b/index.php @@ -71,28 +71,28 @@ if ($action == '2fa_entercode') { // Authenticator-verification has already happened at this point, so just get the user-data $sel_stmt = Database::prepare("SELECT * FROM $table WHERE `" . $field . "` = :uid"); } - \Froxlor\User::getAll() = Database::pexecute_first($sel_stmt, $sel_param); + $userinfo = Database::pexecute_first($sel_stmt, $sel_param); // whoops, no (valid) user? Start again - if (empty(\Froxlor\User::getAll())) { + if (empty($userinfo)) { \Froxlor\UI\Response::redirectTo('index.php', array( 'showmessage' => '2' )); } - // set fields in \Froxlor\User::getAll() required for finishLogin() - \Froxlor\User::getAll()['adminsession'] = $isadmin; - \Froxlor\User::getAll()['userid'] = $uid; + // set fields in $userinfo required for finishLogin() + $userinfo['adminsession'] = $isadmin; + $userinfo['userid'] = $uid; // if not successful somehow - start again - if (! finishLogin(\Froxlor\User::getAll())) { + if (! finishLogin($userinfo)) { \Froxlor\UI\Response::redirectTo('index.php', array( 'showmessage' => '2' )); } // when using email-2fa, remove the one-time-code - if (\Froxlor\User::getAll()['type_2fa'] == '1') { + if ($userinfo['type_2fa'] == '1') { $del_stmt = Database::prepare("UPDATE $table SET `data_2fa` = '' WHERE `" . $field . "` = :uid"); - \Froxlor\User::getAll() = Database::pexecute_first($del_stmt, array( + $userinfo = Database::pexecute_first($del_stmt, array( 'uid' => $uid )); } @@ -199,23 +199,23 @@ if ($action == '2fa_entercode') { } } - \Froxlor\User::getAll()_stmt = Database::prepare("SELECT * FROM $table + $userinfo_stmt = Database::prepare("SELECT * FROM $table WHERE `loginname`= :loginname"); - Database::pexecute(\Froxlor\User::getAll()_stmt, array( + Database::pexecute($userinfo_stmt, array( "loginname" => $loginname )); - \Froxlor\User::getAll() = \Froxlor\User::getAll()_stmt->fetch(PDO::FETCH_ASSOC); + $userinfo = $userinfo_stmt->fetch(PDO::FETCH_ASSOC); - if (\Froxlor\User::getAll()['loginfail_count'] >= Settings::Get('login.maxloginattempts') && \Froxlor\User::getAll()['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) { + if ($userinfo['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $userinfo['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) { \Froxlor\UI\Response::redirectTo('index.php', array( 'showmessage' => '3' )); exit(); - } elseif (\Froxlor\System\Crypt::validatePasswordLogin(\Froxlor\User::getAll(), $password, $table, $uid)) { + } elseif (\Froxlor\System\Crypt::validatePasswordLogin($userinfo, $password, $table, $uid)) { // only show "you're banned" if the login was successful // because we don't want to publish that the user does exist - if (\Froxlor\User::getAll()['deactivated']) { - unset(\Froxlor\User::getAll()); + if ($userinfo['deactivated']) { + unset($userinfo); \Froxlor\UI\Response::redirectTo('index.php', array( 'showmessage' => '5' )); @@ -228,10 +228,10 @@ if ($action == '2fa_entercode') { WHERE `$uid`= :uid"); Database::pexecute($stmt, array( "lastlogin_succ" => time(), - "uid" => \Froxlor\User::getAll()[$uid] + "uid" => $userinfo[$uid] )); - \Froxlor\User::getAll()['userid'] = \Froxlor\User::getAll()[$uid]; - \Froxlor\User::getAll()['adminsession'] = $adminsession; + $userinfo['userid'] = $userinfo[$uid]; + $userinfo['adminsession'] = $adminsession; } } else { // login incorrect @@ -240,7 +240,7 @@ if ($action == '2fa_entercode') { WHERE `$uid`= :uid"); Database::pexecute($stmt, array( "lastlogin_fail" => time(), - "uid" => \Froxlor\User::getAll()[$uid] + "uid" => $userinfo[$uid] )); // Log failed login @@ -249,7 +249,7 @@ if ($action == '2fa_entercode') { )); $rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to login with wrong password."); - unset(\Froxlor\User::getAll()); + unset($userinfo); \Froxlor\UI\Response::redirectTo('index.php', array( 'showmessage' => '2' )); @@ -257,15 +257,15 @@ if ($action == '2fa_entercode') { } // 2FA activated - if (Settings::Get('2fa.enabled') == '1' && \Froxlor\User::getAll()['type_2fa'] > 0) { + if (Settings::Get('2fa.enabled') == '1' && $userinfo['type_2fa'] > 0) { // redirect to code-enter-page - $_SESSION['secret_2fa'] = (\Froxlor\User::getAll()['type_2fa'] == 2 ? \Froxlor\User::getAll()['data_2fa'] : 'email'); - $_SESSION['uid_2fa'] = \Froxlor\User::getAll()[$uid]; + $_SESSION['secret_2fa'] = ($userinfo['type_2fa'] == 2 ? $userinfo['data_2fa'] : 'email'); + $_SESSION['uid_2fa'] = $userinfo[$uid]; $_SESSION['uidfield_2fa'] = $uid; $_SESSION['uidtable_2fa'] = $table; $_SESSION['unfo_2fa'] = $is_admin; // send mail if type_2fa = 1 (email) - if (\Froxlor\User::getAll()['type_2fa'] == 1) { + if ($userinfo['type_2fa'] == 1) { // generate code $tfa = new \Froxlor\FroxlorTwoFactorAuth('Froxlor'); $code = $tfa->getCode($tfa->createSecret()); @@ -273,7 +273,7 @@ if ($action == '2fa_entercode') { $stmt = Database::prepare("UPDATE $table SET `data_2fa` = :d2fa WHERE `$uid` = :uid"); Database::pexecute($stmt, array( "d2fa" => $code, - "uid" => \Froxlor\User::getAll()[$uid] + "uid" => $userinfo[$uid] )); // build up & send email $_mailerror = false; @@ -287,7 +287,7 @@ if ($action == '2fa_entercode') { $mail->Subject = $lng['mails']['2fa']['subject']; $mail->AltBody = $mail_body; $mail->MsgHTML(str_replace("\n", "
", $mail_body)); - $mail->AddAddress(\Froxlor\User::getAll()['email'], \Froxlor\User::getCorrectUserSalutation(\Froxlor\User::getAll())); + $mail->AddAddress($userinfo['email'], \Froxlor\User::getCorrectUserSalutation($userinfo)); $mail->Send(); } catch (\PHPMailer\PHPMailer\Exception $e) { $mailerr_msg = $e->errorMessage(); @@ -304,7 +304,7 @@ if ($action == '2fa_entercode') { $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg); \Froxlor\UI\Response::redirectTo('index.php', array( 'showmessage' => '4', - 'customermail' => \Froxlor\User::getAll()['email'] + 'customermail' => $userinfo['email'] )); exit(); } @@ -317,7 +317,7 @@ if ($action == '2fa_entercode') { exit(); } - if (! finishLogin(\Froxlor\User::getAll())) { + if (! finishLogin($userinfo)) { \Froxlor\UI\Response::redirectTo('index.php', array( 'showmessage' => '2' )); @@ -663,17 +663,17 @@ if ($action == 'resetpwd') { } } -function finishLogin(\Froxlor\User::getAll()) +function finishLogin($userinfo) { global $version, $dbversion, $remote_addr, $http_user_agent, $languages; - if (isset(\Froxlor\User::getAll()['userid']) && \Froxlor\User::getAll()['userid'] != '') { + if (isset($userinfo['userid']) && $userinfo['userid'] != '') { $s = md5(uniqid(microtime(), 1)); if (isset($_POST['language'])) { $language = \Froxlor\Validate\Validate::validate($_POST['language'], 'language'); if ($language == 'profile') { - $language = \Froxlor\User::getAll()['def_language']; + $language = $userinfo['def_language']; } elseif (! isset($languages[$language])) { $language = Settings::Get('panel.standardlanguage'); } @@ -681,8 +681,8 @@ function finishLogin(\Froxlor\User::getAll()) $language = Settings::Get('panel.standardlanguage'); } - if (isset(\Froxlor\User::getAll()['theme']) && \Froxlor\User::getAll()['theme'] != '') { - $theme = \Froxlor\User::getAll()['theme']; + if (isset($userinfo['theme']) && $userinfo['theme'] != '') { + $theme = $userinfo['theme']; } else { $theme = Settings::Get('panel.default_theme'); } @@ -692,8 +692,8 @@ function finishLogin(\Froxlor\User::getAll()) WHERE `userid` = :uid AND `adminsession` = :adminsession"); Database::pexecute($stmt, array( - "uid" => \Froxlor\User::getAll()['userid'], - "adminsession" => \Froxlor\User::getAll()['adminsession'] + "uid" => $userinfo['userid'], + "adminsession" => $userinfo['adminsession'] )); } @@ -708,12 +708,12 @@ function finishLogin(\Froxlor\User::getAll()) $params = array( "hash" => $s, - "userid" => \Froxlor\User::getAll()['userid'], + "userid" => $userinfo['userid'], "ipaddress" => $remote_addr, "useragent" => $http_user_agent, "lastactivity" => time(), "language" => $language, - "adminsession" => \Froxlor\User::getAll()['adminsession'] + "adminsession" => $userinfo['adminsession'] ); if ($has_theme) { @@ -734,7 +734,7 @@ function finishLogin(\Froxlor\User::getAll()) } $qryparams['s'] = $s; - if (\Froxlor\User::getAll()['adminsession'] == '1') { + if ($userinfo['adminsession'] == '1') { if (\Froxlor\Froxlor::hasUpdates() || \Froxlor\Froxlor::hasDbUpdates()) { \Froxlor\UI\Response::redirectTo('admin_updates.php', array( 's' => $s diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 9908e5b6..919dcd05 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * */ if (! defined('_CRON_UPDATE')) { - if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset(\Froxlor\User::getAll()['loginname']) || (isset(\Froxlor\User::getAll()['loginname']) && \Froxlor\User::getAll()['loginname'] == '')) { + if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) { header('Location: ../../../../index.php'); exit(); } 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 84ab2afd..cf729023 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -17,7 +17,7 @@ use Froxlor\Settings; * */ if (! defined('_CRON_UPDATE')) { - if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset(\Froxlor\User::getAll()['loginname']) || (isset(\Froxlor\User::getAll()['loginname']) && \Froxlor\User::getAll()['loginname'] == '')) { + if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) { header('Location: ../../../../index.php'); exit(); } @@ -1091,7 +1091,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.9.12')) { showUpdateStep("Setting default amount of autoresponders"); // admin gets unlimited - Database::query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `email_autoresponder`='-1' WHERE `adminid` = '" . (int) \Froxlor\User::getAll()['adminid'] . "'"); + Database::query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `email_autoresponder`='-1' WHERE `adminid` = '" . (int) $userinfo['adminid'] . "'"); // customers Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_autoresponder`='" . (int) $update_autoresponder_default . "' WHERE `deactivated` = '0'"); lastStepStatus(0); @@ -2151,7 +2151,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.9.28-svn5')) { `tickets_see_all` = '1' WHERE `adminid` = :adminid"); Database::pexecute($stmt, array( - 'adminid' => \Froxlor\User::getAll()['adminid'] + 'adminid' => $userinfo['adminid'] )); lastStepStatus(0); diff --git a/install/updatesql.php b/install/updatesql.php index f1f67d40..bb023788 100644 --- a/install/updatesql.php +++ b/install/updatesql.php @@ -21,7 +21,7 @@ use Froxlor\FroxlorLogger; require_once __DIR__ . '/lib/updateFunctions.php'; if (! defined('_CRON_UPDATE')) { - if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset(\Froxlor\User::getAll()['loginname']) || (isset(\Froxlor\User::getAll()['loginname']) && \Froxlor\User::getAll()['loginname'] == '')) { + if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) { header('Location: ../index.php'); exit(); } diff --git a/lib/Froxlor/Api/Commands/Mysqls.php b/lib/Froxlor/Api/Commands/Mysqls.php index 695ec036..6fd4f951 100644 --- a/lib/Froxlor/Api/Commands/Mysqls.php +++ b/lib/Froxlor/Api/Commands/Mysqls.php @@ -124,11 +124,11 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt Database::needSqlData(); $sql_root = Database::getSqlData(); Database::needRoot(false); - \Froxlor\User::getAll() = $customer; + $userinfo = $customer; $replace_arr = array( - 'SALUTATION' => \Froxlor\User::getCorrectUserSalutation(\Froxlor\User::getAll()), - 'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation(\Froxlor\User::getAll()), // < keep this for compatibility + 'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($userinfo), + 'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($userinfo), // < keep this for compatibility 'DB_NAME' => $username, 'DB_PASS' => $password, 'DB_DESC' => $databasedescription, @@ -137,9 +137,9 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt ); // get template for mail subject - $mail_subject = $this->getMailTemplate(\Froxlor\User::getAll(), 'mails', 'new_database_by_customer_subject', $replace_arr, $this->lng['mails']['new_database_by_customer']['subject']); + $mail_subject = $this->getMailTemplate($userinfo, 'mails', 'new_database_by_customer_subject', $replace_arr, $this->lng['mails']['new_database_by_customer']['subject']); // get template for mail body - $mail_body = $this->getMailTemplate(\Froxlor\User::getAll(), 'mails', 'new_database_by_customer_mailbody', $replace_arr, $this->lng['mails']['new_database_by_customer']['mailbody']); + $mail_body = $this->getMailTemplate($userinfo, 'mails', 'new_database_by_customer_mailbody', $replace_arr, $this->lng['mails']['new_database_by_customer']['mailbody']); $_mailerror = false; $mailerr_msg = ""; @@ -147,7 +147,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt $this->mailer()->Subject = $mail_subject; $this->mailer()->AltBody = $mail_body; $this->mailer()->msgHTML(str_replace("\n", "
", $mail_body)); - $this->mailer()->addAddress(\Froxlor\User::getAll()['email'], \Froxlor\User::getCorrectUserSalutation(\Froxlor\User::getAll())); + $this->mailer()->addAddress($userinfo['email'], \Froxlor\User::getCorrectUserSalutation($userinfo)); $this->mailer()->send(); } catch (\PHPMailer\PHPMailer\Exception $e) { $mailerr_msg = $e->errorMessage(); @@ -159,7 +159,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt if ($_mailerror) { $this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_ERR, "[API] Error sending mail: " . $mailerr_msg); - \Froxlor\UI\Response::standard_error('errorsendingmail', \Froxlor\User::getAll()['email'], true); + \Froxlor\UI\Response::standard_error('errorsendingmail', $userinfo['email'], true); } $this->mailer()->clearAddresses(); diff --git a/lib/Froxlor/Bulk/BulkAction.php b/lib/Froxlor/Bulk/BulkAction.php index d28e4c95..25826f11 100644 --- a/lib/Froxlor/Bulk/BulkAction.php +++ b/lib/Froxlor/Bulk/BulkAction.php @@ -145,6 +145,8 @@ abstract class BulkAction protected function importEntity($data_array = null) { + global $userinfo; + $module = '\\Froxlor\\Api\\Commands\\' . substr($this->api_call, 0, strpos($this->api_call, ".")); $function = substr($this->api_call, strpos($this->api_call, ".") + 1); @@ -157,7 +159,7 @@ abstract class BulkAction $result = null; try { - $json_result = $module::getLocal(\Froxlor\User::getAll(), $new_data)->$function(); + $json_result = $module::getLocal($userinfo, $new_data)->$function(); $result = json_decode($json_result, true)['data']; } catch (\Exception $e) { $this->errors[] = $e->getMessage(); diff --git a/lib/Froxlor/Bulk/DomainBulkAction.php b/lib/Froxlor/Bulk/DomainBulkAction.php index 6eb79d91..b0126265 100644 --- a/lib/Froxlor/Bulk/DomainBulkAction.php +++ b/lib/Froxlor/Bulk/DomainBulkAction.php @@ -51,14 +51,17 @@ class DomainBulkAction extends BulkAction { $this->preImport(); - if (\Froxlor\User::getAll()['domains'] == "-1") { + // get the admins userinfo to check for domains_used, etc. + global $userinfo; + + if ($userinfo['domains'] == "-1") { $dom_unlimited = true; } else { $dom_unlimited = false; } - $domains_used = (int) \Froxlor\User::getAll()['domains_used']; - $domains_avail = (int) \Froxlor\User::getAll()['domains']; + $domains_used = (int) $userinfo['domains_used']; + $domains_avail = (int) $userinfo['domains']; if (empty($separator) || strlen($separator) != 1) { throw new \Exception("Invalid separator specified: '" . $separator . "'"); diff --git a/lib/Froxlor/Database/Database.php b/lib/Froxlor/Database/Database.php index 121a57b9..e36fa5d6 100644 --- a/lib/Froxlor/Database/Database.php +++ b/lib/Froxlor/Database/Database.php @@ -350,7 +350,7 @@ class Database */ private static function _showerror($error, $showerror = true, $json_response = false, \PDOStatement $stmt = null) { - global $theme; + global $userinfo, $theme, $linker; // include userdata.inc.php require \Froxlor\Froxlor::getInstallDir() . "/lib/userdata.inc.php"; @@ -445,7 +445,7 @@ class Database $err_hint = str_replace("", date('Y', time()), $err_hint); $err_report_html = ''; - if (is_array(\Froxlor\User::getAll()) && ((\Froxlor\User::getAll()['adminsession'] == '1' && \Froxlor\Settings::Get('system.allow_error_report_admin') == '1') || (\Froxlor\User::getAll()['adminsession'] == '0' && \Froxlor\Settings::Get('system.allow_error_report_customer') == '1'))) { + if (is_array($userinfo) && (($userinfo['adminsession'] == '1' && \Froxlor\Settings::Get('system.allow_error_report_admin') == '1') || ($userinfo['adminsession'] == '0' && \Froxlor\Settings::Get('system.allow_error_report_customer') == '1'))) { $err_report_html = 'Report error'; $err_report_html = str_replace("", $linker->getLink(array( 'section' => 'index', diff --git a/lib/Froxlor/Database/IntegrityCheck.php b/lib/Froxlor/Database/IntegrityCheck.php index 1937551a..050e5f9a 100644 --- a/lib/Froxlor/Database/IntegrityCheck.php +++ b/lib/Froxlor/Database/IntegrityCheck.php @@ -35,12 +35,13 @@ class IntegrityCheck */ public function __construct() { - if (! isset(\Froxlor\User::getAll()) || ! is_array(\Froxlor\User::getAll())) { - \Froxlor\User::getAll() = array( + global $userinfo; + if (! isset($userinfo) || ! is_array($userinfo)) { + $userinfo = array( 'loginname' => 'integrity-check' ); } - $this->_log = \Froxlor\FroxlorLogger::getInstanceOf(\Froxlor\User::getAll()); + $this->_log = \Froxlor\FroxlorLogger::getInstanceOf($userinfo); $this->available = get_class_methods($this); unset($this->available[array_search('__construct', $this->available)]); unset($this->available[array_search('checkAll', $this->available)]); diff --git a/lib/Froxlor/Domain/IpAddr.php b/lib/Froxlor/Domain/IpAddr.php index a61fe3d8..2037970f 100644 --- a/lib/Froxlor/Domain/IpAddr.php +++ b/lib/Froxlor/Domain/IpAddr.php @@ -29,14 +29,16 @@ class IpAddr public static function getIpPortCombinations($ssl = false) { + global $userinfo; + $additional_conditions_params = array(); $additional_conditions_array = array(); - if (\Froxlor\User::getAll()['ip'] != '-1') { + if ($userinfo['ip'] != '-1') { $admin_ip_stmt = Database::prepare(" SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id` = IN (:ipid) "); - $myips = implode(",", json_decode(\Froxlor\User::getAll()['ip'], true)); + $myips = implode(",", json_decode($userinfo['ip'], true)); Database::pexecute($admin_ip_stmt, array( 'ipid' => $myips )); diff --git a/lib/Froxlor/I18N/Lang.php b/lib/Froxlor/I18N/Lang.php deleted file mode 100644 index 97dcc8ac..00000000 --- a/lib/Froxlor/I18N/Lang.php +++ /dev/null @@ -1,27 +0,0 @@ - @@ -254,7 +254,7 @@ class HTML */ public static function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1) { - global $s, $header, $footer; + global $userinfo, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; @@ -277,7 +277,7 @@ class HTML public static function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) { - global $s, $header, $footer, $theme; + global $userinfo, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; diff --git a/lib/Froxlor/UI/Paging.php b/lib/Froxlor/UI/Paging.php index 9d7c2589..bdf31249 100644 --- a/lib/Froxlor/UI/Paging.php +++ b/lib/Froxlor/UI/Paging.php @@ -26,6 +26,13 @@ namespace Froxlor\UI; class Paging { + /** + * Userinfo + * + * @var array + */ + private $userinfo = array(); + /** * MySQL-Table * @@ -102,15 +109,16 @@ class Paging * Class constructor. * Loads settings from request or from userdata and saves them to session. * - * @param array $userinfo - * @param string $table - * Name of Table - * @param array $fields - * Fields, in format array( 'fieldname_in_mysql' => 'field_caption' ) - * @param int $entriesperpage - * *deprecated* entries per page - * @param bool $natSorting - * *deprecated* Switch natsorting on/off (global, affects all calls of sort) + * @param + * array userinfo + * @param + * string Name of Table + * @param + * array Fields, in format array( 'fieldname_in_mysql' => 'field_caption' ) + * @param + * int *deprecated* entries per page + * @param + * bool *deprecated* Switch natsorting on/off (global, affects all calls of sort) * @param int $default_field * default sorting-field-index * @param string $default_order diff --git a/lib/Froxlor/UI/Response.php b/lib/Froxlor/UI/Response.php index de13b19c..da7d02aa 100644 --- a/lib/Froxlor/UI/Response.php +++ b/lib/Froxlor/UI/Response.php @@ -81,7 +81,7 @@ class Response */ public static function standard_error($errors = '', $replacer = '', $throw_exception = false) { - global $s, $header, $footer, $theme; + global $userinfo, $s, $header, $footer, $lng, $theme; $_SESSION['requestData'] = $_POST; $replacer = htmlentities($replacer); @@ -125,7 +125,7 @@ class Response public static function dynamic_error($message) { - global $s, $header, $footer, $theme; + global $userinfo, $s, $header, $footer, $lng, $theme; $_SESSION['requestData'] = $_POST; $link = ''; if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) { @@ -150,7 +150,7 @@ class Response */ public static function standard_success($success_message = '', $replacer = '', $params = array(), $throw_exception = false) { - global $s, $header, $footer, $theme; + global $s, $header, $footer, $lng, $theme; if (isset($lng['success'][$success_message])) { $success_message = strtr($lng['success'][$success_message], array( diff --git a/lib/Froxlor/User.php b/lib/Froxlor/User.php index 05e1b4fb..94b52ee3 100644 --- a/lib/Froxlor/User.php +++ b/lib/Froxlor/User.php @@ -6,26 +6,6 @@ use Froxlor\Database\Database; class User { - private static $userinfo = array(); - - /** - * - * @param array $userinfo - */ - public static function setUserinfoArray($userinfo = array()) - { - self::$userinfo = $userinfo; - } - - /** - * - * @return array - */ - public static function getAll() - { - return self::$userinfo; - } - /** * Returns full style user details "Name, Firstname | Company" * diff --git a/lib/formfields/admin/admin/formfield.admin_edit.php b/lib/formfields/admin/admin/formfield.admin_edit.php index e5301d3f..a207767c 100644 --- a/lib/formfields/admin/admin/formfield.admin_edit.php +++ b/lib/formfields/admin/admin/formfield.admin_edit.php @@ -40,26 +40,26 @@ return array( 'value' => array( $result['deactivated'] ), - 'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true) + 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) ), 'admin_password' => array( 'label' => $lng['login']['password'] . ' (' . $lng['panel']['emptyfornochanges'] . ')', 'type' => 'password', 'autocomplete' => 'off', - 'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true) + 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) ), 'admin_password_suggestion' => array( 'label' => $lng['customer']['generated_pwd'], 'type' => 'text', 'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''), 'value' => \Froxlor\System\Crypt::generatePassword(), - 'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true) + 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) ), 'def_language' => array( 'label' => $lng['login']['language'], 'type' => 'select', 'select_var' => $language_options, - 'visible' => ($result['adminid'] == \Froxlor\User::getAll()['userid'] ? false : true) + 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) ) ) ), @@ -106,7 +106,7 @@ return array( 'section_c' => array( 'title' => $lng['admin']['servicedata'], 'image' => 'icons/user_add.png', - 'visible' => ($result['adminid'] != \Froxlor\User::getAll()['userid'] ? true : false), + 'visible' => ($result['adminid'] != $userinfo['userid'] ? true : false), 'fields' => array( 'ipaddress' => array( 'label' => $lng['serversettings']['ipaddress']['title'], diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index 7ffc3f95..48b7b243 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -35,7 +35,7 @@ return array( 'mandatory' => true ), 'adminid' => array( - 'visible' => (\Froxlor\User::getAll()['customers_see_all'] == '1' ? true : false), + 'visible' => ($userinfo['customers_see_all'] == '1' ? true : false), 'label' => $lng['admin']['admin'], 'type' => 'select', 'select_var' => $admins, @@ -91,7 +91,7 @@ return array( 'image' => 'icons/domain_add.png', 'fields' => array( 'documentroot' => array( - 'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'label' => 'DocumentRoot', 'desc' => $lng['panel']['emptyfordefault'], 'type' => 'text' @@ -124,7 +124,7 @@ return array( 'value' => array() ), 'specialsettings' => array( - 'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'style' => 'align-top', 'label' => $lng['admin']['ownvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], @@ -133,7 +133,7 @@ return array( 'rows' => 12 ), 'notryfiles' => array( - 'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && \Froxlor\User::getAll()['change_serversettings'] == '1'), + 'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'), 'label' => $lng['admin']['notryfiles']['title'], 'desc' => $lng['admin']['notryfiles']['description'], 'type' => 'checkbox', @@ -286,7 +286,7 @@ return array( 'section_c' => array( 'title' => $lng['admin']['phpserversettings'], 'image' => 'icons/domain_add.png', - 'visible' => ((\Froxlor\User::getAll()['change_serversettings'] == '1' || \Froxlor\User::getAll()['caneditphpsettings'] == '1') ? true : false), + 'visible' => (($userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1') ? true : false), 'fields' => array( 'openbasedir' => array( 'label' => 'OpenBasedir', @@ -335,7 +335,7 @@ return array( 'section_d' => array( 'title' => $lng['admin']['nameserversettings'], 'image' => 'icons/domain_add.png', - 'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false), 'fields' => array( 'isbinddomain' => array( 'label' => 'Nameserver', diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index c33db1b7..4c756ec1 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -37,7 +37,7 @@ return array( 'mandatory' => true ), 'adminid' => array( - 'visible' => (\Froxlor\User::getAll()['customers_see_all'] == '1' ? true : false), + 'visible' => ($userinfo['customers_see_all'] == '1' ? true : false), 'label' => $lng['admin']['admin'], 'type' => (\Froxlor\Settings::Get('panel.allow_domain_change_admin') == '1' ? 'select' : 'label'), 'select_var' => (isset($admins) ? $admins : null), @@ -102,7 +102,7 @@ return array( 'image' => 'icons/domain_edit.png', 'fields' => array( 'documentroot' => array( - 'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'label' => 'DocumentRoot', 'desc' => $lng['panel']['emptyfordefault'], 'type' => 'text', @@ -138,7 +138,7 @@ return array( ) ), 'specialsettings' => array( - 'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'style' => 'align-top', 'label' => $lng['admin']['ownvhostsettings'], 'desc' => $lng['serversettings']['default_vhostconf']['description'], @@ -148,7 +148,7 @@ return array( 'rows' => 12 ), 'specialsettingsforsubdomains' => array( - 'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'label' => $lng['admin']['specialsettingsforsubdomains'], 'desc' => $lng['serversettings']['specialsettingsforsubdomains']['description'], 'type' => 'checkbox', @@ -163,7 +163,7 @@ return array( ) ), 'notryfiles' => array( - 'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && \Froxlor\User::getAll()['change_serversettings'] == '1'), + 'visible' => (\Froxlor\Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'), 'label' => $lng['admin']['notryfiles']['title'], 'desc' => $lng['admin']['notryfiles']['description'], 'type' => 'checkbox', @@ -330,7 +330,7 @@ return array( 'section_c' => array( 'title' => $lng['admin']['phpserversettings'], 'image' => 'icons/domain_edit.png', - 'visible' => ((\Froxlor\User::getAll()['change_serversettings'] == '1' || \Froxlor\User::getAll()['caneditphpsettings'] == '1') ? true : false), + 'visible' => (($userinfo['change_serversettings'] == '1' || $userinfo['caneditphpsettings'] == '1') ? true : false), 'fields' => array( 'openbasedir' => array( 'label' => 'OpenBasedir', @@ -365,7 +365,7 @@ return array( 'select_var' => $phpconfigs ), 'phpsettingsforsubdomains' => array( - 'visible' => (\Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'label' => $lng['admin']['phpsettingsforsubdomains'], 'desc' => $lng['serversettings']['phpsettingsforsubdomains']['description'], 'type' => 'checkbox', @@ -396,7 +396,7 @@ return array( 'section_d' => array( 'title' => $lng['admin']['nameserversettings'], 'image' => 'icons/domain_edit.png', - 'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\User::getAll()['change_serversettings'] == '1' ? true : false), + 'visible' => (\Froxlor\Settings::Get('system.bind_enable') == '1' && $userinfo['change_serversettings'] == '1' ? true : false), 'fields' => array( 'isbinddomain' => array( 'label' => 'Nameserver', diff --git a/lib/formfields/customer/domains/formfield.domains_edit.php b/lib/formfields/customer/domains/formfield.domains_edit.php index 523d9cc8..56a28543 100644 --- a/lib/formfields/customer/domains/formfield.domains_edit.php +++ b/lib/formfields/customer/domains/formfield.domains_edit.php @@ -60,7 +60,7 @@ return array( 'select_var' => $redirectcode ), 'selectserveralias' => array( - 'visible' => ((($result['parentdomainid'] == '0' && \Froxlor\User::getAll()['subdomains'] != '0') || $result['parentdomainid'] != '0') ? true : false), + 'visible' => ((($result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0') || $result['parentdomainid'] != '0') ? true : false), 'label' => $lng['admin']['selectserveralias'], 'desc' => $lng['admin']['selectserveralias_desc'], 'type' => 'select', diff --git a/lib/init.php b/lib/init.php index 17dd85eb..381539c2 100644 --- a/lib/init.php +++ b/lib/init.php @@ -210,10 +210,8 @@ if (isset($s) && $s != "" && $nosession != 1) { ); $userinfo_stmt = Database::prepare($query); $userinfo = Database::pexecute_first($userinfo_stmt, $userinfo_data); - \Froxlor\User::setUserinfoArray($userinfo); - unset($userinfo); - if (((\Froxlor\User::getAll()['adminsession'] == '1' && AREA == 'admin' && isset(\Froxlor\User::getAll()['adminid'])) || (\Froxlor\User::getAll()['adminsession'] == '0' && (AREA == 'customer' || AREA == 'login') && isset(\Froxlor\User::getAll()['customerid']))) && (! isset(\Froxlor\User::getAll()['deactivated']) || \Froxlor\User::getAll()['deactivated'] != '1')) { + if ((($userinfo['adminsession'] == '1' && AREA == 'admin' && isset($userinfo['adminid'])) || ($userinfo['adminsession'] == '0' && (AREA == 'customer' || AREA == 'login') && isset($userinfo['customerid']))) && (! isset($userinfo['deactivated']) || $userinfo['deactivated'] != '1')) { $upd_stmt = Database::prepare(" UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `lastactivity` = :lastactive @@ -264,11 +262,11 @@ foreach ($langs as $key => $value) { // ensure that we can display messages $language = Settings::Get('panel.standardlanguage'); -if (isset(\Froxlor\User::getAll()['language']) && isset($languages[\Froxlor\User::getAll()['language']])) { +if (isset($userinfo['language']) && isset($languages[$userinfo['language']])) { // default: use language from session, #277 - $language = \Froxlor\User::getAll()['language']; + $language = $userinfo['language']; } else { - if (! isset(\Froxlor\User::getAll()['def_language']) || ! isset($languages[\Froxlor\User::getAll()['def_language']])) // this will always evaluat true, since it is the above statement inverted. @todo remove + if (! isset($userinfo['def_language']) || ! isset($languages[$userinfo['def_language']])) // this will always evaluat true, since it is the above statement inverted. @todo remove { if (isset($_GET['language']) && isset($languages[$_GET['language']])) { $language = $_GET['language']; @@ -293,7 +291,7 @@ if (isset(\Froxlor\User::getAll()['language']) && isset($languages[\Froxlor\User } } } else { - $language = \Froxlor\User::getAll()['def_language']; + $language = $userinfo['def_language']; } } @@ -312,10 +310,6 @@ if ($language != 'English') { // last but not least include language references file include_once \Froxlor\FileDir::makeSecurePath('lng/lng_references.php'); -// set language array -\Froxlor\I18N\Lang::setLanguageArray($lng); -unset($lng); - // Initialize our new link - class $linker = new \Froxlor\UI\Linker('index.php', $s); @@ -327,8 +321,8 @@ $theme = (Settings::Get('panel.default_theme') !== null) ? Settings::Get('panel. /** * overwrite with customer/admin theme if defined */ -if (isset(\Froxlor\User::getAll()['theme']) && \Froxlor\User::getAll()['theme'] != $theme) { - $theme = \Froxlor\User::getAll()['theme']; +if (isset($userinfo['theme']) && $userinfo['theme'] != $theme) { + $theme = $userinfo['theme']; } // Check if a different variant of the theme is used @@ -363,7 +357,7 @@ if (file_exists($hl_path . '/logo_custom.png')) { * Redirects to index.php (login page) if no session exists */ if ($nosession == 1 && AREA != 'login') { - \Froxlor\User::setUserinfoArray(array()); + unset($userinfo); $params = array( "script" => basename($_SERVER["SCRIPT_NAME"]), "qrystr" => $_SERVER["QUERY_STRING"] @@ -377,9 +371,13 @@ if ($nosession == 1 && AREA != 'login') { */ $templatecache = array(); -if (isset(\Froxlor\User::getAll()['loginname']) && \Froxlor\User::getAll()['loginname'] != '') { +/** + * Logic moved out of lng-file + */ +if (isset($userinfo['loginname']) && $userinfo['loginname'] != '') { + $lng['menue']['main']['username'] .= $userinfo['loginname']; // Initialize logging - $log = \Froxlor\FroxlorLogger::getInstanceOf(\Froxlor\User::getAll()); + $log = \Froxlor\FroxlorLogger::getInstanceOf($userinfo); } /** @@ -421,10 +419,10 @@ if (AREA == 'admin' || AREA == 'customer') { ) ) ); - $navigation = \Froxlor\UI\HTML::buildNavigation($navigation_data['admin'], \Froxlor\User::getAll()); + $navigation = \Froxlor\UI\HTML::buildNavigation($navigation_data['admin'], $userinfo); } else { $navigation_data = \Froxlor\PhpHelper::loadConfigArrayDir('lib/navigation/'); - $navigation = \Froxlor\UI\HTML::buildNavigation($navigation_data[AREA], \Froxlor\User::getAll()); + $navigation = \Froxlor\UI\HTML::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 36111830..bbc6896a 100644 --- a/lib/navigation/00.froxlor.main.php +++ b/lib/navigation/00.froxlor.main.php @@ -23,7 +23,7 @@ return array( 'label' => $lng['admin']['overview'], 'elements' => array( array( - 'label' => $lng['menue']['main']['username'] . (isset(\Froxlor\User::getAll()['loginname']) && \Froxlor\User::getAll()['loginname'] != '' ? " " . \Froxlor\User::getAll()['loginname'] : "") + 'label' => $lng['menue']['main']['username'] ), array( 'url' => 'customer_index.php?page=change_password', diff --git a/logfiles_viewer.php b/logfiles_viewer.php index 48ad2538..9ee8d4ef 100644 --- a/logfiles_viewer.php +++ b/logfiles_viewer.php @@ -30,7 +30,7 @@ $domain_id = isset($_GET['domain_id']) ? (int) $_GET['domain_id'] : null; $last_n = isset($_GET['number_of_lines']) ? (int) $_GET['number_of_lines'] : 100; // user's with logviewenabled = false -if (AREA != 'admin' && \Froxlor\User::getAll()['logviewenabled'] != '1') { +if (AREA != 'admin' && $userinfo['logviewenabled'] != '1') { // back to domain overview \Froxlor\UI\Response::redirectTo($filename, array( 'page' => 'domains', @@ -42,7 +42,7 @@ if (function_exists('exec')) { // get domain-info try { - $json_result = SubDomains::getLocal(\Froxlor\User::getAll(), array( + $json_result = SubDomains::getLocal($userinfo, array( 'id' => $domain_id ))->get(); } catch (Exception $e) { diff --git a/ssl_certificates.php b/ssl_certificates.php index 9fa097dc..554d7613 100644 --- a/ssl_certificates.php +++ b/ssl_certificates.php @@ -33,7 +33,7 @@ if ($action == 'delete') { $id = isset($_GET['id']) ? (int) $_GET['id'] : 0; if ($id > 0) { try { - $json_result = Certificates::getLocal(\Froxlor\User::getAll(), array( + $json_result = Certificates::getLocal($userinfo, array( 'id' => $id ))->delete(); $success_message = sprintf($lng['domains']['ssl_certificate_removed'], $id); @@ -47,7 +47,7 @@ $log->logAction(USR_ACTION, LOG_NOTICE, "viewed domains::ssl_certificates"); $fields = array( 'd.domain' => $lng['domains']['domainname'] ); -$paging = new \Froxlor\UI\Paging(\Froxlor\User::getAll(), TABLE_PANEL_DOMAIN_SSL_SETTINGS, $fields); +$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DOMAIN_SSL_SETTINGS, $fields); // select all my (accessable) certificates $certs_stmt_query = "SELECT s.*, d.domain, d.letsencrypt, c.customerid, c.loginname @@ -58,14 +58,14 @@ $certs_stmt_query = "SELECT s.*, d.domain, d.letsencrypt, c.customerid, c.loginn $qry_params = array(); -if (AREA == 'admin' && \Froxlor\User::getAll()['customers_see_all'] == '0') { +if (AREA == 'admin' && $userinfo['customers_see_all'] == '0') { // admin with only customer-specific permissions $certs_stmt_query .= "d.adminid = :adminid "; - $qry_params['adminid'] = \Froxlor\User::getAll()['adminid']; + $qry_params['adminid'] = $userinfo['adminid']; } elseif (AREA == 'customer') { // customer-area $certs_stmt_query .= "d.customerid = :cid "; - $qry_params['cid'] = \Froxlor\User::getAll()['customerid']; + $qry_params['cid'] = $userinfo['customerid']; } else { $certs_stmt_query .= "1 "; } diff --git a/templates/Sparkle/2fa/overview.tpl b/templates/Sparkle/2fa/overview.tpl index 9aa46c6d..fcb2fa25 100644 --- a/templates/Sparkle/2fa/overview.tpl +++ b/templates/Sparkle/2fa/overview.tpl @@ -8,7 +8,7 @@ $header
- +

{$lng['2fa']['2fa_overview_desc']}

@@ -18,7 +18,7 @@ $header
- +

{$lng['2fa']['2fa_email_desc']}

@@ -27,7 +27,7 @@ $header
- +

{$lng['2fa']['2fa_ga_desc']}

diff --git a/templates/Sparkle/admin/admins/admins_admin.tpl b/templates/Sparkle/admin/admins/admins_admin.tpl index fe219c1e..c009ff30 100644 --- a/templates/Sparkle/admin/admins/admins_admin.tpl +++ b/templates/Sparkle/admin/admins/admins_admin.tpl @@ -3,10 +3,10 @@ {$row['name']} - + {$row['loginname']} - + {$row['loginname']} diff --git a/templates/Sparkle/admin/admins/admins_edit.tpl b/templates/Sparkle/admin/admins/admins_edit.tpl index 053f160e..9b58bd70 100644 --- a/templates/Sparkle/admin/admins/admins_edit.tpl +++ b/templates/Sparkle/admin/admins/admins_edit.tpl @@ -6,7 +6,7 @@ $header - +
{$lng['error']['youcanteditallfieldsofyourself']}
diff --git a/templates/Sparkle/admin/customers/customers.tpl b/templates/Sparkle/admin/customers/customers.tpl index c18ceb88..cfeab255 100644 --- a/templates/Sparkle/admin/customers/customers.tpl +++ b/templates/Sparkle/admin/customers/customers.tpl @@ -17,7 +17,7 @@ $header {$searchcode} - +
  {$lng['admin']['customer_add']} @@ -58,7 +58,7 @@ $header - +
  {$lng['admin']['customer_add']} diff --git a/templates/Sparkle/admin/domains/domains.tpl b/templates/Sparkle/admin/domains/domains.tpl index 35adb7be..952f94f5 100644 --- a/templates/Sparkle/admin/domains/domains.tpl +++ b/templates/Sparkle/admin/domains/domains.tpl @@ -17,7 +17,7 @@ {$searchcode}
- +
  {$lng['admin']['domain_add']} @@ -61,7 +61,7 @@
- +
  {$lng['admin']['domain_add']} diff --git a/templates/Sparkle/admin/index/index.tpl b/templates/Sparkle/admin/index/index.tpl index 80d5146a..858c7a5d 100644 --- a/templates/Sparkle/admin/index/index.tpl +++ b/templates/Sparkle/admin/index/index.tpl @@ -8,144 +8,144 @@ $header
- +
{$lng['admin']['customers']}
{$overview['number_customers']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['customers']} {$lng['panel']['available']} + + {$userinfo['customers']} {$lng['panel']['available']}
- +
{$lng['customer']['domains']}
{$overview['number_domains']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['domains']} {$lng['panel']['available']} + + {$userinfo['domains']} {$lng['panel']['available']}
- +
{$lng['customer']['subdomains']}
{$overview['subdomains_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['subdomains_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['subdomains']} {$lng['panel']['available']} + {$userinfo['subdomains_used']} {$lng['panel']['assigned']}
+ + {$userinfo['subdomains']} {$lng['panel']['available']}
- +
{$lng['customer']['diskspace']}
{$overview['diskspace_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['diskspace_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['diskspace']} {$lng['panel']['available']} + {$userinfo['diskspace_used']} {$lng['panel']['assigned']}
+ + {$userinfo['diskspace']} {$lng['panel']['available']}
- +
{$lng['customer']['traffic']}
{$overview['traffic_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['traffic_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['traffic']} {$lng['panel']['available']} + {$userinfo['traffic_used']} {$lng['panel']['assigned']}
+ + {$userinfo['traffic']} {$lng['panel']['available']}
- +
{$lng['customer']['mysqls']}
{$overview['mysqls_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['mysqls_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['mysqls']} {$lng['panel']['available']} + {$userinfo['mysqls_used']} {$lng['panel']['assigned']}
+ + {$userinfo['mysqls']} {$lng['panel']['available']}
- +
{$lng['customer']['emails']}
{$overview['emails_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['emails_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['emails']} {$lng['panel']['available']} + {$userinfo['emails_used']} {$lng['panel']['assigned']}
+ + {$userinfo['emails']} {$lng['panel']['available']}
- +
{$lng['customer']['accounts']}
{$overview['email_accounts_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['email_accounts_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['email_accounts']} {$lng['panel']['available']} + {$userinfo['email_accounts_used']} {$lng['panel']['assigned']}
+ + {$userinfo['email_accounts']} {$lng['panel']['available']}
- +
{$lng['customer']['forwarders']}
{$overview['email_forwarders_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['email_forwarders_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['email_forwarders']} {$lng['panel']['available']} + {$userinfo['email_forwarders_used']} {$lng['panel']['assigned']}
+ + {$userinfo['email_forwarders']} {$lng['panel']['available']}
- +
{$lng['customer']['email_quota']}
{$overview['email_quota_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['email_quota_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['email_quota']} {$lng['panel']['available']} + {$userinfo['email_quota_used']} {$lng['panel']['assigned']}
+ + {$userinfo['email_quota']} {$lng['panel']['available']}
- +
{$lng['customer']['ftps']}
{$overview['ftps_used']} {$lng['panel']['used']}
- {\Froxlor\User::getAll()['ftps_used']} {$lng['panel']['assigned']}
- - {\Froxlor\User::getAll()['ftps']} {$lng['panel']['available']} + {$userinfo['ftps_used']} {$lng['panel']['assigned']}
+ + {$userinfo['ftps']} {$lng['panel']['available']}
@@ -181,10 +181,10 @@ $header - + - +
{\Froxlor\User::getAll()['custom_notes']}
{$userinfo['custom_notes']}
diff --git a/templates/Sparkle/admin/phpconfig/overview.tpl b/templates/Sparkle/admin/phpconfig/overview.tpl index 606ccabc..b23cc62f 100644 --- a/templates/Sparkle/admin/phpconfig/overview.tpl +++ b/templates/Sparkle/admin/phpconfig/overview.tpl @@ -20,7 +20,7 @@ $header {$lng['admin']['phpsettings']['description']} {$lng['admin']['phpsettings']['activedomains']} - + {$lng['admin']['phpsettings']['fpmdesc']} {$lng['admin']['phpsettings']['binary']} @@ -31,7 +31,7 @@ $header - +
  {$lng['admin']['phpsettings']['addnew']} diff --git a/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl b/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl index 87cd07ef..decb7caf 100644 --- a/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl +++ b/templates/Sparkle/admin/settings/updatecounters_row_admin.tpl @@ -1,6 +1,6 @@ - {$admin['loginname']}{$admin['loginname']} + {$admin['loginname']}{$admin['loginname']} {$lng['admin']['customers']}: class="green"class="red">{$admin['customers_used']} -> {$admin['customers_used_new']}
diff --git a/templates/Sparkle/customer/domains/domainlist.tpl b/templates/Sparkle/customer/domains/domainlist.tpl index dbf8bd86..5325ee92 100644 --- a/templates/Sparkle/customer/domains/domainlist.tpl +++ b/templates/Sparkle/customer/domains/domainlist.tpl @@ -17,7 +17,7 @@ {$searchcode}
- +
  {$lng['domains']['subdomain_add']} @@ -47,7 +47,7 @@ - +
  {$lng['domains']['subdomain_add']} diff --git a/templates/Sparkle/customer/domains/domains_domain.tpl b/templates/Sparkle/customer/domains/domains_domain.tpl index 64968b60..321b45b9 100644 --- a/templates/Sparkle/customer/domains/domains_domain.tpl +++ b/templates/Sparkle/customer/domains/domains_domain.tpl @@ -23,7 +23,7 @@ {$lng['panel']['edit']}   - + {$lng['panel']['viewlogs']} @@ -33,7 +33,7 @@ {$lng['panel']['delete']}   - + {$lng['dnseditor']['edit']}   diff --git a/templates/Sparkle/customer/domains/domains_edit.tpl b/templates/Sparkle/customer/domains/domains_edit.tpl index 9650d630..4435ba66 100644 --- a/templates/Sparkle/customer/domains/domains_edit.tpl +++ b/templates/Sparkle/customer/domains/domains_edit.tpl @@ -4,7 +4,7 @@ $header

{$title}  {$title} - +  ({$lng['dnseditor']['edit']})

diff --git a/templates/Sparkle/customer/email/emails.tpl b/templates/Sparkle/customer/email/emails.tpl index e10c9c8a..3ee17e54 100644 --- a/templates/Sparkle/customer/email/emails.tpl +++ b/templates/Sparkle/customer/email/emails.tpl @@ -17,7 +17,7 @@
- +
  {$lng['emails']['emails_add']} @@ -52,7 +52,7 @@ - +
  {$lng['emails']['emails_add']} diff --git a/templates/Sparkle/customer/ftp/accounts.tpl b/templates/Sparkle/customer/ftp/accounts.tpl index c4c515b8..ce431599 100644 --- a/templates/Sparkle/customer/ftp/accounts.tpl +++ b/templates/Sparkle/customer/ftp/accounts.tpl @@ -17,7 +17,7 @@ {$searchcode}
- +
  {$lng['ftp']['account_add']} @@ -51,7 +51,7 @@ - +
  {$lng['ftp']['account_add']} diff --git a/templates/Sparkle/customer/index/index.tpl b/templates/Sparkle/customer/index/index.tpl index 1f3adb43..f350fa4d 100644 --- a/templates/Sparkle/customer/index/index.tpl +++ b/templates/Sparkle/customer/index/index.tpl @@ -7,129 +7,129 @@ $header
- +
- +
{$lng['customer']['subdomains']}
- {\Froxlor\User::getAll()['subdomains_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['subdomains']} {$lng['panel']['available']} + {$userinfo['subdomains_used']} {$lng['panel']['used']}
+ + {$userinfo['subdomains']} {$lng['panel']['available']}
- +
- +
{$lng['customer']['diskspace']}
- {\Froxlor\User::getAll()['diskspace_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['diskspace']} {$lng['panel']['available']} + {$userinfo['diskspace_used']} {$lng['panel']['used']}
+ + {$userinfo['diskspace']} {$lng['panel']['available']}
- +
- +
{$lng['customer']['traffic']}
- {\Froxlor\User::getAll()['traffic_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['traffic']} {$lng['panel']['available']} + {$userinfo['traffic_used']} {$lng['panel']['used']}
+ + {$userinfo['traffic']} {$lng['panel']['available']}
- +
- +
{$lng['customer']['emails']}
- {\Froxlor\User::getAll()['emails_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['emails']} {$lng['panel']['available']} + {$userinfo['emails_used']} {$lng['panel']['used']}
+ + {$userinfo['emails']} {$lng['panel']['available']}
- +
- +
{$lng['customer']['accounts']}
- {\Froxlor\User::getAll()['email_accounts_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['email_accounts']} {$lng['panel']['available']}
+ {$userinfo['email_accounts_used']} {$lng['panel']['used']}
+ + {$userinfo['email_accounts']} {$lng['panel']['available']}
- {\Froxlor\User::getAll()['mailspace_used']} {$lng['customer']['mib']} + {$userinfo['mailspace_used']} {$lng['customer']['mib']}
- +
- +
{$lng['customer']['forwarders']}
- {\Froxlor\User::getAll()['email_forwarders_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['email_forwarders']} {$lng['panel']['available']} + {$userinfo['email_forwarders_used']} {$lng['panel']['used']}
+ + {$userinfo['email_forwarders']} {$lng['panel']['available']}
- +
- +
{$lng['customer']['email_quota']}
- {\Froxlor\User::getAll()['email_quota_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['email_quota']} {$lng['panel']['available']} + {$userinfo['email_quota_used']} {$lng['panel']['used']}
+ + {$userinfo['email_quota']} {$lng['panel']['available']}
- +
- +
{$lng['customer']['mysqls']}
- {\Froxlor\User::getAll()['mysqls_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['mysqls']} {$lng['panel']['available']}
+ {$userinfo['mysqls_used']} {$lng['panel']['used']}
+ + {$userinfo['mysqls']} {$lng['panel']['available']}
- {\Froxlor\User::getAll()['dbspace_used']} {$lng['customer']['mib']} + {$userinfo['dbspace_used']} {$lng['customer']['mib']}
- +
- +
{$lng['customer']['ftps']}
- {\Froxlor\User::getAll()['ftps_used']} {$lng['panel']['used']}
- - {\Froxlor\User::getAll()['ftps']} {$lng['panel']['available']} + {$userinfo['ftps_used']} {$lng['panel']['used']}
+ + {$userinfo['ftps']} {$lng['panel']['available']}
@@ -163,7 +163,7 @@ $header {$lng['login']['username']}: - {\Froxlor\User::getAll()['loginname']} + {$userinfo['loginname']} {$lng['customer']['domains']}: @@ -189,45 +189,45 @@ $header - + {$lng['customer']['customernumber']}: - {\Froxlor\User::getAll()['customernumber']} + {$userinfo['customernumber']} - + {$lng['customer']['company']}: - {\Froxlor\User::getAll()['company']} + {$userinfo['company']} - + {$lng['customer']['name']}: - {\Froxlor\User::getAll()['firstname']} {\Froxlor\User::getAll()['name']} + {$userinfo['firstname']} {$userinfo['name']} - + {$lng['customer']['street']}: - {\Froxlor\User::getAll()['street']} + {$userinfo['street']} - + {$lng['customer']['zipcode']}/{$lng['customer']['city']}: - {\Froxlor\User::getAll()['zipcode']} {\Froxlor\User::getAll()['city']} + {$userinfo['zipcode']} {$userinfo['city']} - + {$lng['customer']['email']}: - {\Froxlor\User::getAll()['email']} + {$userinfo['email']} - + - {\Froxlor\User::getAll()['custom_notes']} + {$userinfo['custom_notes']} diff --git a/templates/Sparkle/customer/mysql/mysqls.tpl b/templates/Sparkle/customer/mysql/mysqls.tpl index c5b1773c..f1085ca1 100644 --- a/templates/Sparkle/customer/mysql/mysqls.tpl +++ b/templates/Sparkle/customer/mysql/mysqls.tpl @@ -17,7 +17,7 @@ {$searchcode}
- +
  {$lng['mysql']['database_create']} @@ -49,7 +49,7 @@ - +
  {$lng['mysql']['database_create']} diff --git a/templates/Sparkle/footer.tpl b/templates/Sparkle/footer.tpl index 1beae3df..359c0bb9 100644 --- a/templates/Sparkle/footer.tpl +++ b/templates/Sparkle/footer.tpl @@ -1,4 +1,4 @@ - +
diff --git a/templates/Sparkle/header.tpl b/templates/Sparkle/header.tpl index 1ef7595c..1b1e9fe8 100644 --- a/templates/Sparkle/header.tpl +++ b/templates/Sparkle/header.tpl @@ -29,11 +29,11 @@ - <if isset(\Froxlor\User::getAll()['loginname']) && \Froxlor\User::getAll()['loginname'] != ''>{\Froxlor\User::getAll()['loginname']} - </if>Froxlor Server Management Panel + <if isset($userinfo['loginname']) && $userinfo['loginname'] != ''>{$userinfo['loginname']} - </if>Froxlor Server Management Panel - +

Froxlor Server Management Panel

@@ -43,12 +43,12 @@