#4784 session register

skala
Laurent Opprecht 13 years ago
parent 2868595d5f
commit fc1dff7906
  1. 3
      index.php
  2. 3
      main/announcements/announcements.php
  3. 3
      main/auth/external_login/login.ldap.php
  4. 3
      main/auth/external_login/newUser.ldap.php
  5. 3
      main/auth/external_login/newUser.php
  6. 3
      main/auth/external_login/updateUser.php
  7. 3
      main/auth/inscription.php
  8. 3
      main/auth/key/key_auth.class.php
  9. 3
      main/auth/ldap/authldap.php
  10. 3
      main/auth/ldap/login.php
  11. 4
      main/auth/shibboleth/lib/shibboleth_session.class.php
  12. 3
      main/auth/sso/sso.class.php
  13. 3
      main/calendar/agenda.php
  14. 3
      main/course_home/course_home.php
  15. 3
      main/dropbox/dropbox_init.inc.php
  16. 3
      main/exercice/admin.php
  17. 3
      main/exercice/answer_admin.inc.php
  18. 3
      main/exercice/exercice.php
  19. 3
      main/exercice/exercise_admin.php
  20. 3
      main/exercice/exercise_result.php
  21. 3
      main/exercice/exercise_show.php
  22. 3
      main/exercice/exercise_submit.php
  23. 3
      main/exercice/exercise_submit_modal.php
  24. 3
      main/exercice/hotspot_admin.inc.php
  25. 3
      main/exercice/overview.php
  26. 3
      main/exercice/question_pool.php
  27. 3
      main/exercice/upload_exercise.php
  28. 3
      main/forum/forumfunction.inc.php
  29. 3
      main/forum/forumsearch.php
  30. 3
      main/forum/newthread.php
  31. 3
      main/forum/viewforum.php
  32. 3
      main/inc/email_editor.php
  33. 2
      main/inc/lib/autoload.class.php
  34. 11
      main/inc/lib/chamilo.class.php
  35. 6
      main/inc/lib/chamilo_session.class.php
  36. 3
      main/inc/lib/current_course.class.php
  37. 14
      main/inc/lib/current_user.class.php
  38. 3
      main/inc/lib/login.lib.php
  39. 3
      main/inc/lib/main_api.lib.php
  40. 3
      main/inc/lib/online.inc.php
  41. 4
      main/inc/lib/system/session.class.php
  42. 3
      main/inc/lib/userportal.lib.php
  43. 2
      main/inc/local.inc.php
  44. 3
      main/install/index.php
  45. 3
      main/newscorm/learnpath_functions.inc.php
  46. 3
      main/newscorm/lp_controller.php
  47. 3
      main/newscorm/lp_view.php
  48. 3
      main/newscorm/resourcelinker.inc.php
  49. 3
      main/newscorm/resourcelinker.php
  50. 3
      main/reservation/m_item.php
  51. 3
      main/resourcelinker/resourcelinker.inc.php
  52. 3
      main/resourcelinker/resourcelinker.php
  53. 3
      main/session/index.php
  54. 3
      tests/main/inc/lib/main_api.lib.test.php
  55. 3
      tests/test_manager.inc.php
  56. 3
      user_portal.php

@ -5,6 +5,9 @@
* @package chamilo.main
*/
use \ChamiloSession as Session;
define('CHAMILO_HOMEPAGE', true);
$language_file = array('courses', 'index');

@ -17,6 +17,9 @@
INIT SECTION
*/
// name of the language file that needs to be included
use \ChamiloSession as Session;
$language_file = array('announcements', 'group', 'survey');
// use anonymous mode when accessing this course tool

@ -35,6 +35,9 @@
* - index.php?loginFailed=1&error=unrecognize_sso_origin');
*
**/
use \ChamiloSession as Session;
require_once(dirname(__FILE__).'/ldap.conf.php');
require_once(dirname(__FILE__).'/functions.inc.php');

@ -35,6 +35,9 @@
* - index.php?loginFailed=1&error=unrecognize_sso_origin');
**/
use \ChamiloSession as Session;
require_once(dirname(__FILE__).'/ldap.conf.php');
require_once(dirname(__FILE__).'/functions.inc.php');

@ -7,6 +7,9 @@
You also have to implements the external_get_user_info function in functions.inc.php
*/
use \ChamiloSession as Session;
require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once(api_get_path(LIBRARY_PATH).'course.lib.php');
require_once(dirname(__FILE__).'/functions.inc.php');

@ -2,6 +2,9 @@
/*
This script must not exit.
*/
use \ChamiloSession as Session;
require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once(api_get_path(LIBRARY_PATH).'course.lib.php');
require_once(dirname(__FILE__).'/functions.inc.php');

@ -6,6 +6,9 @@
* @package chamilo.auth
*/
use \ChamiloSession as Session;
$language_file = array('registration', 'admin');
if (!empty($_POST['language'])) { //quick hack to adapt the registration form result to the selected registration language
$_GET['language'] = $_POST['language'];

@ -1,5 +1,8 @@
<?php
use \ChamiloSession as Session;
/**
* Used to authenticate user with an access token. By default this method is disabled.
* Method used primarily to make API calls:Rss, etc.

@ -50,6 +50,9 @@
* @version 3.0
* @package chamilo.auth.ldap
*/
use \ChamiloSession as Session;
/**
* Code
*/

@ -20,6 +20,9 @@
* variables based on the result.
*/
//require_once('../../inc/global.inc.php'); - this script should be loaded by the /index.php script anyway, so global is already loaded
use \ChamiloSession as Session;
require_once('authldap.php');
$loginLdapSucces = ldap_login($login, $password);

@ -1,5 +1,8 @@
<?php
use \ChamiloSession as Session;
/**
* A Chamilo user session. Used as there is no session object so far provided by the core API.
* Should be moved to the core library.Prefixed by Shibboleth to avoid name clashes.
@ -89,7 +92,6 @@ class ShibbolethSession
$no_redirection = true;
require("$includePath/local.inc.php");
return $_user;
}

@ -1,4 +1,7 @@
<?php
use \ChamiloSession as Session;
/* For licensing terms, see /license.txt */
/**
* This file contains the necessary elements to implement a Single Sign On

@ -7,6 +7,9 @@
* INIT SECTION
*/
use \ChamiloSession as Session;
// name of the language file that needs to be included
$language_file = array('agenda','group');

@ -30,6 +30,9 @@
/* INIT SECTION */
use \ChamiloSession as Session;
// Name of the language file that needs to be included.
$language_file = 'course_home';
$use_anonymous = true;

@ -28,6 +28,9 @@
*/
/* INIT SECTION */
use \ChamiloSession as Session;
$language_file = 'dropbox';
// This var disables the link in the breadcrumbs on top of the page

@ -47,6 +47,9 @@
/**
* Code
*/
use \ChamiloSession as Session;
require_once 'exercise.class.php';
require_once 'question.class.php';
require_once 'answer.class.php';

@ -11,6 +11,9 @@
* Code
*/
use \ChamiloSession as Session;
// ALLOWED_TO_INCLUDE is defined in admin.php
if(!defined('ALLOWED_TO_INCLUDE'))
{

@ -13,6 +13,9 @@
* Code
*/
// name of the language file that needs to be included
use \ChamiloSession as Session;
$language_file = array('exercice','tracking');
// including the global library

@ -11,6 +11,9 @@
* Code
*/
// name of the language file that needs to be included
use \ChamiloSession as Session;
$language_file='exercice';
require_once 'exercise.class.php';

@ -16,6 +16,9 @@
/**
* Code
*/
use \ChamiloSession as Session;
require_once 'exercise.class.php';
require_once 'question.class.php';
require_once 'answer.class.php';

@ -14,6 +14,9 @@
* Code
*/
// name of the language file that needs to be included
use \ChamiloSession as Session;
$language_file = array('exercice');
// including additional libraries

@ -27,6 +27,9 @@
/**
* Code
*/
use \ChamiloSession as Session;
require_once 'exercise.class.php';
require_once 'question.class.php';
require_once 'answer.class.php';

@ -7,6 +7,9 @@
/**
* Code
*/
use \ChamiloSession as Session;
$language_file=array('exercice');
require_once '../inc/global.inc.php';
api_protect_course_script(false);

@ -10,6 +10,9 @@
* Code
* ALLOWED_TO_INCLUDE is defined in admin.php
*/
use \ChamiloSession as Session;
if (!defined('ALLOWED_TO_INCLUDE')) {
exit();
}

@ -9,6 +9,9 @@
/**
* Code
*/
use \ChamiloSession as Session;
$language_file = 'exercice';
require_once 'exercise.class.php';
require_once '../inc/global.inc.php';

@ -14,6 +14,9 @@
* Code
*/
// name of the language file that needs to be included
use \ChamiloSession as Session;
$language_file = 'exercice';
require_once 'exercise.class.php';

@ -9,6 +9,9 @@
/**
* Language files that should be included
*/
use \ChamiloSession as Session;
$language_file[] = 'learnpath';
$language_file[] = 'exercice';
// setting the help

@ -24,6 +24,9 @@
/**
* code
*/
use \ChamiloSession as Session;
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';

@ -21,6 +21,9 @@
* @package chamilo.forum
*/
use \ChamiloSession as Session;
// Language files that need to be included.
$language_file = array ('forum', 'group');

@ -22,6 +22,9 @@
* @package chamilo.forum
*/
use \ChamiloSession as Session;
// Language file that need to be included.
$language_file = array('forum', 'document');

@ -22,6 +22,9 @@
* @package chamilo.forum
*/
use \ChamiloSession as Session;
// Language files that need to be included.
$language_file = array('forum', 'group');

@ -9,6 +9,9 @@
*/
// name of the language file that needs to be included
use \ChamiloSession as Session;
$language_file = "index";
require_once '../inc/global.inc.php';

@ -317,7 +317,6 @@ class Autoload
$result['ScoreDisplayForm'] = '/main/gradebook/lib/fe/scoredisplayform.class.php';
$result['ScormDocument'] = '/main/coursecopy/classes/ScormDocument.class.php';
$result['Security'] = '/main/inc/lib/security.lib.php';
$result['Session'] = '/main/inc/lib/session.class.php';
$result['SessionHandler'] = '/main/inc/lib/session_handler.class.php';
$result['SessionManager'] = '/main/inc/lib/sessionmanager.lib.php';
$result['Shibboleth'] = '/main/auth/shibboleth/app/shibboleth.class.php';
@ -360,6 +359,7 @@ class Autoload
$result['SurveyTree'] = '/main/inc/lib/surveymanager.lib.php';
$result['SurveyUtil'] = '/main/survey/survey.lib.php';
$result['SystemAnnouncementManager'] = '/main/inc/lib/system_announcements.lib.php';
$result['System\Session'] = '/main/inc/lib/system/session.class.php';
$result['TableSort'] = '/main/inc/lib/table_sort.class.php';
$result['Template'] = '/main/inc/lib/template.lib.php';
$result['Text_Diff'] = '/main/inc/lib/pear/Text/Diff.php';

@ -1,5 +1,14 @@
<?php
/**
*
* @return ChamiloSession
*/
function session()
{
return Chamilo::session();
}
/**
* Description of chamilo
*
@ -24,7 +33,7 @@ class Chamilo
{
return api_get_setting('server_type') == 'production';
}
/**
*
* @return ChamiloSession

@ -10,7 +10,7 @@
* @license see /license.txt
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva
*/
class ChamiloSession extends Session
class ChamiloSession extends System\Session
{
const NAME = 'ch_sid';
@ -165,6 +165,10 @@ class ChamiloSession extends Session
return $result;
}
/**
*
* @return CurrentCourse
*/
public function course()
{
static $result = null;

@ -1,5 +1,8 @@
<?php
use \ChamiloSession as Session;
/**
* Wrapper for the current course. Provide access to its data.
*

@ -1,5 +1,8 @@
<?php
use \ChamiloSession as Session;
/**
* Wrapper for the current user - i.e. the logged in user. Provide access
* to the current user's data.
@ -34,7 +37,7 @@ class CurrentUser
return $_user;
//return Session::read('_user');
}
public function is_anonymous()
{
return api_is_anonymous();
@ -72,7 +75,7 @@ class CurrentUser
public function user_id()
{
return (int)$this->get('user_id');
return (int) $this->get('user_id');
}
public function language()
@ -98,12 +101,7 @@ class CurrentUser
*/
public function is_platform_admin()
{
return (bool) Session::read('is_platformAdmin');
if ($_SESSION['is_platformAdmin']) {
return true;
}
global $_user;
return $allow_sessions_admins && $_user['status'] == SESSIONADMIN;
return (bool) Session::read('is_platformAdmin', false);
}
/**

@ -1,5 +1,8 @@
<?php
use \ChamiloSession as Session;
/* For licensing terms, see /license.txt */
/**
* Code library for login process

@ -13,6 +13,9 @@
* Constants declaration
*/
use \ChamiloSession as Session;
// USER STATUS CONSTANTS
/** global status of a user: student */
define('STUDENT', 5);

@ -16,6 +16,9 @@
* @param int user id
* @return void
*/
use \ChamiloSession as Session;
function LoginCheck($uid) {
global $_course, $_configuration;
$uid = (int) $uid;

@ -1,5 +1,7 @@
<?php
namespace System;
/**
* Session Management
*
@ -8,7 +10,7 @@
* @license see /license.txt
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Geneva
*/
class Session implements ArrayAccess
class Session implements \ArrayAccess
{
static function read($variable, $default = null)

@ -1,6 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
use \ChamiloSession as Session;
require_once api_get_path(LIBRARY_PATH).'system_announcements.lib.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
require_once api_get_path(SYS_CODE_PATH).'survey/survey.lib.php';

@ -137,6 +137,8 @@
// require_once api_get_path(LIBRARY_PATH).'legal.lib.php';
//}
use \ChamiloSession as Session;
//Conditional login
if (isset($_SESSION['conditional_login']['uid']) && $_SESSION['conditional_login']['can_login']=== true){
$uData = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']);

@ -17,6 +17,9 @@
/* CONSTANTS */
use \ChamiloSession as Session;
define('SYSTEM_INSTALLATION', 1);
define('INSTALL_TYPE_UPDATE', 'update');
define('FORM_FIELD_DISPLAY_LENGTH', 40);

@ -24,6 +24,9 @@
* @todo remove code duplication
*/
use \ChamiloSession as Session;
/**
* This function deletes an item
* @param integer $id: the item we want to delete

@ -8,6 +8,9 @@
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
use \ChamiloSession as Session;
$debug = 0;
if ($debug > 0) error_log('New LP -+- Entered lp_controller.php -+- (action: '.$_REQUEST['action'].')', 0);

@ -17,6 +17,9 @@
* Code
*/
use \ChamiloSession as Session;
$_SESSION['whereami'] = 'lp/view';
$this_section = SECTION_COURSES;

@ -17,6 +17,9 @@
//$language_file = 'resourcelinker';
// Flag to allow for anonymous user - needs to be set before global.inc.php.
use \ChamiloSession as Session;
$use_anonymous = true;
require_once 'back_compat.inc.php';

@ -15,6 +15,9 @@
/* INIT SECTION */
// Flag to allow for anonymous user - needs to be set before global.inc.php.
use \ChamiloSession as Session;
$use_anonymous = true;
// Name of the language file that needs to be included.

@ -4,6 +4,9 @@
/**
Item-manager (add, edit & delete)
*/
use \ChamiloSession as Session;
require_once ('rsys.php');
Rsys :: protect_script('m_item');
$tool_name = get_lang('ResourceList');

@ -10,6 +10,9 @@
* @todo This class is used?
*/
use \ChamiloSession as Session;
/**
* INIT SECTION
*/

@ -15,6 +15,9 @@
*/
// name of the language file that needs to be included
//$language_file = 'resourcelinker';// TODO: Repeated deleting and moving the rest of this lang file to trad4all
use \ChamiloSession as Session;
include ('../inc/global.inc.php');
$this_section=SECTION_COURSES;

@ -8,6 +8,9 @@
/**
* Code
*/
use \ChamiloSession as Session;
// Language files that should be included.
$language_file = array('learnpath', 'courses', 'index','tracking','exercice', 'admin');
$cidReset = true;

@ -1,4 +1,7 @@
<?php
use \ChamiloSession as Session;
require_once(api_get_path(LIBRARY_PATH).'course.lib.php');
class TestMainApi extends UnitTestCase {

@ -1,4 +1,7 @@
<?php
use \ChamiloSession as Session;
/* For licensing terms, see /license.txt */
/**

@ -20,6 +20,9 @@
*/
// Language files that should be included.
use \ChamiloSession as Session;
$language_file = array('courses', 'index','admin');
$cidReset = true; /* Flag forcing the 'current course' reset,

Loading…
Cancel
Save