User's can't change (update) password
12 years 7 months ago
12 years 7 months ago by Yuri Reis.
Topic Author
User's can't change (update) password #1
Hy guys,
Im here again kk
I have other problem. Users are created with username with numbers only (EX : username = 223344) and are authenticated in joomdle fail to update their data. Especially the password (which in my case is the most important)
Somebody helpme!
Thanks one more time
Yuri Reis Barbosa - Vitória / Brazil
Im here again kk
I have other problem. Users are created with username with numbers only (EX : username = 223344) and are authenticated in joomdle fail to update their data. Especially the password (which in my case is the most important)
Somebody helpme!
Thanks one more time
Yuri Reis Barbosa - Vitória / Brazil
Please Log in or Create an account to join the conversation.
12 years 7 months ago
User's can't change (update) password #2
Hi.
You mean you are using numbers-only usernames?
You mean you are using numbers-only usernames?
Please Log in or Create an account to join the conversation.
12 years 7 months ago
12 years 7 months ago by Yuri Reis.
Topic Author
User's can't change (update) password #3
yes Antonio, this is exactly my problem.
If I get the user (who has only numbers - username) and add a character with a letter, for example "a", everything returns to normal and I can update the password in Moodle.
It should be noted that this error only happens when the user will change the password on the moodle with the joomdle authentication method. If I switch to manual authentication method, the problem does not happen.
Ex: username = 2011224761567 dosen't update the password in mooodle
username = 2011224761567A update the password in moodle
username = 201122476156A update the password in moodle
Interestingly, the screen shows a moodle message that the password was changed. But nothing happens! If you try to use the password you just updated, does not work. If you use the old password it works.
Remember that when we update the password of a user in moodle he asks the old password and new password 2 times.
Recalling that the update for the same user password in joomla it works, both in admin as the frontend via token ("I forgot my password")
If I get the user (who has only numbers - username) and add a character with a letter, for example "a", everything returns to normal and I can update the password in Moodle.
It should be noted that this error only happens when the user will change the password on the moodle with the joomdle authentication method. If I switch to manual authentication method, the problem does not happen.
Ex: username = 2011224761567 dosen't update the password in mooodle
username = 2011224761567A update the password in moodle
username = 201122476156A update the password in moodle
Interestingly, the screen shows a moodle message that the password was changed. But nothing happens! If you try to use the password you just updated, does not work. If you use the old password it works.
Remember that when we update the password of a user in moodle he asks the old password and new password 2 times.
Recalling that the update for the same user password in joomla it works, both in admin as the frontend via token ("I forgot my password")
Please Log in or Create an account to join the conversation.
12 years 7 months ago
User's can't change (update) password #4
I think I found the problem.
You can test the fix, making a simple change in plugins/xmlrpc/joomdle.php, function changePassword.
Change:
$user =& JFactory::getUser($username);
By:
$id = JUserHelper::getUserId($username);
$user =& JFactory::getUser($id);
Please test and confirm that it solves your problem.ç
Also, please keep an eye on any other numeric-username bug that may appear. Anyway, I will do a code review on this when I have the time.
You can test the fix, making a simple change in plugins/xmlrpc/joomdle.php, function changePassword.
Change:
$user =& JFactory::getUser($username);
By:
$id = JUserHelper::getUserId($username);
$user =& JFactory::getUser($id);
Please test and confirm that it solves your problem.ç
Also, please keep an eye on any other numeric-username bug that may appear. Anyway, I will do a code review on this when I have the time.
Please Log in or Create an account to join the conversation.
12 years 7 months ago
Topic Author
User's can't change (update) password #5
Hi,
this change not work correctly because the function of joomla "getUser" (librarie -> factory.php) works for both username or id by calling the "getInstance" function. If you pass a number he sees as id(user.php -> line 176 -> function getInstance), if you pass a String he understands like a username.
Thanks one more time
this change not work correctly because the function of joomla "getUser" (librarie -> factory.php) works for both username or id by calling the "getInstance" function. If you pass a number he sees as id(user.php -> line 176 -> function getInstance), if you pass a String he understands like a username.
Thanks one more time
Please Log in or Create an account to join the conversation.
12 years 7 months ago
12 years 7 months ago by Yuri Reis.
Topic Author
User's can't change (update) password #6
I solved my problem because the username "number" is very big and i did one klugde
at the line 186 (libraries->joomla->user->user.php) on the function getInstance i changed
this condition if((!is_numeric($id))) for this if((!is_numeric($id)) || ($id > 201122476.0)).
But this is temporary...
at the line 186 (libraries->joomla->user->user.php) on the function getInstance i changed
this condition if((!is_numeric($id))) for this if((!is_numeric($id)) || ($id > 201122476.0)).
But this is temporary...
Please Log in or Create an account to join the conversation.
12 years 7 months ago
User's can't change (update) password #7
OK thanks for updating. Once Antonio returns next week, I have him look at this.
Chris
Chris
Please Log in or Create an account to join the conversation.
12 years 7 months ago
User's can't change (update) password #8
Hi yurbasoba.
Did you try my proposed fix before hacking Joomla? It worked for me locally.
Did you try my proposed fix before hacking Joomla? It worked for me locally.
Please Log in or Create an account to join the conversation.