Closed (fixed)
Project:
Persistent Login
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Jan 2012 at 22:12 UTC
Updated:
6 May 2012 at 23:30 UTC
Jump to comment: Most recent file
Even though Account Settings --> Registration and Cancellations --> Who can register accounts? has been set to Administrators only, anyone can register (though the registration is still blocked) once the Persistent Login module has been enabled.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 1404578-user-register-6.x-9.patch | 1.7 KB | gapple |
| #8 | 1404578-8.patch | 1.25 KB | gapple |
| #4 | honor_administrators_only_setting-1404578-2.patch | 518 bytes | David4514 |
| #2 | honor_administrators_only_setting-1404578-2.patch | 518 bytes | David4514 |
Comments
Comment #1
David4514 commentedThe code in persistent_login.module that follows is what is bypassing the Account Settings:
Is there a way to test for the Administrators only setting for who can register a new account? If there is, then possibly this menu item should only be added if that has not been set.
Comment #2
David4514 commentedIn the following code, a test to see if user registration is allowed if first performed. If it is allowed, then the 'user/register' item is added.
I do not know if this would impact anything else in the module, but it seems to fix my problem. A patch for this is attached.
Comment #3
David4514 commentedIn the following code, a test to see if user registration is allowed is first performed. If it is allowed, then the 'user/register' item is added.
I do not know if this would impact anything else in the module, but it seems to fix my problem. A patch for this is attached.
Comment #4
David4514 commentedThe submit of the above comment failed and the patch was not attached. I'll try again.
Comment #5
gappleThe menu alter was added to address #784942: Hide login form 'Request New Password' link when only 'verifying' password; I don't think your patch will cause that issue to re-appear, but would like to confirm that.
Comment #6
gappleComment #7
rlmumfordThis patch is going to cause problems, as hook_menu_alter is only called on a cache clear. If the user who was logged in when the cache was cleared was able to register accounts, everyone will be able to. You'll need to edit the persistant_login_user_reauth_access to solve the problem.
Comment #8
gappleThank you for raising that issue, @rlmumford.
I believe this patch should solve the issue, by calling
user_register_access()instead of justuser_is_anonymous()Comment #9
gappleAnd here is a patch for 6.x
Comment #10
gappleBoth patches seemed to work with a quick test; 'Register' link is available if registrations are open, but is not available if registrations are closed, or the user is logged in via PL.
Fixed in commits:
c40392b74a8502b4c1334d06adce2425090b4e75 (7.x)
6497158605a5bafc610bb33871f5743a3844ceb5 (6.x)