Code

Added ACLs to ldap server selection in terminal and workstation startup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Nov 2008 15:00:41 +0000 (15:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Nov 2008 15:00:41 +0000 (15:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12876 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc
gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc

index 7f9c678394ffd444555c53b887de56574ca3e656..df75154e034900df3b167ce59a30302166967872 100644 (file)
@@ -71,9 +71,21 @@ class termstartup extends plugin
 
     $this->orig_dn= $this->dn;
 
-    foreach($this->config->data['SERVERS']['LDAP'] as $server) {
-      $this->gotoLdapServerList[]= $server;
+    /* Creating a list of valid Mirrors
+     * none will not be saved to ldap.
+     */
+    $ldap   = $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    $ui = get_userinfo();
+    foreach($this->config->data['SERVERS']['LDAP'] as $dn => $data){
+      if($ui->get_category_permissions($data['dn'],"server",TRUE)){
+        for($i = 0; $i < $data['goLdapBase']['count']; $i ++){
+          $name = $data["cn"][0].":".$data["goLdapBase"][$i];
+          $this->gotoLdapServerList[]= $name;
+        }
+      }
     }
+
     if(isset($this->attrs['gotoLdapServer'])){
       unset($this->attrs['gotoLdapServer']['count']);
       sort($this->attrs['gotoLdapServer']);
index da4a7d674251387f1212461898f481ef3ff38c62..ceaf0cf2371ed23db85def291988f2286fd05ea1 100644 (file)
@@ -90,8 +90,14 @@ class workstartup extends plugin
      */
     $ldap   = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
-    foreach($this->config->data['SERVERS']['LDAP'] as $server) {
-      $this->gotoLdapServerList[]= $server; 
+    $ui = get_userinfo();
+    foreach($this->config->data['SERVERS']['LDAP'] as $dn => $data){
+      if($ui->get_category_permissions($data['dn'],"server",TRUE)){
+        for($i = 0; $i < $data['goLdapBase']['count']; $i ++){
+          $name = $data["cn"][0].":".$data["goLdapBase"][$i];
+          $this->gotoLdapServerList[]= $name; 
+        }
+      }
     }
 
     /* Get list of assigned ldap servers