diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index d05f6255c..1425ea3aa 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -812,12 +812,6 @@ function check_login($user, $pass, $app_passwd_data = false) { global $redis; global $imap_server; - if ($app_passwd_data === false) { - $app_passwd_data['eas'] = false; - $app_passwd_data['dav'] = false; - $app_passwd_data['proxyauth'] = false; - } - if (!filter_var($user, FILTER_VALIDATE_EMAIL) && !ctype_alnum(str_replace(array('_', '.', '-'), '', $user))) { $_SESSION['return'][] = array( 'type' => 'danger', @@ -943,8 +937,8 @@ function check_login($user, $pass, $app_passwd_data = false) { 'log' => array(__FUNCTION__, $user, '*'), 'msg' => array('logged_in_as', $user) ); - if ($app_passwd_data['proxyauth'] === true) { - $service = ($app_passwd_data['eas'] === true) ? 'EAS' : (($app_passwd_data['dav'] === true) ? 'DAV' : 'SSO'); + if ($app_passwd_data['eas'] === true || $app_passwd_data['dav'] === true) { + $service = ($app_passwd_data['eas'] === true) ? 'EAS' : 'DAV'; $stmt = $pdo->prepare("REPLACE INTO sasl_log (`service`, `app_password`, `username`, `real_rip`) VALUES (:service, :app_id, :username, :remote_addr)"); $stmt->execute(array( ':service' => $service, diff --git a/data/web/sogo-auth.php b/data/web/sogo-auth.php index 3c0130da8..1e1632324 100644 --- a/data/web/sogo-auth.php +++ b/data/web/sogo-auth.php @@ -23,7 +23,7 @@ if (isset($_SERVER['PHP_AUTH_USER'])) { elseif (preg_match('/^(\/SOGo|)\/Microsoft-Server-ActiveSync.*/', $original_uri) === 1) { $is_eas = true; } - $login_check = check_login($username, $password, array('dav' => $is_dav, 'eas' => $is_eas, 'proxyauth' => true)); + $login_check = check_login($username, $password, array('dav' => $is_dav, 'eas' => $is_eas)); if ($login_check === 'user') { header("X-User: $username"); header("X-Auth: Basic ".base64_encode("$username:$password"));