Esempio n. 1
0
<?php

// DISABLE !!!
include PATH_PUBLIC . "bad_link.php";
exit;
// TODO: Delete from CVS
require_once "../etc/koala.conf.php";
require_once PATH_LIB . "steam_handling.inc.php";
if ($_SESSION["LMS_USER"] instanceof lmsuser && $_SESSION["LMS_USER"]->is_logged_in()) {
    $login = $_SESSION["LMS_USER"]->get_login();
    $password = $_SESSION["LMS_USER"]->get_password();
} else {
    $login = STEAM_GUEST_LOGIN;
    $password = STEAM_GUEST_PW;
}
steam_connect(STEAM_SERVER, STEAM_PORT, $login, $password);
$document = steam_factory::get_object($STEAM->get_id(), $_GET["id"]);
$doc_data = $document->get_attributes(array("OBJ_NAME", "DOC_MIME_TYPE"));
header("Pragma: private");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream");
header("Content-Length:" . $document->get_content_size());
header("Content-Disposition: inline; filename=\"" . $document->get_name() . "\"");
print $document->get_content();
Esempio n. 2
0
        $file = fopen($htaccess_path, "wb");
        $written = fwrite($file, implode("", $htaccess));
        fclose($file);
        if ($written == 0) {
            output("Error: could not write " . $htaccess_path . "\n");
            exit(1);
        }
        output("Wrote RewriteBase to " . $htaccess_path . "\n");
    }
}
// check sTeam structures and create them if necessary:
include_once "etc/koala.conf.php";
set_exception_handler(NULL);
include_once "lib/steam_handling.inc.php";
try {
    steam_connect(STEAM_SERVER, STEAM_PORT, STEAM_ROOT_LOGIN, STEAM_ROOT_PW);
    if (!$STEAM->get_login_status()) {
        throw new Exception("Could not connect/login.");
    }
    $steam_group = steam_factory::get_group($STEAM->get_id(), "sTeam");
    if (!is_object($steam_group)) {
        output("Error: could not get 'sTeam' group from open-sTeam backend.\n");
        exit(1);
    }
    $admin_group = steam_factory::get_group($STEAM->get_id(), "Admin");
    if (!is_object($admin_group)) {
        output("Error: could not get 'Admin' group from open-sTeam backend.\n");
        exit(1);
    }
    $config->add_entry("STEAM_FACULTIES_GROUP", "Number", "open-sTeam faculties group object-id");
    $config->add_entry("STEAM_COURSES_GROUP", "Number", "open-sTeam courses group object-id");