Skip to content

Commit

Permalink
Expand available shells to be per-user type
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Dec 6, 2023
1 parent b663883 commit a3aaaac
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions virtual-server-lib-funcs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17974,10 +17974,15 @@ sub list_available_shells
$classes{'ssh'}++;
$defclass = 'ssh';
}
# Only the default or first of each class are available
# Only the default or first of each class are available for each user
foreach my $c (grep { $_ ne $defclass } keys %classes) {
local ($firstclass) = grep { $_->{'id'} eq $c } @rv;
$firstclass->{'avail'} = 1;
foreach my $u ('owner', 'mailbox') {
my ($firstclass) = grep { $_->{'id'} eq $c &&
$_->{$u} } @rv;
if ($firstclass) {
$firstclass->{'avail'} = 1;
}
}
}
}
$list_available_shells_cache{$mail} = \@rv;
Expand Down

0 comments on commit a3aaaac

Please sign in to comment.