diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc
index 469b5a11..e1bc9229 100644
--- a/lam/lib/modules.inc
+++ b/lam/lib/modules.inc
@@ -793,6 +793,8 @@ class accountContainer {
/** True if this is a newly created account */
var $isNewAccount;
+
+ private $lastLoadedProfile = '';
/**
* Returns the account module with the given class name
@@ -847,21 +849,6 @@ class accountContainer {
// change RDN
if (isset($_POST['rdn'])) $this->rdn = $_POST['rdn'];
- // load profile
- if (isset($_POST['selectLoadProfile']) && isset($_POST['loadProfile'])) {
- $profile = loadAccountProfile($_POST['selectLoadProfile'], $this->type);
- // pass profile to each module
- $modules = array_keys($this->module);
- foreach ($modules as $module) $this->module[$module]->load_profile($profile);
- if (isset($profile['ldap_rdn'][0])) {
- if (in_array($profile['ldap_rdn'][0], getRDNAttributes($this->type))) {
- $this->rdn = $profile['ldap_rdn'][0];
- }
- }
- if (isset($profile['ldap_suffix'][0])) {
- $this->dn = $profile['ldap_suffix'][0];
- }
- }
// save account
if (isset($_POST['create'])) {
$errors = $this->save_account();
@@ -893,6 +880,22 @@ class accountContainer {
}
}
else $result = call_user_func(array(&$this->module[$this->order[$this->current_page]], 'process_'.$this->subpage));
+ // load profile
+ if (isset($_POST['accountContainerLoadProfile']) && isset($_POST['accountContainerSelectLoadProfile'])) {
+ $profile = loadAccountProfile($_POST['accountContainerSelectLoadProfile'], $this->type);
+ $this->lastLoadedProfile = $_POST['accountContainerSelectLoadProfile'];
+ // pass profile to each module
+ $modules = array_keys($this->module);
+ foreach ($modules as $module) $this->module[$module]->load_profile($profile);
+ if (isset($profile['ldap_rdn'][0])) {
+ if (in_array($profile['ldap_rdn'][0], getRDNAttributes($this->type))) {
+ $this->rdn = $profile['ldap_rdn'][0];
+ }
+ }
+ if (isset($profile['ldap_suffix'][0])) {
+ $this->dn = $profile['ldap_suffix'][0];
+ }
+ }
}
// change to next page
$errorsOccured = false;
@@ -1037,9 +1040,28 @@ class accountContainer {
echo "subpage == 'finish') echo " disabled";
echo ">\n";
- echo "
\n";
+ echo "
\n";
}
// profile selection
+ $profilelist = getAccountProfiles($this->type);
+ if (sizeof($profilelist) > 0) {
+ sort($profilelist);
+ echo "