ClearPress::authenticator::passwd - ClearPress::authenticator::passwd documentation


ClearPress documentation Contained in the ClearPress distribution.

Index


Code Index:

NAME

Top

ClearPress::authenticator::passwd

VERSION

Top

$LastChangedRevision: 348 $

SYNOPSIS

Top

DESCRIPTION

Top

SUBROUTINES/METHODS

Top

authen_credentials - attempt to authenticate against passwd/NIS using given username & password

  my $hrAuthenticated = $oPasswd->authen_credentials({username => $sUsername, password => $sPassword});

  returns undef or hashref

DIAGNOSTICS

Top

CONFIGURATION AND ENVIRONMENT

Top

DEPENDENCIES

Top

strict
warnings
base
ClearPress::authenticator
Readonly
Carp

INCOMPATIBILITIES

Top

BUGS AND LIMITATIONS

Top

AUTHOR

Top

$Author: Roger Pettett$

LICENSE AND COPYRIGHT

Top


ClearPress documentation Contained in the ClearPress distribution.

#########
# Author:        rmp
# Last Modified: $Date: 2010-01-04 13:02:42 +0000 (Mon, 04 Jan 2010) $
# Id:            $Id: passwd.pm 348 2010-01-04 13:02:42Z zerojinx $
# Source:        $Source$
# $HeadURL: https://clearpress.svn.sourceforge.net/svnroot/clearpress/trunk/lib/ClearPress/authenticator/passwd.pm $
#
package ClearPress::authenticator::passwd;
use strict;
use warnings;
use base qw(ClearPress::authenticator);
use Carp;

our $VERSION = do { my ($r) = q$Revision: 348 $ =~ /(\d+)/smx; $r; };

sub authen_credentials {
  my ($self, $ref) = @_;

  if(!$ref ||
     !$ref->{username} ||
     !$ref->{password} ) {
    return;
  }

  my ($name, $passwd) = getpwnam $ref->{username};
  if(!$name) {
    return;
  }

  if((crypt $ref->{password}, $passwd) eq $passwd) {
    return $ref;
  }

  return;
}

1;
__END__