#!/usr/local/bin/perl
# hide.cgi
# Remove from user's module list

require './acl-lib.pl';
&ReadParse();
&can_edit_user($in{'user'}) || &error($text{'edit_euser'});

%hide = map { $_, 1 } split(/\0/, $in{'hide'});
($user) = grep { $_->{'name'} eq $in{'user'} } &list_users();
$user->{'modules'} = [ grep { !$hide{$_} } @{$user->{'modules'}} ];
&modify_user($user->{'name'}, $user);
&restart_miniserv();
&redirect("");

