aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 90b7622ae..a28a09ac3 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -576,6 +576,10 @@
return false;
}
+ // Check to see if we've registered the first admin yet.
+ // If not, this is the first admin user!
+ $admin = datalist_get('admin_registered');
+
// Otherwise ...
$user = new ElggUser();
$user->username = $username;
@@ -585,6 +589,11 @@
$user->access_id = 2;
$user->save();
+ if (!$admin) {
+ $user->admin = true;
+ datalist_set('admin_registered',1);
+ }
+
return $user->getGUID();