summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89d5b00)
raw | patch | inline | side by side (parent: 89d5b00)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 24 Sep 2007 07:55:18 +0000 (07:55 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 24 Sep 2007 07:55:18 +0000 (07:55 +0000) |
Update goFonHomeServer for users and conferences too, if server name has changes
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7381 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7381 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_goFonServer.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_goFonServer.inc b/plugins/admin/systems/class_goFonServer.inc
index 8f5fd0eabc99bef02385346f15f5b802cc59ad35..8707485cc017c7aa8cdab94f6e8afa28a8705d10 100644 (file)
var $goFonAreaCode = "";
var $goFonCountryCode = "";
var $view_logged =FALSE;
-
+
+ var $orig_dn = "";
function goFonServer(&$config,$dn)
{
goService::goService($config,$dn);
$this->DisplayName = _("VoIP service");
+
+ $this->orig_dn = $dn;
}
}
}
+
+ function save()
+ {
+ goService::save();
+ /* Update goFonAccounts if server was is renamed.
+ Set attribute goFonHomeServer to current dn
+ */
+ if(in_array("goFonServer",$this->objectclasses)){
+ if($this->orig_dn != "new" && $this->orig_dn != $this->dn){
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(&(goFonHomeServer=*)(|(objectClass=goFonAccount)(objectClass=goFonConference)))",array("goFonHomeServer"));
+ $dns = array();
+ while($attrs = $ldap->fetch()){
+ $dns[] = $attrs['dn'];
+ }
+ foreach($dns as $dn){
+ $ldap->cd($dn);
+ $ldap->modify(array("goFonHomeServer" => $this->dn));
+ show_ldap_error($ldap->get_error(),sprintf(_("Updating gofon home server failed for '%s'."),$dn));
+ }
+ }
+ }
+ }
+
/* Return plugin informations for acl handling */
function plInfo()