<?php
  /*

      upgrade.php

      Wrapper script for system/upgrade.php 
      (where the script really should reside, only needs this wrapper to get the require's correct)

      Changelog:
        2005-07-15 arne_sf: Implemented output buffering, to be able to upgrade
          database before displaying any output
        2005-04-30 arne_sf: Initial version
        
      ----

      Copyright (C) 2005  Arne (arne_sf@users.sourceforge.net)

      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 version 2.

      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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

  */
  
  
  // Version number of this release (also defined in index.php)
  define(SCRIPTVERSION, '0.9.9');

  // Destroy any session that might exist effectively logging off
  session_start();
  session_destroy();
    
  // Initialize output array for the upgrade system
  $output = array();

  // Page Title
  $ptitle = 'Upgrade';

  // Includes
  require_once 'system/db.php';
  require_once 'system/lang.php';
  require_once 'system/global_preferences.php';
  require_once 'system/upgrade.php';
  require 'header.php';

?>
  <h1>Upgrade of Helpdesk Issue Manager</h1>
  <h2>Please wait while the Helpdesk Issue Manager's database is updated. This
    may take a while...</h2>
  <div class="block">
<?php
        
  // Display upgrade output
  foreach ($output as $line)
    echo $line;
    
?>
  </div>
<?php

  // Include
  require 'footer.php';    
?>
