diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2012-12-15 13:06:40 -0500 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2012-12-15 13:06:40 -0500 |
commit | cd3839cfec814c191ff664faeaf9e9360118d6bf (patch) | |
tree | 6b47816134bdfd50afdff5cb7dfa2611f61fc73b | |
parent | c62260d19232255ed91801bfd3e8887bfe7cfb91 (diff) | |
download | elgg-cd3839cfec814c191ff664faeaf9e9360118d6bf.tar.gz elgg-cd3839cfec814c191ff664faeaf9e9360118d6bf.tar.bz2 |
Fixes #4698. Catching and displaying exceptions during initial admin user creation.
-rw-r--r-- | install/ElggInstaller.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 934b38d28..775bbf5b6 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -1519,22 +1519,27 @@ class ElggInstaller { protected function createAdminAccount($submissionVars, $login = FALSE) { global $CONFIG; - $guid = register_user( - $submissionVars['username'], - $submissionVars['password1'], - $submissionVars['displayname'], - $submissionVars['email'] - ); + try { + $guid = register_user( + $submissionVars['username'], + $submissionVars['password1'], + $submissionVars['displayname'], + $submissionVars['email'] + ); + } catch (Exception $e) { + register_error($e->getMessage()); + return false; + } if (!$guid) { register_error(elgg_echo('install:admin:cannot_create')); - return FALSE; + return false; } $user = get_entity($guid); if (!$user) { register_error(elgg_echo('install:error:loadadmin')); - return FALSE; + return false; } elgg_set_ignore_access(TRUE); @@ -1543,7 +1548,7 @@ class ElggInstaller { } else { datalist_set('admin_registered', 1); } - elgg_set_ignore_access(FALSE); + elgg_set_ignore_access(false); // add validation data to satisfy user validation plugins create_metadata($guid, 'validated', TRUE, '', 0, ACCESS_PUBLIC); |