Skip to content

Commit 4238133

Browse files
committed
Merge branch 'master' into '135-sync-issues-when-using-altnames-to-login'
# Conflicts: # lib/grommunio/grommunio.php
2 parents 208551b + 22f2119 commit 4238133

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

lib/grommunio/grommunio.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ class Grommunio extends InterProcessData implements IBackend, ISearchProvider, I
3939
private $stateFolder;
4040
private $userDeviceData;
4141

42-
// gromox config parameter for PR_EC_ENABLED_FEATURES / PR_EC_DISABLED_FEATURES
43-
public const MOBILE_ENABLED = 'mobile';
44-
4542
public const MAXAMBIGUOUSRECIPIENTS = 9999;
4643
public const FREEBUSYENUMBLOCKS = 50;
4744
public const MAXFREEBUSYSLOTS = 32767; // max length of 32k for the MergedFreeBusy element is allowed
@@ -3045,28 +3042,9 @@ private function getAddressbookDir() {
30453042
* @throws FatalException if user is disabled for grommunio-sync
30463043
*/
30473044
private function isGSyncEnabled() {
3048-
$addressbook = $this->getAddressbook();
30493045
// this check needs to be performed on the store of the main (authenticated) user
3050-
$storeProps = mapi_getprops($this->storeCache[$this->mainUser], [PR_MAILBOX_OWNER_ENTRYID, PR_EC_ENABLED_FEATURES_L]);
3051-
$mobileDisabled = !($storeProps[PR_EC_ENABLED_FEATURES_L] & UP_EAS);
3052-
if (!$mobileDisabled) {
3053-
$mailuser = mapi_ab_openentry($addressbook, $storeProps[PR_MAILBOX_OWNER_ENTRYID]);
3054-
$enabledFeatures = mapi_getprops($mailuser, [PR_EC_DISABLED_FEATURES, PR_SMTP_ADDRESS]);
3055-
// g-sync135: always use SMTP address (issue with altnames)
3056-
if (isset($enabledFeatures[PR_SMTP_ADDRESS])) {
3057-
Request::SetUserIdentifier($enabledFeatures[PR_SMTP_ADDRESS]);
3058-
}
3059-
if (isset($enabledFeatures[PR_EC_DISABLED_FEATURES]) && is_array($enabledFeatures[PR_EC_DISABLED_FEATURES])) {
3060-
$mobileDisabled = in_array(self::MOBILE_ENABLED, $enabledFeatures[PR_EC_DISABLED_FEATURES]);
3061-
$deviceId = Request::GetDeviceID();
3062-
// Checks for deviceId present in zarafaDisabledFeatures LDAP array attribute. Check is performed case insensitive.
3063-
$deviceIdDisabled = (($deviceId !== null) && in_array($deviceId, array_map('strtolower', $enabledFeatures[PR_EC_DISABLED_FEATURES]))) ? true : false;
3064-
if ($deviceIdDisabled) {
3065-
throw new FatalException(sprintf("User has deviceId %s disabled for usage with grommunio-sync.", $deviceId));
3066-
}
3067-
}
3068-
}
3069-
if ($mobileDisabled) {
3046+
$storeProps = mapi_getprops($this->storeCache[$this->mainUser], [PR_EC_ENABLED_FEATURES_L]);
3047+
if (!($storeProps[PR_EC_ENABLED_FEATURES_L] & UP_EAS)) {
30703048
throw new FatalException("User is disabled for grommunio-sync.");
30713049
}
30723050

lib/grommunio/mapiprovider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,8 +2492,8 @@ private function isDST($localtime, $tz) {
24922492
}
24932493

24942494
$year = gmdate("Y", $localtime);
2495-
$start = $this->getTimestampOfWeek($year, $tz["dststartmonth"], $tz["dststartday"], $tz["dststartweek"], $tz["dststarthour"], $tz["dststartminute"], $tz["dststartsecond"]);
2496-
$end = $this->getTimestampOfWeek($year, $tz["dstendmonth"], $tz["dstendday"], $tz["dstendweek"], $tz["dstendhour"], $tz["dstendminute"], $tz["dstendsecond"]);
2495+
$start = $this->getTimestampOfWeek($year, $tz["dststartmonth"], $tz["dststartweek"], $tz["dststartday"], $tz["dststarthour"], $tz["dststartminute"], $tz["dststartsecond"]);
2496+
$end = $this->getTimestampOfWeek($year, $tz["dstendmonth"], $tz["dstendweek"], $tz["dstendday"], $tz["dstendhour"], $tz["dstendminute"], $tz["dstendsecond"]);
24972497

24982498
if ($start < $end) {
24992499
// northern hemisphere (july = dst)

0 commit comments

Comments
 (0)