You are here

BlockedNumberOne.php in Site Audit 8.2

Same filename and directory in other branches
  1. 7 Check/Users/BlockedNumberOne.php

Contains \SiteAudit\Check\Users\BlockedNumberOne.

File

Check/Users/BlockedNumberOne.php
View source
<?php

/**
 * @file
 * Contains \SiteAudit\Check\Users\BlockedNumberOne.
 */

/**
 * Class SiteAuditCheckUsersBlockedNumberOne.
 */
class SiteAuditCheckUsersBlockedNumberOne extends SiteAuditCheckAbstract {

  /**
   * Implements \SiteAudit\Check\Abstract\getLabel().
   */
  public function getLabel() {
    return dt('UID #1 access');
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getDescription().
   */
  public function getDescription() {
    return dt('Determine if UID #1 is blocked.');
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultFail().
   */
  public function getResultFail() {
    return dt('UID #1 is blocked!');
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultInfo().
   */
  public function getResultInfo() {
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultPass().
   */
  public function getResultPass() {
    return dt('UID #1 not blocked.');
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultWarn().
   */
  public function getResultWarn() {
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getAction().
   */
  public function getAction() {
    if ($this->score != SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS) {
      return dt('Unblock UID #1 using `drush user-unblock 1`');
    }
  }

  /**
   * Implements \SiteAudit\Check\Abstract\calculateScore().
   */
  public function calculateScore() {
    if (!$this->registry['uid_1']
      ->get('status')->value) {
      return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL;
    }
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS;
  }

}

Classes

Namesort descending Description
SiteAuditCheckUsersBlockedNumberOne Class SiteAuditCheckUsersBlockedNumberOne.