Code

Updated list for roles
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Apr 2010 08:48:54 +0000 (08:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Apr 2010 08:48:54 +0000 (08:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17769 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc

index 5eeaa315078d7153c49845f5be106c8530c1eb78..70920c79500b35ed08b5ee35012442ea0d148b87 100644 (file)
@@ -94,8 +94,8 @@ class roleGeneric extends plugin {
     $this->memberList->setEditable(false);
     $this->memberList->setWidth("100%");
     $this->memberList->setHeight("300px");
-    $this->memberList->setHeader(array("~",_("Name"),_("Uid")));
-    $this->memberList->setColspecs(array('20px','*','*','20px'));
+    $this->memberList->setHeader(array('~',_("Given name"),_("Surename"),_("Uid")));
+    $this->memberList->setColspecs(array('20px','*','*','*','20px'));
     $this->memberList->setDefaultSortColumn(1);
   }
 
@@ -106,7 +106,7 @@ class roleGeneric extends plugin {
   function reload()
   {
     // Entries can't be added twice. 
-    $attrs = array("description", "objectClass", "uid","cn");
+    $attrs = array("description", "objectClass", "uid","cn",'sn','givenName');
     $this->roleOccupant = array_unique($this->roleOccupant);
     $this->roleOccupant = array_values($this->roleOccupant);
   
@@ -215,18 +215,16 @@ class roleGeneric extends plugin {
       $data[$key] = $dn;
       if(isset($this->roleOccCache[$dn])){
         $icon = image('plugins/users/images/select_user.png');
-        $entry = $this->roleOccCache[$dn];
-        $name = $entry['cn']['0'];
-        $uid = $entry['uid']['0'];
-        if(isset($entry['description'][0])){
-          $name .= " [".$entry['description'][0]."]";
-        }
+        $entry     = $this->roleOccCache[$dn];
+        $sn        = $entry['sn']['0'];
+        $givenName = $entry['givenName']['0'];
+        $uid       = $entry['uid']['0'];
       }else{
-        $name = _("Unknown")."&nbsp;".$dn;
-        $uid = "&nbsp;";
+        $sn = $givenName = _("Unknown");
+        $uid = LDAP::fix($dn);
         $icon = image('images/false.png');
       }
-      $lData[$key] = array('data' => array($icon, $name, $uid));
+      $lData[$key] = array('data' => array($icon,$givenName,$sn, $uid));
     }
 
     $this->memberList->setListData($data,$lData);