Add the Invited role - refs BT#9070

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent ea4b07fe8b
commit a86668d36f
  1. 1
      main/admin/user_add.php
  2. 1
      main/admin/user_edit.php
  3. 12
      main/inc/lib/main_api.lib.php

@ -198,6 +198,7 @@ $status[COURSEMANAGER] = get_lang('Teacher');
$status[STUDENT] = get_lang('Learner');
$status[DRH] = get_lang('Drh');
$status[SESSIONADMIN] = get_lang('SessionsAdmin');
$status[ROLE_INVITED] = get_lang('Invited');
$form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'class'=>'chzn-select', 'onchange' => 'javascript: display_drh_list();'));

@ -211,6 +211,7 @@ $status[COURSEMANAGER] = get_lang('Teacher');
$status[STUDENT] = get_lang('Learner');
$status[DRH] = get_lang('Drh');
$status[SESSIONADMIN] = get_lang('SessionsAdmin');
$status[ROLE_INVITED] = get_lang('Invited');
$form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'onchange' => 'javascript: display_drh_list();','class'=>'chzn-select'));

@ -43,6 +43,7 @@ define('SESSION_GENERAL_COACH', 13);
define('COURSE_STUDENT', 14); //student subscribed in a course
define('SESSION_STUDENT', 15); //student subscribed in a session course
define('COURSE_TUTOR', 16); // student is tutor of a course (NOT in session)
define('ROLE_INVITED', 20);
// Table of status
$_status_list[COURSEMANAGER] = 'teacher'; // 1
@ -50,6 +51,7 @@ $_status_list[SESSIONADMIN] = 'session_admin'; // 3
$_status_list[DRH] = 'drh'; // 4
$_status_list[STUDENT] = 'user'; // 5
$_status_list[ANONYMOUS] = 'anonymous'; // 6
$_status_list[ROLE_INVITED] = 'invited'; // 20
// COURSE VISIBILITY CONSTANTS
/** only visible for course admin */
@ -2559,6 +2561,16 @@ function api_is_teacher() {
return isset($_user['status']) && $_user['status'] == COURSEMANAGER;
}
/**
* Checks whether the current user is a invited user
* @return boolean
*/
function api_is_invited_user() {
global $_user;
return isset($_user['status']) && $_user['status'] == ROLE_INVITED;
}
/**
* This function checks whether a session is assigned into a category
* @param int - session id

Loading…
Cancel
Save