At least Zimbra OSE does not provide an internal LDAP field for "User is AS enabled". My workaroud so far:
Additional config file backend/zimbra/config_as_users.php:
!/usr/bin/php
<?php
/*******
* File : config_as_users.php
* Project : Z-Push 2.x & Zimbra backend
* Descr : ActiveSync "allowed users" configuration file
* Info : Adds array with users allowed to use Active Sync, as
* Open Source Zimbra does not allow per-user settings.
*
* Created : 26.05.2013
*
* Copyright 2013 Stefan Onderka (stefan@onderka.com)
*
********/
// *******
// ActiveSync user control settings
// *******
// Array of users allowed to "Active Sync"
$zpush_allowed_users = array("name1.name1@somain.tld",
"name2.name2@somain.tld",
"name3.name3@somain.tld",
"name4.name4@somain.tld");
// Convert array to constant
define('ZPUSH_ALLOWED_USERS', serialize($zpush_allowed_users));
?>
and a mdifiction to backend/zimbra/zimbra.php aroud line #889 right after the beginning of the "Logon" function:
!/usr/bin/php
public function Logon($username, $domain, $password) {
+ // ActiveSync user control:
+ // Constant ZPUSH_ALLOWED_USERS holds serialized
+ // valid users as 'user@domain.tld'
+ // Get Array from constant:
+ $zpush_allowed_users = unserialize(ZPUSH_ALLOWED_USERS);
+ // Is $username contained in $zpush_allowed_users?
+ if ( in_array($username, $zpush_allowed_users, false) ) {
+ // Contained, OK
+ ZLog::Write(LOGLEVEL_INFO, '[ZPUSH_ALLOWED_USERS] Allowed. OK' );
+ } else {
+ // Not contained: STOP
+ ZLog::Write(LOGLEVEL_INFO, '[ZPUSH_ALLOWED_USERS] Not allowed. STOP.
+ exit();
+ }
Wouldn't that be something to integrate for all Zimbra OSE users?
...and of course add
require_once('backend/zimbra/config_as_users.php');
to zimbra.php ;)
If you take a look at the z-push forum - I suggested an alternative method some months ago - that used a file to store the users/devices. It allowed for authorizing users and limiting the number of different devices they could sync at any one time. I posted it hoping it might spur the z-push team on to adding something similar.
http://z-push.sourceforge.net/phpbb/viewtopic.php?f=5&t=2253