Esempio n. 1
0
 /**
  * Serve a webdav request
  *
  * @access public
  * @param string
  */
 function ServeRequest($base = false)
 {
     //$this->base = '/';
     $this->uriBase = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/webdav/';
     // let the base class do all the work
     parent::ServeRequest();
 }
 /**
  * Serve a webdav request
  *
  * @access public
  * @param  string  
  */
 function ServeRequest($base = false)
 {
     // special treatment for litmus compliance test
     // reply on its identifier header
     // not needed for the test itself but eases debugging
     foreach (apache_request_headers() as $key => $value) {
         if (stristr($key, "litmus")) {
             error_log("Litmus test {$value}");
             header("X-Litmus-reply: " . $value);
         }
     }
     // set root directory, defaults to webserver document root if not set
     if ($base) {
         $this->base = realpath($base);
         // TODO throw if not a directory
     } else {
         if (!$this->base) {
             $this->base = $_SERVER['DOCUMENT_ROOT'];
         }
     }
     // establish connection to property/locking db
     mysql_connect($this->db_host, $this->db_user, $this->db_passwd) or die(mysql_error());
     mysql_select_db($this->db_name) or die(mysql_error());
     // TODO throw on connection problems
     // let the base class do all the work
     parent::ServeRequest();
 }
Esempio n. 3
0
 /**
  * ServeRequest
  * 
  * Verarbeitet die WebDAV Anfrage
  *
  */
 function ServeRequest()
 {
     //Startet den WebDAV Server und verarbeitet die Anfrage
     parent::ServeRequest();
     //Temp Dateien löschen (die bei GET entstanden sind)
     foreach ($this->tmp_files as $key => $value) {
         unlink($value);
     }
 }
Esempio n. 4
0
 function ServeRequest($base)
 {
     // special treatment for litmus compliance test
     // reply on its identifier header
     // not needed for the test itself but eases debugging
     foreach (apache_request_headers() as $key => $value) {
         if (stristr($key, "litmus")) {
             #					error_log("--- $value");
             header("X-Litmus-reply: " . $value);
         }
     }
     $this->base = $base;
     mysql_connect("localhost", "root", "") or die(mysql_error());
     mysql_select_db("webdav") or die(mysql_error());
     parent::ServeRequest();
 }
Esempio n. 5
0
 /**
  * Serve a WebDAV request
  *
  * @access public
  */
 public function serve()
 {
     // special treatment for litmus compliance test
     // reply on its identifier header
     // not needed for the test itself but eases debugging
     if (function_exists('apache_request_headers')) {
         foreach (apache_request_headers() as $key => $value) {
             if (stristr($key, 'litmus')) {
                 error_log("Litmus test {$value}");
                 midgardmvc_core::get_instance()->dispatcher->header("X-Litmus-reply: {$value}");
             }
         }
     }
     midgardmvc_core::get_instance()->log(__CLASS__ . '::' . __FUNCTION__, "\n\n=================================================");
     midgardmvc_core::get_instance()->log(__CLASS__ . '::' . __FUNCTION__, "Serving {$_SERVER['REQUEST_METHOD']} request for {$_SERVER['REQUEST_URI']}");
     midgardmvc_core::get_instance()->dispatcher->header("X-Dav-Method: {$_SERVER['REQUEST_METHOD']}");
     // let the base class do all the work
     parent::ServeRequest();
     midgardmvc_core::get_instance()->log(__CLASS__ . '::' . __FUNCTION__, "Path was: {$this->path}");
     die;
 }
Esempio n. 6
0
 /**
  * Serve a webdav request
  *
  * @access public
  * @param  string
  */
 function ServeRequest()
 {
     // special treatment for litmus compliance test
     // reply on its identifier header
     // not needed for the test itself but eases debugging
     foreach (apache_request_headers() as $key => $value) {
         if (stristr($key, "litmus")) {
             error_log("Litmus test {$value}");
             header("X-Litmus-reply: " . $value);
         }
     }
     $this->http_auth_realm = 'Web Files';
     $this->dav_powered_by = 'Sitellite Content Server ' . SITELLITE_VERSION;
     $this->rex = new Rex('sitellite_filesystem');
     $this->url = site_prefix() . '/webfiles-app';
     $this->_SERVER['SCRIPT_NAME'] = '/webfiles-app';
     $this->base = 'inc/data';
     $this->debug = appconf('debug');
     // let the base class do all the work
     parent::ServeRequest();
 }
 /**
  * Serve a webdav request
  *
  * @access public
  * @param  string
  */
 function ServeRequest($base = false)
 {
     global $sugar_config, $current_language;
     if (!empty($sugar_config['session_dir'])) {
         session_save_path($sugar_config['session_dir']);
     }
     session_start();
     // clean_incoming_data();
     $current_language = $sugar_config['default_language'];
     // special treatment for litmus compliance test
     // reply on its identifier header
     // not needed for the test itself but eases debugging
     /*
                 foreach(apache_request_headers() as $key => $value) {
                     if(stristr($key,"litmus")) {
                         error_log("Litmus test $value");
                         header("X-Litmus-reply: ".$value);
                     }
                 }
     */
     // set root directory, defaults to webserver document root if not set
     if ($base) {
         $this->base = realpath($base);
         // TODO throw if not a directory
     } else {
         if (!$this->base) {
             $this->base = $_SERVER['DOCUMENT_ROOT'];
         }
     }
     $query_arr = array();
     // set path
     if (empty($_SERVER["PATH_INFO"])) {
         $this->path = "/";
         if (strtolower($_SERVER["REQUEST_METHOD"]) == 'get') {
             $query_arr = $_REQUEST;
         } else {
             parse_str($_REQUEST['parms'], $query_arr);
         }
     } else {
         $this->path = $this->_urldecode($_SERVER["PATH_INFO"]);
         if (ini_get("magic_quotes_gpc")) {
             $this->path = stripslashes($this->path);
         }
         $query_str = preg_replace('/^\\//', '', $this->path);
         $query_arr = array();
         parse_str($query_str, $query_arr);
     }
     if (!empty($query_arr['type'])) {
         $this->vcal_type = $query_arr['type'];
     } else {
         $this->vcal_type = 'vfb';
     }
     if (!empty($query_arr['source'])) {
         $this->source = $query_arr['source'];
     } else {
         $this->source = 'outlook';
     }
     if (!empty($query_arr['key'])) {
         $this->publish_key = $query_arr['key'];
     }
     // select user by email
     if (!empty($query_arr['email'])) {
         // clean the string!
         $query_arr['email'] = clean_string($query_arr['email']);
         //get user info
         $this->user_focus->retrieve_by_email_address($query_arr['email']);
     } else {
         if (!empty($query_arr['user_name'])) {
             // clean the string!
             $query_arr['user_name'] = clean_string($query_arr['user_name']);
             //get user info
             $arr = array('user_name' => $query_arr['user_name']);
             $this->user_focus->retrieve_by_string_fields($arr);
         } else {
             if (!empty($query_arr['user_id'])) {
                 $this->user_focus->retrieve($query_arr['user_id']);
             }
         }
     }
     // if we haven't found a user, then return 401
     if (empty($this->user_focus->id) || $this->user_focus->id == -1) {
         //set http status
         $this->http_status('401 Unauthorized');
         //send authenticate header only if this is not a freebusy request
         if (empty($_REQUEST['type']) || $_REQUEST['type'] != 'vfb') {
             header('WWW-Authenticate: Basic realm="' . $this->http_auth_realm . '"');
         }
         return;
     }
     //            if(empty($this->user_focus->user_preferences))
     //            {
     $this->user_focus->loadPreferences();
     //            }
     // let the base class do all the work
     parent::ServeRequest();
 }
Esempio n. 8
0
 /**
  * Serve a webdav request
  *
  * @access public
  * @param  string  
  */
 function ServeRequest($base = false)
 {
     // special treatment for litmus compliance test
     // reply on its identifier header
     // not needed for the test itself but eases debugging
     foreach (apache_request_headers() as $key => $value) {
         if (stristr($key, "litmus")) {
             error_log("Litmus test {$value}");
             header("X-Litmus-reply: " . $value);
         }
     }
     // set root directory, defaults to webserver document root if not set
     if ($base) {
         $this->base = realpath($base);
         // TODO throw if not a directory
     } else {
         if (!$this->base) {
             $this->base = $this->_SERVER['DOCUMENT_ROOT'];
         }
     }
     // establish connection to property/locking db
     try {
         $this->db_link = new PDO($this->db_type . ':host=' . $this->db_host . ';dbname=' . $this->db_name, $this->db_user, $this->db_passwd);
     } catch (PDOException $e) {
         print "Error: " . $e->getMessage();
         die;
     }
     // let the base class do all the work
     parent::ServeRequest();
 }
 /**
  * Serve a webdav request
  */
 function ServeRequest()
 {
     $this->http_auth_realm = "Zarafa CardDAV";
     // let the base class do all the work
     parent::ServeRequest();
 }