/**
  * 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();
 }
 /**
  * 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);
     }
 }
Example #4
0
 public function __construct($sBasePath)
 {
     $this->sBasePath = $sBasePath;
     parent::__construct();
     $this->path = implode('/', Manager::getRequestPath());
     $this->base_uri = LinkUtil::absoluteLink('');
     $this->uri = LinkUtil::absoluteLink(LinkUtil::link());
     $this->_SERVER['SCRIPT_NAME'] = LinkUtil::link();
 }
Example #5
0
 function options(&$serverOptions)
 {
     parent::options($serverOptions);
     if ($serverOptions['xpath']->evaluate('boolean(/D:options/D:activity-collection-set)')) {
         $this->setResponseHeader('Content-Type: text/xml; charset="utf-8"');
         echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
         echo "<D:options-response xmlns:D=\"DAV:\">\n";
         echo '  <D:activity-collection-set><D:href>' . $this->getUrl(array('path' => 'deltav.php/act')) . "</D:href></D:activity-collection-set>\n";
         echo "</D:options-response>\n";
     }
     return true;
 }
Example #6
0
 public function __construct(&$store, $config)
 {
     global $ariadne;
     debug("webdav: initting server");
     parent::__construct();
     $this->store = $store;
     $this->config = $config;
     $this->root =& $config['root'];
     debug("webdav: loading modules");
     $this->modules = array();
     include_once $ariadne . "/modules/mod_webdav/files.php";
     $this->modules['files'] = new WebDAV_files($this);
     debug("webdav: init done");
 }
Example #7
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();
 }
Example #8
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;
 }
Example #9
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();
 }
 /**
  * Constructor
  *
  * @param void
  * @return void
  */
 function KTWebDAVServer()
 {
     // CGI compatible auth setup
     $altinfo = KTUtil::arrayGet($_SERVER, 'kt_auth', KTUtil::arrayGet($_SERVER, 'REDIRECT_kt_auth'));
     if (!empty($altinfo) && !isset($_SERVER['PHP_AUTH_USER'])) {
         $val = $altinfo;
         $pieces = explode(' ', $val);
         // bad.
         if ($pieces[0] == 'Basic') {
             $chunk = $pieces[1];
             $decoded = base64_decode($chunk);
             $credential_info = explode(':', $decoded);
             if (count($credential_info) == 2) {
                 $_SERVER['PHP_AUTH_USER'] = $credential_info[0];
                 $_SERVER['PHP_AUTH_PW'] = $credential_info[1];
                 $_SERVER["AUTH_TYPE"] = 'Basic';
             }
         }
     }
     // Let the base class do it's thing
     parent::HTTP_WebDAV_Server();
     // Load KTWebDAV config
     if (!$this->initConfig()) {
         $this->ktwebdavLog('Could not load configuration.', 'error');
         exit(0);
     }
     if ($this->debugInfo == 'on') {
         $this->ktwebdavLog('=====================');
         $this->ktwebdavLog('  Debug Info is : ' . $this->debugInfo);
         $this->ktwebdavLog('    SafeMode is : ' . $this->safeMode);
         $this->ktwebdavLog(' Root Folder is : ' . $this->rootFolder);
         $this->ktwebdavLog('=====================');
     }
 }
 /**
  * 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();
 }
Example #12
0
 /**
  * Serves a WebDAV request.
  */
 public function serveRequest()
 {
     // die quickly if plugin is deactivated
     if (!self::_isActive()) {
         $this->writelog(__METHOD__ . ' WebDAV disabled. Aborting');
         $this->http_status('403 Forbidden');
         echo '<html><body><h1>Sorry</h1>' . '<p><b>Please enable the WebDAV plugin in the ILIAS Administration panel.</b></p>' . '<p>You can only access this page, if WebDAV is enabled on this server.</p>' . '</body></html>';
         return;
     }
     try {
         $start = time();
         $this->writelog('serveRequest():' . $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['PATH_INFO'] . ' ...');
         parent::serveRequest();
         $end = time();
         $this->writelog('serveRequest():' . $_SERVER['REQUEST_METHOD'] . ' done status=' . $this->_http_status . ' elapsed=' . ($end - $start));
         $this->writelog('---');
     } catch (Exception $e) {
         $this->writelog('serveRequest():' . $_SERVER['REQUEST_METHOD'] . ' caught exception: ' . $e->getMessage() . '\\n' . $e->getTraceAsString());
     }
 }
Example #13
0
 function webdav()
 {
     global $bhconfig;
     parent::HTTP_WebDAV_Server();
     $this->http_auth_realm = $bhconfig['sitename'];
 }
Example #14
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();
 }
 function do_LOCK()
 {
     global $post;
     if ($post) {
         $current_user = wp_get_current_user();
         include_once "wp-admin/includes/post.php";
         $current_owner = wp_check_post_lock($post->ID);
         if ($current_owner && $current_owner != $current_user->ID) {
             nocache_headers();
             status_header(423);
             die;
         }
         nocache_headers();
         parent::http_LOCK();
         die;
     } else {
         nocache_headers();
         status_header(404);
         die;
     }
 }