gunnar: server/php-kolab/Kolab_Webadmin/Webadmin address.class.php, NONE, 1.1 administrator.class.php, NONE, 1.1 maintainer.class.php, NONE, 1.1 domainmaintainer.class.php, 1.1, 1.2 group.class.php, 1.1, 1.2 ldap.class.php, 1.5, 1.6 sharedfolder.class.php, 1.1, 1.2 user.class.php, 1.3, 1.4 webadmin.class.php, 1.5, 1.6

cvs at kolab.org cvs at kolab.org
Wed Aug 22 08:33:57 CEST 2007


Author: gunnar

Update of /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin
In directory doto:/tmp/cvs-serv664/Webadmin

Modified Files:
	domainmaintainer.class.php group.class.php ldap.class.php 
	sharedfolder.class.php user.class.php webadmin.class.php 
Added Files:
	address.class.php administrator.class.php maintainer.class.php 
Log Message:
Draft version for the new way to generate listings in the Kolab web admin.

--- NEW FILE: address.class.php ---
<?php
/*  
 *  COPYRIGHT
 *  ---------
 *
 *  See ../AUTHORS file
 *
 *
 *  LICENSE
 *  -------
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  $Revision: 1.1 $
 *
 *  ABOUT
 *  -----
 *
 *  A class for Kolab address management.
 *
 */

/**
 * This class provides methods to deal with global address book
 * entries for Kolab.
 *
 * $Header: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/address.class.php,v 1.1 2007/08/22 06:33:55 gunnar Exp $
 *
 * @author  Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
 * @author  Gunnar Wrobel  <wrobel at pardus.de>
 * @package Kolab_Webadmin
 */
class KolabAddress {

    /**
     * Return a list of all addresses
     *
     * @param KolabLDAP $ldap      The connection to the Kolab LDAP filter.
     * @param string    $base_dn   Base DN for the search
     * @param string    $addfilter Additional LDAP filter criteria.
     * @param int       $perpage   Maximal entries per page
     * @param int       $page      Start with this page
     *
     * @return array An array of address information
     */
    function getAddresses($ldap, $base_dn, $addfilter = '', $perpage = 50, $page = 1)
    {
		$filter = "(&$addfilter(objectclass=inetOrgPerson)(!(uid=*))(sn=*))";
		$result = $ldap->getPagedResult($base_dn, $filter, 
										array( 'mail', 'sn', 'cn', 
											   'kolabDeleteflag' )
										'sn', $perpage, $page);
        
		$entries = array();
		foreach($result as $attrs) {
			$deleted = array_key_exists('kolabDeleteflag', $attrs)?$attrs['kolabDeleteflag'][0]:'FALSE';
			$fn = $this->_ldap->getFirstName($attrs['sn'][0], $attrs['cn'][0]);
			$entries[] = array( 'dn' => $attrs['dn'][0],
								'sn' => $attrs['sn'][0],
								'fn' => $fn,
								'mail' => $attrs['mail'][0],
								'deleted' => $deleted );
        }
        return $entries;
    }

};

/*
  Local variables:
  mode: php
  indent-tabs-mode: f
  tab-width: 4
  buffer-file-coding-system: utf-8
  End:
  vim:encoding=utf-8:
 */
?>

--- NEW FILE: administrator.class.php ---
<?php
/*  
 *  COPYRIGHT
 *  ---------
 *
 *  See ../AUTHORS file
 *
 *
 *  LICENSE
 *  -------
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  $Revision: 1.1 $
 *
 *  ABOUT
 *  -----
 *
 *  A class for Kolab administrator management.
 *
 */

/**
 * This class provides methods to deal with administrator
 * entries for Kolab.
 *
 * $Header: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/administrator.class.php,v 1.1 2007/08/22 06:33:55 gunnar Exp $
 *
 * @author  Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
 * @author  Gunnar Wrobel  <wrobel at pardus.de>
 * @package Kolab_Webadmin
 */
class KolabAdministrator {

    /**
     * Return a list of all administrators
     *
     * @param KolabLDAP $ldap      The connection to the Kolab LDAP filter.
     * @param string    $base_dn   Base DN for the search
     * @param string    $addfilter Additional LDAP filter criteria.
     * @param int       $perpage   Maximal entries per page
     * @param int       $page      Start with this page
     *
     * @return array An array of administrator information
     */
    function getAdministrators($ldap, $base_dn, $addfilter = '', $perpage = 50, $page = 1)
    {
		$filter = "(&$addfilter(cn=*)(objectclass=inetOrgPerson)(uid=*)(sn=*))";
		$result = $ldap->getPagedResult($base_dn, $filter, 
										array('uid', 'sn', 
											  'cn', 'kolabDeleteflag'),
										'sn', $perpage, $page);
        
		$entries = array();
		foreach($result as $attrs) {
			$deleted = array_key_exists('kolabDeleteflag', $attrs)?$attrs['kolabDeleteflag'][0]:'FALSE';
			$fn = $this->_ldap->getFirstName($attrs['sn'][0], $attrs['cn'][0]);
			$entries[] = array( 'dn' => $attrs['dn'][0],
								'sn' => $attrs['sn'][0],
								'fn' => $fn,
								'uid' => $attrs['uid'][0],
								'deleted' => $deleted );
		}
        return $entries;
    }

};

/*
  Local variables:
  mode: php
  indent-tabs-mode: f
  tab-width: 4
  buffer-file-coding-system: utf-8
  End:
  vim:encoding=utf-8:
 */
?>

--- NEW FILE: maintainer.class.php ---
<?php
/*  
 *  COPYRIGHT
 *  ---------
 *
 *  See ../AUTHORS file
 *
 *
 *  LICENSE
 *  -------
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  $Revision: 1.1 $
 *
 *  ABOUT
 *  -----
 *
 *  A class for Kolab maintainer management.
 *
 */

/**
 * This class provides methods to deal with maintainer
 * entries for Kolab.
 *
 * $Header: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/maintainer.class.php,v 1.1 2007/08/22 06:33:55 gunnar Exp $
 *
 * @author  Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
 * @author  Gunnar Wrobel  <wrobel at pardus.de>
 * @package Kolab_Webadmin
 */
class KolabMaintainer {

    /**
     * Return a list of all maintainers
     *
     * @param KolabLDAP $ldap      The connection to the Kolab LDAP filter.
     * @param string    $base_dn   Base DN for the search
     * @param string    $addfilter Additional LDAP filter criteria.
     * @param int       $perpage   Maximal entries per page
     * @param int       $page      Start with this page
     *
     * @return array An array of maintainer information
     */
    function getMaintainers($ldap, $base_dn, $addfilter = '', $perpage = 50, $page = 1)
    {
		$filter = "(&$addfilter(cn=*)(objectclass=inetOrgPerson)(!(uid=manager))(sn=*))";
		$result = $ldap->getPagedResult($base_dn, $filter, 
										array('uid', 'sn', 
											  'cn', 'kolabDeleteflag'),
										'sn', $perpage, $page);
        
		$entries = array();
		foreach($result as $attrs) {
			$deleted = array_key_exists('kolabDeleteflag', $attrs)?$attrs['kolabDeleteflag'][0]:'FALSE';
			$fn = $this->_ldap->getFirstName($attrs['sn'][0], $attrs['cn'][0]);
			$entries[] = array( 'dn' => $attrs['dn'][0],
								'sn' => $attrs['sn'][0],
								'fn' => $fn,
								'uid' => $attrs['uid'][0],
								'deleted' => $deleted );
		}
        return $entries;
    }

};

/*
  Local variables:
  mode: php
  indent-tabs-mode: f
  tab-width: 4
  buffer-file-coding-system: utf-8
  End:
  vim:encoding=utf-8:
 */
?>

Index: domainmaintainer.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/domainmaintainer.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- domainmaintainer.class.php	21 Aug 2007 17:13:44 -0000	1.1
+++ domainmaintainer.class.php	22 Aug 2007 06:33:55 -0000	1.2
@@ -57,6 +57,42 @@
     var $_dn;
 
     /**
+     * Return a list of all domain maintainers
+     *
+     * @param KolabLDAP $ldap      The connection to the Kolab LDAP filter.
+     * @param string    $base_dn   Base DN for the search
+     * @param string    $addfilter Additional LDAP filter criteria.
+     * @param int       $perpage   Maximal entries per page
+     * @param int       $page      Start with this page
+     *
+     * @return array An array of domain maintainer information
+     */
+    function getDomainMaintainers($ldap, $base_dn, $addfilter = '', $perpage = 50, $page = 1)
+    {
+		$filter = "(&$addfilter(cn=*)(objectclass=kolabInetOrgPerson)(!(uid=manager))(sn=*))";
+		$result = $ldap->getPagedResult($base_dn, $filter, 
+										array( 'uid', 'sn', 'cn', 
+											   'kolabDeleteflag' )
+										'sn', $perpage, $page);
+        
+		$entries = array();
+		foreach($result as $attrs) {
+			$deleted = array_key_exists('kolabDeleteflag', $attrs)?$attrs['kolabDeleteflag'][0]:'FALSE';
+			$fn = $this->_ldap->getFirstName($attrs['sn'][0], $attrs['cn'][0]);
+			$dn = $attrs['dn'][0];
+			$dm =& new KolabDomainMaintainer($ldap, $dn);
+			$domains = join(' ', $dm->domains());
+			$entries[] = array( 'dn' => $dn,
+								'sn' => $attrs['sn'][0],
+								'fn' => $fn,
+								'uid' => $attrs['uid'][0],
+								'domains' => $domains,
+								'deleted' => $deleted );
+        }
+        return $entries;
+    }
+
+    /**
      * Initialize the class.
      *
      * @param KolabLDAP $ldap Kolab LDAP connection

Index: group.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/group.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- group.class.php	21 Aug 2007 17:13:44 -0000	1.1
+++ group.class.php	22 Aug 2007 06:33:55 -0000	1.2
@@ -1,3 +1,80 @@
+<?php
+/*  
+ *  COPYRIGHT
+ *  ---------
+ *
+ *  See ../AUTHORS file
+ *
+ *
+ *  LICENSE
+ *  -------
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  $Revision$
+ *
+ *  ABOUT
+ *  -----
+ *
+ *  A class for Kolab group (distribution list) management.
+ *
+ */
+
+/**
+ * This class provides methods to deal with groups for Kolab.
+ *
+ * $Header$
+ *
+ * @author  Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
+ * @author  Gunnar Wrobel  <wrobel at pardus.de>
+ * @package Kolab_Webadmin
+ */
+class KolabGroup {
+
+    /**
+     * Return a list of all groups
+     *
+     * @param KolabLDAP $ldap      The connection to the Kolab LDAP filter.
+     * @param string    $base_dn   Base DN for the search
+     * @param string    $addfilter Additional LDAP filter criteria.
+     * @param int       $perpage   Maximal entries per page
+     * @param int       $page      Start with this page
+     *
+     * @return array An array of group information
+     */
+    function getGroups($ldap, $base_dn, $addfilter = '', $perpage = 50, $page = 1)
+    {
+		$filter = "(&$addfilter(!(cn=domains))(objectclass=kolabGroupOfNames)";
+		$result = $ldap->getPagedResult($base_dn, $filter, 
+										array( 'mail', 'cn', 
+											   'kolabDeleteflag' )
+										'cn', $perpage, $page);
+        
+		$entries = array();
+		foreach($result as $attrs) {
+			$deleted = array_key_exists('kolabDeleteflag', $attrs)?$attrs['kolabDeleteflag'][0]:'FALSE';
+			$internal = (strpos($attrs['dn'][0], 'cn=internal') !== false);
+			$entries[] = array( 'dn' => $attrs['dn'][0],
+								'cn' => $attrs['cn'][0],
+								'internal' => $internal,
+								'mail' => $attrs['mail'][0],
+								'deleted' => $deleted );
+        }
+        return $entries;
+    }
+
     function groupForUid($uid) {
         $group = false;
         if (!$this->_bound) {
@@ -55,3 +132,15 @@
         return $this->_doDeleteObject($dn, $delete_now, false);
     }
 
+};
+
+/*
+  Local variables:
+  mode: php
+  indent-tabs-mode: f
+  tab-width: 4
+  buffer-file-coding-system: utf-8
+  End:
+  vim:encoding=utf-8:
+ */
+?>

Index: ldap.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/ldap.class.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ldap.class.php	21 Aug 2007 17:13:44 -0000	1.5
+++ ldap.class.php	22 Aug 2007 06:33:55 -0000	1.6
@@ -293,9 +293,11 @@
     /**
      * Retrieve a certain section of the results.
      *
-     * @param int  $result The result ID
-     * @param int  $from   Fetch the entries from here including this one
-     * @param int  $to     Fetch the entries to here excluding this one
+     * @param int  $result  The result ID
+     * @param int  $from    Get the results starting here, 
+	 *                      including this entry
+     * @param int  $to      Get the results ending here,
+	 *                      excluding this entry
 	 *
      * @return array The result entries
 	 */
@@ -323,6 +325,35 @@
 	}
 
     /**
+     * Retrieve a certain section of the results.
+     *
+     * @param int    $result     The result ID
+     * @param string $base_dn    Base DN for the search
+     * @param array  $attributes Attributes to return with the search
+     * @param string $sort       Sort criterium
+     * @param int    $perpage    Maximal entries per page
+     * @param int    $page       Start with this page
+	 *
+     * @return array The result entries
+	 */
+	function getPagedResult($base_dn, $filter, $attributes, 
+							$sort, $perpage, $page)
+	{
+        $result = $ldap->search($base_dn, $filter, $attributes);
+
+        if( $result ) {
+
+            $this->_ldap->sort($result, $sort);
+
+			$from = ($page - 1) * $perpage;
+			$to   = $page * $perpage;
+
+			return getEntrySection($result, $from, $to);
+		}
+		return array();
+	}
+
+    /**
      * Read object data.
      *
      * @param string $dn The object to retrieve.
@@ -626,6 +657,18 @@
         return true;
     }
 
+    /**
+     * Get first name
+     *
+     * @param string  $sn The last name
+     * @param string  $cn The common name
+	 *
+     * @return string The extracted first name
+	 */
+	function getFirstName($sn, $cn) 
+	{
+		return substr($cn, 0, strlen($cn) - strlen($sn));
+	}
 };
 
 /*

Index: sharedfolder.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/sharedfolder.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sharedfolder.class.php	21 Aug 2007 17:13:44 -0000	1.1
+++ sharedfolder.class.php	22 Aug 2007 06:33:55 -0000	1.2
@@ -1,4 +1,108 @@
-    function deleteSharedFolder($dn, $delete_now = false) {
+<?php
+/*  
+ *  COPYRIGHT
+ *  ---------
+ *
+ *  See ../AUTHORS file
+ *
+ *
+ *  LICENSE
+ *  -------
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  $Revision$
+ *
+ *  ABOUT
+ *  -----
+ *
+ *  A class for Kolab shared folder management.
+ *
+ */
+
+/**
+ * This class provides methods to deal with shared folders
+ * entries for Kolab.
+ *
+ * $Header$
+ *
+ * @author  Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
+ * @author  Gunnar Wrobel  <wrobel at pardus.de>
+ * @package Kolab_Webadmin
+ */
+class KolabSharedFolder {
+
+    /**
+     * The list of possible folder types
+     *
+     * @var array
+     */
+    var $type_map = array(''        => _('Unspecified'), 
+                          'mail'    => _('Mails'), 
+                          'task'    => _('Tasks'), 
+                          'journal' => _('Journals'),
+                          'event'   => _('Events'), 
+                          'contact' => _('Contacts'), 
+                          'note'    => _('Notes'));
+
+    /**
+     * Return a list of all shared folders
+     *
+     * @param KolabLDAP $ldap      The connection to the Kolab LDAP filter.
+     * @param string    $base_dn   Base DN for the search
+     * @param string    $addfilter Additional LDAP filter criteria.
+     * @param int       $perpage   Maximal entries per page
+     * @param int       $page      Start with this page
+     *
+     * @return array An array of shared folder information
+     */
+    function getSharedFolderss($ldap, $base_dn, $addfilter = '', $perpage = 50, $page = 1)
+    {
+        $filter = "(&$addfilter(objectclass=kolabSharedFolder))";
+		$result = $ldap->getPagedResult($base_dn, $filter, 
+										array('cn', 'kolabDeleteflag',
+                                              'kolabFolderType'),
+										'cn', $perpage, $page);
+        
+		$entries = array();
+		foreach($result as $attrs) {
+			$deleted = array_key_exists('kolabDeleteflag', $attrs)?$attrs['kolabDeleteflag'][0]:'FALSE';
+			$fn = $this->_ldap->getFirstName($attrs['sn'][0], $attrs['cn'][0]);
+            $folderType = KolabSharedFolder::type_map[$attrs['kolabFolderType'][0]];
+			$entries[] = array( 'dn'         => $attrs['dn'][0],
+								'cn'         => $attrs['cn'][0],
+								'foldertype' => $folderType,
+								'deleted'    => $deleted );
+		}
+        return $entries;
+    }
+
+    function deleteSharedFolder($dn, $delete_now = false) 
+    {
         return $this->_doDeleteObject($dn, $delete_now, false);
     }
+  }
 
+
+/*
+  Local variables:
+  mode: php
+  indent-tabs-mode: f
+  tab-width: 4
+  buffer-file-coding-system: utf-8
+  End:
+  vim:encoding=utf-8:
+ */
+?>

Index: user.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/user.class.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- user.class.php	21 Aug 2007 17:13:44 -0000	1.3
+++ user.class.php	22 Aug 2007 06:33:55 -0000	1.4
@@ -116,7 +116,7 @@
             (array)$this->_ldap->groupMembers( "cn=internal,$base_dn", 'maintainer' ) 
         );
 
-        $filter = "($addfilter(objectclass=kolabInetOrgPerson)(uid=*)(mail=*)(sn=*))";
+        $filter = "(&$addfilter(objectclass=kolabInetOrgPerson)(uid=*)(mail=*)(sn=*))";
         $result = $ldap->search($base_dn, $filter, 
 								array( 'uid', 'mail', 'sn', 'cn', 
 									   'kolabDeleteflag' ));
@@ -125,10 +125,7 @@
 
             $this->_ldap->sort($result, 'sn');
 
-			$from = ($page - 1) * $perpage);
-			$to   = $page * $perpage;
-
-			$ldap_entries = getEntrySection($result, $from, $to);
+			$ldap_entries = getEntrySection($result, $perpage, $page);
 
 			$entries = array();
             foreach($ldap_entries as $attrs) {

Index: webadmin.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/webadmin.class.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- webadmin.class.php	21 Aug 2007 17:13:44 -0000	1.5
+++ webadmin.class.php	22 Aug 2007 06:33:55 -0000	1.6
@@ -52,7 +52,12 @@
 require_once 'Kolab/Webadmin/form.class.php';
 
 /** Provide access to the Kolab specific objects. */
+require_once 'Kolab/Webadmin/address.class.php';
+require_once 'Kolab/Webadmin/administrator.class.php';
 require_once 'Kolab/Webadmin/domainmaintainer.class.php';
+require_once 'Kolab/Webadmin/group.class.php';
+require_once 'Kolab/Webadmin/maintainer.class.php';
+require_once 'Kolab/Webadmin/sharedfolder.class.php';
 require_once 'Kolab/Webadmin/user.class.php';
 
 /**
@@ -490,20 +495,20 @@
         if( !empty( $filtervalue ) ) {
             switch( $filtertype ) {
             case 'contains': // contains
-                return $filterattr . '=*' .
-                    $this->_ldap->escape($filtervalue) . '*';
+                return '(' . $filterattr . '=*' .
+                    $this->_ldap->escape($filtervalue) . '*)';
             case 'is': // is
-                return $filterattr . '=' .
-                    $this->_ldap->escape($filtervalue);
+                return '(' . $filterattr . '=' .
+                    $this->_ldap->escape($filtervalue) . ')';
             case 'begins': // begins with
-                return $filterattr . '=' .
-                    $this->_ldap->escape($filtervalue) . '*';
+                return '(' . $filterattr . '=' .
+                    $this->_ldap->escape($filtervalue) . '*)';
             case 'ends': // ends with
-                return $filterattr . '=*' .
-                    $this->_ldap->escape($filtervalue);
+                return '(' . $filterattr . '=*' .
+                    $this->_ldap->escape($filtervalue) . ')';
             default:
-                return $filterattr . '=*' .
-                    $this->_ldap->escape($filtervalue) . '*';
+                return '(' . $filterattr . '=*' .
+                    $this->_ldap->escape($filtervalue) . '*)';
             }
         }
         return '';
@@ -544,8 +549,75 @@
         $alphafilter  = $this->buildAlphaFilter();
         $domainfilter = $this->buildDomainFilter();
 
-        $users = $this->getUsersInterface();
-        return $users->getUsers("&($userfilter)$domainfilter$alphafilter");
+        return KolabUser::getUsers("$userfilter$domainfilter$alphafilter");
+    }
+   
+    /**
+     * Return the visible addresses
+     */
+    function getVisibleAddresses()
+    {
+        $userfilter   = $this->buildUserFilter();
+        $alphafilter  = $this->buildAlphaFilter();
+
+        return KolabAddress::getAddresses("$userfilter$alphafilter");
+    }
+   
+    /**
+     * Return the visible administrators
+     */
+    function getVisibleAdministrators()
+    {
+        $userfilter   = $this->buildUserFilter();
+        $alphafilter  = $this->buildAlphaFilter();
+
+        return KolabAdministrator::getAdministrators("$userfilter$alphafilter");
+    }
+   
+    /**
+     * Return the visible maintainers
+     */
+    function getVisibleMaintainers()
+    {
+        $userfilter   = $this->buildUserFilter();
+        $alphafilter  = $this->buildAlphaFilter();
+
+        return KolabMaintainer::getMaintainers("$userfilter$alphafilter");
+    }
+   
+    /**
+     * Return the visible domain maintainers
+     */
+    function getVisibleDomainMaintainers()
+    {
+        $userfilter   = $this->buildUserFilter();
+        $alphafilter  = $this->buildAlphaFilter();
+
+        return KolabDomainMaintainer::getDomainMaintainers("$userfilter$alphafilter");
+    }
+   
+    /**
+     * Return the visible groups
+     */
+    function getVisibleGroups()
+    {
+        $userfilter   = $this->buildUserFilter();
+        $alphafilter  = $this->buildAlphaFilter();
+        $domainfilter = $this->buildDomainFilter();
+
+        return KolabGroup::getGroups("$userfilter$alphafilter$domainfilter");
+    }
+   
+    /**
+     * Return the visible shared folders
+     */
+    function getVisibleSharedFolders()
+    {
+        $userfilter   = $this->buildUserFilter();
+        $alphafilter  = $this->buildAlphaFilter();
+        $domainfilter = $this->buildDomainFilter();
+
+        return KolabSharedFolders::getSharedFolders("$userfilter$alphafilter$domainfilter");
     }
    
 





More information about the commits mailing list