From cf853aabc97774aa51c9e0d2da4073395e44664c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 14 Jun 2007 10:38:03 +0000 Subject: [PATCH] Updated asterisk conference copy & paste git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6590 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_phoneConferenceGeneric.inc | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc index 1714edca3..24e0fa19b 100644 --- a/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -24,6 +24,7 @@ class conference extends plugin var $cn = ""; var $description = ""; var $base = ""; + var $old_base = ""; var $ou = ""; var $goFonPIN = ""; var $old_cn = ""; @@ -140,6 +141,7 @@ class conference extends plugin } $this->old_dn = $this->dn; $this->old_cn = $this->cn; + $this->old_base = $this->base; } @@ -387,11 +389,13 @@ class conference extends plugin $message[] = $str; } - $ldap = $this->config->get_ldap_link(); - $ldap->cd("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->base); - $ldap->search("(&(objectClass=goFonConference)(cn=".$this->cn."))",array("cn")); - if($ldap->count()){ - $message[] =_("There is already a conference with this name in the current tree."); + if($this->old_cn != $this->cn || $this->base != $this->old_base){ + $ldap = $this->config->get_ldap_link(); + $ldap->cd("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->base); + $ldap->search("(&(objectClass=goFonConference)(cn=".$this->cn."))",array("cn")); + if($ldap->count()){ + $message[] =_("There is already a conference with this name in the current tree."); + } } return $message; } @@ -714,6 +718,17 @@ class conference extends plugin } } + function PrepareForCopyPaste($source) + { + plugin::PrepareForCopyPaste($source) ; + + $source_o = new conference($this->config,$source['dn']); + + foreach($this->attributes as $attr){ + $this->$attr = $source_o->$attr; + } + } + /* Return plugin informations for acl handling */ function plInfo() -- 2.30.2