Improve the way the auth server list is generated and account for a key being removed from the array when deleting. Fixes #7682

This commit is contained in:
jim-p 2017-07-10 12:15:13 -04:00
parent 7da9f1e5fe
commit fa628b1a15

View File

@ -139,10 +139,7 @@ if (!is_array($config['system']['authserver'])) {
$config['system']['authserver'] = array();
}
$a_servers = auth_get_authserver_list();
foreach ($a_servers as $servers) {
$a_server[] = $servers;
}
$a_server = array_values(auth_get_authserver_list());
if (!is_array($config['ca'])) {
$config['ca'] = array();
@ -171,6 +168,7 @@ if ($act == "del") {
/* Remove server from temp list used later on this page. */
unset($a_server[$_GET['id']]);
$a_server = array_values($a_server);
$savemsg = sprintf(gettext("Authentication Server %s deleted."), htmlspecialchars($serverdeleted));
write_config($savemsg);