« First PRODUCTION Solaris 10 x86 box | Main | Using WebAuth in the central UMBC Web Environment »

userpages.umbc.edu disabled account handling

The content for disabled accounts will no longer display on userpages.umbc.edu. This means that if you're account disabled, so is your free web hosting.

Very simple mod_perl module to do this:

package UMBC::HomePageAccess;

use Apache;
use Apache::Constants qw(:common HTTP_MOVED_TEMPORARILY DECLINE_CMD);
use Apache::Log;

sub handler {

my($r) = shift(@_);

my $uri = $r->uri;

if ( $uri =~ /^\/\~([^\/]+)\// ) {
my ($name, $passwd, $uid, $gid, $quota, $gcos, $dir, $shell) =
getpwnam($1);
if ( defined($passwd) ) {
if ( $passwd =~ /^\*(DEACTIVATED|INACTIVE|DELETED)\*$/ ) {
$r->custom_response(404, "/error_disabled.html");
return 404;

}
}
}

return DECLINED;

}

1;

Post a comment

About

This page contains a single entry from the blog posted on April 18, 2005 4:48 PM.

The previous post in this blog was First PRODUCTION Solaris 10 x86 box.

The next post in this blog is Using WebAuth in the central UMBC Web Environment.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34