2014-06-02, 04:15 PM
I have the following problem. I have been crated a C# Login Program for my Forum.
This works relatively well so far.
However, all users can sign up there (except those that have their Acc not Activated)
I want that only the groups subscriber, Admin, Moderator can log in.
I hope anybody can help me
This works relatively well so far.
However, all users can sign up there (except those that have their Acc not Activated)
I want that only the groups subscriber, Admin, Moderator can log in.
I hope anybody can help me
?php
include_once("config.inc.php");
mysql_connect(PRIVAT, PRIVAT, PRIVAT);
mysql_select_db(PRIVAT);
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string(md5($_POST['password']));
$que = mysql_query("SELECT uid, password, salt FROM mybb_users WHERE username = '$username' LIMIT 1");
if(!mysql_num_rows($que))
{
die("Username not found.");
}
$row = mysql_fetch_assoc($que);
$uid = $row['uid'];
$salt = $row['salt'];
$hshed = $row['password'];
$input = md5(md5($salt).$password);
$objResult = mysql_query("SELECT uid FROM mybb_awaitingactivation WHERE uid = '$uid'");
$blnFound = (boolean) ($objResult) ? mysql_num_rows($objResult) : FALSE;
if($input != $hshed)
{
die("bad");
}
else
{
if($blnFound == true)
{
echo "activation";
}
else
{
echo "good";
}
}
?>