Apache-AuthenPasswd

 view release on metacpan or  search on metacpan

AuthenPasswd.pm  view on Meta::CPAN

    return $res if $res; #decline if not Basic

    my $name = MP2 ? $r->user : $r->connection->user;

    if ($name eq "") {
	$r->note_basic_auth_failure;
        MP2 ?  $r->log_error("Apache::AuthenPasswd - no username given", $r->uri) : $r->log_reason("Apache::AuthenPasswd - no username given", $r->uri);
        return MP2 ? Apache::HTTP_UNAUTHORIZED : Apache::Constants::HTTP_UNAUTHORIZED;
    }

    my ($user, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwnam $name;

    unless ($user) {
	$r->note_basic_auth_failure;
	MP2 ? $r->log_error("Apache::AuthenPasswd - user $name: unknown", $r->uri) : $r->log_reason("Apache::AuthenPasswd - user $name: unknown", $r->uri);
        return MP2 ? Apache::HTTP_UNAUTHORIZED : Apache::Constants::HTTP_UNAUTHORIZED;
    }

    if(crypt($sent_pwd, $passwd) eq $passwd) {
	return MP2 ? Apache::OK : Apache::Constants::OK;
    } else {



( run in 0.622 second using v1.01-cache-2.11-cpan-5735350b133 )