aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-09-24 18:17:54 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-09-24 18:17:54 +0000
commitd41c9e53d7c8841c2f22ef3031b2f109a9311f0d (patch)
tree8772bb86a5f0a3e0fbfc412f8a10ff069f5b8b6a
parent9d81b5cddd3d6aca54f1a77e0711db2f6d413441 (diff)
downloadelgg-d41c9e53d7c8841c2f22ef3031b2f109a9311f0d.tar.gz
elgg-d41c9e53d7c8841c2f22ef3031b2f109a9311f0d.tar.bz2
Refs #2454: Merged [6920] to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@6962 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/register.php14
-rw-r--r--languages/en.php3
2 files changed, 15 insertions, 2 deletions
diff --git a/actions/register.php b/actions/register.php
index b5733635f..a5043fed9 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -25,11 +25,21 @@ if (is_array($admin)) {
}
if ($CONFIG->allow_registration) {
-// For now, just try and register the user
try {
+ if (trim($password) == "" || trim($password2) == "") {
+ throw new RegistrationException(elgg_echo('RegistrationException:EmptyPassword'));
+ }
+
+ if (strcmp($password, $password2) != 0) {
+ throw new RegistrationException(elgg_echo('RegistrationException:PasswordMismatch'));
+ }
+
$guid = register_user($username, $password, $name, $email, false, $friend_guid, $invitecode);
- if (((trim($password) != "") && (strcmp($password, $password2) == 0)) && ($guid)) {
+ if ($guid) {
$new_user = get_entity($guid);
+
+ // @todo - consider removing registering admins since this is done
+ // through the useradd action
if (($guid) && ($admin)) {
// Only admins can make someone an admin
admin_gatekeeper();
diff --git a/languages/en.php b/languages/en.php
index 6a3f0d34a..797cfee7a 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -179,6 +179,9 @@ $english = array(
'SecurityException:deletedisablecurrentsite' => 'You can not delete or disable the site you are currently viewing!',
+ 'RegistrationException:EmptyPassword' => 'The password fields cannot be empty',
+ 'RegistrationException:PasswordMismatch' => 'Passwords must match',
+
'memcache:notinstalled' => 'PHP memcache module not installed, you must install php5-memcache',
'memcache:noservers' => 'No memcache servers defined, please populate the $CONFIG->memcache_servers variable',
'memcache:versiontoolow' => 'Memcache needs at least version %s to run, you are running %s',