From 02068d31c52d9d4c3b6f8a23442d03897eff962d Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 10 Jul 2017 12:15:13 -0400 Subject: Improve the way the auth server list is generated and account for a key being removed from the array when deleting. Fixes #7682 (cherry picked from commit fa628b1a15a1c03343caa2735e09de291ae4e382) --- src/usr/local/www/system_authservers.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php index a56f8cc..7678c3b 100644 --- a/src/usr/local/www/system_authservers.php +++ b/src/usr/local/www/system_authservers.php @@ -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); -- cgit v1.1