NickSaban
01-11-2008, 04:59 PM
I'm using Lonnie's draft utility over in the PFL and updated the PFL boards to the newest release of phpBB. Unfortunately, they changed the hash, so the MD5 doesn't work anymore and it broke the login for the utility... Anyone an expert in php and would mind helping me debug this? I'm on AIM (Grshpr 2001) if you'd like to help...
Here's the applicable code:
<?php
// These variables are usually passed back in a form, if they are not set they will be defined here.
// This keeps the httpd log from filling up with PHP UNDEFINED errors on the web server.
if (!isset($uid)) { $uid=""; }
if (!isset($pwd)) { $pwd=""; }
if (!isset($edittype)) { $edittype=""; }
// Set $draftstatus to live or standby
$draftstatus = "standby";
// If userid or password is blank offer the login screen
if (($uid == "") or ($pwd == "")) {
printf("<table width=300 border=0 cellspacing=1>");
printf("<tr>\n");
printf("<td width=80 class='ScheduleTableRow'>
<font face='Arial'>
<form action=$PHP_SELF method='post' enctype='multipart/form-data'>
<input type=hidden name='uid' value='$uid'>
<input type=hidden name='pwd' value='$pwd'>
<b>User:</b></font></td>\n");
printf("<td width=220 class='ScheduleTableRow' align=left>
<input type='text' name='uid' value='%s' size=15></td>\n", $uid);
printf("</tr>\n");
printf("<tr>\n");
printf("<td class='ScheduleTableRow'><font face='Arial'><b>Pass:</b></font></td>\n");
printf("<td class='ScheduleTableRow' align=left>
<input type='password' name='pwd' value='%s' size=15></td>\n", $pwd);
printf("</tr>\n");
printf("<tr><td colspan=2 class='ScheduleTableRow'><center>
<input type='submit' name='submit' value='Submit'></td></tr>\n");
printf("</form>\n");
printf("</table>");
} else {
$sql = "SELECT username, user_password from phpbb3_users where username = '$uid'";
$result = mysql_query($sql,$db)or die("Bad query: ".mysql_error());
// Check password, if it doesn't match another login screen appears with "TRY AGAIN"
if ($myrow = mysql_fetch_array($result)) {
if (md5($pwd) == $myrow[1]) {
switch($edittype) {
Here's the applicable code:
<?php
// These variables are usually passed back in a form, if they are not set they will be defined here.
// This keeps the httpd log from filling up with PHP UNDEFINED errors on the web server.
if (!isset($uid)) { $uid=""; }
if (!isset($pwd)) { $pwd=""; }
if (!isset($edittype)) { $edittype=""; }
// Set $draftstatus to live or standby
$draftstatus = "standby";
// If userid or password is blank offer the login screen
if (($uid == "") or ($pwd == "")) {
printf("<table width=300 border=0 cellspacing=1>");
printf("<tr>\n");
printf("<td width=80 class='ScheduleTableRow'>
<font face='Arial'>
<form action=$PHP_SELF method='post' enctype='multipart/form-data'>
<input type=hidden name='uid' value='$uid'>
<input type=hidden name='pwd' value='$pwd'>
<b>User:</b></font></td>\n");
printf("<td width=220 class='ScheduleTableRow' align=left>
<input type='text' name='uid' value='%s' size=15></td>\n", $uid);
printf("</tr>\n");
printf("<tr>\n");
printf("<td class='ScheduleTableRow'><font face='Arial'><b>Pass:</b></font></td>\n");
printf("<td class='ScheduleTableRow' align=left>
<input type='password' name='pwd' value='%s' size=15></td>\n", $pwd);
printf("</tr>\n");
printf("<tr><td colspan=2 class='ScheduleTableRow'><center>
<input type='submit' name='submit' value='Submit'></td></tr>\n");
printf("</form>\n");
printf("</table>");
} else {
$sql = "SELECT username, user_password from phpbb3_users where username = '$uid'";
$result = mysql_query($sql,$db)or die("Bad query: ".mysql_error());
// Check password, if it doesn't match another login screen appears with "TRY AGAIN"
if ($myrow = mysql_fetch_array($result)) {
if (md5($pwd) == $myrow[1]) {
switch($edittype) {