From ff16dd9ed0678b13f311959d65ea2c840ad6be4c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 10 Oct 2004 11:40:31 +0000 Subject: [PATCH] updated to new profile functions --- lam/lib/modules.inc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 0b455452..92d3f78a 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -554,9 +554,7 @@ class accountContainer { // load profile if ($post['selectLoadProfile'] && $post['loadProfile']) { // *** fixme load*Profile must return array in the same way ldap_get_attributes does. - $function = '$newattributes = load'.ucfirst($scope).'Profile($post[\'selectLoadProfile\']);'; - //eval($function); - $newattributes = call_user_func('load'.ucfirst($scope).'Profile', $post['selectLoadProfile']); + $newattributes = loadAccountProfile($post['selectLoadProfile'], $scope); // pass newattributes to each module $modules = array_keys($this->module); foreach ($modules as $module) $this->module[$module]->load_attributes($newattributes); @@ -573,9 +571,7 @@ class accountContainer { if ($post['saveProfile']) { if ($post['selectSaveProfile']=='') $errors['saveProfile'][] = array('ERROR', _('Save profile'), _('No profilename given.')); else { - $function = 'save'.ucfirst($scope).'Profile();'; - //eval($function); - call_user_func('save'.ucfirst($scope).'Profile'); + //saveAccountProfile($scope); // TODO missing parameters, remove? if ($function) $errors['saveProfile'][] = array('INFO', _('Save profile'), _('New profile created.')); else $errors['saveProfile'][] = array('ERROR', _('Save profile'), _('Wrong profilename given.')); } @@ -707,9 +703,7 @@ class accountContainer { if (!$profile) { // Get list of profiles - $function = '$profilelist = get'.ucfirst($this->type).'Profiles();'; - //eval($function); - $profilelist = call_user_func('get'.ucfirst($this->type).'Profiles'); + $profilelist = getAccountProfiles($this->type); if (count($profilelist)!=0) { $return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _("Load profile") ), 1 => array ( 'kind' => 'select', 'name' => 'selectLoadProfile', 'options' => $profilelist ), @@ -1271,7 +1265,7 @@ class accountContainer { // Write Module-Order in variable $this->order = array_merge ('main' ,$order); // *** fixme load*Profile must return array in the same way ldap_get_attributes does. - $function = '$newattributes = load'.ucfirst($this->type).'Profile(\'default\');'; + $function = '$newattributes = load'.ucfirst($this->type).'Profile(\'default\');'; // TODO function is called loadAccountProfile() //eval($function); return 0; }