当前位置: 首页>>代码示例>>PHP>>正文


PHP lms_steam::is_steam_admin方法代码示例

本文整理汇总了PHP中lms_steam::is_steam_admin方法的典型用法代码示例。如果您正苦于以下问题:PHP lms_steam::is_steam_admin方法的具体用法?PHP lms_steam::is_steam_admin怎么用?PHP lms_steam::is_steam_admin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lms_steam的用法示例。


在下文中一共展示了lms_steam::is_steam_admin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: is_koala_admin

 public static function is_koala_admin($user)
 {
     // check, ob lms_user in session liegt => Benutzer != Gast +
     // der eingeloggte Benutzer ist nicht der koaLA - Gast +
     // der eingeloggte User ist steam Admin => Benutzer is koaLA Admin
     $ret = isset($_SESSION["LMS_USER"]) && $_SESSION["LMS_USER"] instanceof lms_user && $_SESSION["LMS_USER"]->is_logged_in() && $_SESSION["LMS_USER"]->get_login() != STEAM_GUEST_LOGIN && lms_steam::is_steam_admin($user);
     return $ret;
 }
开发者ID:rolwi,项目名称:koala,代码行数:8,代码来源:lms_steam.class.php

示例2: frameResponse

 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $path = $this->params;
     $portal = \lms_portal::get_instance();
     $user = \lms_steam::get_current_user();
     if (!\lms_steam::is_steam_admin($user)) {
         //TODO: REDIRECT!!
     }
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $values = $_POST["values"];
         $start_date = iso_to_unix($values["start"]);
         $end_date = iso_to_unix($values["end"]);
         // TODO PROBLEM CHECKING MISSING
         $courses = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
         $all_user = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
         $new_semester = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), $values["name"], $courses, FALSE, $values["desc"]);
         $new_semester_admins = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "admins", $new_semester, FALSE, "admin group for " . $values["desc"]);
         $new_semester_admins->set_attribute("OBJ_TYPE", "semester_admins");
         $new_semester_admins->add_member($user);
         $new_semester->set_insert_access($new_semester_admins, TRUE);
         $new_semester->set_read_access($all_user, TRUE);
         $new_semester->set_attributes(array("SEMESTER_START_DATE" => $start_date, "SEMESTER_END_DATE" => $end_date));
         // CACHE ZURÜCKSETZEN
         $cache = get_cache_function("ORGANIZATION");
         $cache->drop("lms_steam::get_semesters");
         header("Location: " . PATH_URL . "semester/index/" . $values["name"] . "/all");
     }
     $content = \Semester::getInstance()->loadTemplate("semester_create.template.html");
     $content->setVariable("INFO_TEXT", gettext("So, you want to start a new semester?") . " " . gettext("Please fill out the requested values on the right.") . "<br/><br/>" . str_replace("%SEMESTER", STEAM_CURRENT_SEMESTER, gettext("And don't forget to reset the current semester in the etc/koala.def.php, which is <b>%SEMESTER</b> at the moment.")));
     $content->setVariable("LABEL_NAME", gettext("Shortname"));
     $content->setVariable("INFO_NAME", gettext("IMPORTANT: Don't use any slashes, commas or dots in this name. Keep it short, like 'WS0607' or 'SS06'."));
     $content->setVariable("LABEL_DESC", gettext("Name"));
     $content->setVariable("INFO_DESC", gettext("Examples: 'Wintersemester 06/07', or 'Sommersemester 2006'"));
     $content->setVariable("LABEL_START_DATE", gettext("Starting date of semester"));
     $content->setVariable("LABEL_END_DATE", gettext("Ending date of semester"));
     $content->setVariable("INFO_DATE_FORMAT", gettext("Please type in the date in the following format: YYYY-MM-DD"));
     $content->setVariable("LABEL_CREATE", gettext("Create Semester"));
     /* TODO: Portal anpassen
     		$portal->set_page_main(
     			array(array("link" => PATH_URL.SEMESTER_URL."/", "name" => gettext("Semester")), array("link" => "", "name" => gettext("Create new"))),
     			$content->get(),
     			""
     		);
     		*/
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($content->get());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
开发者ID:rolwi,项目名称:koala,代码行数:49,代码来源:AddSemester.class.php

示例3: execute

 public function execute(\FrameResponseObject $frameResponseObject)
 {
     //echo SEMESTER_URL;die;
     //$portal = \lms_portal::get_instance();
     //$portal->initialize( GUEST_NOT_ALLOWED );
     $user = \lms_steam::get_current_user();
     $all_users = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
     $scg = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
     $current_semester = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $scg->get_groupname() . "." . STEAM_CURRENT_SEMESTER);
     if (!\lms_steam::is_steam_admin($user) && !lms_steam::is_semester_admin($current_semester, $user)) {
         include "bad_link.php";
         exit;
     }
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $values = $_POST["values"];
         $problems = "";
         $hints = "";
         if (empty($values["semester"])) {
             throw new Exception("Semester is not given.");
         }
         if (empty($values["id"])) {
             $problems .= gettext("The course ID is missing.") . " ";
             $hints .= gettext("The ID is necessary for unique identification, ordering and finding the course. Please fill this out.") . " ";
         }
         if (!empty($values["access"]) && $values["access"] == PERMISSION_COURSE_PASSWORD && empty($values["password"])) {
             $problems .= gettext("The course password is missing.") . " ";
             $hints .= gettext("You chose to password protect your course. Please provide a password.") . " ";
         }
         if (empty($problems) && !empty($values["get_lsf_infos"])) {
             // INFOS UEBER LSF HOLEN
             $lsf_client = new \hislsf_soap();
             unset($_SESSION["LSF_COURSE_INFO"]);
             // TODO: SEMESTER DYNAMISCH SETZEN
             $result = $lsf_client->get_available_courses(SYNC_HISLSF_SEMESTER, $values["id"]);
             if (isset($result->veranstaltung)) {
                 if (count($result->veranstaltung) == 1) {
                     header("Location: " . PATH_URL . "course/create" . "/" . $current_semester->get_name() . "/?lsf_course_id=" . $result->veranstaltung->Veranstaltungsschluessel);
                     exit;
                 } else {
                     header("Location: " . PATH_URL . "course" . "/" . $current_semester->get_name() . "/hislsf/" . $values["id"] . "/");
                     exit;
                 }
             } else {
                 $problems = "Keine Veranstaltungen im LSF unter dieser Nummer gefunden.";
             }
         }
         if (empty($problems)) {
             if (empty($values["name"])) {
                 $problems .= gettext("The course name is missing.") . " ";
                 $hints .= gettext("A name is necessary for identification.") . " ";
             }
             if (strpos($values['id'], '.')) {
                 $problems .= gettext("Please don't use the \".\"-char in the course ID.") . ' ';
             }
             if (empty($values["tutors"])) {
                 $values["tutors"] = "NN";
             }
             if (empty($problems)) {
                 if (!isset($values["hislsf"]) || !$values["hislsf"]) {
                     $values["lsf_id"] = "";
                 }
                 $max_members = -1;
                 if ($values["lsf_id"] === "") {
                     if (!empty($values["maxsize"]) && trim($values["maxsize"]) != "" && preg_match('/[^-.0-9]/', trim($values["maxsize"]))) {
                         $problems .= gettext("Invalid max number of participants.") . " ";
                         $hints .= gettext("Please enter a valid number for the max number of participants.") . " " . gettext("Please note that the input of a '0' or to leave the field blank means no limitation.") . " ";
                     } else {
                         if (!empty($values["maxsize"]) && trim($values["maxsize"]) != "" && trim($values["maxsize"]) < 0) {
                             $problems .= gettext("Invalid max number of participants.") . " ";
                             $hints .= gettext("Please enter a number equal or greater than '0' for the max number of participants.") . " " . gettext("Please note that the input of a '0' or to leave the field blank means no limitation.") . " ";
                         } else {
                             if (isset($values["maxsize"])) {
                                 if (trim($values["maxsize"]) === "") {
                                     $max_members = 0;
                                 } else {
                                     $max_members = (int) trim($values["maxsize"]);
                                 }
                             }
                         }
                     }
                 }
                 if (empty($problems)) {
                     try {
                         $new_course = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), $values["id"], $current_semester, FALSE, $values["name"]);
                     } catch (Exception $e) {
                         $problems .= gettext("The course ID already exists.") . " ";
                         $hints .= gettext("The ID is necessary for unique identification, ordering and finding the course. This ID already exists.") . " ";
                     }
                     if (empty($problems)) {
                         $new_course->set_attributes(array("OBJ_TYPE" => "course", "COURSE_PARTICIPANT_MNGMNT" => $obj_type, "COURSE_SEMESTER" => $values["semester"], "COURSE_TUTORS" => $values["tutors"], "COURSE_SHORT_DSC" => $values["short_dsc"], "COURSE_LONG_DSC" => $values["long_dsc"], "COURSE_HISLSF_ID" => $values["lsf_id"]));
                         $learners = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "learners", $new_course, FALSE, "Participants of course '" . $values["name"] . "'");
                         $learners->set_attribute("OBJ_TYPE", "course_learners");
                         $staff = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "staff", $new_course, FALSE, "Tutors of course '" . $values["name"] . "'");
                         $staff->set_attribute("OBJ_TYPE", "course_staff");
                         $staff->add_member($user);
                         $admins = \steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "admins", $new_course, FALSE, "Admins of course '" . $values["name"] . "'");
                         $admins->set_attribute("OBJ_TYPE", "course_admins");
                         // uncomment below if koala can handle admins vs tutors
                         //$admins->add_member( $user );
                         // RIGHTS MANAGEMENT =======================================
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Create.class.php

示例4: define

<?php

require_once "../etc/koala.conf.php";
if (!defined("PATH_TEMPLATES_UNITS_VILM")) {
    define("PATH_TEMPLATES_UNITS_VILM", PATH_EXTENSIONS . "units_vilm/templates/");
}
if (!isset($portal)) {
    $portal = lms_portal::get_instance();
    $portal->initialize(GUEST_NOT_ALLOWED);
}
$user = lms_steam::get_current_user();
$unitname = $unit->get_display_name();
if (!lms_steam::is_steam_admin($user) && !lms_steam::is_semester_admin($current_semester, $user) && !$course->is_admin($user)) {
    include "bad_link.php";
    exit;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if ($_POST["id"] == $unit->get_id()) {
        try {
            $unit->delete();
            $owner = koala_object::get_koala_object(steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $_POST["owner"]));
            $backlink = $owner->get_url() . "units/";
        } catch (Exception $exception) {
            $problems = $exception->get_message();
        }
    }
    if (empty($problems)) {
        $_SESSION["confirmation"] = str_replace("%NAME", $unitname, gettext("The unit '%NAME' has been deleted."));
        header("Location: " . $backlink);
        exit;
    } else {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:units_vilm_delete.php

示例5: gettext

         $content->setVariable("LINK_MY_COURSES", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/?filter=booked" . ($isEditMode ? "&" . $mode : ""));
         $content->parse("BLOCK_YOUR_COURSES");
     }
 }
 if ($isEditMode) {
     $content->setCurrentBlock("BLOCK_EDIT_MODE");
     $content->setVariable("LABEL_EDIT_MODE", gettext("Disable edit mode"));
     $content->setVariable("LINK_EDIT_MODE", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . ($isFiltered ? "/?" . $filter : "/"));
     $content->parse("BLOCK_EDIT_MODE");
 } else {
     $content->setCurrentBlock("BLOCK_EDIT_MODE");
     $content->setVariable("LABEL_EDIT_MODE", gettext("Enable edit mode"));
     $content->setVariable("LINK_EDIT_MODE", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/?mode=edit" . ($isFiltered ? "&" . $filter : ""));
     $content->parse("BLOCK_EDIT_MODE");
 }
 $is_steam_admin = lms_steam::is_steam_admin($user);
 if ($is_steam_admin || lms_steam::is_semester_admin($current_semester, $user)) {
     $content->setCurrentBlock("BLOCK_SEMESTER_ADMIN");
     if (ADD_COURSE) {
         $content->setCurrentBlock("BLOCK_ADD_COURSE");
         $content->setVariable("LINK_CREATE_COURSE", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/new/");
         $content->setVariable("LABEL_CREATE_COURSE", gettext("Create new course"));
         $content->parse("BLOCK_ADD_COURSE");
     }
     if (IMPORT_COURSE_FROM_PAUL) {
         $content->setCurrentBlock("BLOCK_IMPORT_COURSE_FROM_PAUL");
         $content->setVariable("LINK_CREATE_PAUL_COURSE", PATH_URL . SEMESTER_URL . "/" . $current_semester->get_name() . "/paul/");
         $content->setVariable("LABEL_CREATE_PAUL_COURSE", gettext("Create new course via PAUL"));
         $content->parse("BLOCK_IMPORT_COURSE_FROM_PAUL");
     }
     if ($is_steam_admin) {
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:courses_overview.php

示例6: frameResponse

 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $path = $this->params;
     $portal = \lms_portal::get_instance();
     $user = \lms_steam::get_current_user();
     if (isset($path[0])) {
         if (\steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]) instanceof \steam_group) {
             $current_semester = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]);
         } else {
             header("Location: " . PATH_URL . "404/");
             die;
         }
     } else {
         $current_semester = \lms_steam::get_current_semester();
     }
     $current_semester_name = $current_semester->get_name();
     if (\lms_steam::is_steam_admin($user)) {
         if (!$portal->get_user()->is_logged_in()) {
             throw new Exception("Access denied. Please login.", E_USER_AUTHORIZATION);
         }
         $semester_admins = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $current_semester->get_groupname() . ".admins");
         $admin_group = new \koala_group_default($semester_admins);
         if ($_SERVER["REQUEST_METHOD"] == "POST") {
             $delete = $_POST["delete"];
             if (count($delete) == 1) {
                 $login = key($delete);
                 $admin = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $login);
                 $admin_group->remove_member($admin);
             }
         }
         $content = \Semester::getInstance()->loadTemplate("semester_admins.template.html");
         $content->setVariable("INFORMATION_ADMINS", str_replace("%SEMESTER", h($current_semester->get_attribute("OBJ_DESC")), gettext("These people are allowed to create courses for %SEMESTER.")) . " " . gettext("They can appoint other users as staff members/moderators for their own courses."));
         $content->setVariable("LINK_ADD_ADMIN", PATH_URL . "semester/addAdmin/" . $current_semester_name . "/" . $admin_group->get_id());
         $content->setVariable("LABEL_ADD_ADMIN", gettext("Add another admin"));
         //TODO: Messages extension schreiben
         // TODO: Passt der Link?
         $content->setVariable("LINK_MESSAGE", PATH_URL . "mail/write/" . $admin_group->get_id());
         $content->setVariable("LABEL_MESSAGE_ADMINS", gettext("Mail to admins"));
         $admins = $admin_group->get_members();
         $no_admins = count($admins);
         if ($no_admins > 0) {
             $content->setVariable("LABEL_ADMINS", gettext("Course admins"));
             $content->setCurrentBlock("BLOCK_CONTACT_LIST");
             $content->setVariable("LABEL_NAME_POSITION", gettext("Name") . "/" . gettext("Position"));
             $content->setVariable("LABEL_SUBJECT_AREA", gettext("Subject area"));
             $content->setVariable("LABEL_COMMUNICATION", gettext("Communication"));
             $content->setVariable("LABEL_REMOVE_ADMIN", gettext("Action"));
             foreach ($admins as $admin) {
                 $adm_attributes = $admin->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_DESC", "OBJ_ICON"));
                 $content->setCurrentBlock("BLOCK_CONTACT");
                 $content->setVariable("CONTACT_NAME", h($adm_attributes["USER_FIRSTNAME"]) . " " . h($adm_attributes["USER_FULLNAME"]));
                 // TODO: Profile Image einfügen
                 // TODO: Passt der Link?
                 $icon_link = \lms_user::get_user_image_url(30, 40);
                 $content->setVariable("CONTACT_IMAGE", $icon_link);
                 // TODO: Passt der Link?
                 $content->setVariable("CONTACT_LINK", PATH_URL . "user/" . $admin->get_name() . "/");
                 $content->setVariable("OBJ_DESC", h($adm_attributes["OBJ_DESC"]));
                 $content->setVariable("LABEL_MESSAGE", gettext("Message"));
                 // TODO: Passt der Link?
                 $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "mail/write/" . $admin->get_name());
                 $content->setVariable("LABEL_SEND", gettext("Send"));
                 $content->setVariable("LABEL_REMOVE", gettext("Remove"));
                 $content->setVariable("CONTACT_ID", $admin->get_name());
                 $content->parse("BLOCK_CONTACT");
             }
             $content->parse("BLOCK_CONTACT_LIST");
         } else {
             $content->setVariable("LABEL_ADMINS", gettext("No admins found."));
         }
         /* TODO: Portal anpassen
         			$portal->set_page_title( h($current_semester->get_name()) . " Admins" );
         			$portal->set_page_main( 
         				array(
         					array( "link" => PATH_URL . SEMESTER_URL . "/" . h($current_semester->get_name()) . "/", "name" => h($current_semester->get_attribute( "OBJ_DESC" ))), array( "link" => "", "name" => gettext( "Admins" ) )
         				),
         				$content->get(),
         				""
         			);
         			$portal->show_html( );
         			*/
     } else {
         header("Location: " . PATH_URL . "404/");
         die;
     }
     $frameResponseObject->setTitle("Semester " . $current_semester_name);
     $rawHtml = new \Widgets\RawHtml();
     $rawHtml->setHtml($content->get());
     $frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
开发者ID:rolwi,项目名称:koala,代码行数:91,代码来源:ManageSemester.class.php

示例7: frameResponse

 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $path = $this->params;
     $user = \lms_steam::get_current_user();
     $content = \Semester::getInstance()->loadTemplate("courses_overview.template.html");
     $content->setVariable("HELP_TEXT", "<b>" . gettext('Notice') . ':</b> ' . gettext('You can easily find courses by using the filter. Just type in a part of the course\'s title, it\'s ID or the name of the tutor.'));
     $content->setVariable('LABEL_FILTER', gettext('Filter'));
     /**
      * Action Bar
      */
     $content->setCurrentBlock("BLOCK_ACTIONBAR");
     $isFiltered = false;
     $isEditMode = false;
     if (isset($path[0])) {
         if (\steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]) instanceof \steam_group) {
             $current_semester = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "courses." . $path[0]);
         } else {
             ExtensionMaster::getInstance()->send404Error();
         }
     } else {
         $current_semester = \lms_steam::get_current_semester();
     }
     $current_semester_name = $current_semester->get_name();
     if (isset($path[1]) && $path[1] == "booked") {
         $isFiltered = true;
     }
     if (isset($path[2]) && $path[2] == "edit") {
         $isEditMode = true;
     }
     if ($isFiltered) {
         if (ALL_COURSES) {
             $content->setCurrentBlock("BLOCK_ALL_COURSES");
             $content->setVariable("LABEL_MY_COURSES", gettext("All courses"));
             $content->setVariable("LINK_MY_COURSES", PATH_URL . "semester/index/" . $current_semester_name . "/all" . ($isEditMode ? "/edit" : ""));
             $content->parse("BLOCK_ALL_COURSES");
         }
     } else {
         if (YOUR_COURSES) {
             $content->setCurrentBlock("BLOCK_YOUR_COURSES");
             $content->setVariable("LABEL_MY_COURSES", gettext("My courses"));
             $content->setVariable("LINK_MY_COURSES", PATH_URL . "semester/index/" . $current_semester_name . "/booked" . ($isEditMode ? "/edit" : ""));
             $content->parse("BLOCK_YOUR_COURSES");
         }
     }
     if ($isEditMode) {
         $content->setCurrentBlock("BLOCK_EDIT_MODE");
         $content->setVariable("LABEL_EDIT_MODE", gettext("Disable edit mode"));
         $content->setVariable("LINK_EDIT_MODE", PATH_URL . "semester/index/" . $current_semester_name . ($isFiltered ? "/booked" : "/all"));
         $content->parse("BLOCK_EDIT_MODE");
     } else {
         $content->setCurrentBlock("BLOCK_EDIT_MODE");
         $content->setVariable("LABEL_EDIT_MODE", gettext("Enable edit mode"));
         $content->setVariable("LINK_EDIT_MODE", PATH_URL . "semester/index/" . $current_semester_name . ($isFiltered ? "/booked" : "/all") . "/edit");
         $content->parse("BLOCK_EDIT_MODE");
     }
     $is_steam_admin = \lms_steam::is_steam_admin($user);
     if ($is_steam_admin || \lms_steam::is_semester_admin($current_semester, $user)) {
         $content->setCurrentBlock("BLOCK_SEMESTER_ADMIN");
         if (ADD_COURSE) {
             $content->setCurrentBlock("BLOCK_ADD_COURSE");
             $content->setVariable("LINK_CREATE_COURSE", PATH_URL . "semester/addCourse" . "/" . $current_semester_name);
             $content->setVariable("LABEL_CREATE_COURSE", gettext("Create new course"));
             $content->parse("BLOCK_ADD_COURSE");
         }
         if (IMPORT_COURSE_FROM_PAUL) {
             $content->setCurrentBlock("BLOCK_IMPORT_COURSE_FROM_PAUL");
             $content->setVariable("LINK_CREATE_PAUL_COURSE", PATH_URL . "semester/importCourse" . "/" . $current_semester_name);
             $content->setVariable("LABEL_CREATE_PAUL_COURSE", gettext("Create new course via PAUL"));
             $content->parse("BLOCK_IMPORT_COURSE_FROM_PAUL");
         }
         if ($is_steam_admin) {
             $content->setCurrentBlock("BLOCK_SERVER_ADMIN");
             if (MANAGE_SEMESTER) {
                 $content->setCurrentBlock("BLOCK_MANAGE_SEMESTER");
                 $content->setVariable("LINK_MANAGE_SEMESTER", PATH_URL . "semester/manageSemester" . "/" . $current_semester_name);
                 $content->setVariable("LABEL_MANAGE_SEMESTER", gettext("Manage this semester"));
                 $content->parse("BLOCK_MANAGE_SEMESTER");
             }
             if (ADD_SEMESTER) {
                 $content->setCurrentBlock("BLOCK_ADD_SEMESTER");
                 $content->setVariable("LINK_CREATE_SEMESTER", PATH_URL . "semester/addSemester");
                 $content->setVariable("LABEL_CREATE_SEMESTER", gettext("Create new semester"));
                 $content->parse("BLOCK_ADD_SEMESTER");
             }
             $content->parse("BLOCK_SERVER_ADMIN");
         }
         $content->parse("BLOCK_SEMESTER_ADMIN");
     }
     $content->parse("BLOCK_ACTIONBAR");
     // AUS DEM SYSTEM AUSLESEN
     $cache = get_cache_function("ORGANIZATION", 600);
     $semesters = $cache->call("lms_steam::get_semesters");
     foreach ($semesters as $s) {
         $content->setCurrentBlock("BLOCK_TABS");
         if ($s["OBJ_NAME"] == $current_semester_name) {
             $content->setVariable("TAB_STATE", "tabOut");
             $content->setVariable("LINK_SEMESTER", $s["OBJ_NAME"]);
         } else {
             $content->setVariable("TAB_STATE", "tabIn");
             $filter_part = "";
//.........这里部分代码省略.........
开发者ID:rolwi,项目名称:koala,代码行数:101,代码来源:Index.class.php

示例8: header

<?php

require_once "../etc/koala.conf.php";
require_once PATH_LIB . "format_handling.inc.php";
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
$user = lms_steam::get_current_user();
if (!lms_steam::is_steam_admin($user)) {
    include "bad_link.php";
    exit;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $values = $_POST["values"];
    $start_date = iso_to_unix($values["start"]);
    $end_date = iso_to_unix($values["end"]);
    // TODO PROBLEM CHECKING MISSING
    $courses = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
    $all_user = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
    $new_semester = steam_factory::create_group($GLOBALS["STEAM"]->get_id(), $values["name"], $courses, FALSE, $values["desc"]);
    $new_semester_admins = steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "admins", $new_semester, FALSE, "admin group for " . $values["desc"]);
    $new_semester_admins->set_attribute("OBJ_TYPE", "semester_admins");
    $new_semester_admins->add_member($user);
    $new_semester->set_insert_access($new_semester_admins, TRUE);
    $new_semester->set_read_access($all_user, TRUE);
    $new_semester->set_attributes(array("SEMESTER_START_DATE" => $start_date, "SEMESTER_END_DATE" => $end_date));
    // CACHE ZUR�CKSETZEN
    $cache = get_cache_function("ORGANIZATION");
    $cache->drop("lms_steam::get_semesters");
    header("Location: " . PATH_URL . SEMESTER_URL . "/" . $values["name"] . "/");
}
$content = new HTML_TEMPLATE_IT();
开发者ID:rolwi,项目名称:koala,代码行数:31,代码来源:semester_create.php


注:本文中的lms_steam::is_steam_admin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。