/**
  * Installation Step 8: Finished!
  */
 public function finished()
 {
     $this->checkPiwikIsNotInstalled();
     $view = new View('@Installation/finished', $this->getInstallationSteps(), __FUNCTION__);
     $form = new FormDefaultSettings();
     /**
      * Triggered on initialization of the form to customize default Piwik settings (at the end of the installation process).
      *
      * @param \Piwik\Plugins\Installation\FormDefaultSettings $form
      */
     Piwik::postEvent('Installation.defaultSettingsForm.init', array($form));
     $form->addElement('submit', 'submit', array('value' => Piwik::translate('General_ContinueToPiwik') . ' »', 'class' => 'btn btn-lg'));
     if ($form->validate()) {
         try {
             /**
              * Triggered on submission of the form to customize default Piwik settings (at the end of the installation process).
              *
              * @param \Piwik\Plugins\Installation\FormDefaultSettings $form
              */
             Piwik::postEvent('Installation.defaultSettingsForm.submit', array($form));
             $this->markInstallationAsCompleted();
             Url::redirectToUrl('index.php');
         } catch (Exception $e) {
             $view->errorMessage = $e->getMessage();
         }
     }
     $view->addForm($form);
     $view->showNextStep = false;
     $output = $view->render();
     return $output;
 }
Beispiel #2
0
 /**
  * Process the submit on the Installation "default settings" form.
  *
  * @param FormDefaultSettings $form
  */
 public function installationFormSubmit(FormDefaultSettings $form)
 {
     $doNotTrack = (bool) $form->getSubmitValue('do_not_track');
     $dntChecker = new DoNotTrackHeaderChecker();
     if ($doNotTrack) {
         $dntChecker->activate();
     } else {
         $dntChecker->deactivate();
     }
     $anonymiseIp = (bool) $form->getSubmitValue('anonymise_ip');
     if ($anonymiseIp) {
         IPAnonymizer::activate();
     } else {
         IPAnonymizer::deactivate();
     }
 }