Revert "refactor global array"

This reverts commit c5a58e3f36.
This commit is contained in:
Michael Kaufmann
2018-12-22 08:15:31 +01:00
parent 7e39a7bc60
commit 0401e6971a
68 changed files with 613 additions and 646 deletions

12
2fa.php
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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) {

View File

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

View File

@@ -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)) {

View File

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

View File

@@ -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",

View File

@@ -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') {

View File

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

View File

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

View File

@@ -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)) {

View File

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

View File

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

View File

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

View File

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

View File

@@ -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) {

View File

@@ -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", "<br />", $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

View File

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

View File

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

View File

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

View File

@@ -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", "<br />", $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();

View File

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

View File

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

View File

@@ -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("<CURRENT_YEAR>", 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 = '<a href="<LINK>" title="Click here to report error">Report error</a>';
$err_report_html = str_replace("<LINK>", $linker->getLink(array(
'section' => 'index',

View File

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

View File

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

View File

@@ -1,27 +0,0 @@
<?php
namespace Froxlor\I18N;
class Lang
{
private static $lng = array();
/**
*
* @param array $lng
*/
public static function setLanguageArray($lng = array())
{
self::$lng = $lng;
}
/**
*
* @return array
*/
public static function getAll()
{
return self::$lng;
}
}

View File

@@ -7,10 +7,10 @@ class HTML
/**
* Build Navigation Sidebar
*
* @param array $navigation
* data
* @param array $userinfo
* the userinfo of the user
* @param
* array navigation data
* @param
* array userinfo the userinfo of the user
* @return string the content of the navigation bar
*
* @author Florian Lippert <flo@syscp.org>
@@ -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 = '';

View File

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

View File

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

View File

@@ -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"
*

View File

@@ -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'] . '&nbsp;(' . $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'],

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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) {

View File

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

View File

@@ -8,7 +8,7 @@ $header
</header>
<section>
<if \Froxlor\User::getAll()['type_2fa']=='0'>
<if $userinfo['type_2fa']=='0'>
<form method="post"
action="{$linker->getLink(array('section' => 'index', 'page' => $page, 'action' => 'add'))}">
<p>{$lng['2fa']['2fa_overview_desc']}</p>
@@ -18,7 +18,7 @@ $header
</form>
</if>
<if \Froxlor\User::getAll()['type_2fa']=='1'>
<if $userinfo['type_2fa']=='1'>
<form method="post"
action="{$linker->getLink(array('section' => 'index', 'page' => $page, 'action' => 'delete'))}">
<p>{$lng['2fa']['2fa_email_desc']}</p>
@@ -27,7 +27,7 @@ $header
</form>
</if>
<if \Froxlor\User::getAll()['type_2fa']=='2'>
<if $userinfo['type_2fa']=='2'>
<form method="post"
action="{$linker->getLink(array('section' => 'index', 'page' => $page, 'action' => 'delete'))}">
<p>{$lng['2fa']['2fa_ga_desc']}</p>

View File

@@ -3,10 +3,10 @@
{$row['name']}
</td>
<td>
<if $row['adminid'] != \Froxlor\User::getAll()['userid']>
<if $row['adminid'] != $userinfo['userid']>
<a href="{$linker->getLink(array('section' => 'admins', 'page' => $page, 'action' => 'su', 'id' => $row['adminid']))}" rel="external">{$row['loginname']}</a>
</if>
<if $row['adminid'] == \Froxlor\User::getAll()['userid']>
<if $row['adminid'] == $userinfo['userid']>
{$row['loginname']}
</if>
</td>

View File

@@ -6,7 +6,7 @@ $header
</h2>
</header>
<if $result['adminid'] == \Froxlor\User::getAll()['userid']>
<if $result['adminid'] == $userinfo['userid']>
<div class="warningcontainer bradius">
<div class="warning">{$lng['error']['youcanteditallfieldsofyourself']}</div>
</div>

View File

@@ -17,7 +17,7 @@ $header
{$searchcode}
</div>
<if \Froxlor\User::getAll()['customers_used'] < \Froxlor\User::getAll()['customers'] || \Froxlor\User::getAll()['customers'] == '-1'>
<if $userinfo['customers_used'] < $userinfo['customers'] || $userinfo['customers'] == '-1'>
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'customers', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['customer_add']}</a>
@@ -58,7 +58,7 @@ $header
</form>
<if (\Froxlor\User::getAll()['customers_used'] < \Froxlor\User::getAll()['customers'] || \Froxlor\User::getAll()['customers'] == '-1') && 15 < \Froxlor\User::getAll()['customers_used'] >
<if ($userinfo['customers_used'] < $userinfo['customers'] || $userinfo['customers'] == '-1') && 15 < $userinfo['customers_used'] >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'customers', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['customer_add']}</a>

View File

@@ -17,7 +17,7 @@
{$searchcode}
</div>
<if (\Froxlor\User::getAll()['domains_used'] < \Froxlor\User::getAll()['domains'] || \Froxlor\User::getAll()['domains'] == '-1') && $countcustomers !=0 >
<if ($userinfo['domains_used'] < $userinfo['domains'] || $userinfo['domains'] == '-1') && $countcustomers !=0 >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'domains', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['domain_add']}</a>
@@ -61,7 +61,7 @@
</div>
</if>
<if (\Froxlor\User::getAll()['domains_used'] < \Froxlor\User::getAll()['domains'] || \Froxlor\User::getAll()['domains'] == '-1') && 15 < $count && 0 < $countcustomers >
<if ($userinfo['domains_used'] < $userinfo['domains'] || $userinfo['domains'] == '-1') && 15 < $count && 0 < $countcustomers >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'domains', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['domain_add']}</a>

View File

@@ -8,144 +8,144 @@ $header
<div class="grid-g">
<div class="grid-u-1-2" id="statsbox">
<div class="canvasbox">
<input type="hidden" id="customers" class="circular" data-used="{$overview['number_customers']}" data-available="{\Froxlor\User::getAll()['customers']}">
<input type="hidden" id="customers" class="circular" data-used="{$overview['number_customers']}" data-available="{$userinfo['customers']}">
<canvas id="customers-canvas" width="120" height="76"></canvas><br/>
{$lng['admin']['customers']}<br />
<small>
{$overview['number_customers']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['customers'] != '∞'>
{\Froxlor\User::getAll()['customers']} {$lng['panel']['available']}
<if $userinfo['customers'] != '∞'>
{$userinfo['customers']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="domains" class="circular" data-used="{$overview['number_domains']}" data-available="{\Froxlor\User::getAll()['domains']}">
<input type="hidden" id="domains" class="circular" data-used="{$overview['number_domains']}" data-available="{$userinfo['domains']}">
<canvas id="domains-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['domains']}<br />
<small>
{$overview['number_domains']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['domains'] != '∞'>
{\Froxlor\User::getAll()['domains']} {$lng['panel']['available']}
<if $userinfo['domains'] != '∞'>
{$userinfo['domains']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="subdomains" class="circular" data-used="{$overview['subdomains_used']}" data-available="{\Froxlor\User::getAll()['subdomains']}" data-assigned="{\Froxlor\User::getAll()['subdomains_used']}">
<input type="hidden" id="subdomains" class="circular" data-used="{$overview['subdomains_used']}" data-available="{$userinfo['subdomains']}" data-assigned="{$userinfo['subdomains_used']}">
<canvas id="subdomains-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['subdomains']}<br />
<small>
{$overview['subdomains_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['subdomains_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['subdomains'] != '∞'>
{\Froxlor\User::getAll()['subdomains']} {$lng['panel']['available']}
{$userinfo['subdomains_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['subdomains'] != '∞'>
{$userinfo['subdomains']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="diskspace" class="circular" data-used="{$overview['diskspace_used']}" data-available="{\Froxlor\User::getAll()['diskspace']}" data-assigned="{\Froxlor\User::getAll()['diskspace_used']}">
<input type="hidden" id="diskspace" class="circular" data-used="{$overview['diskspace_used']}" data-available="{$userinfo['diskspace']}" data-assigned="{$userinfo['diskspace_used']}">
<canvas id="diskspace-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['diskspace']}<br />
<small>
{$overview['diskspace_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['diskspace_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['diskspace'] != '∞'>
{\Froxlor\User::getAll()['diskspace']} {$lng['panel']['available']}
{$userinfo['diskspace_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['diskspace'] != '∞'>
{$userinfo['diskspace']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="traffic" class="circular" data-used="{$overview['traffic_used']}" data-available="{\Froxlor\User::getAll()['traffic']}" data-assigned="{\Froxlor\User::getAll()['traffic_used']}">
<input type="hidden" id="traffic" class="circular" data-used="{$overview['traffic_used']}" data-available="{$userinfo['traffic']}" data-assigned="{$userinfo['traffic_used']}">
<canvas id="traffic-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['traffic']}<br />
<small>
{$overview['traffic_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['traffic_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['traffic'] != '∞'>
{\Froxlor\User::getAll()['traffic']} {$lng['panel']['available']}
{$userinfo['traffic_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['traffic'] != '∞'>
{$userinfo['traffic']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="mysqls" class="circular" data-used="{$overview['mysqls_used']}" data-available="{\Froxlor\User::getAll()['mysqls']}" data-assigned="{\Froxlor\User::getAll()['mysqls_used']}">
<input type="hidden" id="mysqls" class="circular" data-used="{$overview['mysqls_used']}" data-available="{$userinfo['mysqls']}" data-assigned="{$userinfo['mysqls_used']}">
<canvas id="mysqls-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['mysqls']}<br />
<small>
{$overview['mysqls_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['mysqls_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['mysqls'] != '∞'>
{\Froxlor\User::getAll()['mysqls']} {$lng['panel']['available']}
{$userinfo['mysqls_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['mysqls'] != '∞'>
{$userinfo['mysqls']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="emails" class="circular" data-used="{$overview['emails_used']}" data-available="{\Froxlor\User::getAll()['emails']}" data-assigned="{\Froxlor\User::getAll()['emails_used']}">
<input type="hidden" id="emails" class="circular" data-used="{$overview['emails_used']}" data-available="{$userinfo['emails']}" data-assigned="{$userinfo['emails_used']}">
<canvas id="emails-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['emails']}<br />
<small>
{$overview['emails_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['emails_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['emails'] != '∞'>
{\Froxlor\User::getAll()['emails']} {$lng['panel']['available']}
{$userinfo['emails_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['emails'] != '∞'>
{$userinfo['emails']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="email_accounts" class="circular" data-used="{$overview['email_accounts_used']}" data-available="{\Froxlor\User::getAll()['email_accounts']}" data-assigned="{\Froxlor\User::getAll()['email_accounts_used']}">
<input type="hidden" id="email_accounts" class="circular" data-used="{$overview['email_accounts_used']}" data-available="{$userinfo['email_accounts']}" data-assigned="{$userinfo['email_accounts_used']}">
<canvas id="email_accounts-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['accounts']}<br />
<small>
{$overview['email_accounts_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['email_accounts_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['email_accounts'] != '∞'>
{\Froxlor\User::getAll()['email_accounts']} {$lng['panel']['available']}
{$userinfo['email_accounts_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['email_accounts'] != '∞'>
{$userinfo['email_accounts']} {$lng['panel']['available']}
</if>
</small>
</div>
<div class="canvasbox">
<input type="hidden" id="email_forwarders" class="circular" data-used="{$overview['email_forwarders_used']}" data-available="{\Froxlor\User::getAll()['email_forwarders']}" data-assigned="{\Froxlor\User::getAll()['email_forwarders_used']}">
<input type="hidden" id="email_forwarders" class="circular" data-used="{$overview['email_forwarders_used']}" data-available="{$userinfo['email_forwarders']}" data-assigned="{$userinfo['email_forwarders_used']}">
<canvas id="email_forwarders-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['forwarders']}<br />
<small>
{$overview['email_forwarders_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['email_forwarders_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['email_forwarders'] != '∞'>
{\Froxlor\User::getAll()['email_forwarders']} {$lng['panel']['available']}
{$userinfo['email_forwarders_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['email_forwarders'] != '∞'>
{$userinfo['email_forwarders']} {$lng['panel']['available']}
</if>
</small>
</div>
<if \Froxlor\Settings::Get('system.mail_quota_enabled') == 1>
<div class="canvasbox">
<input type="hidden" id="email_quota" class="circular" data-used="{$overview['email_quota_used']}" data-available="{\Froxlor\User::getAll()['email_quota']}" data-assigned="{\Froxlor\User::getAll()['email_quota_used']}">
<input type="hidden" id="email_quota" class="circular" data-used="{$overview['email_quota_used']}" data-available="{$userinfo['email_quota']}" data-assigned="{$userinfo['email_quota_used']}">
<canvas id="email_quota-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['email_quota']}<br />
<small>
{$overview['email_quota_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['email_quota_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['email_quota'] != '∞'>
{\Froxlor\User::getAll()['email_quota']} {$lng['panel']['available']}
{$userinfo['email_quota_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['email_quota'] != '∞'>
{$userinfo['email_quota']} {$lng['panel']['available']}
</if>
</small>
</div>
</if>
<div class="canvasbox">
<input type="hidden" id="ftps" class="circular" data-used="{$overview['ftps_used']}" data-available="{\Froxlor\User::getAll()['ftps']}" data-assigned="{\Froxlor\User::getAll()['ftps_used']}">
<input type="hidden" id="ftps" class="circular" data-used="{$overview['ftps_used']}" data-available="{$userinfo['ftps']}" data-assigned="{$userinfo['ftps_used']}">
<canvas id="ftps-canvas" width="120" height="76"></canvas><br/>
{$lng['customer']['ftps']}<br />
<small>
{$overview['ftps_used']} {$lng['panel']['used']}<br />
{\Froxlor\User::getAll()['ftps_used']} {$lng['panel']['assigned']}<br />
<if \Froxlor\User::getAll()['ftps'] != '∞'>
{\Froxlor\User::getAll()['ftps']} {$lng['panel']['available']}
{$userinfo['ftps_used']} {$lng['panel']['assigned']}<br />
<if $userinfo['ftps'] != '∞'>
{$userinfo['ftps']} {$lng['panel']['available']}
</if>
</small>
</div>
@@ -181,10 +181,10 @@ $header
</table>
</if>
<if \Froxlor\User::getAll()['custom_notes'] != '' && \Froxlor\User::getAll()['custom_notes_show'] == '1'>
<if $userinfo['custom_notes'] != '' && $userinfo['custom_notes_show'] == '1'>
<table class="dboarditem full">
<tbody>
<tr><td>{\Froxlor\User::getAll()['custom_notes']}</td></tr>
<tr><td>{$userinfo['custom_notes']}</td></tr>
</tbody>
</table>
</if>

View File

@@ -1,6 +1,6 @@
<tr class="top">
<td>
<b><if $admin['adminid'] != \Froxlor\User::getAll()['userid']><a href="{$linker->getLink(array('section' => 'admins', 'page' => 'admins', 'action' => 'su', 'id' => $admin['adminid']))}" target="_blank">{$admin['loginname']}</a></if><if $admin['adminid'] == \Froxlor\User::getAll()['userid']>{$admin['loginname']}</if></b>
<b><if $admin['adminid'] != $userinfo['userid']><a href="{$linker->getLink(array('section' => 'admins', 'page' => 'admins', 'action' => 'su', 'id' => $admin['adminid']))}" target="_blank">{$admin['loginname']}</a></if><if $admin['adminid'] == $userinfo['userid']>{$admin['loginname']}</if></b>
</td>
<td>
{$lng['admin']['customers']}: <span <if $admin['customers_used'] == $admin['customers_used_new']>class="green"<else>class="red"</if>><b>{$admin['customers_used']} -&gt; {$admin['customers_used_new']}</b></span><br />

View File

@@ -17,7 +17,7 @@
{$searchcode}
</div>
<if (\Froxlor\User::getAll()['subdomains_used'] < \Froxlor\User::getAll()['subdomains'] || \Froxlor\User::getAll()['subdomains'] == '-1') && $parentdomains_count != 0 >
<if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') && $parentdomains_count != 0 >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'domains', 'page' => 'domains', 'action' => 'add'))}">{$lng['domains']['subdomain_add']}</a>
@@ -47,7 +47,7 @@
</table>
</form>
<if (\Froxlor\User::getAll()['subdomains_used'] < \Froxlor\User::getAll()['subdomains'] || \Froxlor\User::getAll()['subdomains'] == '-1') && 15 < $domains_count && $parentdomains_count != 0 >
<if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') && 15 < $domains_count && $parentdomains_count != 0 >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'domains', 'page' => 'domains', 'action' => 'add'))}">{$lng['domains']['subdomain_add']}</a>

View File

@@ -23,7 +23,7 @@
<img src="templates/{$theme}/assets/img/icons/edit.png" alt="{$lng['panel']['edit']}" title="{$lng['panel']['edit']}" />
</a>&nbsp;
</if>
<if \Froxlor\User::getAll()['logviewenabled'] == '1'>
<if $userinfo['logviewenabled'] == '1'>
<a href="{$linker->getLink(array('section' => 'domains', 'page' => 'logfiles', 'domain_id' => $row['id']))}">
<img src="templates/{$theme}/assets/img/icons/view.png" alt="{$lng['panel']['viewlogs']}" title="{$lng['panel']['viewlogs']}" />
</a>
@@ -33,7 +33,7 @@
<img src="templates/{$theme}/assets/img/icons/delete.png" alt="{$lng['panel']['delete']}" title="{$lng['panel']['delete']}" />
</a>&nbsp;
</if>
<if $row['isbinddomain'] == '1' && \Froxlor\User::getAll()['dnsenabled'] == '1' && $row['caneditdomain'] == '1' && \Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\Settings::Get('system.dnsenabled') == '1'>
<if $row['isbinddomain'] == '1' && $userinfo['dnsenabled'] == '1' && $row['caneditdomain'] == '1' && \Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\Settings::Get('system.dnsenabled') == '1'>
<a href="{$linker->getLink(array('section' => 'domains', 'page' => 'domaindnseditor', 'domain_id' => $row['id']))}">
<img src="templates/{$theme}/assets/img/icons/dns_edit.png" alt="{$lng['dnseditor']['edit']}" title="{$lng['dnseditor']['edit']}" />
</a>&nbsp;

View File

@@ -4,7 +4,7 @@ $header
<h2>
<img src="templates/{$theme}/assets/img/icons/domain_edit_big.png" alt="{$title}" />&nbsp;
{$title}
<if $result['isbinddomain'] == '1' && \Froxlor\User::getAll()['dnsenabled'] == '1' && \Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\Settings::Get('system.dnsenabled') == '1'>
<if $result['isbinddomain'] == '1' && $userinfo['dnsenabled'] == '1' && \Froxlor\Settings::Get('system.bind_enable') == '1' && \Froxlor\Settings::Get('system.dnsenabled') == '1'>
&nbsp;(<small><a href="{$linker->getLink(array('section' => 'domains', 'page' => 'domaindnseditor', 'domain_id' => $id))}">{$lng['dnseditor']['edit']}</a></small>)
</if>
</h2>

View File

@@ -17,7 +17,7 @@
</div>
<if (\Froxlor\User::getAll()['emails_used'] < \Froxlor\User::getAll()['emails'] || \Froxlor\User::getAll()['emails'] == '-1') && $emaildomains_count !=0 >
<if ($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1') && $emaildomains_count !=0 >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'email', 'page' => $page, 'action' => 'add'))}">{$lng['emails']['emails_add']}</a>
@@ -52,7 +52,7 @@
</table>
</form>
<if (\Froxlor\User::getAll()['emails_used'] < \Froxlor\User::getAll()['emails'] || \Froxlor\User::getAll()['emails'] == '-1') && 15 < $emails_count && $emaildomains_count !=0 >
<if ($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1') && 15 < $emails_count && $emaildomains_count !=0 >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'email', 'page' => $page, 'action' => 'add'))}">{$lng['emails']['emails_add']}</a>

View File

@@ -17,7 +17,7 @@
{$searchcode}
</div>
<if (\Froxlor\User::getAll()['ftps_used'] < \Froxlor\User::getAll()['ftps'] || \Froxlor\User::getAll()['ftps'] == '-1') >
<if ($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1') >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'ftp', 'page' => 'accounts', 'action' => 'add'))}">{$lng['ftp']['account_add']}</a>
@@ -51,7 +51,7 @@
</table>
</form>
<if (\Froxlor\User::getAll()['ftps_used'] < \Froxlor\User::getAll()['ftps'] || \Froxlor\User::getAll()['ftps'] == '-1') && 15 < $ftps_count >
<if ($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1') && 15 < $ftps_count >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'ftp', 'page' => 'accounts', 'action' => 'add'))}">{$lng['ftp']['account_add']}</a>

View File

@@ -7,129 +7,129 @@ $header
<div class="grid-g">
<div class="grid-u-1-2" id="statsbox">
<if \Froxlor\User::getAll()['subdomains'] != '0'>
<if $userinfo['subdomains'] != '0'>
<div class="canvasbox">
<input type="hidden" id="subdomains" class="circular" data-used="{\Froxlor\User::getAll()['subdomains_used']}" data-available="{\Froxlor\User::getAll()['subdomains']}">
<input type="hidden" id="subdomains" class="circular" data-used="{$userinfo['subdomains_used']}" data-available="{$userinfo['subdomains']}">
<canvas id="subdomains-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['subdomains']}<br />
<small>
{\Froxlor\User::getAll()['subdomains_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['subdomains'] != '∞'>
{\Froxlor\User::getAll()['subdomains']} {$lng['panel']['available']}
{$userinfo['subdomains_used']} {$lng['panel']['used']}<br />
<if $userinfo['subdomains'] != '∞'>
{$userinfo['subdomains']} {$lng['panel']['available']}
</if>
</small>
</div>
</if>
<if \Froxlor\User::getAll()['diskspace'] != '0'>
<if $userinfo['diskspace'] != '0'>
<div class="canvasbox">
<input type="hidden" id="diskspace" class="circular" data-used="{\Froxlor\User::getAll()['diskspace_used']}" data-available="{\Froxlor\User::getAll()['diskspace']}">
<input type="hidden" id="diskspace" class="circular" data-used="{$userinfo['diskspace_used']}" data-available="{$userinfo['diskspace']}">
<canvas id="diskspace-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['diskspace']}<br />
<small>
{\Froxlor\User::getAll()['diskspace_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['diskspace'] != '∞'>
{\Froxlor\User::getAll()['diskspace']} {$lng['panel']['available']}
{$userinfo['diskspace_used']} {$lng['panel']['used']}<br />
<if $userinfo['diskspace'] != '∞'>
{$userinfo['diskspace']} {$lng['panel']['available']}
</if>
</small>
</div>
</if>
<if \Froxlor\User::getAll()['traffic'] != '0'>
<if $userinfo['traffic'] != '0'>
<div class="canvasbox">
<input type="hidden" id="traffic" class="circular" data-used="{\Froxlor\User::getAll()['traffic_used']}" data-available="{\Froxlor\User::getAll()['traffic']}">
<input type="hidden" id="traffic" class="circular" data-used="{$userinfo['traffic_used']}" data-available="{$userinfo['traffic']}">
<canvas id="traffic-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['traffic']}<br />
<small>
{\Froxlor\User::getAll()['traffic_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['traffic'] != '∞'>
{\Froxlor\User::getAll()['traffic']} {$lng['panel']['available']}
{$userinfo['traffic_used']} {$lng['panel']['used']}<br />
<if $userinfo['traffic'] != '∞'>
{$userinfo['traffic']} {$lng['panel']['available']}
</if>
</small>
</div>
</if>
<if \Froxlor\User::getAll()['emails'] != '0'>
<if $userinfo['emails'] != '0'>
<div class="canvasbox">
<input type="hidden" id="emails" class="circular" data-used="{\Froxlor\User::getAll()['emails_used']}" data-available="{\Froxlor\User::getAll()['emails']}">
<input type="hidden" id="emails" class="circular" data-used="{$userinfo['emails_used']}" data-available="{$userinfo['emails']}">
<canvas id="emails-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['emails']}<br />
<small>
{\Froxlor\User::getAll()['emails_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['emails'] != '∞'>
{\Froxlor\User::getAll()['emails']} {$lng['panel']['available']}
{$userinfo['emails_used']} {$lng['panel']['used']}<br />
<if $userinfo['emails'] != '∞'>
{$userinfo['emails']} {$lng['panel']['available']}
</if>
</small>
</div>
</if>
<if \Froxlor\User::getAll()['email_accounts'] != '0'>
<if $userinfo['email_accounts'] != '0'>
<div class="canvasbox">
<input type="hidden" id="email_accounts" class="circular" data-used="{\Froxlor\User::getAll()['email_accounts_used']}" data-available="{\Froxlor\User::getAll()['email_accounts']}">
<input type="hidden" id="email_accounts" class="circular" data-used="{$userinfo['email_accounts_used']}" data-available="{$userinfo['email_accounts']}">
<canvas id="email_accounts-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['accounts']}<br />
<small>
{\Froxlor\User::getAll()['email_accounts_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['email_accounts'] != '∞'>
{\Froxlor\User::getAll()['email_accounts']} {$lng['panel']['available']}<br />
{$userinfo['email_accounts_used']} {$lng['panel']['used']}<br />
<if $userinfo['email_accounts'] != '∞'>
{$userinfo['email_accounts']} {$lng['panel']['available']}<br />
</if>
{\Froxlor\User::getAll()['mailspace_used']} {$lng['customer']['mib']}
{$userinfo['mailspace_used']} {$lng['customer']['mib']}
</small>
</div>
</if>
<if \Froxlor\User::getAll()['email_forwarders'] != '0'>
<if $userinfo['email_forwarders'] != '0'>
<div class="canvasbox">
<input type="hidden" id="email_forwarders" class="circular" data-used="{\Froxlor\User::getAll()['email_forwarders_used']}" data-available="{\Froxlor\User::getAll()['email_forwarders']}">
<input type="hidden" id="email_forwarders" class="circular" data-used="{$userinfo['email_forwarders_used']}" data-available="{$userinfo['email_forwarders']}">
<canvas id="email_forwarders-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['forwarders']}<br />
<small>
{\Froxlor\User::getAll()['email_forwarders_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['email_forwarders'] != '∞'>
{\Froxlor\User::getAll()['email_forwarders']} {$lng['panel']['available']}
{$userinfo['email_forwarders_used']} {$lng['panel']['used']}<br />
<if $userinfo['email_forwarders'] != '∞'>
{$userinfo['email_forwarders']} {$lng['panel']['available']}
</if>
</small>
</div>
</if>
<if \Froxlor\Settings::Get('system.mail_quota_enabled') == 1 && \Froxlor\User::getAll()['email_quota'] != '0'>
<if \Froxlor\Settings::Get('system.mail_quota_enabled') == 1 && $userinfo['email_quota'] != '0'>
<div class="canvasbox">
<input type="hidden" id="email_quota" class="circular" data-used="{\Froxlor\User::getAll()['email_quota_used']}" data-available="{\Froxlor\User::getAll()['email_quota']}">
<input type="hidden" id="email_quota" class="circular" data-used="{$userinfo['email_quota_used']}" data-available="{$userinfo['email_quota']}">
<canvas id="email_quota-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['email_quota']}<br />
<small>
{\Froxlor\User::getAll()['email_quota_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['email_quota'] != '∞'>
{\Froxlor\User::getAll()['email_quota']} {$lng['panel']['available']}
{$userinfo['email_quota_used']} {$lng['panel']['used']}<br />
<if $userinfo['email_quota'] != '∞'>
{$userinfo['email_quota']} {$lng['panel']['available']}
</if>
</small>
</div>
</if>
<if \Froxlor\User::getAll()['mysqls'] != '0'>
<if $userinfo['mysqls'] != '0'>
<div class="canvasbox">
<input type="hidden" id="mysqls" class="circular" data-used="{\Froxlor\User::getAll()['mysqls_used']}" data-available="{\Froxlor\User::getAll()['mysqls']}">
<input type="hidden" id="mysqls" class="circular" data-used="{$userinfo['mysqls_used']}" data-available="{$userinfo['mysqls']}">
<canvas id="mysqls-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['mysqls']}<br />
<small>
{\Froxlor\User::getAll()['mysqls_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['mysqls'] != '∞'>
{\Froxlor\User::getAll()['mysqls']} {$lng['panel']['available']}<br />
{$userinfo['mysqls_used']} {$lng['panel']['used']}<br />
<if $userinfo['mysqls'] != '∞'>
{$userinfo['mysqls']} {$lng['panel']['available']}<br />
</if>
{\Froxlor\User::getAll()['dbspace_used']} {$lng['customer']['mib']}
{$userinfo['dbspace_used']} {$lng['customer']['mib']}
</small>
</div>
</if>
<if \Froxlor\User::getAll()['ftps'] != '0'>
<if $userinfo['ftps'] != '0'>
<div class="canvasbox">
<input type="hidden" id="ftps" class="circular" data-used="{\Froxlor\User::getAll()['ftps_used']}" data-available="{\Froxlor\User::getAll()['ftps']}">
<input type="hidden" id="ftps" class="circular" data-used="{$userinfo['ftps_used']}" data-available="{$userinfo['ftps']}">
<canvas id="ftps-canvas" width="120" height="76"></canvas><br />
{$lng['customer']['ftps']}<br />
<small>
{\Froxlor\User::getAll()['ftps_used']} {$lng['panel']['used']}<br />
<if \Froxlor\User::getAll()['ftps'] != '∞'>
{\Froxlor\User::getAll()['ftps']} {$lng['panel']['available']}
{$userinfo['ftps_used']} {$lng['panel']['used']}<br />
<if $userinfo['ftps'] != '∞'>
{$userinfo['ftps']} {$lng['panel']['available']}
</if>
</small>
</div>
@@ -163,7 +163,7 @@ $header
<tbody>
<tr>
<td>{$lng['login']['username']}:</td>
<td>{\Froxlor\User::getAll()['loginname']}</td>
<td>{$userinfo['loginname']}</td>
</tr>
<tr>
<td>{$lng['customer']['domains']}:</td>
@@ -189,45 +189,45 @@ $header
</tr>
</thead>
<tbody>
<if \Froxlor\User::getAll()['customernumber'] >
<if $userinfo['customernumber'] >
<tr>
<td>{$lng['customer']['customernumber']}:</td>
<td>{\Froxlor\User::getAll()['customernumber']}</td>
<td>{$userinfo['customernumber']}</td>
</tr>
</if>
<if \Froxlor\User::getAll()['company'] >
<if $userinfo['company'] >
<tr>
<td>{$lng['customer']['company']}:</td>
<td>{\Froxlor\User::getAll()['company']}</td>
<td>{$userinfo['company']}</td>
</tr>
</if>
<if \Froxlor\User::getAll()['name'] >
<if $userinfo['name'] >
<tr>
<td>{$lng['customer']['name']}:</td>
<td>{\Froxlor\User::getAll()['firstname']} {\Froxlor\User::getAll()['name']}</td>
<td>{$userinfo['firstname']} {$userinfo['name']}</td>
</tr>
</if>
<if \Froxlor\User::getAll()['street'] >
<if $userinfo['street'] >
<tr>
<td>{$lng['customer']['street']}:</td>
<td>{\Froxlor\User::getAll()['street']}</td>
<td>{$userinfo['street']}</td>
</tr>
</if>
<if \Froxlor\User::getAll()['city'] >
<if $userinfo['city'] >
<tr>
<td>{$lng['customer']['zipcode']}/{$lng['customer']['city']}:</td>
<td>{\Froxlor\User::getAll()['zipcode']} {\Froxlor\User::getAll()['city']}</td>
<td>{$userinfo['zipcode']} {$userinfo['city']}</td>
</tr>
</if>
<if \Froxlor\User::getAll()['email'] >
<if $userinfo['email'] >
<tr>
<td>{$lng['customer']['email']}:</td>
<td>{\Froxlor\User::getAll()['email']}</td>
<td>{$userinfo['email']}</td>
</tr>
</if>
<if \Froxlor\User::getAll()['custom_notes'] != '' && \Froxlor\User::getAll()['custom_notes_show'] == '1'>
<if $userinfo['custom_notes'] != '' && $userinfo['custom_notes_show'] == '1'>
<tr>
<td colspan="2">{\Froxlor\User::getAll()['custom_notes']}</td>
<td colspan="2">{$userinfo['custom_notes']}</td>
</tr>
</if>
</tbody>

View File

@@ -17,7 +17,7 @@
{$searchcode}
</div>
<if (\Froxlor\User::getAll()['mysqls_used'] < \Froxlor\User::getAll()['mysqls'] || \Froxlor\User::getAll()['mysqls'] == '-1') >
<if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'mysql', 'page' => 'mysqls', 'action' => 'add'))}">{$lng['mysql']['database_create']}</a>
@@ -49,7 +49,7 @@
</table>
</form>
<if (\Froxlor\User::getAll()['mysqls_used'] < \Froxlor\User::getAll()['mysqls'] || \Froxlor\User::getAll()['mysqls'] == '-1') && 15 < $mysqls_count >
<if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') && 15 < $mysqls_count >
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'mysql', 'page' => 'mysqls', 'action' => 'add'))}">{$lng['mysql']['database_create']}</a>

View File

@@ -1,4 +1,4 @@
<if isset(\Froxlor\User::getAll()['loginname'])>
<if isset($userinfo['loginname'])>
</div>
<div class="clear"></div>
</div>

View File

@@ -29,11 +29,11 @@
<link href="templates/{$theme}/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
<link href="templates/{$theme}/assets/img/touchicon.png" rel="shortcut" />
<link href="templates/{$theme}/assets/img/touchicon.png" rel="apple-touch-icon" />
<title><if isset(\Froxlor\User::getAll()['loginname']) && \Froxlor\User::getAll()['loginname'] != ''>{\Froxlor\User::getAll()['loginname']} - </if>Froxlor Server Management Panel</title>
<title><if isset($userinfo['loginname']) && $userinfo['loginname'] != ''>{$userinfo['loginname']} - </if>Froxlor Server Management Panel</title>
</head>
<body>
<if isset(\Froxlor\User::getAll()['loginname'])>
<if isset($userinfo['loginname'])>
<header class="topheader">
<hgroup>
<h1>Froxlor Server Management Panel</h1>
@@ -43,12 +43,12 @@
</a>
<div class="topheader_navigation">
<ul class="topheadernav">
<if \Froxlor\Settings::Get('panel.is_configured') == 0 && \Froxlor\User::getAll()['adminsession'] == 1 && \Froxlor\User::getAll()['change_serversettings'] == 1>
<if \Froxlor\Settings::Get('panel.is_configured') == 0 && $userinfo['adminsession'] == 1 && $userinfo['change_serversettings'] == 1>
<li class="liwarn">
<a href="{$linker->getLink(array('section' => 'configfiles', 'page' => 'configfiles'))}">{$lng['panel']['not_configured']}</a>
</li>
</if>
<li>{\Froxlor\User::getAll()['loginname']}</li>
<li>{$userinfo['loginname']}</li>
<li><a href="{$linker->getLink(array('section' => 'index'))}">{$lng['panel']['dashboard']}</a></li>
<li><a href="#">{$lng['panel']['options']}&nbsp;&#x25BE;</a>
<ul>
@@ -57,10 +57,10 @@
<if \Froxlor\Settings::Get('2fa.enabled') == 1>
<li><a href="{$linker->getLink(array('section' => 'index', 'page' => '2fa'))}">{$lng['2fa']['2fa']}</a></li>
</if>
<if \Froxlor\Settings::Get('panel.allow_theme_change_admin') == '1' && \Froxlor\User::getAll()['adminsession'] == 1>
<if \Froxlor\Settings::Get('panel.allow_theme_change_admin') == '1' && $userinfo['adminsession'] == 1>
<li><a href="{$linker->getLink(array('section' => 'index', 'page' => 'change_theme'))}">{$lng['panel']['theme']}</a></li>
</if>
<if \Froxlor\Settings::Get('panel.allow_theme_change_customer') == '1' && \Froxlor\User::getAll()['adminsession'] == 0>
<if \Froxlor\Settings::Get('panel.allow_theme_change_customer') == '1' && $userinfo['adminsession'] == 0>
<li><a href="{$linker->getLink(array('section' => 'index', 'page' => 'change_theme'))}">{$lng['panel']['theme']}</a></li>
</if>
<if \Froxlor\Settings::Get('api.enabled') == 1>