From e8edd1d69f2fd74a0b1f81885f4afa3576f9d31f Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 16 Sep 2008 14:07:00 +0000 Subject: [PATCH] Moved more values git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12484 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/contrib/desktoprc | 2 +- gosa-core/contrib/gosa.conf.5 | 38 ++++++++++---------- gosa-core/include/class_config.inc | 6 ++-- gosa-core/include/class_ldap.inc | 10 +++--- gosa-core/include/class_plugin.inc | 58 +++++++++++++++--------------- gosa-core/setup/setup_ldap.tpl | 2 +- 6 files changed, 58 insertions(+), 58 deletions(-) diff --git a/gosa-core/contrib/desktoprc b/gosa-core/contrib/desktoprc index 839c056e7..27cfc1e3d 100644 --- a/gosa-core/contrib/desktoprc +++ b/gosa-core/contrib/desktoprc @@ -1 +1 @@ -URL="https://www.gosa-project.org/demo/2.5/" +URL="https://www.gosa-project.org/demo/2.6/" diff --git a/gosa-core/contrib/gosa.conf.5 b/gosa-core/contrib/gosa.conf.5 index 43b864444..deaaa40f8 100644 --- a/gosa-core/contrib/gosa.conf.5 +++ b/gosa-core/contrib/gosa.conf.5 @@ -180,7 +180,7 @@ each location definition inside of this global definition. accountPrimaryAttribute="cn" ... - @@ -271,52 +271,52 @@ The statement enables copy and paste for LDAP entries managed with GOsa. .PP -.B enable_snapshot +.B snapshots .I bool .PP The -.I enable_snapshot +.I snapshots statement enables a snapshot mechaism in GOsa. This enables you to save certain states of entries and restore them later on. .PP -.B snapshot_base +.B snapshotBase .I dn .PP The -.I snapshot_base +.I snapshotBase statement defines the base where snapshots should be stored inside of the LDAP. .PP -.B snapshot_server -.I url +.B snapshotURI +.I uri .PP The -.I snapshot_server -variable defines the LDAP URL for the server which is used to do object +.I snapshotURI +variable defines the LDAP URI for the server which is used to do object snapshots. .PP -.B snapshot_user +.B snapshotAdminDn .I dn .PP The -.I snapshot_user +.I snapshotAdminDn variable defines the user which is used to authenticate when connecting to -.I snapshot_server. +.I snapshotURI. .PP -.B snapshot_password +.B snapshotAdminPassword .I string .PP The -.I snapshot_password +.I snapshotAdminPassword variable defines the credentials which are used in combination with -.I snapshot_user +.I snapshotAdminDn and -.I snapshot_server +.I snapshotURI in order to authenticate. .PP @@ -1126,13 +1126,13 @@ These entries define the way how to connect to some directory service. .B Example: .nf - .fi -.I url -is a valid LDAP url extendet by the base this referral is responsible for. +.I uri +is a valid LDAP uri extendet by the base this referral is responsible for. .I admin is the DN which has the permission to write LDAP entries. And .I password diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 8a83b1093..a4c6979ec 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -188,7 +188,7 @@ class config { /* Handle referral tags */ case 'REFERRAL': if ($this->tags[$this->level-2] == 'LOCATION'){ - $url= $attrs['URL']; + $url= $attrs['URI']; $server= preg_replace('!^([^:]+://[^/]+)/.*$!', '\\1', $url); /* Add location elements */ @@ -335,8 +335,8 @@ class config { $bases= array(); $servers= array(); foreach ($this->current['REFERRAL'] as $ref){ - $server= preg_replace('%^(.*)/[^/]+$%', '\\1', $ref['URL']); - $base= preg_replace('%^.*/([^/]+)$%', '\\1', $ref['URL']); + $server= preg_replace('%^(.*)/[^/]+$%', '\\1', $ref['URI']); + $base= preg_replace('%^.*/([^/]+)$%', '\\1', $ref['URI']); $bases[$base]= strlen($base); $servers[$base]= $server; } diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 19d8c1d52..02f4c9573 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -160,13 +160,13 @@ class LDAP{ function rebind($ldap, $referral) { $credentials= $this->get_credentials($referral); - if (@ldap_bind($ldap, LDAP::fix($credentials['ADMIN']), $credentials['PASSWORD'])) { + if (@ldap_bind($ldap, LDAP::fix($credentials['ADMINDN']), $credentials['ADMINPASSWORD'])) { $this->error = "Success"; $this->hascon=true; $this->reconnect= true; return (0); } else { - $this->error = "Could not bind to " . $credentials['ADMIN']; + $this->error = "Could not bind to " . $credentials['ADMINDN']; return NULL; } } @@ -586,7 +586,7 @@ class LDAP{ /* Ignore referrals */ $found= false; foreach($this->referrals as $ref){ - $base= preg_replace('!^[^:]+://[^/]+/([^?]+).*$!', '\\1', $ref['URL']); + $base= preg_replace('!^[^:]+://[^/]+/([^?]+).*$!', '\\1', $ref['URI']); if ($base == $cdn){ $found= true; break; @@ -789,8 +789,8 @@ class LDAP{ if (isset($referrals[$server])){ return ($referrals[$server]); } else { - $ret['ADMIN']= LDAP::fix($this->binddn); - $ret['PASSWORD']= $this->bindpw; + $ret['ADMINDN']= LDAP::fix($this->binddn); + $ret['ADMINPASSWORD']= $this->bindpw; } return ($ret); diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 31d5b4baf..e208621de 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -1225,17 +1225,17 @@ class plugin $ldap->cd($this->config->current['BASE']); /* check if there are special server configurations for snapshots */ - if($config->get_cfg_value("snapshot_server") == ""){ + if($config->get_cfg_value("snapshotURI") == ""){ /* Source and destination server are both the same, just copy source to dest obj */ $ldap_to = $ldap; $snapldapbase = $this->config->current['BASE']; }else{ - $server = $config->get_cfg_value("snapshot_server"); - $user = $config->get_cfg_value("snapshot_user"); - $password = $config->get_cfg_value("snapshot_password"); - $snapldapbase = $config->get_cfg_value("snapshot_base"); + $server = $config->get_cfg_value("snapshotURI"); + $user = $config->get_cfg_value("snapshotAdminDn"); + $password = $config->get_cfg_value("snapshotAdminPassword"); + $snapldapbase = $config->get_cfg_value("snapshotBase"); $ldap_to = new ldapMultiplexer(new LDAP($user,$password, $server)); $ldap_to -> cd($snapldapbase); @@ -1254,7 +1254,7 @@ class plugin /* Collect some infos */ $base = $this->config->current['BASE']; - $snap_base = $config->get_cfg_value("snapshot_base"); + $snap_base = $config->get_cfg_value("snapshotBase"); $base_of_object = preg_replace ('/^[^,]+,/i', '', $this->dn); $new_base = preg_replace("/".normalizePreg($base)."$/","",$base_of_object).$snap_base; @@ -1317,19 +1317,19 @@ class plugin function snapshotEnabled() { $config = $this->config; - if($config->get_cfg_value("enable_snapshot") == "true"){ + if($config->get_cfg_value("snapshots") == "true"){ /* Check if the snapshot_base is defined */ - if ($config->get_cfg_value("snapshot_base") == ""){ - msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."),"SNAPSHOT_BASE"), ERROR_DIALOG); + if ($config->get_cfg_value("snapshotBase") == ""){ + msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."),"snapshotBase"), ERROR_DIALOG); return(FALSE); } /* check if there are special server configurations for snapshots */ - if ($config->get_cfg_value("snapshot_server") != ""){ + if ($config->get_cfg_value("snapshotURI") != ""){ /* check if all required vars are available to create a new ldap connection */ $missing = ""; - foreach(array("snapshot_server","snapshot_user","snapshot_password","snapshot_base") as $var){ + foreach(array("snapshotURI","snapshotAdminDn","snapshotAdminPassword","snapshotBase") as $var){ if($config->get_cfg_value($var) == ""){ $missing .= $var." "; msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."), $missing), ERROR_DIALOG); @@ -1357,13 +1357,13 @@ class plugin /* check if there are special server configurations for snapshots */ - if(isset($cfg['SERVER']) && isset($cfg['SNAPSHOT_SERVER']) && $cfg['SERVER'] == $cfg['SNAPSHOT_SERVER']){ + if(isset($cfg['SERVER']) && isset($cfg['SNAPSHOTURI']) && $cfg['SERVER'] == $cfg['SNAPSHOTURI']){ $ldap_to = $ldap; - }elseif(isset($cfg['SNAPSHOT_SERVER'])){ - $server = $cfg['SNAPSHOT_SERVER']; - $user = $cfg['SNAPSHOT_USER']; - $password = $cfg['SNAPSHOT_PASSWORD']; - $snapldapbase = $cfg['SNAPSHOT_BASE']; + }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); @@ -1376,7 +1376,7 @@ class plugin /* Prepare bases and some other infos */ $base = $this->config->current['BASE']; - $snap_base = $cfg['SNAPSHOT_BASE']; + $snap_base = $cfg['SNAPSHOTBASE']; $base_of_object = preg_replace ('/^[^,]+,/i', '', $dn); $new_base = preg_replace("/".normalizePreg($base)."$/","",$base_of_object).$snap_base; $tmp = array(); @@ -1418,11 +1418,11 @@ class plugin $cfg= &$this->config->current; /* check if there are special server configurations for snapshots */ - if(isset($cfg['SNAPSHOT_SERVER'])){ - $server = $cfg['SNAPSHOT_SERVER']; - $user = $cfg['SNAPSHOT_USER']; - $password = $cfg['SNAPSHOT_PASSWORD']; - $snapldapbase = $cfg['SNAPSHOT_BASE']; + 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 (!$ldap_to->success()){ @@ -1434,7 +1434,7 @@ class plugin /* Prepare bases */ $base = $this->config->current['BASE']; - $snap_base = $cfg['SNAPSHOT_BASE']; + $snap_base = $cfg['SNAPSHOTBASE']; $new_base = preg_replace("/".normalizePreg($base)."$/","",$base_of_object).$snap_base; /* Fetch all objects and check if they do not exist anymore */ @@ -1484,11 +1484,11 @@ class plugin $cfg= &$this->config->current; /* check if there are special server configurations for snapshots */ - if(isset($cfg['SNAPSHOT_SERVER'])){ - $server = $cfg['SNAPSHOT_SERVER']; - $user = $cfg['SNAPSHOT_USER']; - $password = $cfg['SNAPSHOT_PASSWORD']; - $snapldapbase = $cfg['SNAPSHOT_BASE']; + 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 (!$ldap_to->success()){ diff --git a/gosa-core/setup/setup_ldap.tpl b/gosa-core/setup/setup_ldap.tpl index 8c3788db8..8e082d638 100644 --- a/gosa-core/setup/setup_ldap.tpl +++ b/gosa-core/setup/setup_ldap.tpl @@ -34,7 +34,7 @@
-
{t}Connection URL{/t}
+
{t}Connection URI{/t}
-- 2.30.2