diff --git a/inc/SP/Account/AccountCrypt.class.php b/inc/SP/Account/AccountCrypt.class.php index b3707e61..f2aad837 100644 --- a/inc/SP/Account/AccountCrypt.class.php +++ b/inc/SP/Account/AccountCrypt.class.php @@ -55,6 +55,8 @@ class AccountCrypt */ public function updateOldPass(&$currentMasterPass) { + set_time_limit(300); + $accountsOk = []; $userId = Session::getUserData()->getUserId(); $demoEnabled = Checks::demoIsEnabled(); diff --git a/inc/SP/Account/AccountHistoryCrypt.class.php b/inc/SP/Account/AccountHistoryCrypt.class.php index 20e5acc4..a69ee830 100644 --- a/inc/SP/Account/AccountHistoryCrypt.class.php +++ b/inc/SP/Account/AccountHistoryCrypt.class.php @@ -55,6 +55,8 @@ class AccountHistoryCrypt */ public function updateOldPass(&$currentMasterPass) { + set_time_limit(300); + $accountsOk = []; $demoEnabled = Checks::demoIsEnabled(); $errorCount = 0; diff --git a/inc/SP/Core/Upgrade/Crypt.class.php b/inc/SP/Core/Upgrade/Crypt.class.php index ea1fd8c1..9e21ac1f 100644 --- a/inc/SP/Core/Upgrade/Crypt.class.php +++ b/inc/SP/Core/Upgrade/Crypt.class.php @@ -51,18 +51,26 @@ class Crypt public static function migrate(&$masterPass) { try { - DB::beginTransaction(); + if (!DB::beginTransaction()) { + throw new SPException(SPException::SP_ERROR, __('No es posible iniciar una transacción', false)); + } self::migrateAccounts($masterPass); self::migrateCustomFields($masterPass); - DB::endTransaction(); + if (!DB::endTransaction()) { + throw new SPException(SPException::SP_ERROR, __('No es posible finalizar una transacción', false)); + } } catch (CryptoException $e) { - DB::rollbackTransaction(); + if (DB::rollbackTransaction()) { + debugLog('Rollback'); + } return false; } catch (SPException $e) { - DB::rollbackTransaction(); + if (DB::rollbackTransaction()) { + debugLog('Rollback'); + } return false; } diff --git a/inc/SP/Core/Upgrade/Upgrade.class.php b/inc/SP/Core/Upgrade/Upgrade.class.php index 0e70a3f4..74f3f199 100644 --- a/inc/SP/Core/Upgrade/Upgrade.class.php +++ b/inc/SP/Core/Upgrade/Upgrade.class.php @@ -226,8 +226,8 @@ class Upgrade return $dbResult === true && is_object($UserData) && !empty($masterPass) - && Crypt::migrateHash($masterPass) && Crypt::migrate($masterPass) + && Crypt::migrateHash($masterPass) && UserMigrate::setMigrateUsers(); } } catch (SPException $e) {