gunnar: server/php-kolab/Kolab_Webadmin/Webadmin ldap.class.php, 1.11, 1.12 locale.php, 1.5, 1.6 object.php, 1.3, 1.4 user.class.php, 1.7, 1.8 webadmin.class.php, 1.10, 1.11

cvs at kolab.org cvs at kolab.org
Mon Sep 17 20:01:24 CEST 2007


Author: gunnar

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

Modified Files:
	ldap.class.php locale.php object.php user.class.php 
	webadmin.class.php 
Log Message:
Fixes for repearing the new webadmin list view.

Index: ldap.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/ldap.class.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ldap.class.php	22 Aug 2007 17:33:23 -0000	1.11
+++ ldap.class.php	17 Sep 2007 18:01:22 -0000	1.12
@@ -357,8 +357,8 @@
 
             $this->sort($result, $sort);
 
-            $from = ($page - 1) * $perpage;
-            $to   = $page * $perpage;
+            $from = $page * $perpage;
+            $to   = ($page + 1) * $perpage;
 
             return $this->getEntrySection($result, $from, $to);
         }

Index: locale.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/locale.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6

Index: object.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/object.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- object.php	22 Aug 2007 17:33:23 -0000	1.3
+++ object.php	17 Sep 2007 18:01:22 -0000	1.4
@@ -208,6 +208,8 @@
         if (isset($this->_cache[KOLAB_ATTR_CN])) {
             $cn = $this->_cache[KOLAB_ATTR_CN];
         }
+		var_dump(array($sn, $cn));
+		
         return $this->_ldap->getFirstName($sn, $cn);
     }
     
@@ -281,6 +283,78 @@
         return substr(get_class($this), 5);
     }
 
+    
+    /**
+     * Return a list view renderer for this type of object
+     *
+     * @return 
+     */
+    function getListView()
+    {
+        return PEAR::raiseError(_("Not implemented!"));
+    }
+    
 };
 
+class KolabObjectListView {
+
+    /**
+     * The object to display
+     *
+     * @var KolabObject
+     */
+    var $_object;
+
+    /**
+     * Return a list header for this type of object
+     *
+     * @return 
+     */
+    function KolabObjectListView($object)
+    {
+        $this->_object = $object;
+    }
+    
+    /**
+     * Return a list title for this type of object
+     *
+     * @return 
+     */
+    function getTitle()
+    {
+        return PEAR::raiseError(_("Not implemented!"));
+    }
+
+    /**
+     * Return a list header for this type of object
+     *
+     * @return 
+     */
+    function getHeader()
+    {
+        return PEAR::raiseError(_("Not implemented!"));
+    }
+    
+    /**
+     * Return a list entry for this object
+     *
+     * @return 
+     */
+    function getRow()
+    {
+        return PEAR::raiseError(_("Not implemented!"));
+    }
+    
+
+}
+
+/*
+  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.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- user.class.php	22 Aug 2007 13:25:00 -0000	1.7
+++ user.class.php	17 Sep 2007 18:01:22 -0000	1.8
@@ -224,9 +224,86 @@
    }
         
     }
+
+    function getName() 
+    {
+        return $this->getSn() . ', ' . $this->getFn();
+    }
+    
     
 
+    /**
+     * Return a list view renderer for users
+     *
+     * @return 
+     */
+    function getListView()
+    {
+		$renderer = &new KolabUserListView($this);
+        return $renderer;
+    }
+    
 };
+
+class KolabUserListView extends KolabObjectListView {
+
+    /**
+     * Return a list title for this type of object
+     *
+     * @return 
+     */
+    function getTitle()
+    {
+        return _("Email Users");
+    }
+
+    /**
+     * Return a list header for this type of object
+     *
+     * @return 
+     */
+    function getHeader()
+    {
+        $type = '<th>' . _("Type") . '</th>';
+        $name = '<th>' . _("Name") . '</th>';
+        $mail = '<th>' . _("E-mail") . '</th>';
+        $uid = '<th>' . _("uid") . '</th>';
+        $action = '<th colspan="2">' . _("Action") . '</th>';
+        return $type . $name . $mail . $uid . $action;
+    }
+    
+    /**
+     * Return a list entry for this object
+     *
+     * @return 
+     */
+    function getRow()
+    {
+        if ($this->_object->getType() == 'U') {
+            $type = '<td class="contentcell" title="' . _("User Account") . '" align="center">U</td>';
+        } elseif ($this->_object->getType() == 'G') {
+            $type = '<td class="contentcell" title="' . _("Group Account") . '" align="center">G</td>';
+        } elseif ($this->_object->getType() == 'R') {
+            $type = '<td class="contentcell" title="' . _("Resource Account") . '" align="center">R</td>';
+        } else {
+            $type = '<td class="contentcell" title="' . _("Unknown Account Type") . '" align="center">?</td>';
+        }
+        $name = '<td class="contentcell">' . htmlspecialchars($this->_object->getName()) . '</td>';
+        $email = htmlspecialchars($this->_object->getMail());
+        $mail = '<td class="contentcell"><a href="mailto:' . $email . '">' . $email . '</a></td>';
+        $uid = '<td class="contentcell">' . htmlspecialchars($this->_object->getUid()) . '</td>';
+        
+        if ($this->_object->getDeleted()) {
+            $action = '<td class="actioncell" colspan="2">' . _("User Deleted, awaiting cleanup...") . '</td>';
+        } else {
+            $action = '<td class="actioncell" align="center"><a href="user.php?action=modify&dn=' . urlencode($this->_object->getDn()) . '">' . _("Modify") . '</a></td>' .
+                '<td class="actioncell" align="center"><a href="user.php?action=delete&dn=' . urlencode($this->_object->getDn()) . '">' . _("Delete") . '</a></td>';
+        }
+        return $type . $name . $mail . $uid . $action;
+    }
+    
+
+}
 
 /*
   Local variables:

Index: webadmin.class.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Webadmin/Webadmin/webadmin.class.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- webadmin.class.php	22 Aug 2007 17:33:23 -0000	1.10
+++ webadmin.class.php	17 Sep 2007 18:01:22 -0000	1.11
@@ -523,7 +523,8 @@
         } else {
             $domainfilter = '';
         }
-	$addfilter = $userfilter . $alphafilter . $domainfilter;
+        $addfilter = $userfilter . $alphafilter . $domainfilter;
+	
         if (!empty($addfilter)) {
             $addfilter = '(&' . $addfilter . ')';
         }





More information about the commits mailing list