Revision history for UserRegistration


Revision [23356]

Last edited on 2016-05-20 07:38:47 by BrianKoontz [Replaces old-style internal links with new pipe-split links.]
Additions:
~-[[Ticket:236 | Ticket]]
~-[[http://wush.net/trac/wikka/changeset/130 | Changelog for r130]] and [[http://wush.net/trac/wikka/changeset/138 | r138]]
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130&format=raw | actions/usersettings.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=138&format=raw | r138]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=130&format=raw | setup/install.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=138&format=raw | r138]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=130&format=raw | trunk/wikka.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=138&format=raw | r138]]##
~&In 1.1.6.4, the invitation code setting (2) was replaced by a [[Docs:UserRegistrationValidationFramework | user registration module]]. This has been ported to 1.1.7.
Deletions:
~-[[Ticket:236 Ticket]]
~-[[http://wush.net/trac/wikka/changeset/130 Changelog for r130]] and [[http://wush.net/trac/wikka/changeset/138 r138]]
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130&format=raw actions/usersettings.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=138&format=raw r138]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=130&format=raw setup/install.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=138&format=raw r138]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=130&format=raw trunk/wikka.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=138&format=raw r138]]##
~&In 1.1.6.4, the invitation code setting (2) was replaced by a [[Docs:UserRegistrationValidationFramework user registration module]]. This has been ported to 1.1.7.


Revision [19951]

Edited on 2008-05-17 23:34:38 by BrianKoontz [Updated for 1.1.7]
Additions:
2 - password required (''deprecated as of 1.1.6.4, see note below'')
~&In 1.1.6.4, the invitation code setting (2) was replaced by a [[Docs:UserRegistrationValidationFramework 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''
Deletions:
2 - password required
~&In 1.1.6.4, the invitation code setting (2) was replaced by a [[Docs:UserRegistrationValidationFramework user registration module]]. This will likely be ported to 1.1.7 as well.
''Note that the code you can find in th history of this page is out of date and won't be updated since it will be in 1.1.7''


Revision [19565]

Edited on 2008-02-18 01:11:46 by BrianKoontz [Added note about invite code option in 1.1.6.4]
Additions:
~&In 1.1.6.4, the invitation code setting (2) was replaced by a [[Docs:UserRegistrationValidationFramework user registration module]]. This will likely be ported to 1.1.7 as well.


Revision [19370]

Edited on 2008-01-28 00:15:26 by JavaWoman [Modified links pointing to docs server]

No Differences

Revision [17607]

Edited on 2007-10-04 17:39:35 by JavaWoman [adding links for r138 for those who want to patch their 1.1.6.3 version]
Additions:
~-[[http://wush.net/trac/wikka/changeset/130 Changelog for r130]] and [[http://wush.net/trac/wikka/changeset/138 r138]]
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130&format=raw actions/usersettings.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=138&format=raw r138]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=130&format=raw setup/install.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=138&format=raw r138]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=130&format=raw trunk/wikka.php]] followed by [[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=138&format=raw r138]]##
Deletions:
~-[[http://wush.net/trac/wikka/changeset/130 Changelog]]
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130&format=raw actions/usersettings.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=130&format=raw setup/install.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=130&format=raw trunk/wikka.php]]##


Revision [17445]

Edited on 2007-08-24 01:21:12 by JavaWoman [fixing milestone (thanks, stem!)]
Additions:
{{svn}}''2006-06-18''
''Note that the code you can find in th history of this page is out of date and won't be updated since it will be in 1.1.7''
Deletions:
''2006-06-18''
''Note that the code you can find in th history of this page is out of date and won't be updated since it will be in 1.1.6.3''


Revision [17113]

Edited on 2007-07-04 04:09:14 by DarTar [fixing milestone]
Additions:
This patch has been committed to the SVN repository and will be included in ##1.1.7##:
Deletions:
This patch has been committed to the SVN repository and will be included in ##1.1.6.3##:


Revision [16427]

Edited on 2007-04-19 09:06:39 by BrianKoontz [Restored]
Additions:
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130&format=raw actions/usersettings.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=130&format=raw setup/install.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=130&format=raw trunk/wikka.php]]##
<<
>> **See also:**
~-UserAccountModules
~-RegisterAction
>>::c::
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
{{lastedit}}
====Additions to the config====
additions to ##wikkaconfig.php##
%%(php)
'allow_user_registration' => '2',
'invitation_code' => 'helloWorld',
%%
allow_registration sets the mode:
0 - no registration possible
1 - registration "without limits"
2 - password required
invitation_code takes the password
''Note that the code you can find in th history of this page is out of date and won't be updated since it will be in 1.1.6.3''
----
CategoryDevelopmentActions CategoryDevelopmentUserAccount
Deletions:
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130


Revision [16426]

Edited on 2007-04-19 08:48:27 by Wt2Pg4 [Restored]
Additions:
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130
Deletions:
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130&format=raw actions/usersettings.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=130&format=raw setup/install.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=130&format=raw trunk/wikka.php]]##
<<
>> **See also:**
~-UserAccountModules
~-RegisterAction
>>::c::
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
{{lastedit}}
====Additions to the config====
additions to ##wikkaconfig.php##
%%(php)
'allow_user_registration' => '2',
'invitation_code' => 'helloWorld',
%%
allow_registration sets the mode:
0 - no registration possible
1 - registration "without limits"
2 - password required
invitation_code takes the password
''Note that the code you can find in th history of this page is out of date and won't be updated since it will be in 1.1.6.3''
----
CategoryDevelopmentActions CategoryDevelopmentUserAccount


Revision [15677]

Edited on 2006-11-23 12:53:36 by StefanMeyer [invitation_code fix]
Additions:
invitation_code takes the password
Deletions:
registercode takes the password


Revision [15676]

Edited on 2006-11-23 11:49:48 by StefanMeyer [changed registercode into invitation_code]
Additions:
'invitation_code' => 'helloWorld',
Deletions:
'registercode' => 'helloWorld',


Revision [15237]

Edited on 2006-08-27 12:03:43 by NilsLindenberg [changing config param to reflect svn code]
Additions:
'allow_user_registration' => '2',
Deletions:
'allow_registration' => '2',


Revision [14636]

Edited on 2006-06-19 05:54:10 by NilsLindenberg [deleted code which is out of date]
Additions:
''Note that the code you can find in th history of this page is out of date and won't be updated since it will be in 1.1.6.3''
Deletions:
====changes in usersettings====
A) If you haven't modified your usersettings.php, you can replace it with the following version:
%%(php;1)
<?php
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "logout"))
{
$this->LogoutUser();
$this->Redirect($this->href(), "You are now logged out.");
}
else if ($user = $this->GetUser())
{
// is user trying to update?
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "update"))
{
$this->Query("update ".$this->config["table_prefix"]."users set ".
"email = '".mysql_real_escape_string($_POST["email"])."', ".
"doubleclickedit = '".mysql_real_escape_string($_POST["doubleclickedit"])."', ".
"show_comments = '".mysql_real_escape_string($_POST["show_comments"])."', ".
"revisioncount = '".mysql_real_escape_string($_POST["revisioncount"])."', ".
"changescount = '".mysql_real_escape_string($_POST["changescount"])."' ".
"where name = '".$user["name"]."' limit 1");
$this->SetUser($this->LoadUser($user["name"]));
// forward
$this->Redirect($this->href(), "User settings stored!");
}
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "changepass"))
{
// check password
$password = $_POST["password"];
if (preg_match("/ /", $password)) $passerror = "Sorry, blanks are not permitted in the password.";
else if (strlen($password) < 5) $passerror = "Tsk tsk, the password is much too short...";
else if (($user["password"] == md5($_POST["oldpass"])) || ($user["password"] == $_POST["oldpass"]))
{
$this->Query("update ".$this->config["table_prefix"]."users set "."password = md5('".mysql_real_escape_string($password)."') "."where name = '".$user["name"]."'");
$user["password"]=md5($password);
$this->SetUser($user);
$this->Redirect($this->href(), "Password changed.");
}
else
{
$passerror = "The old password you entered is wrong.";
}
}
print "<script type=\"text/javascript\"><!-- \nfunction hov(loc,cls){ \n if(loc.className) loc.className=cls;\n}\n //-->\n</script>\n";
// user is logged in; display config form
print($this->FormOpen());
?>
<input type="hidden" name="action" value="update" />
<table>
<tr>
<td align="right"></td>
<td>Hello, <?php echo $this->Link($user["name"]) ?>!</td>
</tr>
<tr>
<td align="right">Your email address:</td>
<td><input name="email" value="<?php echo $this->htmlspecialchars_ent($user["email"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Doubleclick Editing:</td>
<td><input type="hidden" name="doubleclickedit" value="N"><input type="checkbox" name="doubleclickedit" value="Y" <?php echo $user["doubleclickedit"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Show comments by default:</td>
<td><input type="hidden" name="show_comments" value="N"><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">RecentChanges display limit:</td>
<td><input name="changescount" value="<?php echo $this->htmlspecialchars_ent($user["changescount"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Page revisions list limit:</td>
<td><input name="revisioncount" value="<?php echo $this->htmlspecialchars_ent($user["revisioncount"]) ?>" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Update Settings" /> <input type="button" value="Logout" onclick="document.location='<?php echo $this->href("", "", "action=logout"); ?>'" /></td>
</tr>
</table>
<?php
print($this->FormClose());
print($this->FormOpen());
?>
<input type="hidden" name="action" value="changepass" />
<table>
<tr>
<td align="left"><b>Change your password:</b></td>
<td><br /><br /> </td>
</tr>
<?php
if (isset($passerror))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($passerror)."</div></td></tr>\n");
}
?>
<tr>
<td align="left">Your current password:</td>
<td><input type="password" name="oldpass" size="40" /></td>
</tr>
<tr>
<td align="left">Your new password:</td>
<td><input type="password" name="password" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Change" size="40" /></td>
</tr>
</table>
<br />
See a list of pages you own (<a href="<?php echo $this->href("", "MyPages"); ?>">MyPages</a>) and pages you've edited (<a href="<?php echo $this->href("", "MyChanges"); ?>">MyChanges</a>).<br />
<?php
print($this->FormClose());
}
else
{
// user is not logged in
print "<script type=\"text/javascript\"><!-- \nfunction hov(loc,cls){ \n if(loc.className) loc.className=cls;\n}\n //-->\n</script>\n";
// is user trying to log in or register?
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
{
// if user name already exists, check password
if ($existingUser = $this->LoadUser($_POST["name"]))
{
// check password
if ($existingUser["password"] == md5($_POST["password"]))
{
$this->SetUser($existingUser);
$this->Redirect($this->href());
}
else
{
$error = "Wrong password!";
}
}
// 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')))
{
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$password = $_POST["password"];
$confpassword = $_POST["confpassword"];
// check if name is WikiName style
if ($this->ExistsPage($name)) $error = 'Sorry, this ""WikiName"" is reserved for a page. Please choose a different name.';
elseif (!$this->IsWikiName($name)) $error = "User name must be WikiName formatted!";
elseif (!$email) $error = "You must specify an email address.";
elseif (!preg_match("/^.+?\@.+?\..+$/", $email)) $error = "That doesn't quite look like an email address.";
elseif ($confpassword != $password) $error = "Passwords didn't match.";
elseif (preg_match("/ /", $password)) $error = "Spaces aren't allowed in passwords.";
elseif (strlen($password) < 5) $error = "Password too short.";
else
{
$this->Query("insert into ".$this->config["table_prefix"]."users set ".
"signuptime = now(), ".
"name = '".mysql_real_escape_string($name)."', ".
"email = '".mysql_real_escape_string($email)."', ".
"password = md5('".mysql_real_escape_string($_POST["password"])."')");
// log in
$this->SetUser($this->LoadUser($name));
// forward
$this->Redirect($this->href());
}
}
else
{
$error = "Sorry, the register-code you entered was not correct!";
}
}
elseif (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "updatepass"))
{
// check if name is WikkiName style
$name = trim($_POST["yourname"]);
if (!$this->IsWikiName($name)) $newerror = "You have entered an incorrect or non-existent wikiname. The wikiname must be written in wikistyle, e.g: \"\"WikkaName.\"\"";
// if user name already exists, check password
elseif ($existingUser = $this->LoadUser($_POST["yourname"]))
{
if ($existingUser["password"] == $_POST["temppassword"])
{
// update password
$this->SetUser($existingUser, $_POST["remember"]);
$this->Redirect($this->href());
}
else
{
$newerror = "Sorry, you entered the wrong password.";
}
}
}
print($this->FormOpen());
?>
<input type="hidden" name="action" value="login" />
<table>
<tr>
<td align="right"></td>
<td><?php echo $this->Format("If you're already a registered user, log in here!"); ?></td>
</tr>
<?php
if (isset($error))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($error)."</div></td></tr>\n");
}
?>
<tr>
<td align="right">Your WikiName:</td>
<td><input name="name" size="40" value="<?php if (isset($name)) echo $name; ?>" /></td>
</tr>
<tr>
<td align="right">Password (5+ chars):</td>
<td><input type="password" name="password" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Login" 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
}
?>
</table>
<?php
print($this->FormClose());
print($this->FormOpen());
?>
<input type="hidden" name="action" value="updatepass" />
<table>
<tr>
<td colspan="2"><br /><hr /><h4>Forget your password?</h4></td><td></td>
</tr>
<tr>
<td align="left"></td>
<td>Log in here with the temporary password. <br />If you need a temporary password, click <?php echo $this->Format("[[PasswordForgotten here]]") ?></td>
</tr>
<?php
if (isset($newerror))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($newerror)."</div></td></tr>\n");
}
?>
<tr>
<td align="left">Your WikiName:</td>
<td><input name="yourname" value="<?php if (isset($_POST["yourname"])) echo $_POST["yourname"]; ?>" size="40" /></td>
</tr>
<tr>
<td align="left">Your temp password:</td>
<td><input name="temppassword" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Login" size="40" /></td>
</tr>
</table>
<?php
print($this->FormClose());
}
?>%%
~&Updated code to hopefully fix 'unexpected T_ELSE' bug reported by 68.191.5.12 - but untested as I don't have a version running where I can just implement it. Please test! -JavaWoman
B) **Or** apply the following changes to ##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"))
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')))
line 169
else
{
$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
}
?>


Revision [14633]

Edited on 2006-06-18 17:53:46 by NilsLindenberg [adding information about svn]
Additions:
<<==SVN==
''2006-06-18''
This patch has been committed to the SVN repository and will be included in ##1.1.6.3##:
~-[[Ticket:236 Ticket]]
~-[[http://wush.net/trac/wikka/changeset/130 Changelog]]
Patched files:
~-##[[http://wush.net/trac/wikka/browser/trunk/actions/usersettings.php?rev=130&format=raw actions/usersettings.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/setup/install.php?rev=130&format=raw setup/install.php]]##
~-##[[http://wush.net/trac/wikka/browser/trunk/wikka.php?rev=130&format=raw trunk/wikka.php]]##
Deletions:
<<**Note:**
15/06/2006: I am currently adapting the code to the 1.1.6.2 release. There are three (minor) things left to do, otherwise it works fine (though I need to do some more tests).


Revision [14603]

Edited on 2006-06-14 19:58:52 by NilsLindenberg [status - message]
Additions:
<<**Note:**
15/06/2006: I am currently adapting the code to the 1.1.6.2 release. There are three (minor) things left to do, otherwise it works fine (though I need to do some more tests).
<<


Revision [13959]

Edited on 2006-04-27 13:30:58 by GigaClon [removing &]
Additions:
<td><input type="submit" value="Update Settings" /> <input type="button" value="Logout" onclick="document.location='<?php echo $this->href("", "", "action=logout"); ?>'" /></td>
Deletions:
<td><input type="submit" value="Update Settings" /> <input type="button" value="Logout" onclick="document.location='<?php echo $this->href("", "", "&action=logout"); ?>'" /></td>


Revision [13955]

Edited on 2006-04-27 06:59:59 by JavaWoman [Updated code - see comment below it]
Additions:
$this->Query("update ".$this->config["table_prefix"]."users set "."password = md5('".mysql_real_escape_string($password)."') "."where name = '".$user["name"]."'");
if (isset($passerror))
print("<tr><td></td><td><div class=\"error\">".$this->Format($passerror)."</div></td></tr>\n");
elseif ($register == '1' || ($register == '2' && $_REQUEST['code_input'] == $this->GetConfigValue('registercode')))
else
$error = "Sorry, the register-code you entered was not correct!";
// check if name is WikkiName style
$name = trim($_POST["yourname"]);
if (!$this->IsWikiName($name)) $newerror = "You have entered an incorrect or non-existent wikiname. The wikiname must be written in wikistyle, e.g: \"\"WikkaName.\"\"";
elseif ($existingUser = $this->LoadUser($_POST["yourname"]))
if ($existingUser["password"] == $_POST["temppassword"])
// update password
$this->SetUser($existingUser, $_POST["remember"]);
$newerror = "Sorry, you entered the wrong password.";
<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>
<td align='right'>Confirm password:</td>
<td><input type='password' name='confpassword' size='40' /></td>
<td align='right'>Email address:</td>
<td><input name='email' size='40' /></td>
if ($register == '2')
<td align='right'>Register Code:</td>
<td><input type='text' size='20' name='code_input' /></td>
<td><input type='submit' value='Register' size='40' /></td>
<td colspan="2"><br /><hr /><h4>Forget your password?</h4></td><td></td>
if (isset($newerror))
print("<tr><td></td><td><div class=\"error\">".$this->Format($newerror)."</div></td></tr>\n");
?>%%
~&Updated code to hopefully fix 'unexpected T_ELSE' bug reported by 68.191.5.12 - but untested as I don't have a version running where I can just implement it. Please test! -JavaWoman
Deletions:




$password = $_POST["password"];
$this->Query("update ".$this->config["table_prefix"]."users set "."password = md5('".mysql_real_escape_string($password)."') "."where name = '".$user["name"]."'");
if (isset($passerror))
print("<tr><td></td><td><div class=\"error\">".$this->Format($passerror)."</div></td></tr>\n");
else if ($register == '1' || ($register == '2' && $_REQUEST['code_input'] == $this->GetConfigValue('registercode')))
$error = "Sorry, the register-code you entered was not correct!";
// check if name is WikkiName style
$name = trim($_POST["yourname"]);
if (!$this->IsWikiName($name)) $newerror = "You have entered an incorrect or non-existent wikiname. The wikiname must be written in wikistyle, e.g: \"\"WikkaName.\"\"";

// if user name already exists, check password
elseif ($existingUser = $this->LoadUser($_POST["yourname"]))
// updatepassword
if ($existingUser["password"] == $_POST["temppassword"])
$this->SetUser($existingUser, $_POST["remember"]);
$this->Redirect($this->href());
{
$newerror = "Sorry, you entered the wrong password.";
}

<tr>
<td colspan="2"><br /><hr /><h4>Forget your password?</h4></td><td></td>
</tr>
<?php
if (isset($newerror))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($newerror)."</div></td></tr>\n");
}
</table>
<?php
print($this->FormClose());
?>


Revision [13951]

Edited on 2006-04-26 19:59:58 by NilsLindenberg [adding an & at line 87]
Additions:
if (preg_match("/ /", $password)) $passerror = "Sorry, blanks are not permitted in the password.";
<td><input type="submit" value="Update Settings" /> <input type="button" value="Logout" onclick="document.location='<?php echo $this->href("", "", "&action=logout"); ?>'" /></td>
else if ($register == '1' || ($register == '2' && $_REQUEST['code_input'] == $this->GetConfigValue('registercode')))
$error = "Sorry, the register-code you entered was not correct!";
// check if name is WikkiName style
$name = trim($_POST["yourname"]);
if (!$this->IsWikiName($name)) $newerror = "You have entered an incorrect or non-existent wikiname. The wikiname must be written in wikistyle, e.g: \"\"WikkaName.\"\"";
// if user name already exists, check password
elseif ($existingUser = $this->LoadUser($_POST["yourname"]))
// updatepassword
if ($existingUser["password"] == $_POST["temppassword"])
{
$this->SetUser($existingUser, $_POST["remember"]);
$this->Redirect($this->href());
}
else
{
$newerror = "Sorry, you entered the wrong password.";
}
$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
?>
<td colspan="2"><br /><hr /><h4>Forget your password?</h4></td><td></td>
</tr>
<?php
if (isset($newerror))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($newerror)."</div></td></tr>\n");
?>
// is user trying to log in or register?
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
// 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
{
$error = "Sorry, the register-code you entered was not correct!";
}
$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
?>
Deletions:
if (preg_match("/ /", $password)) $passerror = "Sorry, blanks are not permitted in the password.";
<td><input type="submit" value="Update Settings" /> <input type="button" value="Logout" onclick="document.location='<?php echo $this->href("", "", "action=logout"); ?>'" /></td>
else if ($register == '1' || ($register == '2' && $_REQUEST['code_input'] == $this->GetConfigValue('registercode')))
else
{
$error = "Sorry, the register-code you entered was not correct!";
}
// check if name is WikkiName style
$name = trim($_POST["yourname"]);
if (!$this->IsWikiName($name)) $newerror = "You have entered an incorrect or non-existent wikiname. The wikiname must be written in wikistyle, e.g: \"\"WikkaName.\"\"";
// if user name already exists, check password
elseif ($existingUser = $this->LoadUser($_POST["yourname"]))
// updatepassword
if ($existingUser["password"] == $_POST["temppassword"])
{
$this->SetUser($existingUser, $_POST["remember"]);
$this->Redirect($this->href());
}
else
{
$newerror = "Sorry, you entered the wrong password.";
}
$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
}
?>
<td colspan="2"><br /><hr /><h4>Forget your password?</h4></td><td></td>
</tr>
<?php
if (isset($newerror))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($newerror)."</div></td></tr>\n");
?>
// is user trying to log in or register?
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
// 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
{
$error = "Sorry, the register-code you entered was not correct!";
}
<?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
}
?>


Revision [9935]

Edited on 2005-07-11 09:48:05 by NilsLindenberg [added whole usersettings.php]
Additions:
A) If you haven't modified your usersettings.php, you can replace it with the following version:
%%(php;1)
<?php
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "logout"))
{
$this->LogoutUser();
$this->Redirect($this->href(), "You are now logged out.");
}
else if ($user = $this->GetUser())
{

// is user trying to update?
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "update"))
{
$this->Query("update ".$this->config["table_prefix"]."users set ".
"email = '".mysql_real_escape_string($_POST["email"])."', ".
"doubleclickedit = '".mysql_real_escape_string($_POST["doubleclickedit"])."', ".
"show_comments = '".mysql_real_escape_string($_POST["show_comments"])."', ".
"revisioncount = '".mysql_real_escape_string($_POST["revisioncount"])."', ".
"changescount = '".mysql_real_escape_string($_POST["changescount"])."' ".
"where name = '".$user["name"]."' limit 1");

$this->SetUser($this->LoadUser($user["name"]));

// forward
$this->Redirect($this->href(), "User settings stored!");
}

if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "changepass"))
{
// check password
$password = $_POST["password"];
if (preg_match("/ /", $password)) $passerror = "Sorry, blanks are not permitted in the password.";
else if (strlen($password) < 5) $passerror = "Tsk tsk, the password is much too short...";
else if (($user["password"] == md5($_POST["oldpass"])) || ($user["password"] == $_POST["oldpass"]))
{
$this->Query("update ".$this->config["table_prefix"]."users set "."password = md5('".mysql_real_escape_string($password)."') "."where name = '".$user["name"]."'");
$user["password"]=md5($password);
$this->SetUser($user);
$this->Redirect($this->href(), "Password changed.");
}
else
{
$passerror = "The old password you entered is wrong.";
}
}
print "<script type=\"text/javascript\"><!-- \nfunction hov(loc,cls){ \n if(loc.className) loc.className=cls;\n}\n //-->\n</script>\n";
// user is logged in; display config form
print($this->FormOpen());
?>
<input type="hidden" name="action" value="update" />
<table>
<tr>
<td align="right"></td>
<td>Hello, <?php echo $this->Link($user["name"]) ?>!</td>
</tr>
<tr>
<td align="right">Your email address:</td>
<td><input name="email" value="<?php echo $this->htmlspecialchars_ent($user["email"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Doubleclick Editing:</td>
<td><input type="hidden" name="doubleclickedit" value="N"><input type="checkbox" name="doubleclickedit" value="Y" <?php echo $user["doubleclickedit"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">Show comments by default:</td>
<td><input type="hidden" name="show_comments" value="N"><input type="checkbox" name="show_comments" value="Y" <?php echo $user["show_comments"] == "Y" ? "checked=\"checked\"" : "" ?> /></td>
</tr>
<tr>
<td align="right">RecentChanges display limit:</td>
<td><input name="changescount" value="<?php echo $this->htmlspecialchars_ent($user["changescount"]) ?>" size="40" /></td>
</tr>
<tr>
<td align="right">Page revisions list limit:</td>
<td><input name="revisioncount" value="<?php echo $this->htmlspecialchars_ent($user["revisioncount"]) ?>" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Update Settings" /> <input type="button" value="Logout" onclick="document.location='<?php echo $this->href("", "", "action=logout"); ?>'" /></td>
</tr>
</table>
<?php
print($this->FormClose());
print($this->FormOpen());
?>
<input type="hidden" name="action" value="changepass" />
<table>
<tr>
<td align="left"><b>Change your password:</b></td>
<td><br /><br /> </td>
</tr>
<?php
if (isset($passerror))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($passerror)."</div></td></tr>\n");
}
?>
<tr>
<td align="left">Your current password:</td>
<td><input type="password" name="oldpass" size="40" /></td>
</tr>
<tr>
<td align="left">Your new password:</td>
<td><input type="password" name="password" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Change" size="40" /></td>
</tr>
</table>
<br />
See a list of pages you own (<a href="<?php echo $this->href("", "MyPages"); ?>">MyPages</a>) and pages you've edited (<a href="<?php echo $this->href("", "MyChanges"); ?>">MyChanges</a>).<br />
<?php
print($this->FormClose());
}
else
{
// user is not logged in
print "<script type=\"text/javascript\"><!-- \nfunction hov(loc,cls){ \n if(loc.className) loc.className=cls;\n}\n //-->\n</script>\n";
// is user trying to log in or register?
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
{
// if user name already exists, check password
if ($existingUser = $this->LoadUser($_POST["name"]))
{
// check password
if ($existingUser["password"] == md5($_POST["password"]))
{
$this->SetUser($existingUser);
$this->Redirect($this->href());
}
else
{
$error = "Wrong password!";
}
}
// 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')))
{
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$password = $_POST["password"];
$confpassword = $_POST["confpassword"];
// check if name is WikiName style
if ($this->ExistsPage($name)) $error = 'Sorry, this ""WikiName"" is reserved for a page. Please choose a different name.';
elseif (!$this->IsWikiName($name)) $error = "User name must be WikiName formatted!";
elseif (!$email) $error = "You must specify an email address.";
elseif (!preg_match("/^.+?\@.+?\..+$/", $email)) $error = "That doesn't quite look like an email address.";
elseif ($confpassword != $password) $error = "Passwords didn't match.";
elseif (preg_match("/ /", $password)) $error = "Spaces aren't allowed in passwords.";
elseif (strlen($password) < 5) $error = "Password too short.";
else
{
$this->Query("insert into ".$this->config["table_prefix"]."users set ".
"signuptime = now(), ".
"name = '".mysql_real_escape_string($name)."', ".
"email = '".mysql_real_escape_string($email)."', ".
"password = md5('".mysql_real_escape_string($_POST["password"])."')");
// log in
$this->SetUser($this->LoadUser($name));
// forward
$this->Redirect($this->href());
}
}
else
$error = "Sorry, the register-code you entered was not correct!";
}
elseif (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "updatepass"))
{
// check if name is WikkiName style
$name = trim($_POST["yourname"]);
if (!$this->IsWikiName($name)) $newerror = "You have entered an incorrect or non-existent wikiname. The wikiname must be written in wikistyle, e.g: \"\"WikkaName.\"\"";

// if user name already exists, check password
elseif ($existingUser = $this->LoadUser($_POST["yourname"]))
// updatepassword
if ($existingUser["password"] == $_POST["temppassword"])
$this->SetUser($existingUser, $_POST["remember"]);
$this->Redirect($this->href());
{
$newerror = "Sorry, you entered the wrong password.";
}
}

print($this->FormOpen());
?>
<input type="hidden" name="action" value="login" />
<table>
<tr>
<td align="right"></td>
<td><?php echo $this->Format("If you're already a registered user, log in here!"); ?></td>
</tr>
<?php
if (isset($error))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($error)."</div></td></tr>\n");
}
?>
<tr>
<td align="right">Your WikiName:</td>
<td><input name="name" size="40" value="<?php if (isset($name)) echo $name; ?>" /></td>
</tr>
<tr>
<td align="right">Password (5+ chars):</td>
<td><input type="password" name="password" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Login" size="40" /></td>
</tr>
<?php
</table>
<?php
print($this->FormClose());
print($this->FormOpen());
?>
<input type="hidden" name="action" value="updatepass" />
<table>
<tr>
<td colspan="2"><br /><hr /><h4>Forget your password?</h4></td><td></td>
</tr>
<tr>
<td align="left"></td>
<td>Log in here with the temporary password. <br />If you need a temporary password, click <?php echo $this->Format("[[PasswordForgotten here]]") ?></td>
</tr>
<?php
if (isset($newerror))
{
print("<tr><td></td><td><div class=\"error\">".$this->Format($newerror)."</div></td></tr>\n");
}
<tr>
<td align="left">Your WikiName:</td>
<td><input name="yourname" value="<?php if (isset($_POST["yourname"])) echo $_POST["yourname"]; ?>" size="40" /></td>
</tr>
<tr>
<td align="left">Your temp password:</td>
<td><input name="temppassword" size="40" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Login" size="40" /></td>
</tr>
</table>
<?php
print($this->FormClose());
}
?>
B) **Or** apply the following changes to ##actions/usersettings.php##:
Deletions:
changes in ##actions/usersettings.php##:


Revision [9809]

Edited on 2005-07-05 16:01:51 by DarTar [adding seealso box and category]
Additions:
>> **See also:**
~-UserAccountModules
~-RegisterAction
>>::c::
CategoryDevelopmentActions CategoryDevelopmentUserAccount
Deletions:
>>__Note__: future Wikka development will include separate actions for registration, login, logout, user settings. --- See also: RegisterAction>>::c::
CategoryDevelopmentActions


Revision [8699]

Edited on 2005-05-29 12:30:27 by JavaWoman [new category]
Additions:
CategoryDevelopmentActions
Deletions:
CategoryUserContributions


Revision [7225]

Edited on 2005-04-13 15:34:43 by NilsLindenberg [code correction: line numbers+variable-name]
Additions:
line 123
line 140
line 169
$error = "Sorry, the register-code you entered was not correct!";
lines 218-233
Deletions:
~line 132
~line 152
~line 181
$newerror = "Sorry, the register-code you entered was not correct!";
~line 233
ToDoList:
- more intuitive names for the variables


Revision [6646]

Edited on 2005-03-10 10:24:02 by DarTar [Adding info box]
Additions:
=====UserRegistration=====

>>__Note__: future Wikka development will include separate actions for registration, login, logout, user settings. --- See also: RegisterAction>>::c::
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

{{lastedit}}

====Additions to the config====
additions to ##wikkaconfig.php##

%%(php)
'allow_registration' => '2',
'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 132
%%(php)
// is user trying to log in or register?
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
%%

~line 152
%%(php)
// 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')))
%%

~line 181
%%(php)
else
{
$newerror = "Sorry, the register-code you entered was not correct!";
}
%%

~line 233
%%(php)

<?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
}
?>
%%

ToDoList:
- more intuitive names for the variables

----
Deletions:
=====UserRegistration=====
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

{{lastedit}}

====Additions to the config====
additions to ##wikkaconfig.php##

%%(php)
'allow_registration' => '2',
'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 132
%%(php)
// is user trying to log in or register?
$register = $this->GetConfigValue('allow_registration');
if (isset($_REQUEST["action"]) && ($_REQUEST["action"] == "login"))
%%

~line 152
%%(php)
// 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')))
%%

~line 181
%%(php)
else
{
$newerror = "Sorry, the register-code you entered was not correct!";
}
%%

~line 233
%%(php)

<?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
}
?>
%%

ToDoList:
- more intuitive names for the variables

----


Revision [5003]

Edited on 2005-01-23 13:51:05 by MyTreo [typo]
Additions:
2 - password required
Deletions:
2 - password requiered


Revision [4763]

Edited on 2005-01-17 14:56:46 by NilsLindenberg [cat. added]
Additions:
- more intuitive names for the variables
----
CategoryUserContributions
Deletions:
- more intuitive names for the variables


Revision [3946]

Edited on 2005-01-04 01:01:15 by NilsLindenberg [small codechange, to have "$email" not shown in the email-field anymore]
Additions:
<td><input name='email' size='40' /></td>
Deletions:
<td><input name='email' size='40' value='$email' /></td>


Revision [3795]

Edited on 2004-12-29 16:36:57 by NilsLindenberg [- changed code back to html]
Additions:
$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' value='$email' /></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
}
?>
Deletions:
$register = $this->GetConfigValue('allow_registration');
if ($register == '1' || $register == '2')
echo '<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>';
print("<tr><td align='right'>Confirm password:</td><td><input type='password' name='confpassword' size='40' /></td></tr>\n");
print("<tr><td align='right'>Email address:</td><td><input name='email' size='40' value='$email' /></td></tr>\n");
if ($register == '2')
{
print("<tr><td align='right'>Register Code:</td><td><input type='text' size='20' name='code_input' /></td></tr>\n");
}
print("<tr><td></td><td><input type='submit' value='Register' size='40' /></td></tr> \n");
- re-change the output above to html instead of php (should be possible)


Revision [3669]

The oldest known version of this page was created on 2004-12-25 21:32:52 by NilsLindenberg [- changed code back to html]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki