[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/calendar/ -> freebusy.php (source)

   1  <?php
   2      /**************************************************************************\
   3      * eGroupWare - freebusy times as iCals                                     *
   4      * http://www.egroupware.org                                                *
   5      * Written by RalfBecker@outdoor-training.de                                *
   6      * --------------------------------------------                             *
   7      *  This program is free software; you can redistribute it and/or modify it *
   8      *  under the terms of the GNU General Public License as published by the   *
   9      *  Free Software Foundation; either version 2 of the License, or (at your  *
  10      *  option) any later version.                                              *
  11      \**************************************************************************/
  12  
  13      /* $Id: freebusy.php 22117 2006-07-14 23:24:56Z ralfbecker $ */
  14  
  15      $GLOBALS['egw_info'] = array(
  16          'flags' => array(
  17              'currentapp' => 'calendar',
  18              'noheader'   => True,
  19              'nofooter'   => True,
  20          ),
  21      );
  22      // check if we are loged in, by checking sessionid and kp3, as the sessionid get set automaticaly by php for php4-sessions
  23      if (!($loged_in = @$_REQUEST['sessionid'] && @$_REQUEST['kp3']))
  24      {
  25          $GLOBALS['egw_info']['flags']['currentapp'] = 'login';
  26          $GLOBALS['egw_info']['flags']['noapi'] = True;
  27      }
  28      include ('../header.inc.php');
  29  
  30  	function fail_exit($msg)
  31      {
  32          echo "<html>\n<head>\n<title>$msg</title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=".
  33              $GLOBALS['egw']->translation->charset()."\" />\n</head>\n<body><h1>$msg</h1>\n</body>\n</html>\n";
  34  
  35          $GLOBALS['egw']->common->egw_exit();
  36      }
  37  
  38      if (!$loged_in)
  39      {
  40          include  ('../phpgwapi/inc/functions.inc.php');
  41          $GLOBALS['egw_info']['flags']['currentapp'] = 'calendar';
  42      }
  43      $user  = is_numeric($_GET['user']) ? (int) $_GET['user'] : $GLOBALS['egw']->accounts->name2id($_GET['user'],'account_lid','u');
  44  
  45      if (!($username = $GLOBALS['egw']->accounts->id2name($user)))
  46      {
  47          fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!"." $username($user)",$_GET['user']));
  48      }
  49      if (!$loged_in)
  50      {
  51          $GLOBALS['egw']->preferences->account_id = $user;
  52          $GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository();
  53          $GLOBALS['egw_info']['user']['account_id'] = $user;
  54          $GLOBALS['egw_info']['user']['account_lid'] = $username;
  55  
  56          $cal_prefs = &$GLOBALS['egw_info']['user']['preferences']['calendar'];
  57          if (!$cal_prefs['freebusy'] || !empty($cal_prefs['freebusy_pw']) && $cal_prefs['freebusy_pw'] != $_GET['password'])
  58          {
  59              fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!",$_GET['user']));
  60          }
  61      }
  62      if ($_GET['debug'])
  63      {
  64          echo "<pre>";
  65      }
  66      else
  67      {
  68          ExecMethod2('phpgwapi.browser.content_header','freebusy.ifb','text/calendar');
  69      }
  70      echo ExecMethod2('calendar.boical.freebusy',$user,$_GET['end']);


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