Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
Add user_image support
Browse files Browse the repository at this point in the history
Added image as a property of User object populated from user_image
parameter in launch message
  • Loading branch information
Stephen Vickers committed Sep 18, 2016
1 parent a65bd59 commit 4a28e44
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/ToolProvider/ToolProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @author Stephen P Vickers <[email protected]>
* @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
Expand Down Expand Up @@ -1074,6 +1074,11 @@ private function authenticate()
$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']);
Expand Down
9 changes: 8 additions & 1 deletion src/ToolProvider/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Stephen P Vickers <[email protected]>
* @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
Expand Down Expand Up @@ -39,6 +39,12 @@ class User
* @var string $email
*/
public $email = '';
/**
* User's image URI.
*
* @var string $image
*/
public $image = '';
/**
* Roles for user.
*
Expand Down Expand Up @@ -121,6 +127,7 @@ public function initialize()
$this->lastname = '';
$this->fullname = '';
$this->email = '';
$this->image = '';
$this->roles = array();
$this->groups = array();
$this->ltiResultSourcedId = null;
Expand Down

0 comments on commit 4a28e44

Please sign in to comment.