You are here

public function SiteAuditCheckUsersCountAll::calculateScore in Site Audit 7

Same name and namespace in other branches
  1. 8.2 Check/Users/CountAll.php \SiteAuditCheckUsersCountAll::calculateScore()

Implements \SiteAudit\Check\Abstract\calculateScore().

Overrides SiteAuditCheckAbstract::calculateScore

File

Check/Users/CountAll.php, line 63
Contains \SiteAudit\Check\Users\CountAll.

Class

SiteAuditCheckUsersCountAll
Class SiteAuditCheckUsersCountAll.

Code

public function calculateScore() {
  $sql_query = 'SELECT COUNT(uid) ';
  $sql_query .= 'FROM {users} ';
  $sql_query .= 'WHERE uid != 0 ';
  $this->registry['count_users_all'] = db_query($sql_query)
    ->fetchField();
  if (!$this->registry['count_users_all']) {
    $this->abort = TRUE;
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL;
  }
  return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
}