Commit a703b3ee authored by webchick's avatar webchick

#431148 by pwolanin: Make it easier to visually distinguish between security...

#431148 by pwolanin: Make it easier to visually distinguish between security updates and regular updates.
parent de7635bf
......@@ -56,6 +56,10 @@
direction: ltr; /* Note: version numbers should always be LTR. */
}
.update tr.unknown {
background: #ddd;
}
table.update,
.update table.version {
width: 100%;
......
......@@ -109,10 +109,11 @@ function _update_cron_notify() {
include_once DRUPAL_ROOT . '/includes/install.inc';
$status = update_requirements('runtime');
$params = array();
$notify_all = (variable_get('update_notification_threshold', 'all') == 'all');
foreach (array('core', 'contrib') as $report_type) {
$type = 'update_' . $report_type;
if (isset($status[$type]['severity'])
&& $status[$type]['severity'] == REQUIREMENT_ERROR) {
&& ($status[$type]['severity'] == REQUIREMENT_ERROR || ($notify_all && $status[$type]['reason'] == UPDATE_NOT_CURRENT))) {
$params[$report_type] = $status[$type]['reason'];
}
}
......
......@@ -254,7 +254,7 @@ function _update_requirement_check($project, $type) {
break;
case UPDATE_NOT_CURRENT:
$requirement_label = t('Out of date');
$requirement['severity'] = variable_get('update_notification_threshold', 'all') == 'all' ? REQUIREMENT_ERROR : REQUIREMENT_WARNING;
$requirement['severity'] = REQUIREMENT_WARNING;
break;
case UPDATE_UNKNOWN:
case UPDATE_NOT_CHECKED:
......
......@@ -47,17 +47,18 @@ function theme_update_report($data) {
$class = 'ok';
$icon = theme('image', 'misc/watchdog-ok.png', t('ok'), t('ok'));
break;
case UPDATE_UNKNOWN:
$class = 'unknown';
$icon = theme('image', 'misc/watchdog-warning.png', t('warning'), t('warning'));
break;
case UPDATE_NOT_SECURE:
case UPDATE_REVOKED:
case UPDATE_NOT_SUPPORTED:
$class = 'error';
$icon = theme('image', 'misc/watchdog-error.png', t('error'), t('error'));
break;
case UPDATE_NOT_CHECKED:
case UPDATE_NOT_CURRENT:
if ($notification_level == 'all'
|| $project['status'] != UPDATE_NOT_CURRENT) {
$class = 'error';
$icon = theme('image', 'misc/watchdog-error.png', t('error'), t('error'));
break;
}
// Otherwise, deliberate no break and use the warning class/icon.
default:
$class = 'warning';
$icon = theme('image', 'misc/watchdog-warning.png', t('warning'), t('warning'));
......
......@@ -34,13 +34,13 @@ function update_settings() {
$form['update_notification_threshold'] = array(
'#type' => 'radios',
'#title' => t('Notification threshold'),
'#title' => t('E-mail notification threshold'),
'#default_value' => variable_get('update_notification_threshold', 'all'),
'#options' => array(
'all' => t('All newer versions'),
'security' => t('Only security updates'),
),
'#description' => t('If there are updates available of Drupal core or any of your installed modules and themes, your site will print an error message on the <a href="@status_report">status report</a>, the <a href="@modules_page">modules page</a>, and the <a href="@themes_page">themes page</a>. You can choose to only see these error messages if a security update is available, or to be notified about any newer versions.', array('@status_report' => url('admin/reports/status'), '@modules_page' => url('admin/build/modules'), '@themes_page' => url('admin/build/themes')))
'#description' => t('You can choose to send e-mail only if a security update is available, or to be notified about all newer versions. If there are updates available of Drupal core or any of your installed modules and themes, your site will always print a message on the <a href="@status_report">status report</a> page, and will also display an error message on administration pages if there is a security update.', array('@status_report' => url('admin/reports/status')))
);
$form = system_settings_form($form, FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment