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

Commit 4a28e44

Browse files
author
Stephen Vickers
committed
Add user_image support
Added image as a property of User object populated from user_image parameter in launch message
1 parent a65bd59 commit 4a28e44

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/ToolProvider/ToolProvider.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @author Stephen P Vickers <svickers@imsglobal.org>
1616
* @copyright IMS Global Learning Consortium Inc
1717
* @date 2016
18-
* @version 3.0.0
18+
* @version 3.0.2
1919
* @license GNU Lesser General Public License, version 3 (<http://www.gnu.org/licenses/lgpl.html>)
2020
*/
2121
class ToolProvider
@@ -1074,6 +1074,11 @@ private function authenticate()
10741074
$email = (isset($_POST['lis_person_contact_email_primary'])) ? $_POST['lis_person_contact_email_primary'] : '';
10751075
$this->user->setEmail($email, $this->defaultEmail);
10761076

1077+
// Set the user image URI
1078+
if (isset($_POST['user_image'])) {
1079+
$this->user->image = $_POST['user_image'];
1080+
}
1081+
10771082
// Set the user roles
10781083
if (isset($_POST['roles'])) {
10791084
$this->user->roles = self::parseRoles($_POST['roles']);

src/ToolProvider/User.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @author Stephen P Vickers <svickers@imsglobal.org>
1010
* @copyright IMS Global Learning Consortium Inc
1111
* @date 2016
12-
* @version 3.0.0
12+
* @version 3.0.2
1313
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
1414
*/
1515
class User
@@ -39,6 +39,12 @@ class User
3939
* @var string $email
4040
*/
4141
public $email = '';
42+
/**
43+
* User's image URI.
44+
*
45+
* @var string $image
46+
*/
47+
public $image = '';
4248
/**
4349
* Roles for user.
4450
*
@@ -121,6 +127,7 @@ public function initialize()
121127
$this->lastname = '';
122128
$this->fullname = '';
123129
$this->email = '';
130+
$this->image = '';
124131
$this->roles = array();
125132
$this->groups = array();
126133
$this->ltiResultSourcedId = null;

0 commit comments

Comments
 (0)