From: cajus Date: Fri, 25 Aug 2006 11:46:04 +0000 (+0000) Subject: Included addressbook location patch done by Florian Zschocke X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9d1bb72f8925e7a717467d00e1f7b7744bb712d6;p=gosa.git Included addressbook location patch done by Florian Zschocke git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4515 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/addons/addressbook/class_addressbook.inc b/plugins/addons/addressbook/class_addressbook.inc index 9302a187a..ae56b8d36 100644 --- a/plugins/addons/addressbook/class_addressbook.inc +++ b/plugins/addons/addressbook/class_addressbook.inc @@ -47,11 +47,18 @@ class addressbook extends plugin "facsimileTelephoneNumber", "pager"); var $objectclasses= array("top", "person", "organizationalPerson", "inetOrgPerson"); + var $abobjectclass= "dc=addressbook"; + function addressbook ($config, $dn= NULL) { /* Include config object */ $this->config= $config; + $aoc = search_config($this->config->data['MENU'], "addressbook", "LDAP_OBJECT_CLASS"); + if ($aoc != ""){ + $this->abobjectclass = $aoc; + } + /* Get global filter config */ if (!is_global("phonefilter")){ $ui= get_userinfo(); @@ -307,7 +314,7 @@ class addressbook extends plugin $bases= array(); $filter= ""; if ($phonefilter['global'] == "checked"){ - $bases[]= preg_replace("/".$this->config->current['BASE']."/", "dc=addressbook,".$this->config->current['BASE'], $this->search_base); + $bases[]= preg_replace("/".$this->config->current['BASE']."/", $this->abobjectclass.",".$this->config->current['BASE'], $this->search_base); } else { $filter= '(objectClass=gosaAccount)'; } @@ -461,7 +468,7 @@ class addressbook extends plugin $smarty->assign("info_$name", "-"); } } - if (preg_match("/,dc=addressbook,/", $_SESSION['show_info'])){ + if (preg_match("/,".$this->abobjectclass.",/", $_SESSION['show_info'])){ $storage= _("global addressbook"); $smarty->assign("internal", 0); } else { @@ -592,7 +599,7 @@ class addressbook extends plugin /* Assemble cn/dn */ $this->cn= $this->givenName." ".$this->sn; if ($this->orig_cn != $this->cn || $this->storage_base != $this->orig_storage_base){ - $this->new_dn= $this->create_unique_dn("cn", preg_replace("/,*".$this->config->current['BASE']."$/", "", $this->storage_base).",dc=addressbook,".$this->config->current['BASE']); + $this->new_dn= $this->create_unique_dn("cn", preg_replace("/,*".$this->config->current['BASE']."$/", "", $this->storage_base).",".$this->abobjectclass.",".$this->config->current['BASE']); if ($this->new_dn == "none"){ $message[]= _("Cannot create a unique DN for your entry. Please fill more formular fields."); return ($message); @@ -613,7 +620,7 @@ class addressbook extends plugin { /* Load base attributes */ plugin::plugin ($this->config, $this->dn); - $this->storage_base= preg_replace('/^[^,]+,/', '', preg_replace('/dc=addressbook,/', '', $this->dn)); + $this->storage_base= preg_replace('/^[^,]+,/', '', preg_replace('/'.$this->abobjectclass.',/', '', $this->dn)); }