login issue
Posted by M@AATW
login issue August 23, 2006 05:38AM |
Registered: 18 years ago Posts: 278 |
After installing this mod -
[www.phorum.org]
-I find that some users are having trouble loggin in - it says the the user/password cannot be found. I assume this is because the cookie has been altered by the new mod, but I'm not sure.
If I go into the Admin panel and change the username there, it then works.
I am wondering how many users this may have affected that won't find out until they log out and then try to log back in, is there a way I can log everyone out by invalidating the cookie, or resolve the issue another way?
EDIT: I see the author of the mod is reporting the same issue:
[www.phorum.org]
Edited 1 time(s). Last edit at 08/23/2006 05:43AM by M@AATW.
[www.phorum.org]
-I find that some users are having trouble loggin in - it says the the user/password cannot be found. I assume this is because the cookie has been altered by the new mod, but I'm not sure.
If I go into the Admin panel and change the username there, it then works.
I am wondering how many users this may have affected that won't find out until they log out and then try to log back in, is there a way I can log everyone out by invalidating the cookie, or resolve the issue another way?
EDIT: I see the author of the mod is reporting the same issue:
[www.phorum.org]
Edited 1 time(s). Last edit at 08/23/2006 05:43AM by M@AATW.
Re: login issue August 23, 2006 05:50AM |
Registered: 18 years ago Posts: 152 |
Hey,
that's odd, I hadn't thought that my module causes these problems...
Maybe someone could take a look at the sourcecode if there are any problems?
Greetings,
Clemens
--
Clemens Weiß
Webplain.de
that's odd, I hadn't thought that my module causes these problems...
Maybe someone could take a look at the sourcecode if there are any problems?
Greetings,
Clemens
--
Clemens Weiß
Webplain.de
Re: login issue August 23, 2006 05:55AM |
Admin Registered: 20 years ago Posts: 9,240 |
I think your update-script ( [www.phorum.org] ) is the problem.
you have that code in there:
but phorum_user_save should only get the fields needing to be changed.
It calls phorum_user_prepare_data which does
which means that your already md5-encoded passwords are md5-encoded again.
which leads to all users passwords being invalid.
I guess your problem here
[www.phorum.org]
is coming from the same issue (maybe even the same script?).
Thomas Seifert
Edited 1 time(s). Last edit at 08/23/2006 05:57AM by ts77.
you have that code in there:
$user = phorum_user_get($rec["user_id"], false); if (!isset($user["mod_rating"]["posCount"])) $user["mod_rating"]["posCount"] = 0; if (!isset($user["mod_rating"]["negCount"])) $user["mod_rating"]["negCount"] = 0; $user["mod_rating"]["posCount"] += $meta["mod_rating"]["posCount"]; $user["mod_rating"]["negCount"] += $meta["mod_rating"]["negCount"]; phorum_user_save($user);
but phorum_user_save should only get the fields needing to be changed.
It calls phorum_user_prepare_data which does
case "password": case "password_temp": if ( !$pwd_unchanged ) { $user[$key] = md5( $val ); } elseif ( $pwd_unchanged == -1 ) { $user[$key] = $val; } break;
which means that your already md5-encoded passwords are md5-encoded again.
which leads to all users passwords being invalid.
I guess your problem here
[www.phorum.org]
is coming from the same issue (maybe even the same script?).
Thomas Seifert
Edited 1 time(s). Last edit at 08/23/2006 05:57AM by ts77.
Re: login issue August 23, 2006 06:06AM |
Registered: 18 years ago Posts: 152 |
OK, I'll upload new versions.
So it affects all users that have been rated.
You should change your code examples in creating_mods.txt (2.5 Storing user data)...
Greetings,
Clemens
--
Clemens Weiß
Webplain.de
So it affects all users that have been rated.
You should change your code examples in creating_mods.txt (2.5 Storing user data)...
Greetings,
Clemens
--
Clemens Weiß
Webplain.de
Re: login issue August 23, 2006 06:13AM |
Registered: 18 years ago Posts: 278 |
Re: login issue August 23, 2006 06:16AM |
Admin Registered: 20 years ago Posts: 9,240 |
Re: login issue August 23, 2006 06:17AM |
Registered: 18 years ago Posts: 152 |
No.
Only changing the user's password will solve the problem. I'm sorry...
I wrote an announcement in my forum and included the link in the error message, the user receives.
--
Clemens Weiß
Webplain.de
Only changing the user's password will solve the problem. I'm sorry...
I wrote an announcement in my forum and included the link in the error message, the user receives.
--
Clemens Weiß
Webplain.de
Re: login issue August 23, 2006 06:23AM |
Registered: 18 years ago Posts: 278 |
Re: login issue August 23, 2006 06:25AM |
Registered: 18 years ago Posts: 152 |
Unfortunately not. I used the same code in the module, too.
So all users, that are rated before you install the newest version will have that problem.
--
Clemens Weiß
Webplain.de
So all users, that are rated before you install the newest version will have that problem.
--
Clemens Weiß
Webplain.de
August 23, 2006 06:25AM |
Admin Registered: 18 years ago Posts: 8,532 |
So there are actually people that read the docs? :-) Sorry for the wrong information in there. I updated the documentation in both the 5.1 and the 5.2 tree. See changesets changeset [1280] and changeset [1279] respectively.
Additionally, I will check if we can prevent this problem from happening in case others use the save function in the same way. I guess we could check if the password in the data already looks like the MD5 data in the database and not update it if this is the case. I think that the event where a user chooses a new password that exactly matches the MD5 sum of the previous password can be considered a quite rare event ;-)
I am afraid that for those users you will have to reset the passwords. The problem is that the password information in the database was crippled and there's no way back from that. The only way would be if you had a backup of the data before the problem occurred, so you could fetch the password fields from that backup and put it in the running system.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Additionally, I will check if we can prevent this problem from happening in case others use the save function in the same way. I guess we could check if the password in the data already looks like the MD5 data in the database and not update it if this is the case. I think that the event where a user chooses a new password that exactly matches the MD5 sum of the previous password can be considered a quite rare event ;-)
Quote
M@AATW
So...will running the new script solve the problem for all those that were effected, even if they haven't logged out?
I am afraid that for those users you will have to reset the passwords. The problem is that the password information in the database was crippled and there's no way back from that. The only way would be if you had a backup of the data before the problem occurred, so you could fetch the password fields from that backup and put it in the running system.
Maurice Makaay
Phorum Development Team



Re: login issue August 23, 2006 06:37AM |
Registered: 18 years ago Posts: 278 |
Re: login issue August 23, 2006 06:39AM |
Admin Registered: 20 years ago Posts: 9,240 |
August 23, 2006 06:57AM |
Admin Registered: 18 years ago Posts: 8,532 |
Quote
Maurice
Additionally, I will check if we can prevent this problem from happening in case others use the save function in the same way.
Changeset [1282] implements a safety check that will prevent the password data from being updated in case the "new" password in the data matches the existing MD5 encrypted password for the user.
Maurice Makaay
Phorum Development Team



Sorry, only registered users may post in this forum.