[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/ -> index.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare                                                               *
   4      * http://www.egroupware.org                                                *
   5      * --------------------------------------------                             *
   6      *  This program is free software; you can redistribute it and/or modify it *
   7      *  under the terms of the GNU General Public License as published by the   *
   8      *  Free Software Foundation; either version 2 of the License, or (at your  *
   9      *  option) any later version.                                              *
  10      \**************************************************************************/
  11  
  12      /* $Id: index.php 20295 2006-02-15 12:31:25Z  $ */
  13  
  14      $egw_info = array();
  15      if(!file_exists('header.inc.php'))
  16      {
  17          Header('Location: setup/index.php');
  18          exit;
  19      }
  20  
  21      $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid'];
  22      if(!$GLOBALS['sessionid'])
  23      {
  24          Header('Location: login.php'.
  25              (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ?
  26              '?phpgw_forward='.urlencode('/index.php?'.$_SERVER['QUERY_STRING']):''));
  27          exit;
  28      }
  29  
  30      if(isset($_GET['hasupdates']) && $_GET['hasupdates'] == 'yes')
  31      {
  32          $hasupdates = True;
  33      }
  34  
  35      /*
  36          This is the menuaction driver for the multi-layered design
  37      */
  38      if(isset($_GET['menuaction']))
  39      {
  40          list($app,$class,$method) = explode('.',@$_GET['menuaction']);
  41          if(! $app || ! $class || ! $method)
  42          {
  43              $invalid_data = True;
  44          }
  45      }
  46      else
  47      {
  48      //$egw->log->message('W-BadmenuactionVariable, menuaction missing or corrupt: %1',$menuaction);
  49      //$egw->log->commit();
  50  
  51          $app = 'home';
  52          $invalid_data = True;
  53      }
  54  
  55      if($app == 'phpgwapi')
  56      {
  57          $app = 'home';
  58          $api_requested = True;
  59      }
  60  
  61      $GLOBALS['egw_info']['flags'] = array(
  62          'noheader'   => True,
  63          'nonavbar'   => True,
  64          'enable_network_class'    => True,
  65          'enable_contacts_class'   => True,
  66          'enable_nextmatchs_class' => True,
  67          'currentapp' => $app
  68      );
  69      include('./header.inc.php');
  70  
  71      //     Check if we are using windows or normal webpage
  72      $windowed = false;
  73      $tpl_info = EGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['egw_info']['user']['preferences']['common']['template_set'] . '/setup/setup.inc.php';
  74  
  75      if(@file_exists($tpl_info))
  76      {
  77         include_once($tpl_info);
  78  //       if(isset($template_info))
  79  //       {
  80            if($GLOBALS['egw_info']['template'][$GLOBALS['egw_info']['user']['preferences']['common']['template_set']]['windowed'])
  81            {
  82               $windowed = true;
  83            }
  84  //       }
  85      }
  86  
  87      if($app == 'home' && !$api_requested && !$windowed)
  88      {
  89          if ($GLOBALS['egw_info']['server']['force_default_app'] && $GLOBALS['egw_info']['server']['force_default_app'] != 'user_choice')
  90          {
  91              $GLOBALS['egw_info']['user']['preferences']['common']['default_app'] = $GLOBALS['egw_info']['server']['force_default_app'];
  92          }
  93          if($GLOBALS['egw_info']['user']['preferences']['common']['default_app'] && !$hasupdates)
  94          {
  95              $GLOBALS['egw']->redirect_link('/'.$GLOBALS['egw_info']['user']['preferences']['common']['default_app'].'/index.php');
  96          }
  97          else
  98          {
  99              $GLOBALS['egw']->redirect_link('/home/index.php');
 100          }
 101      }
 102  
 103      if($windowed && $_GET['cd'] == 'yes')
 104      {
 105          $GLOBALS['egw_info']['flags'] = array(
 106              'noheader'   => False,
 107              'nonavbar'   => False,
 108              'enable_network_class'    => True,
 109              'enable_contacts_class'   => True,
 110              'enable_nextmatchs_class' => True,
 111              'currentapp' => 'eGroupWare'
 112          );
 113          $GLOBALS['egw']->common->egw_header();
 114          $GLOBALS['egw']->common->egw_footer();
 115  
 116      }
 117      else
 118      {
 119          if($api_requested)
 120          {
 121              $app = 'phpgwapi';
 122          }
 123  
 124          $GLOBALS[$class] = CreateObject($app.'.'.$class);    // dont use =& with $GLOBALS, it does NOT behave as expected
 125          if((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data)
 126          {
 127              execmethod($_GET['menuaction']);
 128              unset($app);
 129              unset($class);
 130              unset($method);
 131              unset($invalid_data);
 132              unset($api_requested);
 133          }
 134          else
 135          {
 136              if(!$app || !$class || !$method)
 137              {
 138                  if(@is_object($GLOBALS['egw']->log))
 139                  {
 140                      $GLOBALS['egw']->log->message(array(
 141                          'text' => 'W-BadmenuactionVariable, menuaction missing or corrupt: %1',
 142                          'p1'   => $menuaction,
 143                          'line' => __LINE__,
 144                          'file' => __FILE__
 145                      ));
 146                  }
 147              }
 148  
 149              if(!is_array($GLOBALS[$class]->public_functions) || ! $$GLOBALS[$class]->public_functions[$method] && $method)
 150              {
 151                  if(@is_object($GLOBALS['egw']->log))
 152                  {
 153                      $GLOBALS['egw']->log->message(array(
 154                          'text' => 'W-BadmenuactionVariable, attempted to access private method: %1',
 155                          'p1'   => $method,
 156                          'line' => __LINE__,
 157                          'file' => __FILE__
 158                      ));
 159                  }
 160              }
 161              if(@is_object($GLOBALS['egw']->log))
 162              {
 163                  $GLOBALS['egw']->log->commit();
 164              }
 165  
 166              $GLOBALS['egw']->redirect_link('/home/index.php');
 167          }
 168  
 169          if(!isset($GLOBALS['egw_info']['nofooter']))
 170          {
 171              $GLOBALS['egw']->common->egw_footer();
 172          }
 173      }
 174  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7