aboutsummaryrefslogtreecommitdiff
path: root/actions/register.php
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 /actions/register.php
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
Diffstat (limited to 'actions/register.php')
-rw-r--r--actions/register.php43
1 files changed, 25 insertions, 18 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