[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/ -> index.php (source)

   1  <?php
   2  /* vim: set expandtab tabstop=4 shiftwidth=4 encoding=utf-8: */
   3  // +----------------------------------------------------------------------+
   4  // | Eventum - Issue Tracking System                                      |
   5  // +----------------------------------------------------------------------+
   6  // | Copyright (c) 2003, 2004, 2005, 2006, 2007 MySQL AB                  |
   7  // |                                                                      |
   8  // | This program is free software; you can redistribute it and/or modify |
   9  // | it under the terms of the GNU General Public License as published by |
  10  // | the Free Software Foundation; either version 2 of the License, or    |
  11  // | (at your option) any later version.                                  |
  12  // |                                                                      |
  13  // | This program is distributed in the hope that it will be useful,      |
  14  // | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
  15  // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
  16  // | GNU General Public License for more details.                         |
  17  // |                                                                      |
  18  // | You should have received a copy of the GNU General Public License    |
  19  // | along with this program; if not, write to:                           |
  20  // |                                                                      |
  21  // | Free Software Foundation, Inc.                                       |
  22  // | 59 Temple Place - Suite 330                                          |
  23  // | Boston, MA 02111-1307, USA.                                          |
  24  // +----------------------------------------------------------------------+
  25  // | Authors: João Prado Maia <jpm@mysql.com>                             |
  26  // +----------------------------------------------------------------------+
  27  //
  28  // @(#) $Id: index.php 3258 2007-02-14 23:25:56Z glen $
  29  
  30  require_once(dirname(__FILE__) . '/init.php');
  31  require_once (APP_INC_PATH . "class.template.php");
  32  require_once (APP_INC_PATH . "class.auth.php");
  33  require_once (APP_INC_PATH . "db_access.php");
  34  
  35  // check if templates_c is writable by the web server user
  36  if (!Misc::isWritableDirectory(APP_TPL_COMPILE_PATH)) {
  37      $errors = array("Directory '" . APP_TPL_COMPILE_PATH . "' is not writable.");
  38      Misc::displayRequirementErrors($errors);
  39      exit;
  40  }
  41  
  42  $tpl = new Template_API();
  43  $tpl->setTemplate("index.tpl.html");
  44  
  45  if (Auth::hasValidCookie(APP_COOKIE)) {
  46      $cookie = Auth::getCookieInfo(APP_COOKIE);
  47      if (!empty($_REQUEST["url"])) {
  48          $extra = '?url=' . $_REQUEST["url"];
  49      } else {
  50          $extra = '';
  51      }
  52      Auth::redirect(APP_RELATIVE_URL . "select_project.php" . $extra);
  53  }
  54  
  55  $projects = Project::getAnonymousList();
  56  if (empty($projects)) {
  57      $tpl->assign("anonymous_post", 0);
  58  } else {
  59      $tpl->assign("anonymous_post", 1);
  60  }
  61  
  62  $tpl->displayTemplate();


Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7