private function HelpController::generalHelp in Security Review 8
Returns the general help page.
Return value
array The general help page.
1 call to HelpController::generalHelp()
- HelpController::index in src/
Controller/ HelpController.php - Serves as an entry point for the help pages.
File
- src/
Controller/ HelpController.php, line 95
Class
- HelpController
- The class of the Help pages' controller.
Namespace
Drupal\security_review\ControllerCode
private function generalHelp() {
$paragraphs = [];
// Print the general help.
$paragraphs[] = $this
->t('You should take the security of your site very seriously. Fortunately, Drupal is fairly secure by default. The Security Review module automates many of the easy-to-make mistakes that render your site insecure, however it does not automatically make your site impenetrable. You should give care to what modules you install and how you configure your site and server. Be mindful of who visits your site and what features you expose for their use.');
$paragraphs[] = $this
->t('You can read more about securing your site in the <a href="http://drupal.org/security/secure-configuration">drupal.org handbooks</a> and on <a href="http://crackingdrupal.com">CrackingDrupal.com</a>. There are also additional modules you can install to secure or protect your site. Be aware though that the more modules you have running on your site the greater (usually) attack area you expose.');
$paragraphs[] = $this
->t('<a href="http://drupal.org/node/382752">Drupal.org Handbook: Introduction to security-related contrib modules</a>');
// Print the list of security checks with links to their help pages.
$checks = [];
foreach ($this->checklist
->getChecks() as $check) {
// Get the namespace array's reference.
$check_namespace =& $checks[$check
->getMachineNamespace()];
// Set up the namespace array if not set.
if (!isset($check_namespace)) {
$check_namespace['namespace'] = $check
->getNamespace();
$check_namespace['check_links'] = [];
}
// Add the link pointing to the check-specific help.
$check_namespace['check_links'][] = Link::createFromRoute($this
->t('@title', [
'@title' => $check
->getTitle(),
]), 'security_review.help', [
'namespace' => $check
->getMachineNamespace(),
'title' => $check
->getMachineTitle(),
]);
}
return [
'#theme' => 'general_help',
'#paragraphs' => $paragraphs,
'#checks' => $checks,
];
}