(Imported by PageSync)
Tag: wsps-content-edit-tag
(5 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
Using a form to register a new user in the Wiki
 
Using a form to register a new user in the Wiki
 
===Description===
 
===Description===
_createuser is very powerfull and needs special attention. This option can create a new user in the Wiki. It will create a random password and send the user details to the users email address. A confirm emailaddress email will also be send.
+
_createuser is very powerfull and needs special attention. This option can create a new user in the Wiki. It will create a random password and send the user details to the users email address. A confirm emailaddress email will also be send.
  
This functionality is disabled by default and can be enabled by setting the <code>$wgFlexFormConfig['can_create_user'] = true;</code> , see [[DevOps:Doc/FlexForm/1.0/Installation_of_FlexForm]].
+
This functionality is disabled by default and can be enabled by setting the <code>$wgFlexFormConfig['can_create_user'] = true;</code> , see [[DevOps:Doc/FlexForm/2.0/Installation_of_FlexForm]].
 +
 
 +
The text for the email is this Language message :  flexform-createuser-email, so it can be easily changed in your wiki by creating the page : MediaWiki:flexform-createuser-email.
 +
 
 +
The original i18n message is in HTML as the email will be send in HTML format  :
 +
 
 +
<code>"Dear $1,<nowiki><br></nowiki><nowiki><br></nowiki>We have created a new account for you.<nowiki><br></nowiki><nowiki><br></nowiki>You can now login with the following credentials.<nowiki><br></nowiki><nowiki><br></nowiki>Username:<nowiki><br></nowiki>$2<nowiki><br></nowiki><nowiki><br></nowiki>Password:<nowiki><br></nowiki>$3<nowiki><br></nowiki><nowiki><br></nowiki>You should log in and choose a new password.."</code>
 
===Parameters===
 
===Parameters===
 
'''_createuser'''
 
'''_createuser'''
Line 21: Line 27:
 
Create a new user with username adje
 
Create a new user with username adje
 
<syntaxhighlight lang="html">
 
<syntaxhighlight lang="html">
<_form action="addToWiki" >
+
<form>
<_createuser username="adje" email="ad@wikibase.nl" realname="Ad Strack van Schijndel" />
+
  <_createuser username="adje" email="ad@wikibase.nl" realname="Ad Strack van Schijndel" />
<_input type="submit" value="create Adje" />
+
  <input type="submit" value="create Adje" />
</_form>
+
</form>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
===Note===
 
===Note===
Make sure that when using this powerful function to have the FlexForm setting "secure" to true for more security. Furthermore, take care where you show such a form.
+
Make sure that when using this powerful function to have the FlexForm setting "secure" to true for more security. Furthermore, take care where you show such a form. Also it is a good idea to add reCaptcha to your form if you let anonymous users create accounts.
 +
 
 +
As of version 2.2.15 _createuser has been changed to work a bit differently, but it is still backwards compatible.
ws-class-props
Line 1: Line 1:
{{Doc properties
+
{{Csp class properties
|Subject version=2.0
+
|Subject version=2.0,2.1
 
|Doc subject=DevOps:Doc/FlexForm
 
|Doc subject=DevOps:Doc/FlexForm
 
|Doc parent=DevOps:Doc/FlexForm
 
|Doc parent=DevOps:Doc/FlexForm

Revision as of 10:36, 15 July 2025

Name

_createuser

Type

_createuser

Synopsis

Using a form to register a new user in the Wiki

Description

_createuser is very powerfull and needs special attention. This option can create a new user in the Wiki. It will create a random password and send the user details to the users email address. A confirm emailaddress email will also be send.

This functionality is disabled by default and can be enabled by setting the $wgFlexFormConfig['can_create_user'] = true; , see Installation of FlexForm.

The text for the email is this Language message : flexform-createuser-email, so it can be easily changed in your wiki by creating the page : MediaWiki:flexform-createuser-email.

The original i18n message is in HTML as the email will be send in HTML format :

"Dear $1,<br><br>We have created a new account for you.<br><br>You can now login with the following credentials.<br><br>Username:<br>$2<br><br>Password:<br>$3<br><br>You should log in and choose a new password.."

Parameters

_createuser

username = [mandatory] The new username to be registered

email = [mandatory] The email address of the new user

realname = Optional the real name of the user

Example

Create a new user with username adje

<form>
  <_createuser username="adje" email="ad@wikibase.nl" realname="Ad Strack van Schijndel" />
  <input type="submit" value="create Adje" />
</form>

Note

Make sure that when using this powerful function to have the FlexForm setting "secure" to true for more security. Furthermore, take care where you show such a form. Also it is a good idea to add reCaptcha to your form if you let anonymous users create accounts.

As of version 2.2.15 _createuser has been changed to work a bit differently, but it is still backwards compatible.