Skip to content

Commit

Permalink
Dev: Upgraded db for 2fa plugin in core application
Browse files Browse the repository at this point in the history
  • Loading branch information
eddylackmann committed Mar 25, 2021
1 parent f87bda2 commit 9c0da4a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

$config['versionnumber'] = '4.4.14';
$config['dbversionnumber'] = 441;
$config['dbversionnumber'] = 442;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['templateapiversion'] = 3;
Expand Down
2 changes: 1 addition & 1 deletion application/core/plugins/TwoFactorAdminLogin/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>TwoFactorAdminLogin</name>
<type>plugin</type>
<creationDate>2019-03-10</creationDate>
<lastUpdate>2020-08-24</lastUpdate>
<lastUpdate>2021-03-22</lastUpdate>
<author>Markus Fluer, Eddy Lackmann</author>
<authorUrl>https://limesurvey.org</authorUrl>
<version>1.2.5</version>
Expand Down
14 changes: 14 additions & 0 deletions application/helpers/update/updatedb_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3756,6 +3756,20 @@ function ($v) {
$oDB->createCommand()->update('{{settings_global}}', array('stg_value' => 441), "stg_name='DBVersion'");
$oTransaction->commit();
}

if ($iOldDBVersion < 442) {
$oTransaction = $oDB->beginTransaction();
$oDB->createCommand()->insert("{{plugins}}", [
'name' => 'TwoFactorAdminLogin',
'plugin_type' => 'core',
'active' => 0,
'version' => '1.2.5',
'load_error' => 0,
'load_error_message' => null
]);
$oDB->createCommand()->update('{{settings_global}}', array('stg_value' => 442), "stg_name='DBVersion'");
$oTransaction->commit();
}
} catch (Exception $e) {
Yii::app()->setConfig('Updating', false);
$oTransaction->rollback();
Expand Down

0 comments on commit 9c0da4a

Please sign in to comment.