What are the options for adding some text to the account creation process? At the very least I need a statement like the below added:
"By signing up to the wiki you agree to the <link to Acceptable Use Policy>"
Are there any extensions for this or variables I can change? I'd like to avoid changing the PHP page that generates this page if possible so that it's not lost in future upgrades.
Thanks!
- Mike
Michael Kingery (HL7) wrote:
What are the options for adding some text to the account creation process? At the very least I need a statement like the below added:
"By signing up to the wiki you agree to the <link to Acceptable Use Policy>"
Are there any extensions for this or variables I can change? I'd like to avoid changing the PHP page that generates this page if possible so that it's not lost in future upgrades.
Thanks!
- Mike
It's straightforward to add some text there, just edit includes/templates/Userlogin.php and add the text there, for instance:
</td> </tr> +<tr><td></td><td>By creating an account I abide to the +<a href="http://www.example.org/">Terms and Conditions</a></td></tr> <?php }
$tabIndex = 9; if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) {
Doing it in a extension is a bit harder. You want to hook to UserCreateForm and then call $template->addInputItem(). It would look like this:
$wgHooks['UserCreateForm'][] = 'efAddTerms'; function efAddTerms(&$template) { $template->addInputItem('AUP', false, 'checkbox', 'I abide to the [[Acceptable Use Policy]]'); return true; }
That would add the checkbox. You also need to verify that it was checked:
$wgHooks['AbortNewAccount'][] = 'efAbortIfUnacceptable'; function efAbortIfUnacceptable($user, &$abortError) { global $wgRequest; $abortError = 'We only accept people which agree with the Acceptable Use Policy'; return $wgRequest->getCheck('AUP'); }
Good luck
(Not that anybody actually ever reads them before clicking Yes :-) )
I'm getting the following error on our system after upgrading to the latest version of MediaWiki. I can't seem to find anything on the internet about it. Any thoughts?
[02-Dec-2010 13:04:57] PHP Notice: Undefined index: frameCount in F:\Inetpub\wwwroot\mediawiki-new\includes\media\GIF.php on line 37
The ConfirmAccount extension[1] can handle displaying TOS pages as well as a few other nifty things. -Peachey [1]. http://www.mediawiki.org/wiki/Extension:ConfirmAccount
K. Peachey - Perfect! That's exactly what I was looking for.
Jidanni - No worries, I know we can't force them to read it, it's a legal thing.
Platonides - Thanks for your very thorough answer! I didn't want to modify the template because I was afraid it would get lost when we upgrade. I really appreciate you showing how to put the extension together though; I haven't quite gotten to the point where I'm writing these myself rather than downloading them, but I found your code very helpful in understanding how extensions connect with the hooks.
- Mike
mediawiki-l@lists.wikimedia.org