diff --git a/core/Updates/3.8.0-b3.php b/core/Updates/3.8.0-b3.php index 83cc13e4fb6..04556831386 100644 --- a/core/Updates/3.8.0-b3.php +++ b/core/Updates/3.8.0-b3.php @@ -12,6 +12,7 @@ use Piwik\Common; use Piwik\Db; use Piwik\Option; +use Piwik\Plugin; use Piwik\Updater; use Piwik\Updates as PiwikUpdates; use Piwik\Updater\Migration\Factory as MigrationFactory; @@ -47,14 +48,17 @@ public function doUpdate(Updater $updater) { $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); - foreach (Option::getLike('GoogleAuthentication.%') as $name => $value) { - $value = @unserialize($value); - if (!empty($value['isActive']) && !empty($value['secret'])) { - $login = str_replace('GoogleAuthentication.', '', $name); + if (Plugin\Manager::getInstance()->isPluginActivated('GoogleAuthenticator')) { + foreach (Option::getLike('GoogleAuthentication.%') as $name => $value) { + $value = @unserialize($value); + if (!empty($value['isActive']) && !empty($value['secret'])) { + $login = str_replace('GoogleAuthentication.', '', $name); - $table = Common::prefixTable('user'); - Db::query("UPDATE $table SET twofactor_secret = ? where login = ?", array($value['secret'], $login)); + $table = Common::prefixTable('user'); + Db::query("UPDATE $table SET twofactor_secret = ? where login = ?", array($value['secret'], $login)); + } } } + } }