Update sogo-auth.php
Consistency again. :) I moved the prerequisites require_once to the top, ok?master
parent
0c8f217f49
commit
88fbc6bf16
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
||||
|
||||
/**
|
||||
* currently disabled: we could add auth_request to ningx sogo_eas.template
|
||||
|
@ -35,8 +36,8 @@ $session_variable = 'sogo-sso-user';
|
|||
if (!$ALLOW_ADMIN_EMAIL_LOGIN) {
|
||||
header("Location: /");
|
||||
exit;
|
||||
} else if (isset($_GET['login'])) {
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
||||
}
|
||||
elseif (isset($_GET['login'])) {
|
||||
if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['acl']['login_as'] == "1") {
|
||||
$login = html_entity_decode(rawurldecode($_GET["login"]));
|
||||
if (filter_var($login, FILTER_VALIDATE_EMAIL)) {
|
||||
|
@ -49,9 +50,9 @@ if (!$ALLOW_ADMIN_EMAIL_LOGIN) {
|
|||
}
|
||||
header("Location: /");
|
||||
exit;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// this is an nginx auth_request call, we check for an existing sogo-sso-user session variable
|
||||
session_start();
|
||||
$username = "";
|
||||
if (isset($_SESSION[$session_variable]) && filter_var($_SESSION[$session_variable], FILTER_VALIDATE_EMAIL)) {
|
||||
$username = $_SESSION[$session_variable];
|
||||
|
|
Loading…
Reference in New Issue