UserRegistration


SVN
2006-06-18
This patch has been committed to the SVN repository and will be included in 1.1.7:
  • Ticket
Patched files:


 


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]


Additions to the config

additions to wikkaconfig.php

'allow_user_registration' => '2',
'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


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
Comments
Comment by host205-81.pool8258.interbusiness.it
2005-03-10 10:02:00
mhh i try this but i get this error
Fatal error: Call to undefined function: existspage()

can you post the full code for usersetting.php?
Comment by DarTar
2005-03-10 10:25:02
What Wikka version are you running? ExistsPage() has been added - if I remember correctly - since 1.1.6.0.
Comment by JavaWoman
2005-03-10 20:25:06
Correct: ExistsPage exists as of version 1.1.6.0
Comment by ceho.chilan.net
2005-03-24 19:31:48
Can you make a diff file? You'll save much time for those who want to disable registration.
Comment by JsnX
2005-03-25 01:00:57
I'll give you the easiest way to disable registrations.

- 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.
Comment by S0106000d88e13187.cg.shawcable.net
2005-04-13 07:52:34
The above line numbers are incorrect for version 1.1.6.0

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');
.
Comment by NilsLindenberg
2005-04-13 15:35:48
yes, you are right. I have corrected the line-numbers and corrected the name of the variable
Comment by ChrisH
2005-12-11 04:32:36
I cannot get this to work. I keep getting an error of ""Parse error: parse error, unexpected T_DOUBLE_ARROW in /www/c/cheismann/yrazul/htdocs/wiki/wikka.config.php on line 50""

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!
Comment by GmBowen
2005-12-11 04:52:09
you need to move the bracket & semi-colon from line 49 to line 51 (replacing them on line 49 with a comma, and using them to replace the comma on line 51). That should solve your problem. You can also move your lines 50 & 51 above line 49. The order shouldn't matter....it's just that the ); should be at the end.
Comment by ChrisH
2005-12-11 07:02:19
Doh! Thanks.
Comment by 68.191.5.12
2006-04-26 17:41:19
an & need to be added to line 78 next to "action=logout"
Comment by NilsLindenberg
2006-04-26 20:26:49
Thank you.
Comment by 68.191.5.12
2006-04-27 01:28:10
now i get this message when plopping the new usersettings.php into place
Comment by 68.191.5.12
2006-04-27 01:28:21
Parse error: parse error, unexpected T_ELSE in /www/virtualhosts/www.livingbuddhism.org.vt.edu/wikka/actions/usersettings.php on line 172
Comment by JavaWoman
2006-04-27 07:04:07
68.191.5.12 : Please try updated code above: I can't test locally but I think I found the problem.
Comment by GigaClon
2006-04-27 14:42:47
this is 68.191.5.12, it works thanks, also I took out the & previously mentioned. logout was broken due to a incorrect rewrite option
Comment by 84.56.217.111
2006-05-10 13:15:58
I have the problem that I cannot change my wikka.config.php ! Everytime I change and reload my wikka the config file is changed back to the old version without my changes! Can anybody give me a hint where's the problem, please?

Bernd.
Comment by DarTar
2006-05-11 03:07:53
Hi Bernd - the engine only *reads* the config file when it runs, so I don't see what you mean when you say that "the config file is changed back to the old version". Sorry if this sounds silly, but are you sure the file you are modifying is the one that Wikka reads?
Comment by DarTar
2006-06-19 03:30:01
> If you haven't modified your usersettings.php
Nils, to what version of usersettings does this apply? Apparently not 1.1.6.2
Comment by WazoO
2006-07-20 16:27:31
Ok, I tried editing the patches per the SVN .. gave up trying to clean things up so a 'diff' would show me where I screwed up ... copied off the SVN version of the 1.1.6.2 file, installed that in my system. Real issues with the "0 = no registration" mode .... one of the most significant is that the wikka.config.php settings don't seem to be used at all for this code .. only a change to the wikka.php file makes a change in operation. question is ... do you want a 'new' ticket, the existing ticket reopened, content posted onto this page ....???? My Notepad listing of code bits, results, and issues is showing at 4k .....
Comment by NilsLindenberg
2006-07-21 05:24:52
WazoO, please re-open the ticket and tell me what the 'real issues' are. And please include if you use mod_rewrite or not. If there is no personal data inside, could you please attach your listings in a txt-file?

I do not have time in the next two weeks (examns) but after that I'll take a look at it
Comment by WazoO
2006-08-25 23:42:20
OK, the SVN version of this code is using/asking for a configuration parameter of 'allow_user_registration' rather than the 'allow_registration' parameter defined on this page (and in the history code of this page)
Comment by NilsLindenberg
2006-08-27 12:02:36
Uh, sorry, that's my mistake. I did not think about people taking the config entries from here rather from the svn and so I did not change it accourdingly.
Comment by WazoO
2006-08-27 12:50:07
Naw, it's OK .. you've already blamed me <g> .... I started with this page data, ran into issues .. so grabbed the SVN code .. I did not notice the variable change until .. comparing thing1 with twad1, thing2 with twad2, everything matching ... finally noticed that thing1 and twad2 were different ....
Comment by Defjam01
2006-10-14 13:45:10
This plugin is perfect :D
thanks a lot for this!!
Comment by YaVerOt
2006-12-22 16:02:53
Do we have a date for 1.1.6.3, or does this page need to refer to 1.1.7.0? (Or some latter 1.1.7.x) And where do I get the release dates?
Comment by DarTar
2006-12-24 13:45:48
YaVerOt, we are currently closing a number of tickets left for 1.1.7 (which is the next scheduled release). There is not yet a release date, but if you have a SVN client you can checkout the latest version from the repository to see how the new engine will look like. Further information can be found here: http://wush.net/trac/wikka/milestone/1.1.7
Comment by ChristopherHerbert
2007-09-05 07:23:05
I need some help.

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?
Comment by YodaHome
2007-09-06 13:09:21
Can you create new Pages without logging in? If so, just create a new page and embed the usersettings action.
Comment by ChristopherHerbert
2007-09-07 09:27:46
Thanks YodaHome. That did the trick.
Comment by ChrisH
2008-01-23 01:40:59
Ok, I'm confused. I just installed 1.1.6.3 on another one of my sites. There used to be real clear cut instructions for adding the User Registration, they aren't so clear cut now. I know I have to modify the wikka.config file, and change a couple of actions, but I'm not sure where the code is/modifications are any more, and this page has been changed since my last install (over a year ago).
Comment by NilsLindenberg
2008-01-24 07:08:12
You might want to look at the history of this page: http://wikkawiki.org/UserRegistration/show?time=2006-06-18+17%3A53%3A46
Comment by BrianKoontz
2008-01-26 10:52:34
ChrisH--

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.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki