voogru
01-10-2002, 01:43 AM
Hello, im trying to get this download script to work even better, it seems that this one allows a user to download a file if they havent been authorized yet (the confirming email) and i want to make it look to make sure the user is registered or higher heres what i have:
<?
############################################
# Hack by: GameZilla #
# E-mail: gamezilla@socal.rr.com #
# Forum: http://www.otakuforums.com #
############################################
$file_name = "".basename($file);
include("config.inc");
$mysql['user'] = "username";
$mysql['pass'] = "password";
$mysql['db'] = "vbulletin";
$mysql['table'] = "user";
$link = mysql_connect("localhost",$mysql['user'],$mysql['pass']);
mysql_select_db($mysql['db']);
$user = ($HTTP_COOKIE_VARS['user']) ? $HTTP_COOKIE_VARS['user'] : $HTTP_POST_VARS['user'];
$pass = ($HTTP_COOKIE_VARS['pass']) ? $HTTP_COOKIE_VARS['pass'] : $HTTP_POST_VARS['pass'];
$r = mysql_query("SELECT userid,username,password FROM $mysql[table] WHERE username='$user'");
while ($row = mysql_fetch_array($r))
{
if(strtolower($user) == strtolower($row['username']) && md5($pass) == $row['password'])
{
setcookie("user","$user",time() + (9999 * 86400));
setcookie("pass","$pass",time() + (9999 * 86400));
header("location: $file");
exit();
}
$data = addslashes(implode("",file("login.html")));
eval("echo stripslashes(\"$data\");");
exit();
?>
how can i make this look at what a users registration status is?
something like:
}
if ($usergroupid == 1 || $usergroupid == 3 || $usergroupid == 4 || $usergroupid == 8) {
&dieWell("Sorry, your account is valid but is not active. Did you receive the confirmation email?");
}
but thats perl :p
thanks :)
-voogru
<?
############################################
# Hack by: GameZilla #
# E-mail: gamezilla@socal.rr.com #
# Forum: http://www.otakuforums.com #
############################################
$file_name = "".basename($file);
include("config.inc");
$mysql['user'] = "username";
$mysql['pass'] = "password";
$mysql['db'] = "vbulletin";
$mysql['table'] = "user";
$link = mysql_connect("localhost",$mysql['user'],$mysql['pass']);
mysql_select_db($mysql['db']);
$user = ($HTTP_COOKIE_VARS['user']) ? $HTTP_COOKIE_VARS['user'] : $HTTP_POST_VARS['user'];
$pass = ($HTTP_COOKIE_VARS['pass']) ? $HTTP_COOKIE_VARS['pass'] : $HTTP_POST_VARS['pass'];
$r = mysql_query("SELECT userid,username,password FROM $mysql[table] WHERE username='$user'");
while ($row = mysql_fetch_array($r))
{
if(strtolower($user) == strtolower($row['username']) && md5($pass) == $row['password'])
{
setcookie("user","$user",time() + (9999 * 86400));
setcookie("pass","$pass",time() + (9999 * 86400));
header("location: $file");
exit();
}
$data = addslashes(implode("",file("login.html")));
eval("echo stripslashes(\"$data\");");
exit();
?>
how can i make this look at what a users registration status is?
something like:
}
if ($usergroupid == 1 || $usergroupid == 3 || $usergroupid == 4 || $usergroupid == 8) {
&dieWell("Sorry, your account is valid but is not active. Did you receive the confirmation email?");
}
but thats perl :p
thanks :)
-voogru