Code

Some mimetype acl fixes.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 12:04:05 +0000 (12:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 12:04:05 +0000 (12:04 +0000)
Fixed acl C&P detection for user/groups/ogroups

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

plugins/admin/applications/class_applicationManagement.inc
plugins/admin/groups/class_groupManagement.inc
plugins/admin/mimetypes/class_mimetypeManagement.inc
plugins/admin/mimetypes/generic.tpl
plugins/admin/users/class_divListUsers.inc
plugins/admin/users/class_userManagement.inc

index 4ba527185a31917bb3082a4470931cb18cfe4a5e..801ca3fe6268847ea647622a53ecf8b47b7f3b13 100644 (file)
@@ -452,16 +452,14 @@ class applicationManagement extends plugin
     if($s_action == "copy"){
       $this->CopyPasteHandler->Clear();
       $dn = $this->applications[$s_entry]['dn'];
-      
+
       /* Check Acls */
       $acl_all= $this->ui->has_complete_category_acls($dn,"application");  
-      if(!preg_match("/(c.*w|w.*c)/",$acl_all)){
-        return("");
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+        $obj    = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn,  "application");
+        $objNew = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], "new","application");
+        $this->CopyPasteHandler->Copy($obj,$objNew);
       }
-
-      $obj    = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn,  "application");
-      $objNew = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], "new","application");
-      $this->CopyPasteHandler->Copy($obj,$objNew);
     }
 
     /* Copy current object to CopyHandler
@@ -472,12 +470,10 @@ class applicationManagement extends plugin
 
       /* Check Acls */
       $acl_all= $this->ui->has_complete_category_acls($dn,"application");  
-      if(!preg_match("/(c.*w|w.*c)/",$acl_all)){
-        return("");
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+        $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn, "application");
+        $this->CopyPasteHandler->Cut($obj);
       }
-
-      $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn, "application");
-      $this->CopyPasteHandler->Cut($obj);
     }
   }
 
index d3af7a032014ba94f3d0f401d765d7c1692e3c49..0fab284e7b081b5c8183c32804f0a3a1ec9702a6 100644 (file)
@@ -508,8 +508,8 @@ class groupManagement extends plugin
     if($s_action == "copy"){
 
       $dn  = $this->grouplist[trim($s_entry)]['dn'];
-      $acl = $this->ui->get_permissions($dn,"groups/group");
-      if(preg_match("/(c.*w|w.*c)/",$acl)){
+      $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"groups") ;
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
 
         $this->CopyPasteHandler->Clear();
         $obj    = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
@@ -529,8 +529,8 @@ class groupManagement extends plugin
     if($s_action == "cut"){
       
       $dn = $this->grouplist[trim($s_entry)]['dn'];
-      $acl = $this->ui->get_permissions($dn,"groups/group");
-      if(preg_match("/(c.*w|w.*c)/",$acl)){
+      $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"groups") ;
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
 
         $this->CopyPasteHandler->Clear();
         $obj= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
index 3ee002eca2626df699727e1c159ee9e43422b597..3f04ac0aadb7da952ed264d0f24b5225eff0b9f4 100755 (executable)
@@ -446,11 +446,16 @@ class mimetypeManagement extends plugin
     if($s_action == "copy"){
       $this->CopyPasteHandler->Clear();
       $dn = $this->mimetypes[$s_entry]['dn'];
-      $obj    = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes");
-      $obj->set_acl_base($this->dn);
-      $objNew = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], "new","mimetypes");
-      $objNew->set_acl_base($this->dn);
-      $this->CopyPasteHandler->Copy($obj,$objNew);
+
+      /* Check acls */
+      $acl_all= $this->ui->has_complete_category_acls($dn,"ogroups");
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+        $obj    = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes");
+        $obj->set_acl_base($this->dn);
+        $objNew = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], "new","mimetypes");
+        $objNew->set_acl_base($this->dn);
+        $this->CopyPasteHandler->Copy($obj,$objNew);
+      }
     }
 
     /* Copy current object to CopyHandler
@@ -458,8 +463,13 @@ class mimetypeManagement extends plugin
     if($s_action == "cut"){
       $this->CopyPasteHandler->Clear();
       $dn = $this->mimetypes[$s_entry]['dn'];
-      $obj = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn);
-      $this->CopyPasteHandler->Cut($obj);
+
+      /* Check acls */
+      $acl_all= $this->ui->has_complete_category_acls($dn,"ogroups");
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+        $obj = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn);
+        $this->CopyPasteHandler->Cut($obj);
+      }
     }
   }
 
index 50a83fa6cf8557db6a3ad106e548a4616adbd1f0..f61803d9e0539a0e78cd9fbdc50bf0a77386ef36 100644 (file)
@@ -6,7 +6,6 @@
        </tr>
        <tr>
                <td style='width:50%; vertical-align:top;' >
-                               
                        <table>
                                <tr>
                                        <td>
 {/render}
                                        </td>
                                </tr>
+{if !$isReleaseMimeType} 
                                <tr>
                                        <td><LABEL for="base">{t}Base{/t}{$must}</LABEL></td>
                                        <td>
-{render acl=$baseACL}
-       <select size="1" id="base" name="base" title="{t}Choose subtree to place application in{/t}"
-               {if $isReleaseMimeType} disabled {/if}>
-               {html_options options=$bases selected=$base_select}
-       </select>
-{/render}
-{if !$isReleaseMimeType}
-{render acl=$baseACL disable_picture='images/folder_gray.png'}
-        <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
-{/render}
-{/if}
+       {render acl=$baseACL}
+               <select size="1" id="base" name="base" title="{t}Choose subtree to place application in{/t}"
+                       {html_options options=$bases selected=$base_select}
+               </select>
+       {/render}
+       {if !$isReleaseMimeType}
+               {render acl=$baseACL disable_picture='images/folder_gray.png'}
+                       <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
+               {/render}
+       {/if}
                                        </td>
                                 </tr>
 
+{/if}
                        </table>
                        
                </td>
index c6accea237b0b0291a38ac84c6df9642236b9feb..3edbf604d41ec5f1ec1f4e5a236eb6844fae1c60 100644 (file)
@@ -104,7 +104,7 @@ class divListUsers extends MultiSelectWindow
     }
 
     /* Get copy & paste icon */
-    $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users/user") ;
+    $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users") ;
     $acl      = $ui->get_permissions($this->selectedBase,"users/user");
     if(preg_match("/(c.*w|w.*c)/",$acl_all) &&  $this->parent->CopyPasteHandler){
       $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
@@ -243,7 +243,7 @@ class divListUsers extends MultiSelectWindow
       $action= "";
 
       /* Add copy & cut icons */     
-      $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users/user") ;
+      $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users") ;
       $acl      = $ui->get_permissions($val['dn'],"users/user");
       if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
         $action .= "<input class='center' type='image'
index ce9b646ccc3fa79c16063069ae9fe996f9586fff..c0042797a60a184c1b8ec58f9e99d9cff82d85f2 100644 (file)
@@ -827,8 +827,8 @@ class userManagement extends plugin
         $dn= $this->list[trim($s_entry)]['dn'];
 
         /* Check acl */
-        $acl = $this->ui->get_permissions($dn,"users/user");
-        if(preg_match("/(c.*w|w.*c)/",$acl)){
+        $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users") ;
+        if(preg_match("/(c.*w|w.*c)/",$acl_all)){
           $obj    = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
           $obj->set_acl_base($dn);
           $objNew = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], "new");
@@ -847,8 +847,8 @@ class userManagement extends plugin
         $dn= $this->list[trim($s_entry)]['dn'];
 
         /* Check acl */
-        $acl = $this->ui->get_permissions($dn,"users/user");
-        if(preg_match("/(c.*w|w.*c)/",$acl)){
+        $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users") ;
+        if(preg_match("/(c.*w|w.*c)/",$acl_all)){
           $obj= new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
           $obj->set_acl_base($dn);
           $this->CopyPasteHandler->Cut($obj);