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