|
Lines 116-126
sub get_template_and_user {
Link Here
|
| 116 |
my $template = C4::Templates->new( $interface, $filename, $tmplbase, $query); |
116 |
my $template = C4::Templates->new( $interface, $filename, $tmplbase, $query); |
| 117 |
|
117 |
|
| 118 |
my ( $user, $cookie, $sessionID, $flags ) = checkauth( |
118 |
my ( $user, $cookie, $sessionID, $flags ) = checkauth( |
| 119 |
$in->{'query'}, |
119 |
$in->{'query'}, |
| 120 |
$in->{'authnotrequired'}, |
120 |
$in->{'authnotrequired'}, |
| 121 |
$in->{'flagsrequired'}, |
121 |
$in->{'flagsrequired'}, |
| 122 |
$in->{'type'} |
122 |
$in->{'type'} |
| 123 |
); |
123 |
); |
| 124 |
|
124 |
|
| 125 |
# use Data::Dumper;warn "utilisateur $user cookie : ".Dumper($cookie); |
125 |
# use Data::Dumper;warn "utilisateur $user cookie : ".Dumper($cookie); |
| 126 |
|
126 |
|
|
Lines 290-295
sub checkauth {
Link Here
|
| 290 |
my $password = $query->param('password'); |
290 |
my $password = $query->param('password'); |
| 291 |
C4::Context->_new_userenv($sessionID); |
291 |
C4::Context->_new_userenv($sessionID); |
| 292 |
my ( $return, $cardnumber ) = checkpw( $userid, $password ); |
292 |
my ( $return, $cardnumber ) = checkpw( $userid, $password ); |
|
|
293 |
|
| 293 |
if ($return) { |
294 |
if ($return) { |
| 294 |
$loggedin = 1; |
295 |
$loggedin = 1; |
| 295 |
# open L, ">>/tmp/sessionlog"; |
296 |
# open L, ">>/tmp/sessionlog"; |
|
Lines 330-339
sub checkauth {
Link Here
|
| 330 |
} |
331 |
} |
| 331 |
} |
332 |
} |
| 332 |
else { |
333 |
else { |
| 333 |
if ($userid) { |
334 |
if ($userid) { |
| 334 |
$info{'invalid_username_or_password'} = 1; |
335 |
$info{'invalid_username_or_password'} = 1; |
| 335 |
C4::Context->_unset_userenv($sessionID); |
336 |
C4::Context->_unset_userenv($sessionID); |
| 336 |
} |
337 |
} |
| 337 |
} |
338 |
} |
| 338 |
} |
339 |
} |
| 339 |
|
340 |
|
|
Lines 379-384
sub checkauth {
Link Here
|
| 379 |
$template->param( login => 1 ); |
380 |
$template->param( login => 1 ); |
| 380 |
$template->param( loginprompt => 1 ) unless $info{'nopermission'}; |
381 |
$template->param( loginprompt => 1 ) unless $info{'nopermission'}; |
| 381 |
|
382 |
|
|
|
383 |
if ($info{'invalid_username_or_password'} == 1) { |
| 384 |
$template->param( 'invalid_username_or_password' => $info{'invalid_username_or_password'}); |
| 385 |
} |
| 386 |
|
| 382 |
$template->param( \%info ); |
387 |
$template->param( \%info ); |
| 383 |
$cookie = $query->cookie( |
388 |
$cookie = $query->cookie( |
| 384 |
-name => 'CGISESSID', |
389 |
-name => 'CGISESSID', |
|
Lines 423-429
sub checkpw {
Link Here
|
| 423 |
# some features won't be effective : modify systempref, modify MARC structure, |
428 |
# some features won't be effective : modify systempref, modify MARC structure, |
| 424 |
return 2; |
429 |
return 2; |
| 425 |
} |
430 |
} |
| 426 |
return 0; |
431 |
else{ |
|
|
432 |
|
| 433 |
|
| 434 |
} |
| 427 |
} |
435 |
} |
| 428 |
|
436 |
|
| 429 |
END { } # module clean-up code here (global destructor) |
437 |
END { } # module clean-up code here (global destructor) |
| 430 |
- |
|
|