Comment 16 for bug 757599

Revision history for this message
Michele "O-Zone" Pinassi (o-zone) wrote : Re: [Bug 757599] Re: Problema autenticazione

Ciao Davide,

l'include_once('/var/www/html/SquidTL/common.inc.php'); punta al path
corretto ?

Grazie, Michele

On 19/04/2011 16:23, Davide Lastri wrote:
> Ciao,
> squidtl_auth l'ho messo sotto /usr/lib/squid/squidtl_auth, ma all'interno di questo file non trovo nessun path riferito al config.xml
>
> Ecco il file:
> <?php
>
> include_once('/var/www/html/SquidTL/common.inc.php');
>
> if (! defined(STDIN)) {
> define("STDIN", fopen("php://stdin", "r"));
> }
> while (!feof(STDIN)) {
> $line = trim(fgets(STDIN));
> $fields = explode(' ', $line);
> $username = rawurldecode($fields[0]);
> $password = rawurldecode($fields[1]);
>
> $db = OpenDB();
>
> $result = mysql_query("SELECT Username,Context,Type FROM DB_Users WHERE Username='$username' AND Password=PASSWORD('$password');");
> if($result === false) {
> fwrite(STDOUT, "ERR\n");
> exit(1);
> }
> if(mysql_num_rows($result) > 0) {
> $row = mysql_fetch_array($result,MYSQL_ASSOC);
> $Username = stripslashes($row["Username"]);
> $Context = stripslashes($row["Context"]);
> mysql_query("UPDATE DB_Users SET LastLogin=NOW() WHERE Username='$Username';");
> fwrite(STDOUT, "OK\n");
> } else {
> fwrite(STDOUT, "ERR\n");
> }
> }
>
> ?>
>

--
O-Zone ! No (C) since 1996
On the road with VFR VTec 2002 "Vuffy", on the net with Linux Slackware.
Home+BLOG @ http://www.zerozone.it - Travels @ http://www.openitaly.net