From e9da9ef125c69c5f41f60bf10b684867882254a8 Mon Sep 17 00:00:00 2001 From: katagia Date: Mon, 13 Sep 2004 12:01:28 +0000 Subject: [PATCH] Searching for memory leak --- lam/lib/modules.inc | 8 ++++---- lam/lib/modules/posixGroup.inc | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index ab0b9beb..8f4ed05f 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -896,7 +896,7 @@ class accountContainer { $string = trim($string); // Ad must foreach (explode(" $ ", $string) as $attribute) { - $return[$attribute] = ''; + $return[$attribute] = array(''); } } // create array with may-attributes @@ -908,7 +908,7 @@ class accountContainer { $string = trim($string); // Ad may foreach (explode(" $ ", $string) as $attribute) { - $return[$attribute] = ''; + $return[$attribute] = array(''); } } // Get attributes of subclasses @@ -930,7 +930,7 @@ class accountContainer { $string = trim($string); // Ad must foreach (explode(" $ ", $string) as $attribute) { - $return[$attribute] = ''; + $return[$attribute] = array(''); } } // create array with may-attributes @@ -942,7 +942,7 @@ class accountContainer { $string = trim($string); // Ad may foreach (explode(" $ ", $string) as $attribute) { - $return[$attribute] = ''; + $return[$attribute] = array(''); } } } diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index e982e580..aa88406f 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -182,17 +182,19 @@ class posixGroup extends baseModule { parent::init($base); // Add Array with all attributes and type $this->attributes = $_SESSION[$this->base]->get_module_attributes('posixGroup'); - $_SESSION[$this->base]->add_attributes ('posixGroup'); + $this->orig = $this->attributes; // Make references to attributes which already esists in ldap $newattributes = array_keys($this->attributes); $module = array_keys($_SESSION[$this->base]->module); // fixme *** do we have to unset module posixAccuont itself for ($i=0; $ibase]->module[$module[$i]]->attributes[$attribute])) - $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; + if ($module[$i]!='posixGroup') + foreach ($newattributes as $attribute) + if (isset($_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute])) { + $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; + $this->orig[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->orig[$attribute]; + } } - $this->orig = $this->attributes ; $this->changegids=false; } @@ -418,7 +420,8 @@ class posixGroup extends baseModule { $errors['gidNumber'][] = array('INFO', _('GID number'), _('GID number has changed. Please select checkbox to change GID number of users and hosts.')); // Load attributes - $this->attributes['cn'][0] = $post['cn']; + //$this->attributes['cn'][0] = $post['cn']; + $_SESSION['account']->module['posixGroup']->attributes['cn'][0] = $post['cn']; $this->attributes['gidNumber'][0] = $post['gidNumber']; $this->attributes['description'][0] = $post['description']; if ($post['userPassword_no']) $this->userPassword_no=true;