示例#1
0
    die('403 Forbidden');
}
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;
示例#2
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