Searching for memory leak

This commit is contained in:
katagia 2004-09-13 12:01:28 +00:00
parent 7e9befcd6f
commit e9da9ef125
2 changed files with 13 additions and 10 deletions

View File

@ -896,7 +896,7 @@ class accountContainer {
$string = trim($string); $string = trim($string);
// Ad must // Ad must
foreach (explode(" $ ", $string) as $attribute) { foreach (explode(" $ ", $string) as $attribute) {
$return[$attribute] = ''; $return[$attribute] = array('');
} }
} }
// create array with may-attributes // create array with may-attributes
@ -908,7 +908,7 @@ class accountContainer {
$string = trim($string); $string = trim($string);
// Ad may // Ad may
foreach (explode(" $ ", $string) as $attribute) { foreach (explode(" $ ", $string) as $attribute) {
$return[$attribute] = ''; $return[$attribute] = array('');
} }
} }
// Get attributes of subclasses // Get attributes of subclasses
@ -930,7 +930,7 @@ class accountContainer {
$string = trim($string); $string = trim($string);
// Ad must // Ad must
foreach (explode(" $ ", $string) as $attribute) { foreach (explode(" $ ", $string) as $attribute) {
$return[$attribute] = ''; $return[$attribute] = array('');
} }
} }
// create array with may-attributes // create array with may-attributes
@ -942,7 +942,7 @@ class accountContainer {
$string = trim($string); $string = trim($string);
// Ad may // Ad may
foreach (explode(" $ ", $string) as $attribute) { foreach (explode(" $ ", $string) as $attribute) {
$return[$attribute] = ''; $return[$attribute] = array('');
} }
} }
} }

View File

@ -182,17 +182,19 @@ class posixGroup extends baseModule {
parent::init($base); parent::init($base);
// Add Array with all attributes and type // Add Array with all attributes and type
$this->attributes = $_SESSION[$this->base]->get_module_attributes('posixGroup'); $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 // Make references to attributes which already esists in ldap
$newattributes = array_keys($this->attributes); $newattributes = array_keys($this->attributes);
$module = array_keys($_SESSION[$this->base]->module); $module = array_keys($_SESSION[$this->base]->module);
// fixme *** do we have to unset module posixAccuont itself // fixme *** do we have to unset module posixAccuont itself
for ($i=0; $i<count($module); $i++) { for ($i=0; $i<count($module); $i++) {
foreach ($newattributes as $attribute) if ($module[$i]!='posixGroup')
if (isset($_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute])) foreach ($newattributes as $attribute)
$this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$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; $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.')); $errors['gidNumber'][] = array('INFO', _('GID number'), _('GID number has changed. Please select checkbox to change GID number of users and hosts.'));
// Load attributes // 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['gidNumber'][0] = $post['gidNumber'];
$this->attributes['description'][0] = $post['description']; $this->attributes['description'][0] = $post['description'];
if ($post['userPassword_no']) $this->userPassword_no=true; if ($post['userPassword_no']) $this->userPassword_no=true;