Code

Fixed edit in addressbook
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Dec 2006 05:25:38 +0000 (05:25 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Dec 2006 05:25:38 +0000 (05:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5301 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/addressbook/class_addressbook.inc
plugins/addons/addressbook/contents.tpl

index 74377a86f9398e7c1e4f45b6cb82d9c3a3edda52..7b7b95ca0365ea5138364883e2b1e426bbda6641 100644 (file)
@@ -131,6 +131,7 @@ class addressbook extends plugin
     $acl = $this->get_entry_acls($this->abobjectclass.",".$phonefilter['search_base']);
     $smarty->assign("internal_createable", preg_match("/c/",$acl));
     $smarty->assign("internal_removeable", preg_match("/d/",$acl));
+    $smarty->assign("internal_editable",   preg_match("/w/",$acl));
 
     /* Perform actions with CTI hook */
     if (isset($_GET['target'])
@@ -537,7 +538,7 @@ class addressbook extends plugin
       foreach ($this->attributes as $name){
 
         /* Skip entries we are not allowed to read */
-        if(!preg_match("/r/",$this->get_entry_acls($_SESSION['show_info'],$name))){
+        if(!preg_match("/r/",$this->get_entry_acls($this->dn,$name))){
           $smarty->assign("info_$name", "");
         }else
 
index 80472c950f22174ba89aa1eaa4b2bdefb2275694..30d03124ba8e26e81a2b394d069bfdc701b9519a 100644 (file)
    </div>
    <div class="contentboxb">
     <p class="contentboxb" style="vertical-align:middle;">
-     {if $internal_createable}
+{if $internal_createable}
      <img class="center" alt="" src="{$add_image}">&nbsp;
      <a href="main.php{$plug}&amp;global=add" style="text-align:center;vertical-align:middle;">{t}Add entry{/t}</a><br>
-     {/if}
-     {if $internal eq 0}
+{/if}
+
+{if $internal eq 0}
+ {if $internal_editable}
      <img alt="" src="{$edit_image}" class="center">&nbsp;
      <a href="main.php{$plug}&amp;global=edit">{t}Edit entry{/t}</a><br>
-       {if $internal_removeable}
+ {/if}
+ {if $internal_removeable}
             <img alt="" src="{$delete_image}" class="center">&nbsp;
             <a href="main.php{$plug}&amp;global=remove" style="vertical-align:middle;">{t}Remove entry{/t}</a><br>
      {/if}
-     {/if}
+ {/if}
+{/if}
     </p>
    </div>
    <br>