Hi
How do I stop a non siteadmin user from accessing the site root dir?
Saw this at WHT
Had to make one small edit to get it to work for "normal" (non site-admin) users:
"fileman.pl" just dies on line 52 when any user except siteAdmin tries to
login. Check here:
unless ($members =~ /$ENV{REMOTE_USER}/) {
die sprintf ($GT::FileMan::Commands::LANGUAGE{COBALT_BADGROUP},
$root_dir, $ENV{REMOTE_USER});
}
If you take out this line:
die sprintf ($GT::FileMan::Commands::LANGUAGE {COBALT_BADGROUP}, $root_dir, $ENV{REMOTE_USER});
and replace it with something like
my ($user_dir) = $dir =~ m,^(/home/sites/\w+/users/$ENV{REMOTE_USER}),;
$root_dir = $user_dir;
It will now just work fine with all site users by putting users in their respective home directories if they are not site_admins. And they will not be able to access the upper level dir.
I did that and even the lowliest of user could log in and manage his personal web space.
__________________
Gary Harris
http://www.dixiesys.com/
I don't dare to change the code myself... don't know perl that well.
Thanks.
How do I stop a non siteadmin user from accessing the site root dir?
Saw this at WHT
Had to make one small edit to get it to work for "normal" (non site-admin) users:
"fileman.pl" just dies on line 52 when any user except siteAdmin tries to
login. Check here:
unless ($members =~ /$ENV{REMOTE_USER}/) {
die sprintf ($GT::FileMan::Commands::LANGUAGE{COBALT_BADGROUP},
$root_dir, $ENV{REMOTE_USER});
}
If you take out this line:
die sprintf ($GT::FileMan::Commands::LANGUAGE {COBALT_BADGROUP}, $root_dir, $ENV{REMOTE_USER});
and replace it with something like
my ($user_dir) = $dir =~ m,^(/home/sites/\w+/users/$ENV{REMOTE_USER}),;
$root_dir = $user_dir;
It will now just work fine with all site users by putting users in their respective home directories if they are not site_admins. And they will not be able to access the upper level dir.
I did that and even the lowliest of user could log in and manage his personal web space.
__________________
Gary Harris
http://www.dixiesys.com/
I don't dare to change the code myself... don't know perl that well.
Thanks.