diff --git a/plugins/addons/addressbook/class_addressbook.inc b/plugins/addons/addressbook/class_addressbook.inc
index c6c049c1d7553ccda718bf2caf36d617a26c913a..40b1876ccf77422d255441f7a4fbd19dd7d0649a 100644 (file)
/* Include config object */
$this->config= $config;
- print $dn;
-
-#FIXME: ACL is set to default for testing
- $this->acl= "#all#";
-
/* Get global filter config */
if (!is_global("phonefilter")){
$ui= get_userinfo();
/* Call parent execute */
plugin::execute();
- $smarty= get_smarty();
+ $smarty= get_smarty();
+
+ foreach($this->attributes as $attr){
+ $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ }
+
#! Hickert
/*prevent empty variables for smarty*/
$this->load();
/* Load permissions for selected 'dn' and check if
we're allowed to remove this 'dn' */
- $ui= get_userinfo();
- $dn= preg_replace("/,dc=addressbook,/", "", $this->dn);
- $acl= get_permissions ($dn, $ui->subtreeACL);
- $this->acl= get_module_permission($acl, "global-addressbook", $dn);
if (chkacl($this->acl, "delete") == ""){
/* Check locking, save current plugin in 'back_plugin', so
}
/* Lock the current entry, so nobody will edit it during deletion */
+ $ui= get_userinfo();
add_lock ($this->dn, $ui->dn);
$smarty->assign("info", sprintf(_("You're about to delete the entry %s."), $this->dn));
return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
$this->telephone_list[$attrs['sn'][0].$attrs['dn']]=
- "<td class=\"phonelist\" title=\"".$attrs['sn'][0].", ".$attrs['givenName'][0]."\" onClick='location.href=\"main.php?plug=".validate($_GET['plug'])."&start=".validate($_GET['start'])."&show=".base64_encode($attrs['dn'])."\"'><a href=\"main.php?plug=".validate($_GET['plug'])."&start=".validate($_GET['start'])."&show=".base64_encode($attrs['dn'])."\">".$attrs['sn'][0].", ".$attrs['givenName'][0].
+ "<td class=\"phonelist\" title=\"".$attrs['sn'][0].", ".$attrs['givenName'][0]."\" onClick='location.href=\"main.php?plug=".validate($_GET['plug'])."&start=".validate($_GET['start'])."&show=".base64_encode($attrs['dn'])."\"'><a style='vertical-align:middle;' href=\"main.php?plug=".validate($_GET['plug'])."&start=".validate($_GET['start'])."&show=".base64_encode($attrs['dn'])."\">".$attrs['sn'][0].", ".$attrs['givenName'][0].
"</a>
</td>
<td title=\""._("Dial")." ".$attrs['telephoneNumber'][0]."\">
- <a href=\"main.php?plug=".validate($_GET['plug'])."&dial=telephoneNumber&start=".validate($_GET['start'])."&target=".base64_encode($attrs['dn'])."\">".$attrs['telephoneNumber'][0]."
+ <a style='vertical-align:middle;' href=\"main.php?plug=".validate($_GET['plug'])."&dial=telephoneNumber&start=".validate($_GET['start'])."&target=".base64_encode($attrs['dn'])."\">".$attrs['telephoneNumber'][0]."
</a>
</td>
<td title=\"".$attrs['facsimileTelephoneNumber'][0]."\">
".$attrs['facsimileTelephoneNumber'][0]."
</td>
<td title=\""._("Dial")." ".$attrs['mobile'][0]."\">
- <a href=\"main.php?plug=".validate($_GET['plug'])."&dial=mobile&start=".validate($_GET['start'])."&target=".base64_encode($attrs['dn'])."\">".$attrs['mobile'][0]."
+ <a style='vertical-align:middle;' href=\"main.php?plug=".validate($_GET['plug'])."&dial=mobile&start=".validate($_GET['start'])."&target=".base64_encode($attrs['dn'])."\">".$attrs['mobile'][0]."
</a>
</td>
<td title=\""._("Dial")." ".$attrs['homePhone'][0]."\">
- <a href=\"main.php?plug=".validate($_GET['plug'])."&dial=homePhone&start=".validate($_GET['start'])."&target=".base64_encode($attrs['dn'])."\">".$attrs['homePhone'][0]."
+ <a style='vertical-align:middle;' href=\"main.php?plug=".validate($_GET['plug'])."&dial=homePhone&start=".validate($_GET['start'])."&target=".base64_encode($attrs['dn'])."\">".$attrs['homePhone'][0]."
</a>
</td>
<td>
}
/* Fill variables from LDAP */
-# FIXME: Missing ACL support for addressbook yet
if ($_SESSION['show_info'] != "ADD"){
$ldap->cat($_SESSION['show_info']);
$info= $ldap->fetch();
return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
}
+ function save_object()
+ {
+ plugin::save_object();
+ foreach($this->attributes as $attr){
+ if(isset($_POST[$attr])){
+ $this->$attr = $_POST[$attr];
+ }
+ }
+ }
function check()
{
$this->new_dn= $this->dn;
}
- $ui= get_userinfo();
- $dn= preg_replace("/,dc=addressbook,/", "", $this->new_dn);
- $acl= get_permissions ($dn, $ui->subtreeACL);
- $acl= get_module_permission($acl, "global-addressbook", $this->dn);
- if ($_SESSION['show_info'] == "ADD" && chkacl($acl, "create") != ""){
+ if ($_SESSION['show_info'] == "ADD" && chkacl($this->acl, "add") != ""){
$message[]= _("You have no permissions to create or modify a global address book entry.");
}