You are here

function security_review_run_full in Security Review 7

Run the security review checklist and return the full results.

File

./security_review.module, line 200
Site security review and reporting Drupal module.

Code

function security_review_run_full($checklist, $log = NULL) {
  module_load_include('inc', 'security_review');

  // Allow callers, like our drush command, to decide not to log.
  if (is_null($log)) {
    $log = variable_get('security_review_log', TRUE);
  }

  // Call our private function to perform the actual review.
  $results = _security_review_run($checklist, $log);

  // Fill out the descriptions of the results.
  foreach ($results as $module => $checks) {
    foreach ($checks as $check_name => $check) {
      $function = $check['callback'] . '_help';

      // We should have loaded all necessary include files.
      if (function_exists($function)) {
        $element = call_user_func($function, $check);

        // @todo run through theme?
        $results[$module][$check_name]['help'] = $element;
      }
    }
  }
  return $results;
}