From c6f81fe67bfee66a0b3dca5119cda8cb0b7b11f9 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 16 Sep 2017 13:33:27 +0200 Subject: [PATCH] [Web] Fix autodiscover merge on user.php --- data/web/autoconfig.php | 26 +++++++++++++------------- data/web/autodiscover.php | 28 ++++++++++++++-------------- data/web/inc/prerequisites.inc.php | 4 +++- data/web/user.php | 21 +++++++++------------ 4 files changed, 39 insertions(+), 40 deletions(-) diff --git a/data/web/autoconfig.php b/data/web/autoconfig.php index c905c325..58d6fec1 100644 --- a/data/web/autoconfig.php +++ b/data/web/autoconfig.php @@ -4,7 +4,7 @@ $default_autodiscover_config = $autodiscover_config; if(file_exists('inc/vars.local.inc.php')) { include_once 'inc/vars.local.inc.php'; } -$configuration = array_merge($default_autodiscover_config, $autodiscover_config); +$autodiscover_config = array_merge($default_autodiscover_config, $autodiscover_config); error_reporting(0); @@ -33,15 +33,15 @@ header('Content-Type: application/xml'); mail server - - + + SSL %EMAILADDRESS% password-cleartext - - + + STARTTLS %EMAILADDRESS% password-cleartext @@ -51,8 +51,8 @@ header('Content-Type: application/xml'); $records = dns_get_record('_pop3s._tcp.' . $domain, DNS_SRV); // check if POP3 is announced as "not provided" via SRV record if (count($records) == 0 || $records[0]['target'] != '') { ?> - - + + SSL %EMAILADDRESS% password-cleartext @@ -62,8 +62,8 @@ if (count($records) == 0 || $records[0]['target'] != '') { ?> $records = dns_get_record('_pop3._tcp.' . $domain, DNS_SRV); // check if POP3 is announced as "not provided" via SRV record if (count($records) == 0 || $records[0]['target'] != '') { ?> - - + + STARTTLS %EMAILADDRESS% password-cleartext @@ -71,15 +71,15 @@ if (count($records) == 0 || $records[0]['target'] != '') { ?> - - + + SSL %EMAILADDRESS% password-cleartext - - + + STARTTLS %EMAILADDRESS% password-cleartext diff --git a/data/web/autodiscover.php b/data/web/autodiscover.php index 975fd3e0..551cc6dc 100644 --- a/data/web/autodiscover.php +++ b/data/web/autodiscover.php @@ -5,7 +5,7 @@ $default_autodiscover_config = $autodiscover_config; if(file_exists('inc/vars.local.inc.php')) { include_once 'inc/vars.local.inc.php'; } -$configuration = array_merge($default_autodiscover_config, $autodiscover_config); +$autodiscover_config = array_merge($default_autodiscover_config, $autodiscover_config); // Redis $redis = new Redis(); @@ -17,14 +17,14 @@ $data = trim(file_get_contents("php://input")); // Desktop client needs IMAP, unless it's Outlook 2013 or higher on Windows if (strpos($data, 'autodiscover/outlook/responseschema') !== false) { // desktop client - $configuration['autodiscoverType'] = 'imap'; - if ($configuration['useEASforOutlook'] == 'yes' && + $autodiscover_config['autodiscoverType'] = 'imap'; + if ($autodiscover_config['useEASforOutlook'] == 'yes' && // Office for macOS does not support EAS strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') === false && // Outlook 2013 (version 15) or higher preg_match('/(Outlook|Office).+1[5-9]\./', $_SERVER['HTTP_USER_AGENT']) ) { - $configuration['autodiscoverType'] = 'activesync'; + $autodiscover_config['autodiscoverType'] = 'activesync'; } } @@ -88,7 +88,7 @@ else { $displayname = $email; } - if ($configuration['autodiscoverType'] == 'imap') { + if ($autodiscover_config['autodiscoverType'] == 'imap') { ?> @@ -99,8 +99,8 @@ else { settings IMAP - - + + off off @@ -109,8 +109,8 @@ else { SMTP - - + + off off @@ -121,13 +121,13 @@ else { CalDAV - https:///SOGo/dav//Calendar + https:///SOGo/dav//Calendar off CardDAV - https:///SOGo/dav//Contacts + https:///SOGo/dav//Contacts off @@ -135,7 +135,7 @@ else { en:en @@ -147,8 +147,8 @@ else { MobileSync - - + + diff --git a/data/web/inc/prerequisites.inc.php b/data/web/inc/prerequisites.inc.php index a394943e..0ba894f7 100644 --- a/data/web/inc/prerequisites.inc.php +++ b/data/web/inc/prerequisites.inc.php @@ -1,8 +1,10 @@