For those like me, who were looking a very long time for a fix of this weird login bug of users, here is an other thing they can try. The pb i found is in the Your_Account/index.php file, the function to look for is "function_login" (of course ...)
Here is the complete code of this function to replace index.php :
function login($uname, $lpass) {
global $setinfo, $user_prefix, $dbi, $module_name;
$result = sql_query("select pass, uid, storynum, umode, uorder, thold, noscore, ublockon, theme, commentmax from ".$user_prefix."_users where uname='$uname'", $dbi);
$setinfo = sql_fetch_array($result, $dbi);
echo $result;
if ((sql_num_rows($result, $dbi)==1) AND ($setinfo[1] != 1) AND ($setinfo[0] != "")) {
$dbpass=$setinfo[0];
$non_crypt_pass = $lpass;
$old_crypt_pass = crypt($pass,substr($dbpass,0,2));
$new_pass = md5($lpass);
if (($dbpass == $non_crypt_pass) OR ($dbpass == $old_crypt_pass)) {
sql_query("update ".$user_prefix."_users set pass='$new_pass' WHERE uname='$uname'", $dbi);
$result = sql_query("select pass from ".$user_prefix."_users where uname='$uname'", $dbi);
list($dbpass) = sql_fetch_row($result, $dbi);
}
if ($dbpass != $new_pass) {
Header("Location: modules.php?name=$module_name&stop=1");
return;
}
docookie($setinfo[1], $uname, $new_pass, $setinfo[2], $setinfo[3], $setinfo[4], $setinfo[5], $setinfo[6], $setinfo[7], $setinfo[8], $setinfo[9]);
Header("Location: modules.php?name=$module_name&op=userinfo&bypass=1&uname=$uname");
} else {
Header("Location: modules.php?name=$module_name&stop=1");
}
}
Worked for me, if that can be usefull for someone else. The brief explanation of that is when the request result is fetch into an array, apparently the name of each column is not filled correctly. To prevent this, it is better to replace each call to the array with a id number instead of the column name. It also had to be replaced in the routine which write the cookie. Just copy and past the code over and it should work.
If it worked for you, just post a message in here
Steven
Webmaster fr.simflight.com
chatserv General
Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
Posted:
Tue Feb 11, 2003 7:14 am
Seems like a good chance to remind users of Tom's bbtonuke port, if you don't upload all files included with the port you'll have this and other problems, not uploading the Your Account module included with the port will cause new users to not be able to register, not uploading the modules.php file included with the port will find your registered users not being able to login, the files included with the port are there for a reason so all of them must be uploaded, many just upload the Forums folder and then wonder why the site won't work as intended.
_________________ Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
mikem Theme Guru
Joined: Jan 13, 2003
Posts: 1582
Location: Corn fields of Indiana
Posted:
Tue Feb 11, 2003 7:24 am
chatserv wrote:
Seems like a good chance to remind users of Tom's bbtonuke port, if you don't upload all files included with the port you'll have this and other problems, not uploading the Your Account module included with the port will cause new users to not be able to register, not uploading the modules.php file included with the port will find your registered users not being able to login, the files included with the port are there for a reason so all of them must be uploaded, many just upload the Forums folder and then wonder why the site won't work as intended.
Man..I have seen that a MILLION times
You preach it brother!
mikem
chatserv General
Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
Posted:
Tue Feb 11, 2003 7:32 am
Actually it was a recording
No matter how many times i repeat it, new users keep making the same mistake
_________________ Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
stevenFr Guest
Posted:
Tue Feb 11, 2003 8:54 am
Hi,
Maybe i was not clear enough, was talking about the general login problem, not about forum pb. I even don't use it on my site.
Steven
chatserv General
Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
Posted:
Tue Feb 11, 2003 9:07 am
No stevenFr, i only posted what i did bacause it related to what you had posted, you wouldn't believe just how many people keep making this mistake.
_________________ Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
stevenFr Guest
Posted:
Tue Feb 11, 2003 9:26 am
Ok, to be more precise, two servers with exact same directory structures and files taken from the first server.
On Server 1 was working perfect, on server 2 was not working. There was no missing files or so compared to server 1.
Might be a difference of the SQL code base or PHP version, still looking into it.
So in here it was really a code and server behaviour.
Regards,
Steven
ArtificialIntel
Joined: Jan 31, 2004
Posts: -88
Posted:
Tue Feb 11, 2003 11:21 am
steven, if you'd taken time to learn something about the phpBB to nuke port, you'd know that there's a modification in the Your_account module that comes with the port so that it doesn't die when the Your_Account module suddenly finds that there's more fields in the users table than there is data to write to because of the port.
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum