X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fsecurity_review%2Fsecurity_review.install;fp=web%2Fmodules%2Fcontrib%2Fsecurity_review%2Fsecurity_review.install;h=0000000000000000000000000000000000000000;hb=9424afc6c1f518c301bf87a23c047d1873435d05;hp=999114962a9bcef661566a880c0290b9c328ad06;hpb=5ca1b61ad2659177690cbde2cf7675f9c0d50491;p=yaffs-website diff --git a/web/modules/contrib/security_review/security_review.install b/web/modules/contrib/security_review/security_review.install deleted file mode 100644 index 999114962..000000000 --- a/web/modules/contrib/security_review/security_review.install +++ /dev/null @@ -1,80 +0,0 @@ -admin/people/permissions. Be sure to grant permissions to trusted users only as this module can show sensitive site information.', - [':url' => Url::fromRoute('user.admin_permissions')->toString()] - ) - ); -} - -/** - * Implements hook_requirements(). - */ -function security_review_requirements($phase) { - $requirements = []; - - // Provides a Status Report entry. - if ($phase == 'runtime') { - /** @var \Drupal\security_review\Checklist $checklist */ - $checklist = Drupal::service('security_review.checklist'); - - $failed_checks = FALSE; - $no_results = TRUE; - - // Looks for failed checks. - foreach ($checklist->getEnabledChecks() as $check) { - $result = $check->lastResult(); - if ($result instanceof CheckResult) { - $no_results = FALSE; - if ($result->result() === CheckResult::FAIL) { - $failed_checks = TRUE; - break; - } - } - } - - $module_url = Url::fromRoute('security_review')->toString(); - if ($no_results) { - $severity = REQUIREMENT_WARNING; - $value = t( - 'The Security Review checklist has not been run. Run the checklist', - [':url' => $module_url] - ); - } - elseif ($failed_checks) { - $severity = REQUIREMENT_WARNING; - $value = t( - 'There are failed Security Review checks. Review the checklist', - [':url' => $module_url] - ); - } - else { - $severity = REQUIREMENT_OK; - $value = t( - 'Passing all non-ignored Security Review checks. Review the checklist', - [':url' => $module_url] - ); - } - $requirements['security_review'] = [ - 'title' => t('Security Review'), - 'severity' => $severity, - 'value' => $value, - ]; - } - - return $requirements; -}