- or download this
MT::Author
...
I<set_password>). This check is done by one-way encrypting I<$check_pa
+ss>,
using the same salt used to encrypt the original password, then compar
+ing the
two encrypted strings for equality.
- or download this
MT::Auth
...
is a reference to a scalar variable for storing any error message to
be returned to the application. The routine itself should return 1 for
a valid password, 0 or undef for an invalid one.
- or download this
sub set_password {
my $auth = shift;
...
# FIXME: use something besides 'crypt'
$auth->column('password', crypt $pass, $salt);
}
- or download this
sub is_valid_password {
my $author = shift;
...
require MT::Auth;
return MT::Auth->is_valid_password($author, $pass, $crypted, $erro
+r_ref);
}
- or download this
BEGIN {
my @methods = qw(
...
*{"MT::Auth::$meth"} = sub { shift; _handle($meth, @_) };
}
}
- or download this
{
my $auth_module;
...
undef $auth_module;
}
}
- or download this
sub is_valid_password {
my $auth = shift;
...
return $crypted ? $real_pass eq $pass :
crypt($pass, $real_pass) eq $real_pass;
}