class_setup.inc 9.41 KiB
<?php
/*
  This code is part of FusionDirectory (http://www.fusiondirectory.org/)
  Copyright (C) 2003  Cajus Pollmeier
  Copyright (C) 2011-2016  FusionDirectory
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
require_once("class_setupStep.inc");
class fake_userinfo extends userinfo
  function __construct()
    $this->cn   = 'fake_cn';
    $this->dn   = 'fake_dn';
    $this->uid  = 'fake_uid';
    $this->ip   = $_SERVER['REMOTE_ADDR'];
    /* This fake user have all rights */
    $this->ignoreACL = TRUE;
    /* Initialize ACL_CACHE */
    $this->reset_acl_cache();
class setup
  /* Number of setup steps */ 
  var $i_steps;
  /* Current step */
  var $i_current        = 0;
  /* Previous setup step; */
  var $i_previous       = 0;
  var $i_config         = 4;
  var $o_steps          = array();
  var $captured_values  = array();
  function __construct()
    $this->o_steps = array(
      new Step_Welcome($this),
      new Step_Language($this),
      new Step_Checks($this),
      new Step_Ldap($this),
      new Step_Config_before_init($this),
      new Step_Migrate($this),
      new Step_Finish($this),
    $this->i_steps = count($this->o_steps);
    /* Ensure that setup is not reachable if fusiondirectory.conf exist (CONFIG_FILE) */
    if (file_exists(CONFIG_DIR."/".CONFIG_FILE)) {
      session::destroy();
      header("Location: index.php");