[Koha-cvs] koha/opac opac-passwd.pl [R_2-2-7-1]
Antoine Farnault
antoine at koha-fr.org
Mon Feb 12 11:30:15 CET 2007
CVSROOT: /sources/koha
Module name: koha
Branch: R_2-2-7-1
Changes by: Antoine Farnault <toins> 07/02/12 10:30:15
Modified files:
opac : opac-passwd.pl
Log message:
Commiting BUG FIX for 2.2.7.1.
(fix for Bug 1150, password now has to be at least systempreference - MinPasswordLength or 5, if the preference doesn't exist.)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-passwd.pl?cvsroot=koha&only_with_tag=R_2-2-7-1&r1=1.1.2.4&r2=1.1.2.4.6.1
Patches:
Index: opac-passwd.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-passwd.pl,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.4.6.1
diff -u -b -r1.1.2.4 -r1.1.2.4.6.1
--- opac-passwd.pl 8 Mar 2006 13:46:55 -0000 1.1.2.4
+++ opac-passwd.pl 12 Feb 2007 10:30:14 -0000 1.1.2.4.6.1
@@ -40,7 +40,9 @@
flagsrequired => {borrow => 1},
debug => 1,
});
-
+my $MinPasswordLength = (C4::Context->preference("MinPasswordLength") ?
+ C4::Context->preference("MinPasswordLength") :5
+ );
# get borrower information ....
my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
my $sth = $dbh->prepare("UPDATE borrowers SET password = ? WHERE borrowernumber=?");
@@ -48,7 +50,7 @@
if ( $query->param('Oldkey') && $query->param('Newkey') && $query->param('Confirm') ){
if ( goodkey($dbh,$borrowernumber, $query->param('Oldkey')) ){
if ( $query->param('Newkey') eq $query->param('Confirm') &&
- length($query->param('Confirm')) > 5 ){ # Record password
+ length($query->param('Confirm')) >= $MinPasswordLength ){ # Record password
my $clave = md5_base64($query->param('Newkey'));
$sth->execute($clave,$borrowernumber);
$template->param('password_updated' => '1');
@@ -57,10 +59,11 @@
$template->param('Ask_data' => '1');
$template->param('Error_messages' => '1');
$template->param('PassMismatch' => '1');
- }elsif (length($query->param('Confirm')) <= 5 ){
+ }elsif (length($query->param('Confirm')) < $MinPasswordLength ){
$template->param('Ask_data' => '1');
$template->param('Error_messages' => '1');
$template->param('ShortPass' => '1');
+ $template->param('MinPasswordLength' => $MinPasswordLength );
}else{
$template->param('Error_messages' => '1');
}
More information about the Koha-cvs
mailing list