Code

Added shortcut to acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Jul 2006 06:30:02 +0000 (06:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Jul 2006 06:30:02 +0000 (06:30 +0000)
Added is_moveable acl to user generic

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4216 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_plugin.inc
plugins/personal/generic/class_user.inc
plugins/personal/generic/generic.tpl

index 18b8867f459abd084c3ff62b7305e568cc0b2a3c..3f2a2160a203bd2f0e5de7e42f151a92c03eb7c4 100644 (file)
@@ -1432,6 +1432,13 @@ echo "FIXME: remove_snapshot uses old acl's<br>";
     $ui= get_userinfo();
     return preg_match('/m/', $ui->get_permissions($this->dn, get_class($this), '0'));
   }
+
+
+  function getacl($attribute)
+  {
+    $ui= get_userinfo();
+    return  $ui->get_permissions($this->dn, get_class($this), $attribute));
+  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index 5a8964902122637964c7d7c69905576920d83e8c..40f8176490f3132ecf55e80b66f36e212d3e18cb 100644 (file)
@@ -480,17 +480,22 @@ class user extends plugin
     $ui =get_userinfo();
     foreach($this->attributes as $val){
       $smarty->assign("$val", $this->$val);
-      $smarty->assign("$val"."ACL", $ui->get_permissions($this->dn, "user", $val));
+      $smarty->assign("$val"."ACL", $this->getacl($val));
     }
 
     $smarty->assign("pwmode", $hashes);
     $smarty->assign("pwmode_select", $this->pw_storage);
-    $smarty->assign("passwordStorageACL", $ui->get_permissions($this->dn,"user", "userPassword"));
+    $smarty->assign("passwordStorageACL", $this->getacl("userPassword"));
     $smarty->assign("base_select",      $this->base);
-    $smarty->assign("baseACL",          $ui->get_permissions($this->dn,"user", "base"));
-    $smarty->assign("selectmode",       $ui->get_permissions($this->dn,"user", "create"));
-    $smarty->assign("CertificatesACL",  $ui->get_permissions($this->dn,"user", "Certificate"));
-    $smarty->assign("userPictureACL",     $ui->get_permissions($this->dn,"user", "userPicture"));
+    $smarty->assign("CertificatesACL",  $this->getacl("Certificate"));
+    $smarty->assign("userPictureACL",   $this->getacl("userPicture"));
+
+    /* Create base acls */
+    $baseACL = $this->("base");
+    if(!$this->acl_is_moveable()) {
+      $baseACL = preg_replace("/w/","",$baseACL);
+    }
+    $smarty->assign("baseACL",          $baseACL);
 
     /* Show us the edit screen */
     @$smarty->assign("bases", $this->allowedBasesToMoveTo());
@@ -506,14 +511,14 @@ class user extends plugin
       $smarty->assign("ivbbmodes", $ivbbmodes);
       foreach ($this->govattrs as $val){
         $smarty->assign("$val", $this->$val);
-        $smarty->assign("$val"."ACL", $ui->get_permissions($this->dn,"user",$val));
+        $smarty->assign("$val"."ACL", $this->getacl($val));
       }
     } else {
       $smarty->assign("governmentmode", "false");
     }
 
     /* Special mode for uid */
-    $uidACL= $ui->get_permissions($this->dn,"user", "uid");
+    $uidACL= $this->getacl("uid");
     if (isset ($this->dn)){
       if ($this->dn != "new"){
         $uidACL= preg_replace("/w/","",$uidACL);
index bac5756b1741bce8c4ba268d304d82bb7e7599a3..a1f4b9e6381e55d72fff14cd6e48f772484030fa 100644 (file)
      <td>
       <div style="height:10px;"></div>
        {render acl=$baseACL}
-               <select id="base" size="1" name="base" {$selectmode} title="{t}Choose subtree to place user in{/t}">
+               <select id="base" size="1" name="base" title="{t}Choose subtree to place user in{/t}">
                        {html_options options=$bases selected=$base_select}
                </select>
-               {if $selectmode==""}
-                       <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
-               {else}
-                       <img src="images/folder_gray.png" class="center" title="{t}Select a base{/t}">
-               {/if}
+               <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
        {/render}
      </td>
     </tr>