You are here

function security_review_get_last_check in Security Review 7

Same name and namespace in other branches
  1. 6 security_review.module \security_review_get_last_check()

Retrieve the result from the last run of a security check.

Return value

array @see security_review_get_stored_results() for format

2 calls to security_review_get_last_check()
security_review_check_help in ./security_review.pages.inc
Page callback provides general help and check specific help documentation.
_security_review_run_check in ./security_review.inc
Run a single Security Review check.

File

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

Code

function security_review_get_last_check($namespace, $check_name) {
  $fields = array(
    'namespace',
    'reviewcheck',
    'result',
    'lastrun',
    'skip',
    'skiptime',
    'skipuid',
  );
  $result = db_select('security_review', 'sr')
    ->fields('sr', $fields)
    ->condition('namespace', $namespace)
    ->condition('reviewcheck', $check_name)
    ->execute()
    ->fetchAssoc();
  if (!empty($result)) {
    $result['result'] = $result['result'] === '1' ? TRUE : FALSE;
    $result['skip'] = $result['skip'] === '1' ? TRUE : FALSE;
    return $result;
  }
  return FALSE;
}