refactor global array

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 20:31:17 +01:00
parent 5fa0f4b87e
commit c5a58e3f36
68 changed files with 646 additions and 613 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 = $userinfo['adminid'];
$uid = \Froxlor\User::getAll()['adminid'];
} elseif (AREA == 'customer') {
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `type_2fa` = :t2fa, `data_2fa` = :d2fa WHERE customerid = :id");
$uid = $userinfo['customerid'];
$uid = \Froxlor\User::getAll()['customerid'];
}
$success_message = "";
@@ -68,7 +68,7 @@ if ($action == 'delete') {
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed 2fa::overview");
if ($userinfo['type_2fa'] == '0') {
if (\Froxlor\User::getAll()['type_2fa'] == '0') {
// available types
$type_select_values = array(
@@ -81,10 +81,10 @@ if ($userinfo['type_2fa'] == '0') {
foreach ($type_select_values as $_val => $_type) {
$type_select .= \Froxlor\UI\HTML::makeoption($_type, $_val);
}
} elseif ($userinfo['type_2fa'] == '1') {
} elseif (\Froxlor\User::getAll()['type_2fa'] == '1') {
// email 2fa enabled
} elseif ($userinfo['type_2fa'] == '2') {
} elseif (\Froxlor\User::getAll()['type_2fa'] == '2') {
// authenticator 2fa enabled
$ga_qrcode = $tfa->getQRCodeImageAsDataUri($userinfo['loginname'], $userinfo['data_2fa']);
$ga_qrcode = $tfa->getQRCodeImageAsDataUri(\Froxlor\User::getAll()['loginname'], \Froxlor\User::getAll()['data_2fa']);
}
eval("echo \"" . \Froxlor\UI\Template::getTemplate("2fa/overview", true) . "\";");