/**
  * Serve a webdav request
  *
  * @access public
  * @param  string
  */
 public function ServeICalRequest($base = false)
 {
     if (empty($_REQUEST['type'])) {
         $_REQUEST['type'] = 'ics';
     }
     if (empty($_REQUEST['encoding'])) {
         $this->cal_encoding = 'utf-8';
     } else {
         $this->cal_encoding = $_REQUEST['encoding'];
     }
     if (empty($_REQUEST['cal_charset'])) {
         $this->cal_charset = 'utf-8';
     } else {
         $this->cal_charset = $_REQUEST['cal_charset'];
     }
     if (empty($_REQUEST['http_spec'])) {
         $this->http_spec = '1.1';
     } else {
         $this->http_spec = $_REQUEST['http_spec'];
     }
     // check the HTTP auth headers for a user
     if (empty($_REQUEST['user_name']) && !empty($_SERVER['PHP_AUTH_USER'])) {
         $_REQUEST['user_name'] = $_SERVER['PHP_AUTH_USER'];
         $_REQUEST['key'] = $_SERVER['PHP_AUTH_PW'];
     }
     // if username is still empty, then return 401
     if (empty($_REQUEST['user_name']) && empty($_REQUEST['email'])) {
         if ($_REQUEST['type'] == 'ics') {
             $this->http_status("401 not authorized");
             header('WWW-Authenticate: Basic realm="SugarCRM iCal"');
             ob_end_clean();
             echo 'Authorization required';
         } else {
             $this->http_status("404 Not Found");
             ob_end_clean();
         }
         return;
     }
     parent::ServeRequest();
 }
Example #2
0
// excerpt:
// You must install the Microsoft Internet Explorer (IE) Web Publishing Wizard to get
// the functionality you need to publish Internet free/busy data to a server or the Web.
// You can install this wizard from Control Panel, Add/Remove Programs, Microsoft Internet
// Explorer, Web Publishing Wizard. For every user, you must configure the path and filename
// where you want Outlook to store free/busy information. You configure this location on the
// Free/Busy Options dialog box you see in Screen 2. You must initiate publishing manually by
// using Tools, Send/Receive, Free/Busy Information in Outlook.
//
// To access a non-Exchange Server user's free/busy information, you must configure the
// appropriate path on each contact's Details tab. For example, you enter
// "http://servername/sugarcrm/index.php?entryPoint=vcal_server/type=vfb&source=outlook&email=myemail@servername.com".
// If you don't configure this information correctly, the client software looks up the entry
// in the Search at this URL window on the Free/Busy Options dialog box.
//
// Setup for: Microsoft Outlook XP
// In Tools > Options > Calendar Options > Free/Busy
//
// Global search path:
// %USERNAME% and %SERVER% are Outlook replacement variables to construct the email address:
// http://servername/sugarcrm/index.php?entryPoint=vcal_server/type=vfb&source=outlook&email=%NAME%@%SERVER%
// or contact by contact by editing the details and entering its Free/Busy URL:
// http://servername/sugarcrm/index.php?entryPoint=vcal_server/type=vfb&source=outlook&email=user@email.com
// or
// http://servername/sugarcrm/index.php?entryPoint=vcal_server/type=vfb&source=outlook&user_name=user_name
// or:
// http://servername/sugarcrm/index.php?entryPoint=vcal_server/type=vfb&source=outlook&user_id=user_id
require_once "modules/vCals/HTTP_WebDAV_Server_vCal.php";
$server = new HTTP_WebDAV_Server_vCal();
$server->ServeRequest();
sugar_cleanup();