Hi
been using Login Toboggan to enable immediate login after registration.
D_B_login_restrict_user wouldnt allow login - allowed domains look to have already been set in user module's 'load' op.
Worked around it by forcing reset on login op: domain_get_user_domains($user,TRUE,TRUE)
Maybe the reset would be under a register or insert/update op - bit new to Drupal so only guessing
Thanks for the module
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | domain_bonus_login_restrict_110314.patch | 1.28 KB | afox |
Comments
Comment #1
afox commentedI found out this same problem when using this Domain Bonus with Ubercart.
I don't think using domain_get_user_domains -function is necessary at this point. We don't need the other functionality that function provides. And as we see from this bug, it only makes things more difficult.
Attached is a patch that replaces the function call with a normal database query. Also switched from using if-statement to switch-case for future convenience.
Comment #2
rogeriodec commentedThank you very much for your patch!
After weeks of searching for the cause of non-operation of the function "Immediate Login" of Logintoboggan, I discovered that the fault lay with the Domain Restrict Login Bonus.
Looking for a patch, I found yours.
Now I managed to keep both modules working, thanks.
The only thing I noticed, though not a big problem is that when a user tries to log into another domain, before the message of "invalid password", a ton of errors appear:
warning: Parameter 2 to content_profile_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to domain_bonus_login_restrict_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 3 to block_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 3 to comment_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to contact_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to dblog_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 3 to locale_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to node_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to statistics_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 3 to system_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to user_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to activity_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to userreference_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 3 to ckeditor_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to date_timezone_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to domain_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to flag_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to force_password_change_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 3 to googleanalytics_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to imagecache_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to logintoboggan_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to mimemail_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to page_title_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to roleassign_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to simplenews_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to support_overview_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to workflow_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to pathauto_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to trigger_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to dul_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
warning: Parameter 2 to support_user() expected to be a reference, value given in /var/www/includes/module.inc on line 497.
Could you tell me how can I prevent these errors appear when a user tries to log into a domain that is not it?
Comment #3
afox commentedGreat! Glad it helped. Regarding your other problem, seems like you're running old core version with PHP 5.3. I suggest upgrading to the latest version.
Comment #4
afox commentedI'd say it's ready as it's quite simple and working on multiple sites.
Comment #5
rogeriodec commentedOne more time, you are right!
I was testing on Ubuntu with PHP Version 5.3.6.
In my official host the problem does not occur.
I am very grateful.
Thank you!