diff --git a/application/config/version.php b/application/config/version.php index cb435ea52b9..60f28253b3a 100644 --- a/application/config/version.php +++ b/application/config/version.php @@ -13,7 +13,7 @@ */ $config['versionnumber'] = "2.06a1"; -$config['dbversionnumber'] = 179; +$config['dbversionnumber'] = 180; $config['buildnumber'] = ''; $config['updatable'] = true; diff --git a/application/helpers/update/updatedb_helper.php b/application/helpers/update/updatedb_helper.php index fa325dbbdbd..8f7ae3c0b6c 100644 --- a/application/helpers/update/updatedb_helper.php +++ b/application/helpers/update/updatedb_helper.php @@ -1266,7 +1266,37 @@ function db_upgrade_all($iOldDBVersion) { alterColumn('{{participants}}', 'lastname', "string(150)", false); $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>179),"stg_name='DBVersion'"); } + if ($iOldDBVersion < 180) + { + $aUsers = User::model()->findAll(); + $aPerm = array( + 'entity_id' => 0, + 'entity' => 'global', + 'uid' => 0, + 'permission' => 'auth_db', + 'create_p' => 0, + 'read_p' => 1, + 'update_p' => 0, + 'delete_p' => 0, + 'import_p' => 0, + 'export_p' => 0 + ); + foreach ($aUsers as $oUser) + { + if (!Permission::model()->hasGlobalPermission('auth_db','read',$oUser->uid)) + { + $oPermission = new Permission; + foreach ($aPerm as $k => $v) + { + $oPermission->$k = $v; + } + $oPermission->uid = $oUser->uid; + $oPermission->save(); + } + } + $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>180),"stg_name='DBVersion'"); + } $oTransaction->commit(); // Activate schema caching $oDB->schemaCachingDuration=3600; diff --git a/application/libraries/PluginManager/PluginManager.php b/application/libraries/PluginManager/PluginManager.php index 7bcf0adddbc..a2b1926ee2f 100644 --- a/application/libraries/PluginManager/PluginManager.php +++ b/application/libraries/PluginManager/PluginManager.php @@ -75,14 +75,14 @@ public function getInstalledPlugins() public function isPluginActive($sPluginName) { $pluginModel = Plugin::model(); - $record = $pluginModel->findByAttributes(array('name' => $sPluginName)); + $record = $pluginModel->findByAttributes(array('name' => $sPluginName, 'active' => '1')); if ($record == false) { return false; } else { - return $record->active; + return true; } }