From: hickert Date: Fri, 27 Oct 2006 07:16:36 +0000 (+0000) Subject: Completed addressbook acls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9fba1d6fc2501169cbbb1ca81f95865a1fd0796f;p=gosa.git Completed addressbook acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4949 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/addons/addressbook/address_edit.tpl b/plugins/addons/addressbook/address_edit.tpl index 9a79f3b72..8b51230f8 100644 --- a/plugins/addons/addressbook/address_edit.tpl +++ b/plugins/addons/addressbook/address_edit.tpl @@ -35,10 +35,10 @@ {render acl=$snACL} - , + , {/render} {render acl=$givenNameACL} - + {/render} @@ -50,7 +50,7 @@ {render acl=$initialsACL} - + {/render} @@ -62,7 +62,7 @@ {render acl=$titleACL} - + {/render} @@ -84,8 +84,7 @@ {render acl=$homePostalAddressACL} - + {/render} @@ -97,7 +96,7 @@ {render acl=$homePhoneACL} - + {/render} @@ -109,7 +108,7 @@ {render acl=$mobileACL} - + {/render} @@ -121,7 +120,7 @@ {render acl=$mailACL} - + {/render} @@ -146,7 +145,7 @@ {render acl=$oACL} - + {/render} @@ -158,7 +157,7 @@ {render acl=$ouACL} - + {/render} @@ -170,7 +169,7 @@ {render acl=$lACL} - + {/render} @@ -182,7 +181,7 @@ {render acl=$postalCodeACL} - + {/render} @@ -194,7 +193,7 @@ {render acl=$stACL} - + {/render} @@ -212,8 +211,7 @@ {render acl=$postalAddressACL} - + {/render} @@ -225,8 +223,7 @@ {render acl=$telephoneNumberACL} - + {/render} @@ -238,7 +235,7 @@ {render acl=$facsimileTelephoneNumberACL} - {/render} @@ -251,7 +248,7 @@ {render acl=$pagerACL} - + {/render} diff --git a/plugins/addons/addressbook/class_addressbook.inc b/plugins/addons/addressbook/class_addressbook.inc index baa8f01e6..d3c2b9f3a 100644 --- a/plugins/addons/addressbook/class_addressbook.inc +++ b/plugins/addons/addressbook/class_addressbook.inc @@ -444,7 +444,7 @@ class addressbook extends plugin \"vcf\" "; - 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]; + } } + } } diff --git a/plugins/addons/addressbook/main.inc b/plugins/addons/addressbook/main.inc index dcef6ee93..bcf1c7831 100644 --- a/plugins/addons/addressbook/main.inc +++ b/plugins/addons/addressbook/main.inc @@ -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'];