diff --git a/Admin/Installer.php b/Admin/Installer.php index d139391..f2673c8 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -66,7 +66,9 @@ class Installer extends InstallerAbstract $query = new Builder($con); $query->insert('country_name', 'country_native', 'country_code2', 'country_code3', 'country_codenum')->into('country'); - $countries = $query->select('*')->from('country')->execute(); + $querySqlite = new Builder($sqlite); + $countries = $querySqlite->select('*')->from('country')->execute(); + foreach ($countries as $country) { $query->values( $country['country_name'], @@ -97,7 +99,9 @@ class Installer extends InstallerAbstract $query = new Builder($con); $query->insert('language_name', 'language_native', 'language_639_2T', 'language_639_2B', 'language_639_3')->into('language'); - $languages = $query->select('*')->from('language')->execute(); + $querySqlite = new Builder($sqlite); + $languages = $querySqlite->select('*')->from('language')->execute(); + foreach ($languages as $language) { $query->values( $language['language_name'], diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 08610a3..c4e6566 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -430,21 +430,23 @@ final class ApiController extends Controller */ private function createProfileForAccount(Account $account, RequestAbstract $request) : void { - if (((string) ($request->getData('password') ?? '')) !== '' - && ((string) ($request->getData('login') ?? '')) !== '' + if (((string) ($request->getData('password') ?? '')) === '' + || ((string) ($request->getData('login') ?? '')) === '' ) { - $old = clone $account; - - $this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry( - new \Modules\Profile\Models\Profile($account), - $request - ); - - $this->updateModel($request, $old, $account, function() use($account) : void { - $account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES)); - AccountMapper::update($account); - }, 'account'); + return; } + + $old = clone $account; + + $this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry( + new \Modules\Profile\Models\Profile($account), + $request + ); + + $this->updateModel($request, $old, $account, function() use($account) : void { + $account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES)); + AccountMapper::update($account); + }, 'account'); } /**