You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. use mod-auth-external
What is the expected output? What do you see instead?
$_ENV containing vars like the AUTHENTICATORS file says
Nothing there ...
What version of the product are you using? On what operating system?
Gentoo, apache 2.4.7, mod-auth-external-3.3.2
Please provide any additional information below.
I have the following auth php script ..
#!/usr/bin/php
<?php
function flog($msg){
$fh = fopen("/tmp/apache_auth", "a");
fwrite($fh, date("Y-m-d H:i:s")." - ".$msg."\n");
fclose($fh);
}
$user = trim(fgets(STDIN));
$pass = trim(fgets(STDIN));
$pass = sha1($pass);
flog($user." - ".$pass);
flog(print_r($_ENV, 1));
foreach ($_ENV as $k => $v){
flog($k . '=' . $v);
}
$conn = mysql_connect(...);
mysql_select_db(...);
$checkquery = "SELECT `id`, `expiry` FROM `auth` WHERE `user` =
'".mysql_real_escape_string($user)."' AND `password` =
'".mysql_real_escape_string($pass)."' AND `enabled` = '1' AND (`expiry` > NOW()
OR `expiry` = '0000-00-00 00:00:00') LIMIT 1;";
flog($checkquery);
$check = mysql_query($checkquery, $conn) or die(mysql_error($conn));
if (mysql_num_rows($check) > 0){
$row = mysql_fetch_array($check);
if($row['expiry'] != '0000-00-00 00:00:00'){
$update = "UPDATE `auth` SET `expiry` = NOW()+INTERVAL 1 MONTH WHERE `id` = '".$row['id']."' LIMIT 1;";
$update = mysql_query($update, $conn) or die(mysql_error($conn));
}
flog("Yes");
exit(0);
}else{
flog("NO");
exit(1);
}
?>
Here's what /tmp/apache_auth contains:
2013-12-12 19:30:17 - SELECT `id`, `expiry` FROM `auth` WHERE `user` = '...'
AND `password` = '...' AND `enabled` = '1' AND (`expiry` > NOW() OR `expiry` =
'0000-00-00 00:00:00') LIMIT 1;
2013-12-12 19:30:17 - Yes
2013-12-12 19:30:17 - dex - ...
2013-12-12 19:30:17 - Array
(
)
Am I doing it wrong ? Do I need to enable special flags in php/apache ?
Original issue reported on code.google.com by [email protected] on 12 Dec 2013 at 5:35
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 12 Dec 2013 at 5:35The text was updated successfully, but these errors were encountered: