thomas: server/kolab-webadmin/kolab-webadmin/www/admin/maintainer index.php.in, 1.3, 1.4

cvs at kolab.org cvs at kolab.org
Tue Jan 22 19:36:22 CET 2008


Author: thomas

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/maintainer
In directory doto:/tmp/cvs-serv21978/kolab-webadmin/kolab-webadmin/www/admin/maintainer

Modified Files:
	index.php.in 
Log Message:
Adjusted common code in management pages to look the same for easier comparison.
This fixed some variable initialisations.


Index: index.php.in
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/maintainer/index.php.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- index.php.in	21 Nov 2007 18:11:37 -0000	1.3
+++ index.php.in	22 Jan 2008 18:36:20 -0000	1.4
@@ -1,6 +1,6 @@
 <?php
 /*
- *  Copyright (c) 2004 Klarälvdalens Datakonsult AB
+ *  Copyright (c) 2004-2005 Klarälvdalens Datakonsult AB
  *
  *    Written by Steffen Hansen <steffen at klaralvdalens-datakonsult.se>
  *
@@ -29,7 +29,8 @@
 $sidx = 'maintainer';
 
 if( $auth->group() != 'admin' ) {
-   array_push($errors, _("Error: You don't have Permissions to access this Menu"));
+  debug("auth->group=".$auth->group());
+  array_push($errors, _("Error: You don't have Permissions to access this Menu"));
 }
 
 require_once('@kolab_php_module_prefix at admin/include/menu.php');
@@ -46,6 +47,7 @@
 else $page = "1";
 
 // Get all entries & dynamically split the letters with growing entries
+$entries = array();
 if( !$errors ) {
   if (isset($_SESSION['base_dn'])) $base_dn = $_SESSION['base_dn'];
   else $base_dn = 'k=kolab';
@@ -56,7 +58,8 @@
   $result = ldap_search($ldap->connection, $base_dn, $filter, array( 'uid', 'sn', 'cn', 'kolabDeleteflag' ));
 
   if( $result ) {
-	$title = _('Manage Maintainers (').count($maintainers)._(' Maintainers)');
+	$count = count($maintainers)-1;
+	$title = _('Manage Maintainers (').$count._(' Maintainers)');
 	// if there are more than 2000 entries, split in 26 categories for every letter,
 	// or if more than 50, put in groups, or else just show all.
 	if (false && $count > 2000) {
@@ -76,16 +79,16 @@
 		$attrs = ldap_get_attributes($ldap->connection, $entry);
 		$dn = ldap_get_dn($ldap->connection,$entry);
 		$deleted = array_key_exists('kolabDeleteflag',$attrs)?$attrs['kolabDeleteflag'][0]:"FALSE";
-        $userid = $attrs['uid'][0];
-        $sn = $attrs['sn'][0];
-        $cn = $attrs['cn'][0];
-        $fn = KolabLDAP::getGivenName($cn, $sn);
+		$uid = $attrs['uid'][0];
+		$sn = $attrs['sn'][0];
+		$cn = $attrs['cn'][0];
+		$fn = KolabLDAP::getGivenName($cn, $sn);
 		// skip admins and maintainers
 		if( array_key_exists( $dn, $maintainers ) ) {
 		  $entries[] = array( 'dn' => $dn,
 							  'sn' => $sn,
 							  'fn' => $fn,
-							  'uid' => $userid,
+							  'uid' => $uid,
 							  'deleted' => $deleted );
 		}
 		$entry = ldap_next_entry( $ldap->connection,$entry );





More information about the commits mailing list