Beispiel #1
0
include_once dirname(__FILE__) . "/include/users.php";
include_once dirname(__FILE__) . "/include/functions.php";
define('_EXT_PATH', dirname(__FILE__));
ini_set("default_charset", "UTF-8");
ini_set("display_errors", 0);
# Activate if your PHP is CGI mode
$phpcgi = substr(PHP_SAPI, 0, 3) == 'cgi';
$realm = 'Restricted Area: eXtplorer WebDAV';
ext_load_users();
foreach ($GLOBALS["users"] as $user) {
    $users[$user[0]] = $user[1];
}
// Authenticate the user or ask to login. We have to use basic authorization, because the passwords are stored in an encrypted format
AuthenticationBasicHTTP($realm, $users, $phpcgi);
require_once dirname(__FILE__) . "/libraries/HTTP/WebDAV/Server/Filesystem.php";
$server = new HTTP_WebDAV_Server_Filesystem();
if (stristr($_SERVER['SCRIPT_NAME'], 'administrator/components/com_extplorer')) {
    $jconfig_file = dirname(__FILE__) . "/../../../configuration.php";
    $mosConfig_absolute_path = '';
    if (file_exists($jconfig_file)) {
        include_once $jconfig_file;
    }
    if (class_exists('jconfig')) {
        // Joomla! >= 1.5
        $config = new JConfig();
        $server->db_host = $config->host;
        $server->db_name = $config->db;
        $server->db_user = $config->user;
        $server->db_passwd = $config->password;
        $server->db_type = $config->dbtype;
        $server->db_prefix = $config->dbprefix . '_extwebdav_';
<?php

// $Id$
ini_set("include_path", ini_get("include_path") . ":/usr/local/apache/htdocs");
require_once "HTTP/WebDAV/Server/Filesystem.php";
$server = new HTTP_WebDAV_Server_Filesystem();
$server->ServeRequest($_SERVER["DOCUMENT_ROOT"]);
Beispiel #3
0
    require ROOT . '/angie.php';
    require ANGIE_PATH . '/init.php';
    $application =& application();
    $application->prepare(array('initialize_resources' => true, 'connect_to_database' => true, 'initialize_smarty' => true, 'init_modules' => true, 'authenticate' => true, 'init_locale' => true, 'load_hooks' => true));
    //array
    $application->init();
    include_once WEBDAV_MODULE_PATH . '/models/authenticate.php';
    $not_installed_modules = Modules::findNotInstalled();
    foreach ($not_installed_modules as $module) {
        if ($module->name == 'webdav') {
            header("HTTP/1.1 503 Service Unavailable");
            die('Module is not installed');
        }
    }
    if (!ConfigOptions::getValue('webdav_enabled')) {
        header("HTTP/1.1 503 Service Unavailable");
        die('Module has been disabled by administrator');
    }
    //if
    // Activate if your PHP is CGI mode
    $phpcgi = 0;
    $realm = 'activeCollab webdav area';
    $user = AuthenticationBasicHTTP($realm);
    require_once WEBDAV_MODULE_PATH . '/models/filesystem.php';
    $server = new HTTP_WebDAV_Server_Filesystem();
    $server->ServeRequest(false, $user);
} else {
    header("HTTP/1.1 503 Service Unavailable");
    die;
}
// if
Beispiel #4
0
ini_set("default_charset", "UTF-8");
//ini_set("error_reporting", E_ALL);
$realm = 'Restricted area Keyphrene';
$DBUSER = "******";
$DBPWD = "hello";
$DB_WEBDAV = 'webdav';
$users = array($DBUSER => $DBPWD);
//AuthenticationDigestHTTP($realm, $users);
//AuthenticationBasicHTTP($realm, $users);
if (isset($_SERVER["ORIG_PATH_INFO"])) {
    $_SERVER["PATH_INFO"] = $_SERVER["ORIG_PATH_INFO"];
    //$_SERVER["PATH_INFO"] = $_SERVER["REQUEST_URI"];
} else {
    if (isset($_SERVER["REQUEST_URI"])) {
        $_SERVER["PATH_INFO"] = $_SERVER["REQUEST_URI"];
    }
}
if (isset($_SERVER['HTTP_CONTENT_LENGTH'])) {
    $_SERVER["CONTENT_LENGTH"] = $_SERVER['HTTP_CONTENT_LENGTH'];
    unset($_SERVER['HTTP_CONTENT_LENGTH']);
}
error_log(var_export($_SERVER, true));
require_once "HTTP/WebDAV/Server/Filesystem.php";
$server = new HTTP_WebDAV_Server_Filesystem();
$server->db_host = $DBHOST;
$server->db_name = $DB_WEBDAV;
$server->db_user = $DBUSER;
$server->db_passwd = $DBPWD;
//$server->ServeRequest(_SITE_PATH);
$server->ServeRequest("/home/showing/");