From e25f8e678c44ef78f4d0dffc3d53e0e149d7aa23 Mon Sep 17 00:00:00 2001 From: JediKev Date: Thu, 17 May 2018 14:57:28 -0500 Subject: [PATCH] issue: User Registration CLI This addresses an issue on the forums where the User Registration CLI was referencing a nonexistent function therefore breaking when ran. This updates the code to point to the correct function and includes the correct `$vars` necessary for User Registration. This also adds `require_once` for `class.config.php` in `bootstrap.php` so we can access the `$cfg` var. --- bootstrap.php | 1 + include/cli/modules/user.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index fe3dd21..6448035 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -204,6 +204,7 @@ class Bootstrap { require_once(INCLUDE_DIR.'class.format.php'); //format helpers require_once(INCLUDE_DIR.'class.validator.php'); //Class to help with basic form input validation...please help improve it. require(INCLUDE_DIR.'class.mailer.php'); + require_once INCLUDE_DIR.'class.config.php'; require_once INCLUDE_DIR.'mysqli.php'; require_once INCLUDE_DIR.'class.i18n.php'; require_once INCLUDE_DIR.'class.search.php'; diff --git a/include/cli/modules/user.php b/include/cli/modules/user.php index 00dd6af..e6d46a5 100644 --- a/include/cli/modules/user.php +++ b/include/cli/modules/user.php @@ -95,7 +95,12 @@ class UserManager extends Module { )); } if (!($account = $U->getAccount())) { - $account = UserAccount::create(array('user' => $U)); + $vars = array( + 'id' => $U->getId(), + 'username' => $U->getEmail(), + 'sendemail' => ($options['send-mail']) ? 1 : 0 + ); + $account = UserAccount::register($U, $vars); $U->account = $account; $U->save(); } -- 1.8.3.1