[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/sitemgr/sitemgr-link/ -> index.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare SiteMgr - Web Content Management                              *
   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      $GLOBALS['egw_info']['flags'] = array
  15      (
  16          'currentapp' => 'sitemgr-link',
  17          'noheader'   => True,
  18          'nonavbar'   => True,
  19          'noapi'      => False
  20      );
  21      $parentdir = dirname(dirname($_SERVER['SCRIPT_FILENAME']));
  22      if (file_exists($parentdir.'/header.inc.php'))
  23      {
  24          include($parentdir.'/header.inc.php');
  25      }
  26      else
  27      {
  28          die("You need to make sure the sitemgr-link app is in the eGroupWare directory.  Under *nix you can make a symbolic link.");
  29      }
  30      $sites_bo = createobject('sitemgr.Sites_BO');
  31      // switch to current website in case of website login
  32      if(isset($_GET['location'])) 
  33      {
  34          $location_parts = explode('?',$_GET['location']);
  35          $dest_site_id =  $sites_bo->urltoid($location_parts[0]);
  36          if($dest_site_id)
  37          {
  38              $GLOBALS['egw_info']['user']['preferences']['sitemgr']['currentsite'] = $dest_site_id;
  39              $GLOBALS['egw']->preferences->change('sitemgr','currentsite', $dest_site_id);
  40              $GLOBALS['egw']->preferences->save_repository(True);
  41          }
  42      }
  43      $siteinfo = $sites_bo->get_currentsiteinfo();
  44      $location = $siteinfo['site_url'];
  45      if ($location && file_exists($siteinfo['site_dir'] . '/functions.inc.php'))
  46      {
  47          $location .= '?sessionid='.@$GLOBALS['egw_info']['user']['sessionid'] .
  48                      '&kp3=' . @$GLOBALS['egw_info']['user']['kp3'] .
  49                      '&domain=' . @$GLOBALS['egw_info']['user']['domain'];
  50          // preserve page at login from website
  51          if($location_parts) $location .= '&'. $location_parts[1];
  52          
  53          $GLOBALS['egw']->redirect($location);
  54          exit;
  55      }
  56      else
  57      {
  58          $GLOBALS['egw']->common->egw_header();
  59          echo parse_navbar();
  60          $aclbo =& CreateObject('sitemgr.ACL_BO', True);
  61          echo '<table width="50%"><tr><td>';
  62          if ($aclbo->is_admin())
  63          {
  64              echo lang('Before the public web site can be viewed, you must configure the various locations and preferences.  Please go to the sitemgr setup page by following this link:') . 
  65                  '<a href="' . 
  66                  $GLOBALS['egw']->link('/index.php', 'menuaction=sitemgr.Common_UI.DisplayPrefs') . 
  67                  '">' .
  68                  lang('sitemgr setup page') .
  69                  '</a>. ' .
  70                  lang('Note that you may get this message if your preferences are incorrect.  For example, if config.inc.php is not found in the directory that you specified.');
  71          }
  72          else
  73          {
  74              echo lang('Your administrator has not yet setup the web content manager for public viewing.  Go bug your administrator to get their butt in gear.');
  75          }
  76          echo '</td></tr></table>';
  77          $GLOBALS['egw']->common->egw_footer();
  78      }
  79  ?>


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