Hi,
i try to authentificate squid users against a hsql-db.
I'm using a php-script which i have found. It seems to be okay, squid was
working with it, authentification is ok. Now i have another script which
connects to the database and gives a result-value (0=ok, 1 =err).
If I modify the php-script to proof the return-value, authentification don't
work with user out of the database, but it worked with testuser (fo and
hello) from the script. I get the pages which i want after authentification
with the script-user, but not with the db-user. The squid-access.log said
then TCP_DENIED.
If i test it on the commandline it's okay for both
example:
./squid_helper.php
fo bar
OK
root roter
OK
hello world
OK
I don't know where the error is.
Here is the Script:
#!/usr/bin/php
<?
if (! defined(STDIN)) {
define("STDIN", fopen("php://stdin", "r"));
}
while (!feof(STDIN)) {
$line = trim(fgets(STDIN));
$fields = explode(' ', $line);
$username = rawurldecode($fields[0]); //1738
$password = rawurldecode($fields[1]); //1738
$last_line = exec("cd /root/bin/Ausgabe && java Ausgabe
".$username." ".$password,$output, $retval);
// fwrite(STDOUT, $retval);
if ($username == 'hello'
and $password == 'world') {
fwrite(STDOUT, "OK\n");
// fwrite(STDOUT, "eins\n");
} else if ($username == 'fo'
and $password == 'bar') {
fwrite(STDOUT, "OK\n");
// fwrite(STDOUT, "zwei\n");
} else if ($retval == 0) {
fwrite(STDOUT, "OK\n");
// fwrite(STDOUT, "drei\n");
}else {
fwrite(STDOUT, "ERR\n");
}
// if ($retval == 0) { fwrite(STDOUT, "OK\n"); }
// else { fwrite(STDOUT, "ERR\n"); }
}
?>
Do you have any ideas?
-- View this message in context: http://www.nabble.com/Squid-Authentification-tp19649606p19649606.html Sent from the Squid - Users mailing list archive at Nabble.com.Received on Wed Sep 24 2008 - 14:02:10 MDT
This archive was generated by hypermail 2.2.0 : Wed Sep 24 2008 - 12:00:03 MDT