Bug #256
User Auto Creation of joomla_int not working (using ldap authentification) (latest SVN )
| Status: | Closed | Start: | 04/01/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 100% |
||
| Category: | Plugin - Internal Joomla | |||
| Target version: | JFusion 1.1.2 Release Candidate | |||
| Affects JFusion Version: | 1.2.2 |
Description
Auto Creation of Users not working since the fullname of the user is missing.
Error Message: joomla_int User Create: Please enter your name:
This Problem is caused by the following lines (around line 167) in the jfusion User Plugin:
//create a JFusion userinfo object $userinfo = new stdClass; $userinfo->username = $user['username']; $userinfo->password_clear = $user['password']; $userinfo->email = $user['email'];
Solution:
The User fullname is missing in the $userinfo variable. Add it with the following code.
$userinfo->name = $user['fullname'];
History
Updated by Sylvain Rayé 10 months ago
- Category set to Plugin - Internal Joomla
- Status changed from New to Resolved
- Assigned to set to Sylvain Rayé
- % Done changed from 0 to 100
Ok. I add it and commit in few minutes
Updated by Sylvain Rayé 10 months ago
- Status changed from Resolved to Feedback
Can you test for me? It has been committed. thx
Updated by Daniel Baur 10 months ago
The first login now causes this error:
Fatal error: Call to undefined method plgUserJfusion::getUser() in /var/www/joomla/administrator/components/com_jfusion/models/model.jplugin.php on line 600
However, the user is created. The following logins work, with no error message.
Updated by Daniel Baur 10 months ago
code of line 600:
//check to see if the user exists now $joomla_user = $this->getUser($userinfo,$jname);
Updated by Sylvain Rayé 10 months ago
Thanks. I already see it. I test it. Just need to replace $this->getUser by JFusionJplugin::getUser.
Updated by Marius Van Rijnsoever 10 months ago
Got all $this references in that model replaced in my local copy (there were about 10 of them). Do you want me to commit this?
Thanks, Marius
Updated by Sylvain Rayé 10 months ago
Hi Marius,
I just missed your message, I have already made the change but can you do a compare between your version and mine to check if it's ok. Like that, two pairs of eyes are better than only one ;-)
I did the change only for $this->getUser and there are only two. So I think you have gone further.
Thanks
Sylvain
Updated by Sylvain Rayé 10 months ago
Marius,
I just think about something. Is it necessary to replace every $this by JFusionJplugin:: because other plugins use maybe some method of jplugin. I don't know it's juts a question. Think about more of the consequences
Updated by Marius Van Rijnsoever 10 months ago
I can't see negatives in replacing all $this params, as no variables are assigned to specific instances. Therefore replacing will prevent these errors, without affecting other code. But feel free to correct me if you think otherwise.
Thanks, Marius
Updated by Sylvain Rayé 10 months ago
No problem if you don't see any. You are little bit more aware about the others plugins. So, don't hesitate to change them ($this) ;-)
Updated by Marius Van Rijnsoever 10 months ago
Hi Daniel Baur,
Would you be able to give the "thumbs up" to the latest SVN package for LDAP plugin compatibility, since you are now our official lDAP tester :)
Thanks, Marius
Updated by Daniel Baur 10 months ago
seems to work know, the ldap user is correctly created for joomla_int. However, with the latest svn these users aren't created for the slave addons anymore (tested it with phpbb3 and smf).
But this seems like a my fault (some kind of misconfiguration), since even if i create a user in joomla_int by myself it it isnt created for the slaves (but funnily enough the usersync seems to work)
Updated by Marius Van Rijnsoever 10 months ago
Thanks again for the testing. I have improved the code for when LDAP plugin is used with a non-joomla software as the master. Does that fix the issue? Otherwise it will be very handy if you could post a login checker output.
Thanks, Marius
Updated by Daniel Baur 10 months ago
looks like it works now (think it was my fault, deleting the users directly form the db is not a good idea...), the user is created for joomla_int, phpbb3 and smf. But the username, realname and email in phpbb3 and smf are blank -.-
I will post an update (with a login checker output), but i want to reinstall phpbb3, smf and jfusion first to avoid any mistakes cause by corrupted databases.
Updated by Daniel Baur 10 months ago
Update for the latest SVN.
On the first login, i get now the following error message:
* JUser::_load: User does not exist
* joomla_int Session Create: You do not have access to this page! Your usergroup is:. As a minimum you should be a member of:USERS
However, the user is created for joomla_int, but not for all the other enabled plugins (smf).
Subsequent logins, do not create this error message, and the user is correctly created for the enabled plugings (smf).
If i use the login checker (instead of logging in) the user is created for joomla_int and smf, but memberName, emailAddress and realName in smf are empty
Server Configuration Joomla Version 1.5.10 PHP Version 5.2.3-1ubuntu6.5 MySQL Version 5.0.45 System Information Linux i-cms-00 2.6.22-14-server #1 SMP Tue Feb 12 08:27:05 UTC 2008 i686 Browser Information Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729) JFusion User and Auth Plugins Disabled JFusion Versions JFusion Component Version 1.1.2 JFusion Authentication Plugin Version 1.1.2 JFusion User Plugin Version 1.1.2 JFusion Activity Module Version 1.1.2-001 JFusion Login Module Version 1.1.2-001 JFusion Search Plugin Version 1.1.2-001 JFusion Discussion Plugin Version 1.1.2-001 JFusion joomla_int Plugin configuration master 1 slave 0 dual_login 1 check_encryption 1 JFusion smf Plugin configuration master 0 slave 1 dual_login 1 check_encryption 1 Authentication Plugin status 1 type LDAP error_message "" username dbaur password ************** email ****@****.de fullname Daniel Baur birthdate "" gender "" postcode "" country "" language "" timezone "" Authentication Plugin Success jfusion User Plugin User Plugin Success User Plugin Debug init 0 Using userinfo from a non-JFusion authentication plugin 1 User not present in Master, trying to create Master User 2 Master User Create Success smf User Update 0 No user with that identifier has been found. Creating a new user. 1 A new user was created smf User Details userid 88 username "" name "" email "" password 0ed9e5******** password_salt ae3f***** activation "" is_activated 1 reason null lastvisit 0 group_id 0 group_name Default Usergroup block 0 password_clear ************** smf Session 0 Trying to find loginform using url: http://******.de/smf/index.php?action=login 1 Login page read, setting cookies first phase: 2 Created COOKIE: Name=PHPSESSID, VALUE=80aab703bb9be75fb2138a231c7feaae, Expires=08-04-2009 11:18:40, Cookie Path=/, Cookie Domain=, Cookie Secure connection only=0, Cookie HTTP-only=0 3 Valid login form found 4 Valid username and password fields found 5 Starting login: action= http://******.de/smf/index.php?PHPSESSID=80aab703bb9be75fb2138a231c7feaae&action=login2 parameters= user=&passwrd=xxxxxx&cookielength=-1&submit=Login 6 Login performed, setting cookies definite phase: 7 Created COOKIE: Name=PHPSESSID, VALUE=80aab703bb9be75fb2138a231c7feaae, Expires=08-04-2009 11:18:40, Cookie Path=/, Cookie Domain=, Cookie Secure connection only=0, Cookie HTTP-only=0
Login checker after the first login failed with the error message above:
Server Configuration Joomla Version 1.5.10 PHP Version 5.2.3-1ubuntu6.5 MySQL Version 5.0.45 System Information Linux i-cms-00 2.6.22-14-server #1 SMP Tue Feb 12 08:27:05 UTC 2008 i686 Browser Information Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729) JFusion User and Auth Plugins Disabled JFusion Versions JFusion Component Version 1.1.2 JFusion Authentication Plugin Version 1.1.2 JFusion User Plugin Version 1.1.2 JFusion Activity Module Version 1.1.2-001 JFusion Login Module Version 1.1.2-001 JFusion Search Plugin Version 1.1.2-001 JFusion Discussion Plugin Version 1.1.2-001 JFusion joomla_int Plugin configuration master 1 slave 0 dual_login 1 check_encryption 1 JFusion smf Plugin configuration master 0 slave 1 dual_login 1 check_encryption 1 Authentication Plugin status 1 type LDAP error_message "" username weissbac password ************** email *****@*****.de fullname Henning Weissbach birthdate "" gender "" postcode "" country "" language "" timezone "" Authentication Plugin Success jfusion User Plugin User Plugin Success User Plugin Debug init 0 Using userinfo from a non-JFusion authentication plugin smf User Update 0 No user with that identifier has been found. Creating a new user. 1 A new user was created smf User Details userid 89 username weissbac name Henning Weissbach email weissbach@hs-ulm.de password 2164f3******** password_salt 3069***** activation "" is_activated 1 reason null lastvisit 0 group_id 0 group_name Default Usergroup block 0 password_clear ************** smf Session 0 Trying to find loginform using url: http://*****.de/smf/index.php?action=login 1 Login page read, setting cookies first phase: 2 Created COOKIE: Name=PHPSESSID, VALUE=c62362f055edaf11985eff8fe0a4c720, Expires=08-04-2009 11:21:29, Cookie Path=/, Cookie Domain=, Cookie Secure connection only=0, Cookie HTTP-only=0 3 Valid login form found 4 Valid username and password fields found 5 Starting login: action= http://*****.de/smf/index.php?PHPSESSID=c62362f055edaf11985eff8fe0a4c720&action=login2 parameters= user=weissbac&passwrd=xxxxxx&cookielength=-1&submit=Login 6 Login performed, setting cookies definite phase: 7 Created COOKIE: Name=SMFCookie956, VALUE=a:4:{i:0;s:2:"89";i:1;s:40:"93d1f1e2875cdbe06f4e75976811c2cd6eadfccc";i:2;i:1428396690;i:3;i:0;}, Expires=07-04-2015 10:51:30, Cookie Path=/, Cookie Domain=, Cookie Secure connection only=0, Cookie HTTP-only=0 8 Created COOKIE: Name=PHPSESSID, VALUE=dfbe42e9ea6aa3388aca1e79680960db, Expires=08-04-2009 11:21:30, Cookie Path=/, Cookie Domain=, Cookie Secure connection only=0, Cookie HTTP-only=0
Updated by Marius Van Rijnsoever 10 months ago
- Status changed from Feedback to Closed
- Assigned to changed from Sylvain Rayé to Marius Van Rijnsoever
- Target version set to JFusion 1.1.2 Release Candidate
Added the return of $userinfo to the createUser() of the joomla_int plugin, so that it can be used after a new user been created in the rest of the authentication process.
Thanks again for the testing, Marius
Updated by Daniel Baur 9 months ago
still not working (same error message).
It looks like this is caused by a wrong function call of joomla_int->createUser by the User plugin (/plugins/user/jfusion.php)
line 183: $JFusionMaster->createUser($auth_userinfo, $status);
(Missing argument 3 for JFusionUser_joomla_int::createUser())
Correcting this error however results in a db error, since jfusion now attempts to create the user multiple times:
DB function failed with error number 1062
Duplicate entry 'dbaur' for key 1 SQL=INSERT INTO jos_jfusion_users (id, username) VALUES (153,'dbaur')