dokeos-include
[ class tree: dokeos-include ] [ index: dokeos-include ] [ all elements ]

Procedural File: local.inc.php

Source Location: /main/inc/local.inc.php



Page Details:

SCRIPT PURPOSE

This script initializes and manages Dokeos session information. It keeps available session information up to date.

You can request a course id. It will check if the course Id requested is the same as the current one. If it isn't it will update session information from the database. You can also force the course reset if you want ($cidReset).

All the course information is stored in the $_course array.

You can request a group id. The script will check if the group id requested is the same as the current one. If it isn't it will update session information from the database. You can also force the course reset if you want ($gidReset).

The group id is stored in $_gid session variable.

VARIABLES AFFECTING THE SCRIPT BEHAVIOR

string $login string $password boolean $logout

string $cidReq : course id requested boolean $cidReset : ask for a course Reset, if no $cidReq is provided in the same time, all course informations is removed from the current session

int $gidReq : group Id requested boolean $gidReset : ask for a group Reset, if no $gidReq is provided in the same time, all group informations is removed from the current session

VARIABLES SET AND RETURNED BY THE SCRIPT

All the variables below are set and returned by this script.

USER VARIABLES

string $_user ['firstName' ] string $_user ['lastName' ] string $_user ['mail' ] string $_user ['lastLogin' ] string $_user ['official_code'] string $_user ['picture_uri' ] string $_user['user_id']

boolean $is_platformAdmin boolean $is_allowedCreateCourse

COURSE VARIABLES

string $_cid (the course id)

int $_course['id' ] - auto-assigned integer string $_course['name' ] - the title of the course string $_course['official_code'] - the visual / fake / official code string $_course['sysCode' ] string $_course['path' ] string $_course['dbName' ] string $_course['dbNameGlu' ] string $_course['titular' ] string $_course['language' ] string $_course['extLink' ]['url' ] string $_course['extLink' ]['name'] string $_course['categoryCode'] string $_course['categoryName'] boolean $is_courseMember boolean $is_courseTutor boolean $is_courseAdmin

GROUP VARIABLES

int $_gid (the group id)

IMPORTANT ADVICE FOR DEVELOPERS

We strongly encourage developers to use a connection layer at the top of their scripts rather than use these variables, as they are, inside the core of their scripts. It will make code maintenance much easier.

Many if the functions you need you can already find in the main_api.lib.php

We encourage you to use functions to access these global "kernel" variables. You can add them to e.g. the main API library.

SCRIPT STRUCTURE

  1. The script determines if there is an authentication attempt. This part
only chek if the login name and password are valid. Afterwards, it set the $_user['user_id'] (user id) and the $uidReset flag. Other user informations are retrieved later. It's also in this section that optional external authentication devices step in.

2. The script determines what other session informations have to be set or reset, setting correctly $cidReset (for course) and $gidReset (for group).

3. If needed, the script retrieves the other user informations (first name, last name, ...) and stores them in session.

4. If needed, the script retrieves the course information and stores them in session

5. The script initializes the user permission status and permission for the course level

6. If needed, the script retrieves group informations an store them in session.

7. The script initializes the user status and permission for the group level.




Includes:

include(events.lib.inc.php) [line 245]
SCRIPT PURPOSE

This script initializes and manages Dokeos session information. It keeps available session information up to date.

You can request a course id. It will check if the course Id requested is the same as the current one. If it isn't it will update session information from the database. You can also force the course reset if you want ($cidReset).

All the course information is stored in the $_course array.

You can request a group id. The script will check if the group id requested is the same as the current one. If it isn't it will update session information from the database. You can also force the course reset if you want ($gidReset).

The group id is stored in $_gid session variable.

VARIABLES AFFECTING THE SCRIPT BEHAVIOR

string $login string $password boolean $logout

string $cidReq : course id requested boolean $cidReset : ask for a course Reset, if no $cidReq is provided in the same time, all course informations is removed from the current session

int $gidReq : group Id requested boolean $gidReset : ask for a group Reset, if no $gidReq is provided in the same time, all group informations is removed from the current session

VARIABLES SET AND RETURNED BY THE SCRIPT

All the variables below are set and returned by this script.

USER VARIABLES

string $_user ['firstName' ] string $_user ['lastName' ] string $_user ['mail' ] string $_user ['lastLogin' ] string $_user ['official_code'] string $_user ['picture_uri' ] string $_user['user_id']

boolean $is_platformAdmin boolean $is_allowedCreateCourse

COURSE VARIABLES

string $_cid (the course id)

int $_course['id' ] - auto-assigned integer string $_course['name' ] - the title of the course string $_course['official_code'] - the visual / fake / official code string $_course['sysCode' ] string $_course['path' ] string $_course['dbName' ] string $_course['dbNameGlu' ] string $_course['titular' ] string $_course['language' ] string $_course['extLink' ]['url' ] string $_course['extLink' ]['name'] string $_course['categoryCode'] string $_course['categoryName'] boolean $is_courseMember boolean $is_courseTutor boolean $is_courseAdmin

GROUP VARIABLES

int $_gid (the group id)

IMPORTANT ADVICE FOR DEVELOPERS

We strongly encourage developers to use a connection layer at the top of their scripts rather than use these variables, as they are, inside the core of their scripts. It will make code maintenance much easier.

Many if the functions you need you can already find in the main_api.lib.php

We encourage you to use functions to access these global "kernel" variables. You can add them to e.g. the main API library.

SCRIPT STRUCTURE

  1. The script determines if there is an authentication attempt. This part
only chek if the login name and password are valid. Afterwards, it set the $_user['user_id'] (user id) and the $uidReset flag. Other user informations are retrieved later. It's also in this section that optional external authentication devices step in.

2. The script determines what other session informations have to be set or reset, setting correctly $cidReset (for course) and $gidReset (for group).

3. If needed, the script retrieves the other user informations (first name, last name, ...) and stores them in session.

4. If needed, the script retrieves the course information and stores them in session

5. The script initializes the user permission status and permission for the course level

6. If needed, the script retrieves group informations an store them in session.

7. The script initializes the user status and permission for the group level.


include_once($extAuthSource[$key]['login']) [line 292]
include_once($thisAuthSource['newUser']) [line 332]






Documentation generated on Wed, 05 Sep 2007 06:14:55 +0200 by phpDocumentor 1.4.0