index c4057ea67b5229127cc0e62dcdace0702dc7250b..2966e8d44f93e1a1bd72b4122eac6ab58de2a44f 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
\param dn Distinguished name to initialize plugin from
\sa plugin()
*/
- function plugin ($config, $dn= NULL, $parent= NULL)
+ function plugin (&$config, $dn= NULL, $parent= NULL)
{
/* Configuration is fine, allways */
- $this->config= $config;
+ $this->config= &$config;
$this->dn= $dn;
/* Handle new accounts, don't read information from LDAP */
points to our ldap snapshot server */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
- $tmp = $this->config->current;
+ $cfg= &$this->config->current;
/* check if there are special server configurations for snapshots */
- if(isset($tmp['SNAPSHOT_SERVER'])){
- $server = $tmp['SNAPSHOT_SERVER'];
- $user = $tmp['SNAPSHOT_USER'];
- $password = $tmp['SNAPSHOT_PASSWORD'];
- $snapldapbase = $tmp['SNAPSHOT_BASE'];
+ if(isset($cfg['SNAPSHOT_SERVER'])){
+ $server = $cfg['SNAPSHOT_SERVER'];
+ $user = $cfg['SNAPSHOT_USER'];
+ $password = $cfg['SNAPSHOT_PASSWORD'];
+ $snapldapbase = $cfg['SNAPSHOT_BASE'];
$ldap_to = new LDAP($user,$password, $server);
$ldap_to -> cd ($snapldapbase);
show_ldap_error($ldap->get_error(), sprintf(_("Method get available snapshots with dn '%s' failed."),$this->dn));
/* Prepare bases and some other infos */
$base = $this->config->current['BASE'];
- $snap_base = $tmp['SNAPSHOT_BASE'];
+ $snap_base = $cfg['SNAPSHOT_BASE'];
$base_of_object = preg_replace ('/^[^,]+,/i', '', $dn);
$new_base = preg_replace("/".normalizePreg($base)."$/","",$base_of_object).$snap_base;
$tmp = array();
points to our ldap snapshot server */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
- $tmp = $this->config->current;
+ $cfg= &$this->config->current;
/* check if there are special server configurations for snapshots */
- if(isset($tmp['SNAPSHOT_SERVER'])){
- $server = $tmp['SNAPSHOT_SERVER'];
- $user = $tmp['SNAPSHOT_USER'];
- $password = $tmp['SNAPSHOT_PASSWORD'];
- $snapldapbase = $tmp['SNAPSHOT_BASE'];
+ if(isset($cfg['SNAPSHOT_SERVER'])){
+ $server = $cfg['SNAPSHOT_SERVER'];
+ $user = $cfg['SNAPSHOT_USER'];
+ $password = $cfg['SNAPSHOT_PASSWORD'];
+ $snapldapbase = $cfg['SNAPSHOT_BASE'];
$ldap_to = new LDAP($user,$password, $server);
$ldap_to->cd ($snapldapbase);
show_ldap_error($ldap->get_error(), sprintf(_("Method get deleted snapshots with dn '%s' failed."),$this->dn));
/* Prepare bases */
$base = $this->config->current['BASE'];
- $snap_base = $tmp['SNAPSHOT_BASE'];
+ $snap_base = $cfg['SNAPSHOT_BASE'];
$new_base = preg_replace("/".normalizePreg($base)."$/","",$base_of_object).$snap_base;
/* Fetch all objects and check if they do not exist anymore */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
- $tmp = $this->config->current;
+ $cfg= &$this->config->current;
/* check if there are special server configurations for snapshots */
- if(isset($tmp['SNAPSHOT_SERVER'])){
- $server = $tmp['SNAPSHOT_SERVER'];
- $user = $tmp['SNAPSHOT_USER'];
- $password = $tmp['SNAPSHOT_PASSWORD'];
- $snapldapbase = $tmp['SNAPSHOT_BASE'];
+ if(isset($cfg['SNAPSHOT_SERVER'])){
+ $server = $cfg['SNAPSHOT_SERVER'];
+ $user = $cfg['SNAPSHOT_USER'];
+ $password = $cfg['SNAPSHOT_PASSWORD'];
+ $snapldapbase = $cfg['SNAPSHOT_BASE'];
$ldap_to = new LDAP($user,$password, $server);
$ldap_to->cd ($snapldapbase);
show_ldap_error($ldap->get_error(), sprintf(_("Restore snapshot with dn '%s' failed."),$snapldapbase));
*/
function update_acls($old_dn,$new_dn,$output_changes = FALSE)
{
- global $config;
-
/* Check if old_dn is empty. This should never happen */
if(empty($old_dn) || empty($new_dn)){
trigger_error("Failed to check acl dependencies, wrong dn given.");
/* get_ldap configuration */
$update = array();
- $ldap = $config->get_ldap_link();
- $ldap->cd ($config->current['BASE']);
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd ($this->config->current['BASE']);
$ldap->search("(&(objectClass=gosaAcl)(gosaAclEntry=*))",array("cn","gosaAclEntry"));
while($attrs = $ldap->fetch()){