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


PHP SessionManager::protectSession方法代码示例

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


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

示例1: intval

<?php

/* For licensing terms, see /license.txt */
/**
 * Implements the edition of course-session settings
 * @package chamilo.admin
 */
$cidReset = true;
//require_once '../inc/global.inc.php';
$id_session = intval($_GET['id_session']);
SessionManager::protectSession($id_session);
$course_code = $_GET['course_code'];
$formSent = 0;
$errorMsg = '';
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$course_info = api_get_course_info($_REQUEST['course_code']);
$courseId = $course_info['real_id'];
$tool_name = $course_info['name'];
$sql = "SELECT s.name, c.title\n        FROM {$tbl_session_course} sc, {$tbl_session} s, {$tbl_course} c\n        WHERE\n            sc.session_id = s.id AND\n            sc.c_id = c.id AND\n            sc.session_id='{$id_session}' AND\n            sc.c_id ='" . $courseId . "'";
$result = Database::query($sql);
if (!(list($session_name, $course_title) = Database::fetch_row($result))) {
    header('Location: session_course_list.php?id_session=' . $id_session);
    exit;
}
//$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang("SessionList"));
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:session_course_edit.php

示例2: isset

<?php

/* For licensing terms, see /license.txt */
/**
 * List sessions in an efficient and usable way
 * @package chamilo.admin
 */
$cidReset = true;
require_once '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
SessionManager::protectSession(null, false);
//Add the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$idChecked = isset($_REQUEST['idChecked']) ? $_REQUEST['idChecked'] : null;
$list_type = isset($_REQUEST['list_type']) ? $_REQUEST['list_type'] : 'simple';
if ($action == 'delete') {
    SessionManager::delete($idChecked);
    Display::addFlash(Display::return_message(get_lang('Deleted')));
    header('Location: session_list.php');
    exit;
} elseif ($action == 'copy') {
    $result = SessionManager::copy($idChecked);
    if ($result) {
        Display::addFlash(Display::return_message(get_lang('ItemCopied')));
    } else {
        Display::addFlash(Display::return_message(get_lang('ThereWasAnError'), 'error'));
    }
    header('Location: session_list.php');
    exit;
}
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:session_list.php

示例3: array

// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
// setting breadcrumbs
//$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
// Setting the name of the tool
$tool_name = get_lang('SubscribeStudentsToSession');
$add_type = 'multiple';
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
    $add_type = Security::remove_XSS($_REQUEST['add_type']);
}
$form_sent = 0;
$errorMsg = '';
$users = $sessions = array();
$id = isset($_GET['id']) ? intval($_GET['id']) : null;
SessionManager::protectSession($id);
$htmlResult = null;
if (isset($_POST['form_sent']) && $_POST['form_sent']) {
    $form_sent = $_POST['form_sent'];
    if ($form_sent == 1) {
        $sessionSourceList = $_POST['sessions'];
        $sessionDestinationList = $_POST['sessions_destination'];
        $result = SessionManager::copyStudentsFromSession($sessionSourceList, $sessionDestinationList);
        foreach ($result as $message) {
            $htmlResult .= $message;
        }
    }
}
$session_list = SessionManager::get_sessions_list(array(), array('name'));
$sessionList = array();
foreach ($session_list as $session) {
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:add_students_to_session.php

示例4: array

use Chamilo\CoreBundle\Framework\Container;
/**
*	@author Bart Mollet, Julio Montoya lot of fixes
*	@package chamilo.admin
*/
$cidReset = true;
//require_once '../inc/global.inc.php';
// setting breadcrumbs
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('Sessions'));
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
$sessionId = isset($_GET['id_session']) ? intval($_GET['id_session']) : null;
if (empty($sessionId)) {
    api_not_allowed(true);
}
SessionManager::protectSession($sessionId);
$tool_name = get_lang('SessionOverview');
//$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
$orig_param = '&origin=resume_session';
// Database Table Definitions
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
$table_access_url_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sessionInfo = api_get_session_info($sessionId);
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:resume_session.php


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