Projet

Général

Profil

Révision bb746689

Ajouté par Assos Assos il y a plus de 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/security_review/security_review.pages.inc
41 41
  $header = t('Review results from last run !date', array('!date' => $date));
42 42
  $desc = t("Here you can review the results from the last run of the checklist. Checks are not always perfectly correct in their procedure and result. You can keep a check from running by clicking the 'Skip' link beside it. You can run the checklist again by expanding the fieldset above.");
43 43
  foreach ($checks as $check) {
44
    // Skip this iteration if the result has no matching item in the checklist.
45
    if (!isset($checklist[$check['namespace']][$check['reviewcheck']])) {
46
      continue;
47
    }
44 48
    $message = $check['result'] ? $checklist[$check['namespace']][$check['reviewcheck']]['success'] : $checklist[$check['namespace']][$check['reviewcheck']]['failure'];
45 49
    $title = $check['result'] ? t('OK') : t('Error');
46 50
    $class = $check['skip'] ? 'info' : ($check['result'] ? 'ok' : 'error');
......
139 143
    '#default_value' => variable_get('security_review_untrusted_roles', array_keys($defaults)),
140 144
  );
141 145

  
146
  $inactive_namespaces = array();
147
  // Report stored checks that aren't currently active.
148
  $checks = security_review_get_stored_results();
149
  foreach ($checks as $check) {
150
    if (!isset($checklist[$check['namespace']][$check['reviewcheck']])) {
151
      $inactive_namespaces[] = $check['namespace'];
152
    }
153
  }
154
  if (!empty($inactive_namespaces)) {
155
    $inactive_checks = implode(', ', $inactive_namespaces);
156
    $form['inactive_checks'] = array(
157
      '#prefix' => '<div class="messages warning">',
158
      '#suffix' => '</div>',
159
      '#markup' => t('Inactive checks are being stored under namespaces: %modules. Enabling associated modules may allow these checks to be run again. Inactive checks must be manually removed or uninstall and reinstall Security Review to clear all stored checks.', array('%modules' => $inactive_checks))
160
    );
161
  }
162

  
142 163
  $form['security_review_adv'] = array(
143 164
    '#type' => 'fieldset',
144 165
    '#title' => t('Advanced'),
......
157 178
  foreach ($checklist as $module => $checks) {
158 179
    foreach ($checks as $check_name => $check) {
159 180
      // Determine if check is being skipped.
160
      if (!empty($skipped) && array_key_exists($check_name, $skipped[$module])) {
181
      if (!empty($skipped) && isset($skipped[$module]) && array_key_exists($check_name, $skipped[$module])) {
161 182
        $values[] = $check_name;
162 183
        $label = t('!name <em>skipped by UID !uid on !date</em>', array('!name' => $check['title'], '!uid' => $skipped[$module][$check_name]['skipuid'], '!date' => format_date($skipped[$module][$check_name]['skiptime'])));
163 184
      }
......
339 360
    }
340 361
    elseif (isset($check['callback'])) {
341 362
      if (isset($check['file'])) {
363
        $check_module = $module;
342 364
        // Handle Security Review defining checks for other modules.
343 365
        if (isset($check['module'])) {
344
          $module = $check['module'];
366
          $check_module = $check['module'];
345 367
        }
346
        module_load_include('inc', $module, $check['file']);
368
        module_load_include('inc', $check_module, $check['file']);
347 369
      }
348 370
      $function = $check['callback'] . '_help';
349 371
      if (function_exists($function)) {

Formats disponibles : Unified diff