Code

user management acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Aug 2006 09:19:54 +0000 (09:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Aug 2006 09:19:54 +0000 (09:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4464 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_userManagement.inc
plugins/personal/connectivity/class_oxchangeAccount.inc
plugins/personal/netatalk/class_netatalk.inc

index 8e7f6415f5d3211649881503dfbdf87600bf5d9c..45a3c6d3ddf99940eeed8991f451694c589549ce 100644 (file)
@@ -130,9 +130,6 @@ class userManagement extends plugin
          above dialog */
       add_lock ($this->dn, $this->ui->dn);
 
-      /* Set up the users ACL's for this 'dn' */
-      $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
-
       /* Register usertab to trigger edit dialog */
       $this->usertab= new usertabs($this->config, 
           $this->config->data['TABS']['USERTABS'], $this->dn);
@@ -182,13 +179,11 @@ class userManagement extends plugin
 
       /* Load permissions for selected 'dn' and check if
          we're allowed to remove this 'dn' */
-      $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
-      $acl= get_module_permission($acl, "user", $this->dn);
-      if (chkacl($acl, "password") == ""){
+      $ui = get_userinfo();
+      if (preg_match("/w/",$ui->get_permissions($this->dn,"users/password"))){
 
         /* User is allowed to change passwords, save 'dn' and 'acl' for next
            dialog. */
-        $this->acl= $acl;
         $_SESSION['objectinfo']= $this->dn;
         return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
 
@@ -297,26 +292,17 @@ class userManagement extends plugin
 
       /* Load permissions for selected 'dn' and check if
          we're allowed to remove this 'dn' */
-      $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
-      $this->acl= get_module_permission($acl, "user", $this->dn);
-      if (chkacl($this->acl, "delete") == ""){
-
-        /* Check locking, save current plugin in 'back_plugin', so
-           the dialog knows where to return. */
-        if (($user= get_lock($this->dn)) != ""){
-          return(gen_locked_message ($user, $this->dn));
-        }
 
-        /* Lock the current entry, so nobody will edit it during deletion */
-        add_lock ($this->dn, $this->ui->dn);
-        $smarty->assign("info", sprintf(_("You're about to delete the user %s."), @LDAP::fix($this->dn)));
-        return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
-      } else {
-
-        /* Obviously the user isn't allowed to delete. Show message and
-           clean session. */
-        print_red (_("You are not allowed to delete this user!"));
+      /* Check locking, save current plugin in 'back_plugin', so
+         the dialog knows where to return. */
+      if (($user= get_lock($this->dn)) != ""){
+        return(gen_locked_message ($user, $this->dn));
       }
+
+      /* Lock the current entry, so nobody will edit it during deletion */
+      add_lock ($this->dn, $this->ui->dn);
+      $smarty->assign("info", sprintf(_("You're about to delete the user %s."), @LDAP::fix($this->dn)));
+      return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
     }
 
 
@@ -434,11 +420,11 @@ class userManagement extends plugin
       foreach ($this->config->departments as $key => $value){
     
         /* Get acls from different ou's */
-        $acl= get_permissions (get_people_ou().$value, $this->ui->subtreeACL);
-        $acl= get_module_permission($acl, "user", get_people_ou().$value);
-  
+        $ui  = get_userinfo();
+        $acl = $ui->get_permissions("cn=dummy,".$this->DivListUsers->selectedBase,"users/user")       ; 
         /* If creation of a new user is allowed, append this template */
-        if (chkacl($acl, "create") == ""){
+        if (preg_match("/cw/",$acl)){
           
           /* Search all templates from the current dn */
           $ldap->cd (get_people_ou().$value);
@@ -596,10 +582,6 @@ class userManagement extends plugin
       $this->usertab->adapt_from_template($template_dn);
       $template_base            = preg_replace("/^[^,]+,".normalizePreg(get_people_ou())."/", '', $template_dn);
       $this->usertab->by_object['user']->base= $template_base;
-
-      /* Set up the users ACL's for this 'dn' */
-      $acl= get_permissions ($template_base, $this->ui->subtreeACL);
-      $this->usertab->set_acl($acl);
     }
    
  
@@ -798,11 +780,8 @@ class userManagement extends plugin
       if($s_action == "copy"){
         $this->CopyPasteHandler->Clear();
         $dn= $this->list[trim($s_entry)]['dn'];
-        $acl= get_permissions ($dn, $this->ui->subtreeACL);
         $obj    = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
         $objNew = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], "new");
-        $obj->set_acl($acl);
-        $objNew->set_acl($acl);
         $this->CopyPasteHandler->Copy($obj,$objNew);
       }
 
@@ -811,9 +790,7 @@ class userManagement extends plugin
       if($s_action == "cut"){
         $this->CopyPasteHandler->Clear();
         $dn= $this->list[trim($s_entry)]['dn'];
-        $acl= get_permissions ($dn, $this->ui->subtreeACL);
         $obj= new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
-        $obj->set_acl($acl);
         $this->CopyPasteHandler->Cut($obj);
       }
     }
index ba08ff19fda7e1ee919b5d4674cc8bc927fe41c2..5a89f8dd4a43124369441508f6e5fe612ddcd044 100644 (file)
@@ -589,7 +589,9 @@ class oxchangeAccount extends plugin
     }
 
     $this->dnmode= $this->config->current['DNMODE'];
-    $this->dnModeValue = $this->attrs[$this->dnmode][0];
+    if(isset($this->attrs[$this->dnmode][0])){
+      $this->dnModeValue = $this->attrs[$this->dnmode][0];
+    }
   }
 
   function execute()
index e68bc4b6e84119bf3d0389d097e2e6e85302d46b..54c2c6f782a13ce7738eb1bae3ecf283e0315ec0 100644 (file)
@@ -76,7 +76,7 @@ class netatalk extends plugin {
     $this->shares = array();
     $ldap = $this->config->get_ldap_link();
 
-    if($this->dn === "new" || $this->dn == NULL) {
+    if(($this->dn != "new" && $this->dn != NULL)) {
       $ldap->cd($this->parent->by_object['user']->base);
     } else {
       $ldap->cd ($this->dn);