ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Class to represent a tool consumer user. More...
Public Member Functions | |
__construct () | |
Class constructor. More... | |
initialize () | |
Initialise the user. More... | |
initialise () | |
Initialise the user. More... | |
save () | |
Save the user to the database. More... | |
delete () | |
Delete the user from the database. More... | |
getResourceLink () | |
Get resource link. More... | |
getRecordId () | |
Get record ID of user. More... | |
setRecordId ($id) | |
Set record ID of user. More... | |
setResourceLinkId ($resourceLinkId) | |
Set resource link ID of user. More... | |
getDataConnector () | |
Get the data connector. More... | |
getId ($idScope=null) | |
Get the user ID (which may be a compound of the tool consumer and resource link IDs). More... | |
setNames ($firstname, $lastname, $fullname) | |
Set the user's name. More... | |
setEmail ($email, $defaultEmail=null) | |
Set the user's email address. More... | |
isAdmin () | |
Check if the user is an administrator (at any of the system, institution or context levels). More... | |
isStaff () | |
Check if the user is staff. More... | |
isLearner () | |
Check if the user is a learner. More... | |
Static Public Member Functions | |
static | fromRecordId ($id, $dataConnector) |
Load the user from the database. More... | |
static | fromResourceLink ($resourceLink, $ltiUserId) |
Class constructor from resource link. More... | |
Data Fields | |
$firstname = '' | |
User's first name. More... | |
$lastname = '' | |
User's last name (surname or family name). More... | |
$fullname = '' | |
User's fullname. More... | |
$email = '' | |
User's email address. More... | |
$image = '' | |
User's image URI. More... | |
$roles = array() | |
Roles for user. More... | |
$groups = array() | |
Groups for user. More... | |
$ltiResultSourcedId = null | |
User's result sourcedid. More... | |
$created = null | |
Date/time the record was created. More... | |
$updated = null | |
Date/time the record was last updated. More... | |
$ltiUserId = null | |
user ID as supplied in the last connection request. More... | |
Private Member Functions | |
hasRole ($role) | |
Check whether the user has a specified role name. More... | |
load ($id=null) | |
Load the user from the database. More... | |
Private Attributes | |
$resourceLink = null | |
Resource link object. More... | |
$resourceLinkId = null | |
Resource link record ID. More... | |
$id = null | |
User record ID value. More... | |
$dataConnector = null | |
Data connector object or string. More... | |
Class to represent a tool consumer user.
IMSGlobal\LTI\ToolProvider\User::__construct | ( | ) |
Class constructor.
Definition at line 113 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\initialize().
IMSGlobal\LTI\ToolProvider\User::delete | ( | ) |
Delete the user from the database.
Definition at line 174 of file User.php.
References $ok, and IMSGlobal\LTI\ToolProvider\User\getDataConnector().
|
static |
Load the user from the database.
int | $id | Record ID of user |
DataConnector | $dataConnector | Database connection object |
Definition at line 395 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$dataConnector, IMSGlobal\LTI\ToolProvider\User\$id, and $user.
Referenced by IMSGlobal\LTI\ToolProvider\DataConnector\DataConnector_pdo\getUserResultSourcedIDsResourceLink().
|
static |
Class constructor from resource link.
ResourceLink | $resourceLink | Resource_Link object |
string | $ltiUserId | User ID value |
Definition at line 413 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$ltiUserId, IMSGlobal\LTI\ToolProvider\User\$resourceLink, and $user.
Referenced by IMSGlobal\LTI\ToolProvider\ToolProvider\authenticate(), IMSGlobal\LTI\ToolProvider\ResourceLink\doMembershipsService(), IMSGlobal\LTI\ToolProvider\Service\Membership\get(), IMSGlobal\LTI\ToolProvider\DataConnector\DataConnector_mysql\getUserResultSourcedIDsResourceLink(), ilLTIAppEventListener\handleOutcomeWithoutLP(), and ilLTIAppEventListener\tryOutcomeService().
IMSGlobal\LTI\ToolProvider\User::getDataConnector | ( | ) |
Get the data connector.
Definition at line 240 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$dataConnector.
Referenced by IMSGlobal\LTI\ToolProvider\User\delete(), IMSGlobal\LTI\ToolProvider\User\getResourceLink(), IMSGlobal\LTI\ToolProvider\User\load(), and IMSGlobal\LTI\ToolProvider\User\save().
IMSGlobal\LTI\ToolProvider\User::getId | ( | $idScope = null | ) |
Get the user ID (which may be a compound of the tool consumer and resource link IDs).
int | $idScope | Scope to use for user ID (optional, default is null for consumer default setting) |
Definition at line 254 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$id, IMSGlobal\LTI\ToolProvider\User\$ltiUserId, IMSGlobal\LTI\ToolProvider\User\getResourceLink(), IMSGlobal\LTI\ToolProvider\ToolProvider\ID_SCOPE_CONTEXT, IMSGlobal\LTI\ToolProvider\ToolProvider\ID_SCOPE_GLOBAL, IMSGlobal\LTI\ToolProvider\ToolProvider\ID_SCOPE_ID_ONLY, IMSGlobal\LTI\ToolProvider\ToolProvider\ID_SCOPE_RESOURCE, and IMSGlobal\LTI\ToolProvider\ToolProvider\ID_SCOPE_SEPARATOR.
Referenced by IMSGlobal\LTI\ToolProvider\User\setEmail().
IMSGlobal\LTI\ToolProvider\User::getRecordId | ( | ) |
Get record ID of user.
Definition at line 204 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$id.
IMSGlobal\LTI\ToolProvider\User::getResourceLink | ( | ) |
Get resource link.
Definition at line 188 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$resourceLink, IMSGlobal\LTI\ToolProvider\ResourceLink\fromRecordId(), and IMSGlobal\LTI\ToolProvider\User\getDataConnector().
Referenced by IMSGlobal\LTI\ToolProvider\User\getId().
|
private |
Check whether the user has a specified role name.
string | $role | Name of role |
Definition at line 442 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\isAdmin(), IMSGlobal\LTI\ToolProvider\User\isLearner(), and IMSGlobal\LTI\ToolProvider\User\isStaff().
IMSGlobal\LTI\ToolProvider\User::initialise | ( | ) |
Initialise the user.
Pseudonym for initialize().
Definition at line 144 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\initialize().
IMSGlobal\LTI\ToolProvider\User::initialize | ( | ) |
Initialise the user.
Definition at line 123 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\__construct(), IMSGlobal\LTI\ToolProvider\User\initialise(), and IMSGlobal\LTI\ToolProvider\User\load().
IMSGlobal\LTI\ToolProvider\User::isAdmin | ( | ) |
Check if the user is an administrator (at any of the system, institution or context levels).
Definition at line 355 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\hasRole().
IMSGlobal\LTI\ToolProvider\User::isLearner | ( | ) |
Check if the user is a learner.
Definition at line 380 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\hasRole().
IMSGlobal\LTI\ToolProvider\User::isStaff | ( | ) |
Check if the user is staff.
Definition at line 368 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\hasRole().
|
private |
Load the user from the database.
int | $id | Record ID of user (optional, default is null) |
Definition at line 460 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$dataConnector, IMSGlobal\LTI\ToolProvider\User\$id, IMSGlobal\LTI\ToolProvider\User\getDataConnector(), and IMSGlobal\LTI\ToolProvider\User\initialize().
IMSGlobal\LTI\ToolProvider\User::save | ( | ) |
Save the user to the database.
Definition at line 156 of file User.php.
References $ok, and IMSGlobal\LTI\ToolProvider\User\getDataConnector().
IMSGlobal\LTI\ToolProvider\User::setEmail | ( | $email, | |
$defaultEmail = null |
|||
) |
Set the user's email address.
string | Email address value | |
string | $defaultEmail | Value to use if no email is provided (optional, default is none) |
Definition at line 334 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$email, and IMSGlobal\LTI\ToolProvider\User\getId().
IMSGlobal\LTI\ToolProvider\User::setNames | ( | $firstname, | |
$lastname, | |||
$fullname | |||
) |
Set the user's name.
string | $firstname | User's first name. |
string | $lastname | User's last name. |
string | $fullname | User's full name. |
Definition at line 298 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$firstname, IMSGlobal\LTI\ToolProvider\User\$fullname, IMSGlobal\LTI\ToolProvider\User\$lastname, and IMSGlobal\LTI\ToolProvider\User\$ltiUserId.
IMSGlobal\LTI\ToolProvider\User::setRecordId | ( | $id | ) |
Set record ID of user.
int | $id | Record ID of user |
Definition at line 216 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$id.
IMSGlobal\LTI\ToolProvider\User::setResourceLinkId | ( | $resourceLinkId | ) |
Set resource link ID of user.
int | $resourceLinkId | Resource link ID of user |
Definition at line 228 of file User.php.
References IMSGlobal\LTI\ToolProvider\User\$resourceLinkId.
object IMSGlobal\LTI\ToolProvider\User::$created = null |
|
private |
Data connector object or string.
Definition at line 108 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\fromRecordId(), IMSGlobal\LTI\ToolProvider\User\getDataConnector(), and IMSGlobal\LTI\ToolProvider\User\load().
string IMSGlobal\LTI\ToolProvider\User::$email = '' |
User's email address.
Definition at line 41 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\setEmail().
string IMSGlobal\LTI\ToolProvider\User::$firstname = '' |
User's first name.
Definition at line 23 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\setNames().
string IMSGlobal\LTI\ToolProvider\User::$fullname = '' |
User's fullname.
Definition at line 35 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\setNames().
array IMSGlobal\LTI\ToolProvider\User::$groups = array() |
|
private |
User record ID value.
Definition at line 96 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\fromRecordId(), IMSGlobal\LTI\ToolProvider\User\getId(), IMSGlobal\LTI\ToolProvider\User\getRecordId(), IMSGlobal\LTI\ToolProvider\User\load(), and IMSGlobal\LTI\ToolProvider\User\setRecordId().
string IMSGlobal\LTI\ToolProvider\User::$image = '' |
string IMSGlobal\LTI\ToolProvider\User::$lastname = '' |
User's last name (surname or family name).
Definition at line 29 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\setNames().
string IMSGlobal\LTI\ToolProvider\User::$ltiResultSourcedId = null |
string IMSGlobal\LTI\ToolProvider\User::$ltiUserId = null |
user ID as supplied in the last connection request.
Definition at line 102 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\fromResourceLink(), IMSGlobal\LTI\ToolProvider\User\getId(), and IMSGlobal\LTI\ToolProvider\User\setNames().
|
private |
Resource link object.
Definition at line 84 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\fromResourceLink(), and IMSGlobal\LTI\ToolProvider\User\getResourceLink().
|
private |
Resource link record ID.
Definition at line 90 of file User.php.
Referenced by IMSGlobal\LTI\ToolProvider\User\setResourceLinkId().
array IMSGlobal\LTI\ToolProvider\User::$roles = array() |
object IMSGlobal\LTI\ToolProvider\User::$updated = null |