コード例 #1
0
ファイル: tutorial.php プロジェクト: rolwi/koala
<?php

require_once PATH_EXTENSIONS . "tutorials/classes/koala_group_tutorial.class.php";
include_once PATH_LIB . "format_handling.inc.php";
if (!isset($portal) || !is_object($portal)) {
    $portal = lms_portal::get_instance();
    $portal->initialize(GUEST_NOT_ALLOWED);
}
$current_user = $user = lms_steam::get_current_user();
$lms_tutorial = new koala_group_tutorial($tutorial);
if (!$tutorial->get_workroom()->check_access_read($current_user)) {
    $headline = $lms_tutorial->get_link_path();
    include 'no_access.php';
    exit;
}
$html_handler_course = new koala_html_course($course);
$html_handler_course->set_context("tutorials", array('subcontext' => 'tutorial', 'tutorial' => $lms_tutorial));
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (is_array($_POST["remove"])) {
        $id = key($_POST["remove"]);
        $member_to_kick = steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $id);
        $tutorial->remove_member($member_to_kick);
        $portal->set_confirmation(str_replace("%NAME", h($member_to_kick->get_full_name()), gettext("User %NAME successfully removed from tutorial members.")));
        $cache = get_cache_function($tutorial->get_id(), CACHE_LIFETIME_STATIC);
        $cache->drop("lms_steam::group_get_members", $tutorial->get_id());
    }
}
if ($lms_tutorial->is_password_protected()) {
    $participant_mgmnt = gettext("password protected tutorial");
} else {
    if ($lms_tutorial->is_moderated() && !$lms_tutorial->is_password_protected()) {