From 185b77a331aa9917dd9ecfb16dfcaf83a0e6c14b Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 29 Sep 2008 07:01:51 +0000 Subject: [PATCH] Updated connectivity -> oxChangeAccount. -Problems detecting the accounts uid. The uid was extracted out of the dn and this wasn't working in all cases git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12552 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../openxchange/class_oxchangeAccount.inc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc b/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc index f9f1337aa..3e60cd6f0 100644 --- a/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc +++ b/gosa-plugins/openxchange/personal/connectivity/openxchange/class_oxchangeAccount.inc @@ -40,10 +40,12 @@ class oxchangeAccount extends plugin var $timezones=array(); var $dnmode= ""; var $uid =""; + var $parent = NULL; - function oxchangeAccount (&$config, $dn= NULL) + function oxchangeAccount (&$config, $dn= NULL,&$parent) { - plugin::plugin ($config, $dn); + plugin::plugin ($config, $dn,$parent); + $this->parent = &$parent; for ($i=0;$iconfig->data['TABS']['CONNECTIVITY']);$i++){ if($this->config->data['TABS']['CONNECTIVITY'][$i]['CLASS']=='oxchangeAccount') { $this->oxconf=$this->config->data['TABS']['CONNECTIVITY'][$i]; @@ -264,7 +266,6 @@ class oxchangeAccount extends plugin /* Save to LDAP */ function save() { - $needupdate=TRUE; $istemplate=FALSE; @@ -276,10 +277,15 @@ class oxchangeAccount extends plugin if($object=="gosaUserTemplate") $istemplate=TRUE; } } + + /* Detect accounts uid + */ + if(!isset($this->attrs[$this->dnmode][0])){ + $uid = $this->parent->by_object['user']->uid; + }else{ + $uid=$this->attrs[$this->dnmode][0]; + } - $uidarray=array(); - preg_match("/^(\w+(?=\=))=((\w|\s|\.)+(?=\,)),.*/",$this->dn,$uidarray); - $uid=$uidarray[2]; if (trim($uid) == "") { msg_dialog::display(_("Error"), msgPool::invalid(_("Open-Xchange account name")), ERROR_DIALOG); return; -- 2.30.2