[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/members member-password.pl,1.2,1.3
From: |
Paul POULAIN |
Subject: |
[Koha-cvs] CVS: koha/members member-password.pl,1.2,1.3 |
Date: |
Thu, 02 Sep 2004 09:27:11 -0700 |
Update of /cvsroot/koha/koha/members
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5299/members
Modified Files:
member-password.pl
Log Message:
road to a better member management code.
Useful for LDAP integration
Index: member-password.pl
===================================================================
RCS file: /cvsroot/koha/koha/members/member-password.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** member-password.pl 24 Mar 2004 15:08:20 -0000 1.2
--- member-password.pl 2 Sep 2004 16:27:09 -0000 1.3
***************
*** 11,14 ****
--- 11,15 ----
use C4::Search;
use C4::Context;
+ use C4::Members;
use C4::Circulation::Circ2;
use CGI;
***************
*** 49,76 ****
if ( $newpassword ) {
! my $digest=md5_base64($input->param('newpassword'));
! my $uid = $input->param('newuserid');
! my $dbh=C4::Context->dbh;
!
! #Make sure the userid chosen is unique and not theirs if non-empty. If
it is not,
! #Then we need to tell the user and have them create a new one.
! my $sth2=$dbh->prepare("select * from borrowers where userid=? and
borrowernumber != ?");
! $sth2->execute($uid,$member);
!
! if ( ($uid ne '') && ($sth2->fetchrow) ) {
! #The userid exists so we should display a warning.
! my $warn = 1;
! $template->param( warn => $warn,
! othernames => $bor->{'othernames'},
! surname => $bor->{'surname'},
! firstname => $bor->{'firstname'},
! userid => $bor->{'userid'},
! defaultnewpassword => $newpassword );
! } else {
! #Everything is good so we can update the information.
! my $sth=$dbh->prepare("update borrowers set userid=?,
password=? where borrowernumber=?");
! $sth->execute($uid, $digest, $member);
$template->param(newpassword => $newpassword);
print
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$member");
}
} else {
--- 50,65 ----
if ( $newpassword ) {
! my $digest=md5_base64($input->param('newpassword'));
! my $uid = $input->param('newuserid');
! my $dbh=C4::Context->dbh;
! if (changepassword($uid,$member,$digest)) {
$template->param(newpassword => $newpassword);
print
$input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$member");
+ } else {
+ $template->param(othernames => $bor->{'othernames'},
+ surname =>
$bor->{'surname'},
+ firstname =>
$bor->{'firstname'},
+ userid => $bor->{'userid'},
+ defaultnewpassword =>
$newpassword );
}
} else {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/members member-password.pl,1.2,1.3,
Paul POULAIN <=
- Prev by Date:
[Koha-cvs] CVS: koha/C4 Members.pm,1.4,1.5
- Next by Date:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en/bull order.tmpl,1.4,1.5 subscription-add.tmpl,1.4,1.5
- Previous by thread:
[Koha-cvs] CVS: koha/C4 Members.pm,1.4,1.5
- Next by thread:
[Koha-cvs] CVS: koha/koha-tmpl/intranet-tmpl/default/en/bull order.tmpl,1.4,1.5 subscription-add.tmpl,1.4,1.5
- Index(es):