aboutsummaryrefslogtreecommitdiff
path: root/actions/useradd.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
committerSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
commite53d410129701ea1c9d19529afa493f11b5f5b70 (patch)
treed9963b24bf8932654b4a47e36602c75975e50dba /actions/useradd.php
parent377da25d2965c64941f83baae119fc970ec60982 (diff)
parent08a962c98e2923724f8013d6eaae89101243752a (diff)
downloadelgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz
elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2
Merge github.com:Elgg/Elgg
Conflicts: engine/lib/input.php
Diffstat (limited to 'actions/useradd.php')
-rw-r--r--actions/useradd.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/actions/useradd.php b/actions/useradd.php
index 8e588d073..3df41af79 100644
--- a/actions/useradd.php
+++ b/actions/useradd.php
@@ -20,13 +20,24 @@ if (is_array($admin)) {
$admin = $admin[0];
}
+// no blank fields
+if ($username == '' || $password == '' || $password2 == '' || $email == '' || $name == '') {
+ register_error(elgg_echo('register:fields'));
+ forward(REFERER);
+}
+
+if (strcmp($password, $password2) != 0) {
+ register_error(elgg_echo('RegistrationException:PasswordMismatch'));
+ forward(REFERER);
+}
+
// For now, just try and register the user
try {
$guid = register_user($username, $password, $name, $email, TRUE);
- if (((trim($password) != "") && (strcmp($password, $password2) == 0)) && ($guid)) {
+ if ($guid) {
$new_user = get_entity($guid);
- if (($guid) && ($admin)) {
+ if ($uew_user && $admin && elgg_is_admin_logged_in()) {
$new_user->makeAdmin();
}