Skip to content

Commit

Permalink
Fixed #8738: Upgrading with webserver auth from 2.00+ to 2.05+ does n…
Browse files Browse the repository at this point in the history
…ot enable authwebserver plugin
  • Loading branch information
mennodekker committed Mar 6, 2014
1 parent 9aede57 commit cd7d387
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -1217,6 +1217,30 @@ function db_upgrade_all($iOldDBVersion) {
}
if ($iOldDBVersion < 177)
{
if ( Yii::app()->getConfig('auth_webserver') === true ) {
// using auth webserver, now activate the plugin with default settings.
if (!class_exists('Authwebserver', false)) {
$plugin = Plugin::model()->findByAttributes(array('name'=>'Authwebserver'));
if (!$plugin) {
$plugin = new Plugin();
$plugin->name = 'Authwebserver';
$plugin->active = 1;
$plugin->save();
$plugin = App()->getPluginManager()->loadPlugin('Authwebserver', $plugin->id);
$aPluginSettings = $plugin->getPluginSettings(true);
$aDefaultSettings = array();
foreach ($aPluginSettings as $key => $settings) {
if (is_array($settings) && array_key_exists('current', $settings) ) {
$aDefaultSettings[$key] = $settings['current'];
}
}
$plugin->saveSettings($aDefaultSettings);
} else {
$plugin->active = 1;
$plugin->save();
}
}
}
upgradeSurveys177();
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>177),"stg_name='DBVersion'");
}
Expand Down

0 comments on commit cd7d387

Please sign in to comment.