Code

Completed addressbook acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 Oct 2006 07:16:36 +0000 (07:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 Oct 2006 07:16:36 +0000 (07:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4949 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/addressbook/address_edit.tpl
plugins/addons/addressbook/class_addressbook.inc
plugins/addons/addressbook/main.inc

index 9a79f3b723cfb16d3f4a5503e3a93db90c66a574..8b51230f8cf689a45ddf020bc6059be4f6ec1578 100644 (file)
                                                                </td>
                                                                <td>
 {render acl=$snACL}    
-                                                                       <input id="sn" name="sn" size=10 maxlength=60 value="{$info_sn}" {$snACL}>, 
+                                                                       <input id="sn" name="sn" size=10 maxlength=60 value="{$info_sn}">, 
 {/render}
 {render acl=$givenNameACL}
-                                                                       <input id="givenName" name="givenName" size=10 maxlength=60 value="{$info_givenName}" {$givenNameACL}>
+                                                                       <input id="givenName" name="givenName" size=10 maxlength=60 value="{$info_givenName}">
 {/render}
                                                                <td>
                                                        </tr>
@@ -50,7 +50,7 @@
                                                                </td>
                                                                <td>
 {render acl=$initialsACL}
-                                                                       <input id="initials" name="initials" size=5 maxlength=20 value="{$info_initials}" {$initialsACL}>
+                                                                       <input id="initials" name="initials" size=5 maxlength=20 value="{$info_initials}">
 {/render}
                                                                </td>
                                                        </tr>
@@ -62,7 +62,7 @@
                                                                </td>
                                                                <td>
 {render acl=$titleACL}
-                                                                       <input id="title" name="title" size=10 maxlength=20 value="{$info_title}" {$titleACL}>
+                                                                       <input id="title" name="title" size=10 maxlength=20 value="{$info_title}">
 {/render}
                                                                </td>
                                                        </tr>
@@ -84,8 +84,7 @@
                                                                </td>
                                                                <td style="vertical-align:top;">
 {render acl=$homePostalAddressACL}
-                                                                       <textarea id="homePostalAddress" name="homePostalAddress" 
-                                                                               rows=1 cols=20 {$homePostalAddressACL}>{$info_homePostalAddress}</textarea>
+                                                                       <textarea id="homePostalAddress" name="homePostalAddress" rows=1 cols=20>{$info_homePostalAddress}</textarea>
 {/render}
                                                                </td>
                                                        </tr>
@@ -97,7 +96,7 @@
                                                                </td>
                                                                <td>
 {render acl=$homePhoneACL}
-                                                                       <input id="homePhone" name="homePhone" size=15 maxlength=60 value="{$info_homePhone}" {$homePhoneACL}>
+                                                                       <input id="homePhone" name="homePhone" size=15 maxlength=60 value="{$info_homePhone}">
 {/render}
                                                                </td>
                                                        </tr>
                                                                </td>
                                                                <td>
 {render acl=$mobileACL}
-                                                                       <input id="mobile" name="mobile" size=15 maxlength=60 value="{$info_mobile}" {$mobileACL}>
+                                                                       <input id="mobile" name="mobile" size=15 maxlength=60 value="{$info_mobile}">
 {/render}
                                                                </td>
                                                        </tr>
                                                                </td>
                                                                <td>
 {render acl=$mailACL}
-                                                                       <input id="mail" name="mail" size=15 maxlength=60 value="{$info_mail}" {$mailACL}>
+                                                                       <input id="mail" name="mail" size=15 maxlength=60 value="{$info_mail}">
 {/render}
                                                                </td>
                                                        </tr>
                                                                                        </td>
                                                                                        <td>
 {render acl=$oACL}
-                                                                                               <input id="o" name="o" size=15 maxlength=60 value="{$info_o}" {$oACL}>
+                                                                                               <input id="o" name="o" size=15 maxlength=60 value="{$info_o}">
 {/render}
                                                                                        </td>
                                                                                </tr>
                                                                                        </td>
                                                                                        <td>
 {render acl=$ouACL}
-                                                                                               <input id="ou" name="ou" size=15 maxlength=60 value="{$info_ou}" {$ouACL}>
+                                                                                               <input id="ou" name="ou" size=15 maxlength=60 value="{$info_ou}">
 {/render}
                                                                                        </td>
                                                                                </tr>
                                                                                        </td>
                                                                                        <td>
 {render acl=$lACL}
-                                                                                               <input id="l" name="l" size=15 maxlength=60 value="{$info_l}" {$lACL}>
+                                                                                               <input id="l" name="l" size=15 maxlength=60 value="{$info_l}">
 {/render}
                                                                                        </td>
                                                                                </tr>
                                                                                        </td>
                                                                                        <td>
 {render acl=$postalCodeACL}
-                                                                                               <input id="postalCode" name="postalCode" size=15 maxlength=60 value="{$info_postalCode}" {$postalCodeACL}>
+                                                                                               <input id="postalCode" name="postalCode" size=15 maxlength=60 value="{$info_postalCode}">
 {/render}
                                                                                        </td>
                                                                                </tr>
                                                                                        </td>
                                                                                        <td>
 {render acl=$stACL}
-                                                                                               <input id="st" name="st" size=15 maxlength=60 value="{$info_st}" {$stACL}>
+                                                                                               <input id="st" name="st" size=15 maxlength=60 value="{$info_st}">
 {/render}
                                                                                        </td>
                                                                                </tr>
                                                                                        </td>
                                                                                        <td style="vertical-align:top;">
 {render acl=$postalAddressACL}
-                                                                                               <textarea id="postalAddress" name="postalAddress" rows=1 cols=20 
-                                                                                                       {$postalAddressACL}>{$info_postalAddress}</textarea>
+                                                                                               <textarea id="postalAddress" name="postalAddress" rows=1 cols=20 >{$info_postalAddress}</textarea>
 {/render}
                                                                                        </td>
                                                                                </tr>
                                                                                        </td>
                                                                                        <td>
 {render acl=$telephoneNumberACL}
-                                                                                               <input id="telephoneNumber" name="telephoneNumber" {$telephoneNumberACL}
-                                                                                                       size=15 maxlength=60 value="{$info_telephoneNumber}">
+                                                                                               <input id="telephoneNumber" name="telephoneNumber" size=15 maxlength=60 value="{$info_telephoneNumber}">
 {/render}
                                                                                        </td>
                                                                                </tr>
                                                                                        </td>
                                                                                        <td>
 {render acl=$facsimileTelephoneNumberACL}
-                                                                                               <input id="facsimileTelephoneNumber" name="facsimileTelephoneNumber" {$facsimileTelephoneNumberACL}
+                                                                                               <input id="facsimileTelephoneNumber" name="facsimileTelephoneNumber"
                                                                                                        size=15 maxlength=60 value="{$info_facsimileTelephoneNumber}">
 {/render}
                                                                                        </td>
                                                                                        </td>
                                                                                        <td>
 {render acl=$pagerACL}
-                                                                                               <input id="pager" name="pager" size=15 maxlength=60 value="{$info_pager}" {$pagerACL}>
+                                                                                               <input id="pager" name="pager" size=15 maxlength=60 value="{$info_pager}">
 {/render}
                                                                                        </td>
                                                                                </tr>
index baa8f01e69c1794d1b436805f37c295398a86b93..d3c2b9f3aec6313fa0983f87977c3106920cea85 100644 (file)
@@ -444,7 +444,7 @@ class addressbook extends plugin
             <img align=\"top\" border=0 src=\"images/save.png\" alt=\"vcf\" title=\"".sprintf(_("Save contact for %s as vcard"), $attrs['givenName'][0]." ".$attrs['sn'][0])."\">
             </a>";
 
-          if (isset($attrs['mail'])){
+          if (isset($attrs['mail'][0]) && !empty($attrs['mail'][0])){
             $dest= sprintf(_("Send mail to %s"), $attrs['mail'][0]);
             $this->telephone_list[$attrs['sn'][0].$attrs['dn']].=
 
@@ -464,7 +464,9 @@ class addressbook extends plugin
     /* Fill template variables */
     $smarty->assign("search_for", $this->search_for);
     $smarty->assign("object_type", $this->object_type);
-    $smarty->assign("deplist", $this->config->idepartments);
+
+    $this->base = $phonefilter['search_base'];
+    $smarty->assign("deplist", $this->get_allowed_bases());
     $smarty->assign("depselect", $this->search_base);
     $smarty->assign("global", $phonefilter['global']);
     $smarty->assign("organizational", $phonefilter['organizational']);
@@ -601,9 +603,16 @@ class addressbook extends plugin
   {
     plugin::save_object();
     foreach($this->attributes as $attr){
-      if(isset($_POST[$attr])){
-        $this->$attr = $_POST[$attr];
+
+      /* save attributes depending on acls */
+      $acl = $this->get_entry_acls($this->dn,$attr);
+
+      if(preg_match("/w/",$acl)){
+        if(isset($_POST[$attr])){
+          $this->$attr = $_POST[$attr];
+        }
       }
+
     }
   }
 
index dcef6ee93970189026cfd2f56931c99b72eb9c17..bcf1c78318b51197d58793a23d4bdd6e6b0dda8d 100644 (file)
@@ -23,7 +23,7 @@ if (!$remove_lock){
        if (!isset($_SESSION['addressbook']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
                $_SESSION['addressbook']= new addressbook ($config);
                $_SESSION['addressbook']->set_acl_base($ui->dn);
-               $_SESSION['addressbook']->set_acl_category("gofon");
+               $_SESSION['addressbook']->set_acl_category("addressbook");
        }
        $addressbook= $_SESSION['addressbook'];