<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id: $
- *
*/
class CRM_Utils_VersionCheck {
const
if ($this->versionInfo && $this->localVersion) {
if (isset($this->versionInfo[$this->localMajorVersion])) {
- switch(CRM_Utils_Array::value('status', $this->versionInfo[$this->localMajorVersion])) {
+ switch (CRM_Utils_Array::value('status', $this->versionInfo[$this->localMajorVersion])) {
case 'stable':
case 'lts':
case 'testing':
if (version_compare($this->localVersion, $release['version']) < 0) {
if (!$this->ignoreDate || $this->ignoreDate < $release['date']) {
$newerVersion['newest'] = $release['version'];
- if (CRM_Utils_Array::value('security',$release)) {
+ if (CRM_Utils_Array::value('security', $release)) {
$newerVersion['security'] = $release['version'];
}
}
return $newerVersion;
}
- /**
- * Alert the site admin of new versions of CiviCRM.
- * Show the message once a day
- */
- public function versionAlert() {
- $versionAlertSetting = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'versionAlert', NULL, 1);
- $securityAlertSetting = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'securityUpdateAlert', NULL, 3);
- $settingsUrl = CRM_Utils_System::url('civicrm/admin/setting/misc', 'reset=1', FALSE, NULL, FALSE, FALSE, TRUE);
- if (CRM_Core_Permission::check('administer CiviCRM') && $securityAlertSetting > 1 && $this->isSecurityUpdateAvailable()) {
- $session = CRM_Core_Session::singleton();
- if ($session->timer('version_alert', 24 * 60 * 60)) {
- $msg = ts('This version of CiviCRM requires a security update.') .
- '<ul>
- <li><a href="https://civicrm.org/advisory">' . ts('Read advisory') . '</a></li>
- <li><a href="https://civicrm.org/download">' . ts('Download now') . '</a></li>
- <li><a class="crm-setVersionCheckIgnoreDate" href="' . $settingsUrl . '">' . ts('Suppress this message') . '</a></li>
- </ul>';
- $session->setStatus($msg, ts('Security Alert'), 'alert');
- CRM_Core_Resources::singleton()
- ->addScriptFile('civicrm', 'templates/CRM/Admin/Form/Setting/versionCheckOptions.js');
- }
- }
- elseif (CRM_Core_Permission::check('administer CiviCRM') && $versionAlertSetting > 1) {
- $newerVersion = $this->isNewerVersionAvailable();
- if ($newerVersion) {
- $session = CRM_Core_Session::singleton();
- if ($session->timer('version_alert', 24 * 60 * 60)) {
- $msg = ts('A newer version of CiviCRM is available: %1', array(1 => $newerVersion)) .
- '<ul>
- <li><a href="https://civicrm.org/download">' . ts('Download now') . '</a></li>
- <li><a class="crm-setVersionCheckIgnoreDate" href="' . $settingsUrl . '">' . ts('Suppress this message') . '</a></li>
- </ul>';
- $session->setStatus($msg, ts('Update Available'), 'info');
- CRM_Core_Resources::singleton()
- ->addScriptFile('civicrm', 'templates/CRM/Admin/Form/Setting/versionCheckOptions.js');
- }
- }
- }
- }
-
/**
* Collect info about the site to be sent as pingback data.
*/
'uf' => $config->userFramework,
'lang' => $config->lcMessages,
'co' => $config->defaultContactCountry,
- 'ufv' => $config->userFrameworkVersion,
+ 'ufv' => $config->userSystem->getVersion(),
'PHP' => phpversion(),
'MySQL' => CRM_CORE_DAO::singleValueQuery('SELECT VERSION()'),
- 'communityMessagesUrl' => CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'communityMessagesUrl', NULL, '*default*'),
+ 'communityMessagesUrl' => Civi::settings()->get('communityMessagesUrl'),
);
$this->getPayProcStats();
$this->getEntityStats();