Add user_image support

Added image as a property of User object populated from user_image
parameter in launch message
This commit is contained in:
Stephen Vickers 2016-09-18 11:54:48 +09:00
parent a65bd59aee
commit 4a28e44b67
2 changed files with 14 additions and 2 deletions

View File

@ -15,7 +15,7 @@ use IMSGlobal\LTI\OAuth;
* @author Stephen P Vickers <svickers@imsglobal.org>
* @copyright IMS Global Learning Consortium Inc
* @date 2016
* @version 3.0.0
* @version 3.0.2
* @license GNU Lesser General Public License, version 3 (<http://www.gnu.org/licenses/lgpl.html>)
*/
class ToolProvider
@ -1074,6 +1074,11 @@ EOD;
$email = (isset($_POST['lis_person_contact_email_primary'])) ? $_POST['lis_person_contact_email_primary'] : '';
$this->user->setEmail($email, $this->defaultEmail);
// Set the user image URI
if (isset($_POST['user_image'])) {
$this->user->image = $_POST['user_image'];
}
// Set the user roles
if (isset($_POST['roles'])) {
$this->user->roles = self::parseRoles($_POST['roles']);

View File

@ -9,7 +9,7 @@ use IMSGlobal\LTI\ToolProvider\DataConnector\DataConnector;
* @author Stephen P Vickers <svickers@imsglobal.org>
* @copyright IMS Global Learning Consortium Inc
* @date 2016
* @version 3.0.0
* @version 3.0.2
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/
class User
@ -39,6 +39,12 @@ class User
* @var string $email
*/
public $email = '';
/**
* User's image URI.
*
* @var string $image
*/
public $image = '';
/**
* Roles for user.
*
@ -121,6 +127,7 @@ class User
$this->lastname = '';
$this->fullname = '';
$this->email = '';
$this->image = '';
$this->roles = array();
$this->groups = array();
$this->ltiResultSourcedId = null;