예제 #1
0
파일: header.php 프로젝트: niekbosch/BeeHub
<?php

if (isset($this) && false !== strpos($this->user_prop_getcontenttype(), 'xml')) {
    echo DAV::xml_header();
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>BeeHub</title>
    <?php 
if (RUN_CLIENT_TESTS) {
    ?>
      <link rel="stylesheet" href="/system/tests/resources/qunit.css" />
    <?php 
} else {
    ?>
      <link rel="stylesheet" href="/system/css/jquery-ui.css" />
      <link rel="stylesheet" href="/system/bootstrap/css/bootstrap.min.css" />
      <link rel="stylesheet" href="/system/bootstrap/css/bootstrap-responsive.min.css" />
      <link rel="stylesheet" href="/system/css/beehub.css"/>
      <link rel="shortcut icon" href="https://www.surfsara.nl/sites/all/themes/st_sara/favicon.ico" type="image/x-icon" />
    <?php 
}
?>
    <?php 
echo isset($header) ? $header : '';
?>
  </head><body class="bootstrap">
예제 #2
0
 /**
  * Handles a DAV:principal-search-property-set REPORT request
  * 
  * @param   DAVACL_Principal_Collection  $principal_collection  The resource to perform the request on
  * @return  void
  */
 private function handle_principal_search_property_set($principal_collection)
 {
     $properties = $principal_collection->report_principal_search_property_set();
     echo DAV::xml_header();
     echo '<D:principal-search-property-set xmlns:D="DAV:">';
     foreach ($properties as $prop => $desc) {
         echo "\n<D:principal-search-property><D:prop>";
         list($namespaceURI, $localName) = explode(' ', $prop);
         echo "\n<";
         switch ($namespaceURI) {
             case 'DAV:':
                 echo "D:{$localName}";
                 break;
             case '':
                 echo "{$localName}";
                 break;
             default:
                 echo "ns:{$localName} xmlns:ns=\"{$namespaceURI}\"";
         }
         echo '/>';
         if ($desc) {
             echo '<D:description xml:lang="en">' . DAV::xmlescape($desc) . '</D:description>';
         }
         echo '</D:principal-search-property>';
     }
     echo "\n</D:principal-search-property-set>";
 }
예제 #3
0
 /**
  * This should be a identical copy of DAV_Multistatus::__construct()
  */
 private function __construct()
 {
     DAV::header(array('Content-Type' => 'application/xml; charset="utf-8"', 'status' => DAV::HTTP_MULTI_STATUS));
     echo DAV::xml_header() . '<D:multistatus xmlns:D="DAV:">';
 }
예제 #4
0
 public function testXml_header()
 {
     $this->assertSame('<?xml version="1.0" encoding="utf-8"?>' . "\n", DAV::xml_header(), 'DAV::xml_header() should return the correct value');
 }
예제 #5
0
 /**
  * Refreshes an already existing lock
  * 
  * @param DAV_Resource $resource
  * @return void
  * @throws DAV_Statuss
  */
 private function handleRefreshLock($resource)
 {
     $if_header = $this->if_header;
     if (!isset($if_header[DAV::getPath()]) || !$if_header[DAV::getPath()]['lock']) {
         throw new DAV_Status(DAV::HTTP_BAD_REQUEST, array(DAV::COND_LOCK_TOKEN_SUBMITTED => new DAV_Element_href(DAV::getPath())));
     }
     // I think this can never evaluate to true, because DAV_Request already checks
     // whether the 'If' header matches the lock token of the resource. So if the
     // resource doesn't have a lock, this is already detected before this method
     // is called! (However, I don't dare to delete this yet and it doesn't hurt to
     // keep it)
     if (!($lock = DAV::$LOCKPROVIDER->getlock(DAV::getPath()))) {
         throw new DAV_Status(DAV::HTTP_PRECONDITION_FAILED, array(DAV::COND_LOCK_TOKEN_MATCHES_REQUEST_URI));
     }
     DAV::$LOCKPROVIDER->refresh($lock->lockroot, $lock->locktoken, $this->timeout);
     if (!($lockdiscovery = $resource->prop_lockdiscovery())) {
         throw new DAV_Status(DAV::HTTP_INTERNAL_SERVER_ERROR);
     }
     // Generate output:
     DAV::header('application/xml; charset="utf-8"');
     echo DAV::xml_header() . '<D:prop xmlns:D="DAV:"><D:lockdiscovery>' . $lockdiscovery . '</D:lockdiscovery></D:prop>';
 }
예제 #6
0
 /**
  * Sends this status to client.
  * @return void
  */
 public function output()
 {
     $status = $this->getCode();
     if ($status < 300) {
         throw new DAV_Status(DAV::HTTP_INTERNAL_SERVER_ERROR, "DAV_Status object with status {$status} " . var_export($this->getMessage(), true));
     }
     if (DAV::HTTP_UNAUTHORIZED === $status && DAV::$UNAUTHORIZED) {
         call_user_func(DAV::$UNAUTHORIZED);
         return;
     } elseif (!empty($this->conditions)) {
         $headers = array('status' => $status, 'Content-Type' => 'application/xml; charset="UTF-8"');
         if ($this->location) {
             $headers['Location'] = DAV::encodeURIFullPath($this->location);
         }
         DAV::header($headers);
         echo DAV::xml_header() . '<D:error xmlns:D="DAV:">';
         foreach ($this->conditions as $condition => $xml) {
             echo "\n<D:" . $condition;
             echo $xml ? ">{$xml}</D:{$condition}>" : "/>";
         }
         echo "\n</D:error>";
     } elseif ($this->location) {
         DAV::redirect($status, $this->location);
     } else {
         if (self::$RESPONSE_GENERATOR && in_array($_SERVER['REQUEST_METHOD'], array('GET', 'POST'))) {
             DAV::header(array('status' => $status));
             call_user_func(self::$RESPONSE_GENERATOR, $status, $this->getMessage());
         } else {
             DAV::header(array('status' => $status, 'Content-Type' => 'text/plain; charset="UTF-8"'));
             echo "HTTP/1.1 " . DAV::status_code($status) . "\n" . $this->getMessage();
         }
     }
 }