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


PHP ChamiloSession::instance方法代码示例

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


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

示例1: login

 /**
  * Create a Shibboleth session for the user ID
  *
  * @param  string $uid - The user ID
  * @return $_user (array) - The user infos array created when the user logs in
  */
 function login($uid)
 {
     /* This must be set for local.inc.php to register correctly the global variables in session
      * This is BAD. Logic should be migrated into a function and stop relying on global variables.
      */
     global $_uid, $is_allowedCreateCourse, $is_platformAdmin, $_real_cid, $is_courseAdmin;
     global $is_courseMember, $is_courseTutor, $is_courseCoach, $is_allowed_in_course, $is_sessionAdmin, $_gid;
     $_uid = $uid;
     //is_allowedCreateCourse
     $user = User::store()->get_by_user_id($uid);
     if (empty($user)) {
         return;
     }
     $this->logout();
     Session::instance();
     Session::write('_uid', $_uid);
     global $_user;
     $_user = (array) $user;
     $_SESSION['_user'] = $_user;
     $_SESSION['_user']['user_id'] = $_uid;
     $_SESSION['noredirection'] = true;
     //must be called before 'init_local.inc.php'
     Event::event_login($_uid);
     //used in 'init_local.inc.php' this is BAD but and should be changed
     $loginFailed = false;
     $uidReset = true;
     $gidReset = true;
     $cidReset = false;
     //FALSE !!
     $mainDbName = Database::get_main_database();
     $includePath = api_get_path(SYS_INC_PATH);
     $no_redirection = true;
     require "{$includePath}/local.inc.php";
     return $_user;
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:41,代码来源:shibboleth_session.class.php

示例2: user

 /**
  *
  * @return CurrentUser
  */
 static function user()
 {
     return ChamiloSession::instance()->user();
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:8,代码来源:chamilo.class.php

示例3: foreach

        }
        // Didn't find any? Now try without subdirs
        if ($request_url_root == $details['url']) {
            $_configuration['access_url'] = $details['id'];
            break;
            //found one match, get out of foreach
        }
    }
} else {
    $_configuration['access_url'] = 1;
}
$charset = 'UTF-8';
// Enables the portablity layer and configures PHP for UTF-8
\Patchwork\Utf8\Bootup::initAll();
// Start session after the internationalization library has been initialized.
ChamiloSession::instance()->start($alreadyInstalled);
// Remove quotes added by PHP  - get_magic_quotes_gpc() is deprecated in PHP 5 see #2970
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
    array_walk_recursive_limited($_GET, 'stripslashes', true);
    array_walk_recursive_limited($_POST, 'stripslashes', true);
    array_walk_recursive_limited($_COOKIE, 'stripslashes', true);
    array_walk_recursive_limited($_REQUEST, 'stripslashes', true);
}
// access_url == 1 is the default chamilo location
if ($_configuration['access_url'] != 1) {
    $url_info = api_get_access_url($_configuration['access_url']);
    if ($url_info['active'] == 1) {
        $settings_by_access =& api_get_settings(null, 'list', $_configuration['access_url'], 1);
        foreach ($settings_by_access as &$row) {
            if (empty($row['variable'])) {
                $row['variable'] = 0;
开发者ID:daffef,项目名称:chamilo-lms,代码行数:31,代码来源:global.inc.php

示例4: course_code

 /**
  * The course code (id) to which the object belongs.
  *
  * @return string
  */
 function course_code()
 {
     return ChamiloSession::instance()->course()->code();
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:9,代码来源:portfolio.class.php


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