From f3206b076d073fd0ca0b0c14d20b2e2fbfa5232c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 28 Oct 2008 23:55:46 +0000 Subject: [PATCH] Fix bugs in edit user page when shells and groups are limited --- useradmin/edit_user.cgi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/useradmin/edit_user.cgi b/useradmin/edit_user.cgi index 45fb40a5e..c9c963136 100755 --- a/useradmin/edit_user.cgi +++ b/useradmin/edit_user.cgi @@ -142,6 +142,8 @@ print &ui_table_row(&hlink($text{'home'}, "home"), # Show shell drop-down push(@shlist, $uinfo{'shell'}) if (%uinfo && $uinfo{'shell'}); if ($access{'shells'} ne "*") { + # Limit to shells from ACL + @shlist = %uinfo ? ($uinfo{'shell'}) : (); push(@shlist, split(/\s+/, $access{'shells'})); $shells = 1; } @@ -413,7 +415,7 @@ if ($access{'ugroups'} eq "*" || $access{'uedit_gmode'} >= 3) { } else { # From fixed menu of groups - $cg = %uinfo ? &my_getgrgid($uinfo{'gid'}) : undef; + $cg = $uinfo{'gid'} ? &my_getgrgid($uinfo{'gid'}) : undef; @gl = &unique($cg ? ($cg) : (), &split_quoted_string($access{'ugroups'})); push(@groupopts, [ 0, $text{'uedit_oldg'},