From: hickert Date: Mon, 8 Aug 2005 09:22:50 +0000 (+0000) Subject: Added automatic remove of queue entries if user removes his phone account. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0e87d6c8d56d10ac90e827aa79927b4fccfab07d;p=gosa.git Added automatic remove of queue entries if user removes his phone account. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1073 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 3965507f6..aa9798a2a 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -907,6 +907,8 @@ class phoneAccount extends plugin $SQL=""; + + $first_num = false; // Delete old entries foreach($this->a_old_telenums as $s_telenums){ @@ -950,6 +952,17 @@ class phoneAccount extends plugin } $ldap= $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search("(objectClass=goFonQueue)", array("member")); + while($attr = $ldap->fetch()){ + if(in_array($this->dn,$attr['member'])){ + $new =new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'],$attr['dn']); + unset($new->by_object['ogroup']->memberList[$this->dn]); + unset($new->by_object['ogroup']->member[$this->dn]); + $new->save(); + print_red(sprintf(_("Removed user '%s' from phone queue '%s'."),$this->uid,$new->by_object['ogroup']->attrs['cn'])); + } + } $ldap->cd($this->dn); $ldap->modify($this->attrs); show_ldap_error($ldap->get_error());