UserRegistration
SVN
2006-06-18This patch has been committed to the SVN repository and will be included in 1.1.7:
- Ticket
- actions/usersettings.php followed by r138
- setup/install.php followed by r138
- trunk/wikka.php followed by r138
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
Last edited by BrianKoontz:
Replaces old-style internal links with new pipe-split links.
Fri, 20 May 2016 07:38 UTC [diff]
Replaces old-style internal links with new pipe-split links.
Fri, 20 May 2016 07:38 UTC [diff]
Additions to the config
additions to wikkaconfig.php'allow_user_registration' => '2',
'invitation_code' => 'helloWorld',
'invitation_code' => 'helloWorld',
allow_registration sets the mode:
0 - no registration possible
1 - registration "without limits"
2 - password required (deprecated as of 1.1.6.4, see note below)
invitation_code takes the password
- In 1.1.6.4, the invitation code setting (2) was replaced by a user registration module. This has been ported to 1.1.7.
Note that the code you can find in the history of this page is out of date and won't be updated since it will be in 1.1.7
CategoryDevelopmentActions CategoryDevelopmentUserAccount
Fatal error: Call to undefined function: existspage()
can you post the full code for usersetting.php?
- Open actions/usersettings.php.
- Search for "otherwise, create new account".
- Change the else statement to elseif (0)
It should now look like this:
// otherwise, create new account
elseif (0)
- Done. One line changed and registrations are disabled.
In the 3rd box $newerror should be replaced by $error :
$error = "Sorry, the register-code you entered was not correct!";
------------------------------
Here is the diff file that worked for me:
230,233c
<?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
}
?>
.
217a
<?php
$register = $this->GetConfigValue('allow_registration');
if ($register == '1' || $register == '2')
{
?>
.
177d
169a
else
{
$error = "Sorry, the register-code you entered was not correct!";
}
.
156c
// else
// otherwise, create new account when registration is possible
// without limits (1) or the password matches (2)
elseif ($register == '1' || ($register == '2' && $_REQUEST['code_input'] == $this->GetConfigValue('registercode')))
.
123a
$register = $this->GetConfigValue('allow_registration');
.
Line 50 is the new code I added by cutting and pasting into the wikka.config.php file - here is lines 49 through 52.
"wakka_version" => "1.1.6.0");
'allow_registration' => '2',
'registercode' => 'shadow',
?>
Help!
Bernd.
Nils, to what version of usersettings does this apply? Apparently not 1.1.6.2
I do not have time in the next two weeks (examns) but after that I'll take a look at it
thanks a lot for this!!
I've left my wiki (www.wikituck.com) unattended for a month or two, and spammers have taken it over. Somehow they've replaced the login/register page with spam, and I can't roll it back without logging in. But I can't log in because the login interface is gone!
What can I do?
I've ported the user registration code (at least option 1, permit/deny registration) to the 1.1.6.4 dev branch. You have a couple of options here:
1. Install the dev version of 1.1.6.4 (preferably from the SVN repo, see http://wikkawiki.org/WikkaSVN for instructions). This version is quite stable, and is close to release.
2. Make the changes yourself. I ported the changes to 1.1.6.4 by modifying actions/usersettings.php (you can see what I did here: http://wush.net/trac/wikka/changeset/865).
3. Wait until 1.1.6.4 is release, and upgrade then.