<?php
class StartUp extends Controller {
  private $helper;

  private $is_installed;

  public function __construct() {
    $this->helper = new InstallationHelper;
    $this->is_installed = $this->helper->is_installed();
  }

  public function run() {
    $this->handle_installation_redirect();
  }

  private function handle_installation_redirect() {
    if (!$this->is_installed) { $this->view("startup/welcome"); die(0); }
    // header("Location: " . URLROOT . "/user/login"); add /admin as an endpoint here
    if (GOOGLE_RECAPTCHA == 1) {
      header("Location: " . URLROOT . "/pages?p=recaptcha");
      return;
    }

    header("Location: " . URLROOT . "/pages");
  }


}
 ?>
