|
Lines 1738-1744
sub get_session {
Link Here
|
| 1738 |
} |
1738 |
} |
| 1739 |
|
1739 |
|
| 1740 |
sub checkpw { |
1740 |
sub checkpw { |
| 1741 |
my ( $dbh, $userid, $password, $query, $type ) = @_; |
1741 |
my ( $dbh, $userid, $password, $query, $type, $no_set_userenv ) = @_; |
| 1742 |
$type = 'opac' unless $type; |
1742 |
$type = 'opac' unless $type; |
| 1743 |
if ($ldap) { |
1743 |
if ($ldap) { |
| 1744 |
$debug and print STDERR "## checkpw - checking LDAP\n"; |
1744 |
$debug and print STDERR "## checkpw - checking LDAP\n"; |
|
Lines 1778-1788
sub checkpw {
Link Here
|
| 1778 |
} |
1778 |
} |
| 1779 |
|
1779 |
|
| 1780 |
# INTERNAL AUTH |
1780 |
# INTERNAL AUTH |
| 1781 |
return checkpw_internal(@_) |
1781 |
return checkpw_internal( $dbh, $userid, $password, $no_set_userenv); |
| 1782 |
} |
1782 |
} |
| 1783 |
|
1783 |
|
| 1784 |
sub checkpw_internal { |
1784 |
sub checkpw_internal { |
| 1785 |
my ( $dbh, $userid, $password ) = @_; |
1785 |
my ( $dbh, $userid, $password, $no_set_userenv ) = @_; |
| 1786 |
|
1786 |
|
| 1787 |
$password = Encode::encode( 'UTF-8', $password ) |
1787 |
$password = Encode::encode( 'UTF-8', $password ) |
| 1788 |
if Encode::is_utf8($password); |
1788 |
if Encode::is_utf8($password); |
|
Lines 1812-1818
sub checkpw_internal {
Link Here
|
| 1812 |
if ( checkpw_hash( $password, $stored_hash ) ) { |
1812 |
if ( checkpw_hash( $password, $stored_hash ) ) { |
| 1813 |
|
1813 |
|
| 1814 |
C4::Context->set_userenv( "$borrowernumber", $userid, $cardnumber, |
1814 |
C4::Context->set_userenv( "$borrowernumber", $userid, $cardnumber, |
| 1815 |
$firstname, $surname, $branchcode, $branchname, $flags ); |
1815 |
$firstname, $surname, $branchcode, $branchname, $flags ) unless $no_set_userenv; |
| 1816 |
return 1, $cardnumber, $userid; |
1816 |
return 1, $cardnumber, $userid; |
| 1817 |
} |
1817 |
} |
| 1818 |
} |
1818 |
} |
|
Lines 1829-1835
sub checkpw_internal {
Link Here
|
| 1829 |
if ( checkpw_hash( $password, $stored_hash ) ) { |
1829 |
if ( checkpw_hash( $password, $stored_hash ) ) { |
| 1830 |
|
1830 |
|
| 1831 |
C4::Context->set_userenv( $borrowernumber, $userid, $cardnumber, |
1831 |
C4::Context->set_userenv( $borrowernumber, $userid, $cardnumber, |
| 1832 |
$firstname, $surname, $branchcode, $branchname, $flags ); |
1832 |
$firstname, $surname, $branchcode, $branchname, $flags ) unless $no_set_userenv; |
| 1833 |
return 1, $cardnumber, $userid; |
1833 |
return 1, $cardnumber, $userid; |
| 1834 |
} |
1834 |
} |
| 1835 |
} |
1835 |
} |