Viewing file: checkPasswd.inc.php3 (1.73 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
require("$mysqlCall");
$pass = crypt($pass, $user);
$query = "SELECT * FROM $users where user=\"$user\" and pass=\"$pass\"";
$mysql_result = mysql_query($query, $mysql_link);
if($row = mysql_fetch_row($mysql_result))
{
$fetch_ID = $row[0];
$fetch_user = $row[1];
$fetch_pass = $row[2];
$fetch_superuser = $row[3];
$fetch_email = $row[4];
$active = $row[6];
if($active)
{
if($fetch_superuser == 1)
{
$remote_addr = $REMOTE_ADDR;
$superSession = SessionID(30);
//insert session to database
$Query = "INSERT INTO $superSessionT ";
$Query .= "VALUES ('$superSession', now(), '$fetch_ID', '$remote_addr') ";
mysql_query($Query, $mysql_link);
printSuperGUI($mode, $user, $fetch_email, $superSession, $fetch_ID, $config);
$realuser = 1;
}
else
{
$remote_addr = $REMOTE_ADDR;
$session = SessionID(30);
$Query = "INSERT INTO $normalSessionT ";
$Query .= "VALUES ('$session', now(), '$fetch_ID', '$remote_addr') ";
mysql_query($Query, $mysql_link);
printNormalGUI($mode, $user, $fetch_email, $session, $fetch_ID, $config);
$realuser = 1;
}
}
else
{
print("Vas nalog je deaktiviran<br>");
$realuser = 1;
}
}
if(!isset($realuser))
{
print("<br>Nijeste registrovani ili ste unijeli pogresan password. Probajte ponovo.<br>");
print("<a href=\"index.php3?mode=login\">Kliknite ovdje da bi se ponovo logovali</a>");
}
?>
|