Page MenuHomePhabricator

Update NewSignupPage to use AuthManager
Closed, ResolvedPublic


See parent task and T110414#1578206.

The 'AbortNewAccount' hook is deprecated. Implement a PreAuthenticationProvider (or other AuthenticationProvider) instead. This will also allow you to remove your use of the now-deprecated 'UserCreateForm' hook.

You'd also need to update your check in the 'BeforePageDisplay' hook function since AuthManager does account creation on Special:CreateAccount rather than Special:UserLogin/signup, but it would probably be better to get the match checking merged into core instead.

Event Timeline

Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added subscribers: Liuxinyu970226, Krenair, Florian and 2 others.

@Anomie @Tgr So I wrote a proposed patch, which fixes the most important feature (the checkbox and error message when it's not checked), but I still have some issues with certain features -- can you take a look at the patch and see what I'm doing wrong and teach me how it should be done?

To reproduce the issue I described in the commit message of the aforementioned patch:

  1. Check out NewSignupPage and SocialProfile with git clone (NSP uses the UserRelationship and UserStatsTrack classes provided by SocialProfile)...or alternatively you could just comment out the offending code in the NewSignupPage::onLocalUserCreated function and replace it with an error_log call or somesuch to see if that code is ever reached.
  2. Load it in LocalSettings.php with wfLoadExtension( 'NewSignupPage' ); and set at least $wgForceNewSignupPageInitialization and at least either $wgAutoAddFriendOnInvite or $wgRegisterTrack to true
  3. If you set $wgRegisterTrack = true;, you need to (manually, sadly) create the user_register_track database table: php maintenance/sql.php extensions/NewSignupPage/user_register_track.sql
  4. Try creating a new user account via a URL like /index.php?title=Special:CreateAccount&referral=Foo&from=2 (where Foo is the name of a valid user account)

The idea here is that when a user signs up via such a link, them (the new account) and the referring user (Foo) are automatically made friends when $wgAutoAddFriendOnInvite is true. When $wgRegisterTrack is set to true, an entry gets written to the user_register_track table for each signup action taken via such a link. The new user account's ID and name are stored as ur_user_id and ur_user_name, respectively, whereas the referrer's name and ID are stored as ur_user_id_referral and ur_user_name_referral, and the from URL parameter's value (an int) is stored as ur_from.

Thanks in advance for any and all help you're able to provide me with this matter!

ashley claimed this task.

With the aforementioned patch merged (three weeks ago), this task is fixed. :)