You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-3Lines changed: 64 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -94,9 +94,70 @@ You can set URL to redirect users before they see Moodle login page. For example
94
94
to your web application to login page. You can use "enrolkey_skipsso" URL parameter to bypass this option.
95
95
E.g. http://yourmoodle.com/login/index.php?enrolkey_skipsso=1
96
96
97
+
**Example client**
98
+
99
+
The code below defines a function that can be used to obtain a login url.
100
+
You will need to add/remove parameters depending on whether you have iprestriction or update/create user enabled and which mapping field you are using.
101
+
102
+
The required library curl.php can be obtained from https://github.com/dongsheng/cURL
103
+
```
104
+
/**
105
+
* @param string $useremail Email address of user to create token for.
106
+
* @param string $firstname First name of user (used to update/create user).
107
+
* @param string $lastname Last name of user (used to update/create user).
108
+
* @param string $username Username of user (used to update/create user).
109
+
* @param string $ipaddress IP address of end user that login request will come from (probably $_SERVER['REMOTE_ADDR']).
110
+
* @param int $courseid Course id to send logged in users to, defaults to site home.
111
+
* @param int $modname Name of course module to send users to, defaults to none.
112
+
* @param int $activityid cmid to send logged in users to, defaults to site home.
Copy file name to clipboardExpand all lines: lang/en/auth_userkey.php
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,10 @@
32
32
$string['keylifetime'] = 'User key life time';
33
33
$string['keylifetime_desc'] = 'Life time in seconds of the each user login key.';
34
34
$string['incorrectkeylifetime'] = 'User key life time should be a number';
35
-
$string['createuser'] = 'Crete user?';
35
+
$string['createuser'] = 'Create user?';
36
36
$string['createuser_desc'] = 'If enabled, a new user will be created if fail to find one in LMS.';
37
+
$string['updateuser'] = 'Update user?';
38
+
$string['updateuser_desc'] = 'If enabled, users will be updated with the properties supplied when the webservice is called.';
37
39
$string['redirecturl'] = 'Logout redirect URL';
38
40
$string['redirecturl_desc'] = 'Optionally you can redirect users to this URL after they logged out from LMS.';
39
41
$string['incorrectredirecturl'] = 'You should provide valid URL';
@@ -43,3 +45,4 @@
43
45
$string['ssourl'] = 'URL of SSO host';
44
46
$string['ssourl_desc'] = 'URL of the SSO host to redirect users to. If defined users will be redirected here on login instead of the Moodle Login page';
45
47
$string['redirecterrordetected'] = 'Unsupported redirect to {$a} detected, execution terminated.';
48
+
$string['noip'] = 'Unable to fetch IP address of client.';
0 commit comments