the login page would use the data from the old phpbb2 forums.
Then, it would allow you to login.
What i have done, is change the login info, delete the part that checks if a user is active or not (not in phpbb3), then i attempted to login.
I cant login, no errors, or anything comes up.
I have done some research on this, and it appears that phpbb has changed its password encryption. some people have said they use their own encryption now. I have a few login scripts. They all use this line of code.
if(phpbb_check_hash($password, $user->user_password))
They also use a hash.php file. Which i have, and added this to an includes file.
This is now my code.
The code that I know works, but for something different.
Code:
<html>
<body>
<?php
include('generate_sig.php');
include('includes/hash.php');
include('mysql_connect_sig.php');
if(isset($_POST['submit'])){
if(empty($_POST['username'])){
$username = FALSE;
$message = '<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<b>Login Failed!</b> <br />
No username entered.
<br />Please Try again<br />
</table><br /><br />';
}else{
$username = $_POST['username'];
}
if(empty($_POST['password'])){
$password = FALSE;
$message1 = '<br /><table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<b>Login Failed!</b> <br />
No password entered.
<br />Please Try again<br />
</table><br /><br />';
}else{
$password = $_POST['password'];
//$password = md5($password1);
}
//echo $password1 .' ' .$password. ' ' .$username;
if($username && $password){
/* Connect to the database and prepare the signature */
//require_once ('../mysql1_connect1.php');
//echo 'username: ' . USERNAME;
$db_connection = mysql_connect(HOST, USERNAME, PASSWORD) or die("Could not connect to DB");
/* Select the database we need */
mysql_select_db(DBNAME, $db_connection) or die("Could not find DB");
$query = "SELECT u.user_id, u.username, u.user_posts, u.user_password, u.user_form_salt, p.pf_runescape_user FROM phpbb_users u, phpbb_profile_fields_data p WHERE u.username='$username' AND u.user_id=p.user_id";
$result = mysql_query($query, $db_connection);
if (!$result) {
die(mysql_error());
}
$user = mysql_fetch_object($result);
if($user != NULL)
{
if(phpbb_check_hash($password, $user->user_password))
{
if($user->user_posts < 10) { // User MUST have 10 or more posts in order to get the signature
$message = '<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<B>Signature Retrieval Failed!</B> <BR>
You need to have made at least 10 posts before you can retrieve your signature.
</table><br /><br />';
} else {
if($user->pf_runescape_user != '') {
?>
<form name="myform" action="/dynsig/image.php" method="post">
<input type="hidden" name="username" value="<?php if ($user->pf_runescape_user) echo $user->pf_runescape_user; ?>">
<input type="hidden" name="userid" value="<?php if ($user->user_id) echo $user->user_id; ?>">
</form>
<script language="javascript">
document.myform.submit();
</script>
<?php
} else {
$message = '<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<b>No Registered Runescape User!</b> <br /><br />
<form name="myform" action="/dynsig/image.php" method="post">
Please enter your Runescape username:<input type="text" name="rsuser" size="10" maxlength="20" class="login" value ="'.$_POST["pf_runescape_user"].'" /> <br /><br />
<input type="hidden" name="userid" value="'.$user->user_id.'">
<input type="submit" name="rs_submit" value="Submit" />
</form>
</table><br /><br />';
}
}
} else {
$message = '<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<B>Login Failed!</B> <BR>
The login combination you entered was not found.
<BR>Please Try again<br />
</table><br /><br />';
}
} else {
$message = '<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr>
<td width=40><img src=images/exclamation.gif></td>
<td align=left>
<B>Login Failed!</B> <BR>
The login combination you entered was not found.
<BR>Please Try again<br />
</table><br /><br />';
}
}
}
if(!isset($_POST['submit'])){
echo '<font face=verdana size=2 color=#3FC7C9> <b>Login</b></font><br /><br />'.$message.$message1.'
Login using your forum account.<br />
You must have a forum account and have set the "Username" field in order to use our dynamic sigs.<br />';
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table width=98% bgcolor=#f5f8ff class=blueborder align=center><tr>
<td align=right>
<B>Username:</B> <br /><br />
<B>Password:</B> <br /></td>
<td align=left>
<input type="text" name="username" size="10" maxlength="20" class="login" value ="<?php if (isset($_POST['username'])) echo $_POST['username']; ?>" /> <small><i>Please enter your forum username</small></i><br /><br />
<input type="password" name="password" size="10" maxlength="20" class="login" value ="<?php if (isset($_POST['password'])) echo $_POST['password']; ?>" /> <small><i>Please enter your forum password</small></i><br /><br />
<tr><td width=40></td><td align="center"><input type="submit" name="submit" class="login" value="Login" /></td></tr>
</table><br /><br />
</form>
<?php
} else {
echo($message);
}
?>
</body>
</html>
I just need that code somehow merged with my login script. Then it should work, but I dont know what I am doing, and im asking for help