Authentication: Added some polish, Cancel links, PHP 8.1 updates.

This commit is contained in:
fusionate
2023-06-23 00:14:07 +00:00
parent 7c85bc95f6
commit 6bcc5aff5e
9 changed files with 47 additions and 23 deletions
@@ -40,7 +40,7 @@ class authentication {
}
//set the default authentication method to the database
if (!is_array($_SESSION['authentication']['methods'])) {
if (empty($_SESSION['authentication']['methods']) || !is_array($_SESSION['authentication']['methods'])) {
$_SESSION['authentication']['methods'][] = 'database';
}
@@ -53,7 +53,7 @@ class authentication {
foreach ($_SESSION['authentication']['methods'] as $name) {
//already processed the plugin move to the next plugin
if (!empty($_SESSION['authentication']['plugin']) && $_SESSION['authentication']['plugin'][$name]['authorized']) {
if (!empty($_SESSION['authentication']['plugin']) && !empty($_SESSION['authentication']['plugin'][$name]) && $_SESSION['authentication']['plugin'][$name]['authorized']) {
continue;
}
@@ -468,4 +468,4 @@ $response = $auth->validate();
print_r($response);
*/
?>
?>
@@ -75,6 +75,7 @@ class plugin_email {
$view->assign("login_logo_height", $settings['theme']['login_logo_height']);
$view->assign("login_logo_source", $settings['theme']['logo']);
$view->assign("button_login", $text['button-login']);
$view->assign("button_cancel", $text['button-cancel']);
//show the views
$content = $view->render('username.htm');
@@ -255,6 +256,7 @@ class plugin_email {
$view->assign("login_logo_height", $settings['theme']['login_logo_height']);
$view->assign("login_logo_source", $settings['theme']['logo']);
$view->assign("button_verify", $text['label-verify']);
$view->assign("button_cancel", $text['button-cancel']);
//debug information
//echo "<pre>\n";
@@ -391,4 +393,4 @@ class plugin_email {
}
}
?>
?>
@@ -81,6 +81,7 @@ class plugin_totp {
$view->assign("login_logo_height", $settings['theme']['login_logo_height']);
$view->assign("login_logo_source", $settings['theme']['logo']);
$view->assign("button_login", $text['button-login']);
$view->assign("button_cancel", $text['button-cancel']);
$view->assign("favicon", $settings['theme']['favicon']);
//show the views
@@ -114,7 +115,7 @@ class plugin_totp {
$sql .= " username = :username\n";
$sql .= " or user_email = :username\n";
$sql .= ")\n";
if ($_SESSION["users"]["unique"]["text"] != "global") {
if (empty($_SESSION["users"]["unique"]["text"]) || $_SESSION["users"]["unique"]["text"] != "global") {
//unique username per domain (not globally unique across system - example: email address)
$sql .= "and domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $this->domain_uuid;
@@ -164,6 +165,7 @@ class plugin_totp {
$view->init();
//assign values to the template
$view->assign("project_path", PROJECT_PATH);
$view->assign("login_destination_url", $settings['login']['destination']);
$view->assign("favicon", $settings['theme']['favicon']);
$view->assign("login_title", $text['label-verify']);
@@ -172,6 +174,7 @@ class plugin_totp {
$view->assign("login_logo_height", $settings['theme']['login_logo_height']);
$view->assign("login_logo_source", $settings['theme']['logo']);
$view->assign("favicon", $settings['theme']['favicon']);
$view->assign("button_cancel", $text['button-cancel']);
//show the views
if ($_SESSION['authentication']['plugin']['database']['authorized'] && empty($this->user_totp_secret)) {
@@ -362,4 +365,4 @@ class plugin_totp {
}
}
?>
?>