當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。