summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 85f173b)
raw | patch | inline | side by side (parent: 85f173b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 28 Oct 2008 13:44:16 +0000 (13:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 28 Oct 2008 13:44:16 +0000 (13:44 +0000) |
-Fixed config attribute request for "SNAPSHOTBASE" in class plugin. use $config->get_cfg_value
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12789 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12789 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_plugin.inc | patch | blob | history |
index 5c9dadf3703f26b2f566c0607aacc6e592ab856b..de802b12923ddae7d9294e8e239d5cbc81bc7adc 100644 (file)
$cfg= &$this->config->current;
/* check if there are special server configurations for snapshots */
-
- if(isset($cfg['SERVER']) && isset($cfg['SNAPSHOTURI']) && $cfg['SERVER'] == $cfg['SNAPSHOTURI']){
- $ldap_to = $ldap;
- }elseif(isset($cfg['SNAPSHOTURI'])){
- $server = $cfg['SNAPSHOTURI'];
- $user = $cfg['SNAPSHOTADMINDN'];
- $password = $cfg['SNAPSHOTADMINPASSWORD'];
- $snapldapbase = $cfg['SNAPSHOTBASE'];
-
- $ldap_to = new ldapMultiplexer(new LDAP($user,$password, $server));
- $ldap_to -> cd ($snapldapbase);
+ if($this->config->get_cfg_value("snapshotURI") == ""){
+ $ldap_to = $ldap;
+ }else{
+ $server = $this->config->get_cfg_value("snapshotURI");
+ $user = $this->config->get_cfg_value("snapshotAdminDn");
+ $password = $this->config->get_cfg_value("snapshotAdminPassword");
+ $snapldapbase = $this->config->get_cfg_value("snapshotBase");
+ $ldap_to = new ldapMultiplexer(new LDAP($user,$password, $server));
+ $ldap_to -> cd($snapldapbase);
if (!$ldap_to->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $snapldapbase, "", get_class()));
}
- }else{
- $ldap_to = $ldap;
}
/* Prepare bases and some other infos */
$base = $this->config->current['BASE'];
- $snap_base = $cfg['SNAPSHOTBASE'];
+ $snap_base = $this->config->get_cfg_value("snapshotBase");
$base_of_object = preg_replace ('/^[^,]+,/i', '', $dn);
$new_base = preg_replace("/".normalizePreg($base)."$/","",$base_of_object).$snap_base;
$tmp = array();
$cfg= &$this->config->current;
/* check if there are special server configurations for snapshots */
- if(isset($cfg['SNAPSHOTURI'])){
- $server = $cfg['SNAPSHOTURI'];
- $user = $cfg['SNAPSHOTADMINDN'];
- $password = $cfg['SNAPSHOTADMINPASSWORD'];
- $snapldapbase = $cfg['SNAPSHOTBASE'];
- $ldap_to = new ldapMultiplexer(new LDAP($user,$password, $server));
- $ldap_to->cd ($snapldapbase);
+ if($this->config->get_cfg_value("snapshotURI") == ""){
+ $ldap_to = $ldap;
+ }else{
+ $server = $this->config->get_cfg_value("snapshotURI");
+ $user = $this->config->get_cfg_value("snapshotAdminDn");
+ $password = $this->config->get_cfg_value("snapshotAdminPassword");
+ $snapldapbase = $this->config->get_cfg_value("snapshotBase");
+ $ldap_to = new ldapMultiplexer(new LDAP($user,$password, $server));
+ $ldap_to -> cd($snapldapbase);
if (!$ldap_to->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $snapldapbase, "", get_class()));
}
- }else{
- $ldap_to = $ldap;
}
/* Prepare bases */
$base = $this->config->current['BASE'];
- $snap_base = $cfg['SNAPSHOTBASE'];
+ $snap_base = $this->config->get_cfg_value("snapshotBase");
$new_base = preg_replace("/".normalizePreg($base)."$/","",$base_of_object).$snap_base;
/* Fetch all objects and check if they do not exist anymore */
$cfg= &$this->config->current;
/* check if there are special server configurations for snapshots */
- if(isset($cfg['SNAPSHOTURI'])){
- $server = $cfg['SNAPSHOTURI'];
- $user = $cfg['SNAPSHOTADMINDN'];
- $password = $cfg['SNAPSHOTADMINPASSWORD'];
- $snapldapbase = $cfg['SNAPSHOTBASE'];
- $ldap_to = new ldapMultiplexer(new LDAP($user,$password, $server));
- $ldap_to->cd ($snapldapbase);
+ if($this->config->get_cfg_value("snapshotURI") == ""){
+ $ldap_to = $ldap;
+ }else{
+ $server = $this->config->get_cfg_value("snapshotURI");
+ $user = $this->config->get_cfg_value("snapshotAdminDn");
+ $password = $this->config->get_cfg_value("snapshotAdminPassword");
+ $snapldapbase = $this->config->get_cfg_value("snapshotBase");
+ $ldap_to = new ldapMultiplexer(new LDAP($user,$password, $server));
+ $ldap_to -> cd($snapldapbase);
if (!$ldap_to->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $snapldapbase, "", get_class()));
}
- }else{
- $ldap_to = $ldap;
}
/* Get the snapshot */