File: site.php

package info (click to toggle)
diogenes 0.9.20-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,976 kB
  • ctags: 3,271
  • sloc: php: 12,285; sh: 828; perl: 258; makefile: 137; sql: 85
file content (35 lines) | stat: -rw-r--r-- 1,011 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
if (preg_match("/^\/([^\/]+)\/webdav(\/.*)?$/",$_SERVER['PATH_INFO'],$tmp)) {

  // this is a WebDAV operation
  require_once 'diogenes.common.inc.php';
  require_once 'diogenes.webdav.inc.php';
  $server = new $globals->webdav;
  $server->ServeRequest();

} elseif (preg_match("/^\/([^\/]+)\/admin\/(.*)/",$_SERVER['PATH_INFO'],$tmp)) {
  $afile = $tmp[2];
  if (preg_match("/^(ekitapplet|gnu-regexp-1.1.4|kafenio-config|kafenio-icons|kafenio)\.jar$/", $afile)) {
    header("Content-Type: application/java-archive");
    header("Last-modified:".gmdate("D, d M Y H:i:s T", filemtime($afile)));
    readfile($afile);
  } else {
    // include the requested admin page
    if (!$afile) $afile = "index";    
    require("admin/$afile.php");
  }

} else {

  // post or get on a barrel file
  require_once 'diogenes.common.inc.php';
  require_once 'diogenes.barrel.inc.php';
  $page = new $globals->barrel;

  if (!$globals->validatepages)
    $page->assign("skipvalidator",1);

  $page->doContent();

}
?>