X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fsecurity_review%2Fsrc%2FForm%2FRunForm.php;fp=web%2Fmodules%2Fcontrib%2Fsecurity_review%2Fsrc%2FForm%2FRunForm.php;h=0000000000000000000000000000000000000000;hp=16b50ba84fb71dd4ba8c1bd29f53bf71194f0fbe;hb=419f97be044f1aebd0713921ee604841127e9e84;hpb=052617e40b525f8b817d84c29b1c04951f427069 diff --git a/web/modules/contrib/security_review/src/Form/RunForm.php b/web/modules/contrib/security_review/src/Form/RunForm.php deleted file mode 100644 index 16b50ba84..000000000 --- a/web/modules/contrib/security_review/src/Form/RunForm.php +++ /dev/null @@ -1,95 +0,0 @@ -checklist = $checklist; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('security_review.checklist') - ); - } - - /** - * {@inheritdoc} - */ - public function getFormId() { - return 'security-review-run'; - } - - /** - * {@inheritdoc} - */ - public function buildForm(array $form, FormStateInterface $form_state) { - if (!$this->currentUser()->hasPermission('run security checks')) { - return []; - } - - $form['run_form'] = [ - '#type' => 'details', - '#title' => $this->t('Run'), - '#description' => $this->t('Click the button below to run the security checklist and review the results.') . '
', - '#open' => TRUE, - ]; - - $form['run_form']['submit'] = [ - '#type' => 'submit', - '#value' => $this->t('Run checklist'), - ]; - - // Return the finished form. - return $form; - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - $batch = [ - 'operations' => [], - 'finished' => '_security_review_batch_run_finished', - 'title' => $this->t('Performing Security Review'), - 'init_message' => $this->t('Security Review is starting.'), - 'progress_message' => $this->t('Progress @current out of @total.'), - 'error_message' => $this->t('An error occurred. Rerun the process or consult the logs.'), - ]; - - foreach ($this->checklist->getEnabledChecks() as $check) { - $batch['operations'][] = [ - '_security_review_batch_run_op', - [$check], - ]; - } - - batch_set($batch); - } - -}