Revision [8699]
This is an old revision of UserRegistration made by JavaWoman on 2005-05-29 12:30:27.
UserRegistration
Note: future Wikka development will include separate actions for registration, login, logout, user settings.
See also: RegisterAction
See also: RegisterAction
Is there an easy way to not allow registration? I would like to have it so that I can control the registration process, not let just anyone sign-up.
--BooYa
A nice contribution Nils. If you want to go further with fiddling with the code for registration, I've thought it would be useful if there was a feature that required a password from an administrator to be able to register so that if you were going to register you put in your user info (as now) and a password you've obtained from the admin that allows you to register....for instance, in this way a teacher could set up a wikki with registration "on" and send a note to all of the parents with the registration password so that they could register....outsiders couldn't register, only those with the registration key. Possibly a quite useful feature to many potential user groups. -- GmBowen
Additions to the config
additions to wikkaconfig.php'allow_registration' => '2',
'registercode' => 'helloWorld',
'registercode' => 'helloWorld',
allow_registration sets the mode:
0 - no registration possible
1 - registration "without limits"
2 - password required
registercode takes the password
changes in usersettings
changes in actions/usersettings.php:line 123
// is user trying to log in or register?
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
line 140
// otherwise, create new account when registration is possible without limits (1) or the password matches (2)
else if ($register == '1' || ($register == '2' && $_REQUEST['code_input'] == $this->GetConfigValue('registercode')))
else if ($register == '1' || ($register == '2' && $_REQUEST['code_input'] == $this->GetConfigValue('registercode')))
line 169
else
{
$error = "Sorry, the register-code you entered was not correct!";
}
{
$error = "Sorry, the register-code you entered was not correct!";
}
lines 218-233
<?php
$register = $this->GetConfigValue('allow_registration');
if ($register == '1' || $register == '2')
{
?>
<tr>
<td align="right"></td>
<td width="500">Stuff you only need to fill in when you are logging in for the first time (and thus signing up as a new user on this site)</td>
</tr>
<tr>
<td align='right'>Confirm password:</td>
<td><input type='password' name='confpassword' size='40' /></td>
</tr>
<tr>
<td align='right'>Email address:</td>
<td><input name='email' size='40' /></td>
</tr>
<?php
if ($register == '2')
{
?>
<tr>
<td align='right'>Register Code:</td><td><input type='text' size='20' name='code_input' /></td>
</tr>
<?php
}
?>
<tr>
<td></td>
<td><input type='submit' value='Register' size='40' /></td>
</tr>
<?php
}
?>
$register = $this->GetConfigValue('allow_registration');
if ($register == '1' || $register == '2')
{
?>
<tr>
<td align="right"></td>
<td width="500">Stuff you only need to fill in when you are logging in for the first time (and thus signing up as a new user on this site)</td>
</tr>
<tr>
<td align='right'>Confirm password:</td>
<td><input type='password' name='confpassword' size='40' /></td>
</tr>
<tr>
<td align='right'>Email address:</td>
<td><input name='email' size='40' /></td>
</tr>
<?php
if ($register == '2')
{
?>
<tr>
<td align='right'>Register Code:</td><td><input type='text' size='20' name='code_input' /></td>
</tr>
<?php
}
?>
<tr>
<td></td>
<td><input type='submit' value='Register' size='40' /></td>
</tr>
<?php
}
?>
CategoryDevelopmentActions