Hey all you devs out there (lookinatchu, @brion ) -- I'm trying to write a MediaWiki extension, and running into an API "how to" issue.

I want to allow an anonymous user, under particular circumstances, to create/request an account on a wiki which is otherwise closed to registration.

I've got the "particular circumstances" part written and working. (Silly me, I thought that would be the tricky part.)

The problem is how to summon and enable the functionality of the Special:CreateAccount page just for the current session.

I have figured out how to summon its functionality -- by descending my SpecialPage class from SpecialCreateAccount and carefully overriding certain methods -- but when summoned, it shows an error message at the top of the form:

Unable to continue account creation. Your session most likely timed out.
...and doesn't actually create an account when the user tries to do so.

Somewhere I need to tell it "I know that normally you don't let this type of scum in but really, this one is ok, trust me". (Maybe I need to give my extension a Friend of the Sysop card from the Webmistress Benevolent Association?)

Unfortunately I can't just redirect to the CreateAccount page, or transclude it somehow, because there's no way to tell it "this anonymous session is authorized to access you even though normally anonymous sessions would be kicked out", and it would have to be modified to look for that indication anyway... where {modifying that SpecialPage so it is available when it normally isn't supposed to be} is basically is the problem I'm having.

I'll probably figure it out eventually by painfully and tediously going through the SpecialCreateAccount source code, but if anyone has any leads...

· · Web · 1 · 1 · 2

@woozle offhand I'd guess this is related to delaying session creation until login time (originally an anti-cookie hack to aid in cacheability of stuff). Either the session's not getting set up on your form page (which it normally would on an account creation form that's allowed by the usual ways) or it's getting damaged by a switch of users in the extension code maybe?

My session code knowledge is a bit rusty, be warned. :)

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!