aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-29 15:16:07 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-29 15:16:07 +0000
commit3221448c7cacf882649f8f991d539c8783f34286 (patch)
treea142b09fec3d94476352700edfbb20249da988e7
parent24eb2b495fe85b17c9e04af3965fb42f70f1f9b5 (diff)
downloadelgg-3221448c7cacf882649f8f991d539c8783f34286.tar.gz
elgg-3221448c7cacf882649f8f991d539c8783f34286.tar.bz2
Registration disabled option (no admin screen yet), closes #184
git-svn-id: https://code.elgg.org/elgg/trunk@1572 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/register.php43
-rw-r--r--languages/en.php1
-rw-r--r--views/default/account/forms/login.php5
3 files changed, 29 insertions, 20 deletions
diff --git a/actions/register.php b/actions/register.php
index 6f4009aaf..b404d844a 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -12,6 +12,7 @@
*/
require_once(dirname(dirname(__FILE__)) . "/engine/start.php");
+ global $CONFIG;
// Get variables
$username = get_input('username');
@@ -21,25 +22,31 @@
$name = get_input('name');
$admin = get_input('admin');
-
+
+
+ if (!$CONFIG->disable_registration)
+ {
// For now, just try and register the user
- if (
- (
- (trim($password)!="") &&
- (strcmp($password, $password2)==0)
- ) &&
- ($guid = register_user($username, $password, $name, $email))
- ) {
- if (($guid) && ($admin))
- {
- admin_gatekeeper(); // Only admins can make someone an admin
- $new_user = get_entity($guid);
- $new_user->admin = 'yes';
+ if (
+ (
+ (trim($password)!="") &&
+ (strcmp($password, $password2)==0)
+ ) &&
+ ($guid = register_user($username, $password, $name, $email))
+ ) {
+ if (($guid) && ($admin))
+ {
+ admin_gatekeeper(); // Only admins can make someone an admin
+ $new_user = get_entity($guid);
+ $new_user->admin = 'yes';
+ }
+
+ system_message(sprintf(elgg_echo("registerok"),$CONFIG->sitename));
+ } else {
+ register_error(elgg_echo("registerbad"));
}
-
- system_message(sprintf(elgg_echo("registerok"),$CONFIG->sitename));
- } else {
- register_error(elgg_echo("registerbad"));
- }
+ }
+ else
+ register_error(elgg_echo('registerdisabled'));
?> \ No newline at end of file
diff --git a/languages/en.php b/languages/en.php
index c50d8b155..3d988fb1c 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -254,6 +254,7 @@
'register' => "Register",
'registerok' => "You have successfully registered for %s.",
'registerbad' => "Your registration was unsuccessful. The username may already exist, or your passwords might not match.",
+ 'registerdisabled' => "Registration has been disabled by the system administrator",
'adduser' => "Add User",
'adduser:ok' => "You have successfully added a new user.",
diff --git a/views/default/account/forms/login.php b/views/default/account/forms/login.php
index de8eb5ad9..105c4499d 100644
--- a/views/default/account/forms/login.php
+++ b/views/default/account/forms/login.php
@@ -10,7 +10,8 @@
* @copyright Curverider Ltd 2008
* @link http://elgg.org/
*/
-
+
+ global $CONFIG;
?>
<div id="login-box"> <h2><?php echo elgg_echo('login'); ?></h2>
@@ -19,6 +20,6 @@
<br />
<label><?php echo elgg_echo('password'); ?><br /><input name="password" type="password" class="general-textarea" /></label><br />
<input type="submit" name="submit" class="submit_button" value="<?php echo elgg_echo('login'); ?>" /></p>
- <p><a href="<?php echo $vars['url']; ?>register.php"><?php echo elgg_echo('register'); ?></a></p>
+ <?php if (!$CONFIG->disable_registration) { ?><p><a href="<?php echo $vars['url']; ?>register.php"><?php echo elgg_echo('register'); ?></a></p><?php } ?>
</form>
</div> \ No newline at end of file