Commit 247cc5a6b70da1fe25b6ff98a62c6c31c1f0e5ec

Authored by Frederik Lindenaar
1 parent 21fe3aad

Fixed issue for not showing new values after submitting the configuration screen

Closes #1
Showing 1 changed file with 7 additions and 9 deletions
admin/newusers.php
@@ -12,10 +12,7 @@ $me = new Ldap(); @@ -12,10 +12,7 @@ $me = new Ldap();
12 $me->load_config(); 12 $me->load_config();
13 //$me = get_plugin_data($plugin_id); 13 //$me = get_plugin_data($plugin_id);
14 14
15 -$template->assign('ALLOW_NEWUSERS', $me->config['allow_newusers']);  
16 -$template->assign('ADVERTISE_ADMINS', $me->config['advertise_admin_new_ldapuser']);  
17 -$template->assign('SEND_CASUAL_MAIL', $me->config['send_password_by_mail_ldap']);  
18 - 15 +// Save LDAP configuration when submitted
19 if (isset($_POST['save'])){ 16 if (isset($_POST['save'])){
20 17
21 if (isset($_POST['ALLOW_NEWUSERS'])){ 18 if (isset($_POST['ALLOW_NEWUSERS'])){
@@ -34,11 +31,7 @@ if (isset($_POST['save'])){ @@ -34,11 +31,7 @@ if (isset($_POST['save'])){
34 $me->config['send_password_by_mail_ldap'] = True; 31 $me->config['send_password_by_mail_ldap'] = True;
35 } else { 32 } else {
36 $me->config['send_password_by_mail_ldap'] = False; 33 $me->config['send_password_by_mail_ldap'] = False;
37 - }  
38 -}  
39 34
40 -// Save LDAP configuration  
41 -if (isset($_POST['save'])){  
42 $me->save_config(); 35 $me->save_config();
43 } 36 }
44 37
@@ -48,5 +41,10 @@ if (isset($_POST['save'])){ @@ -48,5 +41,10 @@ if (isset($_POST['save'])){
48 // what do we do when there's no mail in the ldap ? 41 // what do we do when there's no mail in the ldap ?
49 // do we send mail to admins ? 42 // do we send mail to admins ?
50 43
  44 +// And build up the form with the new values
  45 +$template->assign('ALLOW_NEWUSERS', $me->config['allow_newusers']);
  46 +$template->assign('ADVERTISE_ADMINS', $me->config['advertise_admin_new_ldapuser']);
  47 +$template->assign('SEND_CASUAL_MAIL', $me->config['send_password_by_mail_ldap']);
  48 +
51 $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); 49 $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
52 -?>  
53 \ No newline at end of file 50 \ No newline at end of file
  51 +?>