Archived
1
0

Fixed order of processing form data, after submit the new data is now shown

Closes: #1
This commit is contained in:
2015-07-19 23:18:01 +02:00
parent 1ccfe95390
commit 21fe3aadbc

View File

@@ -13,15 +13,7 @@ $me = new Ldap();
$me->load_config(); $me->load_config();
//$me = get_plugin_data($plugin_id); //$me = get_plugin_data($plugin_id);
$template->assign('HOST', $me->config['host']); // Save LDAP configuration when submitted
$template->assign('BASEDN', $me->config['basedn']); // racine !
$template->assign('PORT', $me->config['port']);
$template->assign('LD_ATTR', $me->config['ld_attr']);
$template->assign('LD_GROUP', $me->config['ld_group']);
$template->assign('LD_USE_SSL', $me->config['ld_use_ssl']);
$template->assign('LD_BINDPW', $me->config['ld_bindpw']);
$template->assign('LD_BINDDN', $me->config['ld_binddn']);
if (isset($_POST['save'])){ if (isset($_POST['save'])){
$me->config['host'] = $_POST['HOST']; $me->config['host'] = $_POST['HOST'];
$me->config['basedn'] = $_POST['BASEDN']; $me->config['basedn'] = $_POST['BASEDN'];
@@ -36,10 +28,7 @@ if (isset($_POST['save'])){
} else { } else {
$me->config['ld_use_ssl'] = False; $me->config['ld_use_ssl'] = False;
} }
}
// Save LDAP configuration
if (isset($_POST['save'])){
$me->save_config(); $me->save_config();
} }
@@ -71,5 +60,15 @@ if (isset($_POST['check_ldap'])){
} }
} }
// And build up the form with the new values
$template->assign('HOST', $me->config['host']);
$template->assign('BASEDN', $me->config['basedn']); // racine !
$template->assign('PORT', $me->config['port']);
$template->assign('LD_ATTR', $me->config['ld_attr']);
$template->assign('LD_GROUP', $me->config['ld_group']);
$template->assign('LD_USE_SSL', $me->config['ld_use_ssl']);
$template->assign('LD_BINDPW', $me->config['ld_bindpw']);
$template->assign('LD_BINDDN', $me->config['ld_binddn']);
$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
?> ?>