Skip to content

Commit 90c5aba

Browse files
authored
limit login note
1 parent 984bdcf commit 90c5aba

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

readme.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,24 @@ Parameters **must be** base64 encoded and passed either as the entire query stri
4141

4242
This belongs in `/auth/anonymous` in your moodle folder. Use the plugin istaller if you can. You should also enable the authentication method through `Site Administration > Plugins > (Authentication) > Manage Authentication` and push its priority to the top.
4343

44+
## Limiting Login
45+
46+
I used this plugin in conjunction with a [course theme](https://github.com/frumbert/theme_arid). When the user browsed outside the course the theme was loaded in, you would be automatically logged off as the site fell back on Boost. There's a routine in the lib.php file for automatic log off that you can call.
47+
48+
For instance in boost's `config.php` you can drop this at the bottom to automatically log the user out if Boost is loaded.
49+
50+
```php
51+
// execute this when the theme loads
52+
// don't allow anonymous logon in this theme
53+
if (file_exists($CFG->dirroot . '/auth/anonymous/lib.php')) {
54+
require_once($CFG->dirroot . '/auth/anonymous/lib.php');
55+
auth_anonymous_autologout();
56+
}
57+
```
58+
4459
## Todo / Maybe
4560

46-
-[ ] Option to switch to openssl encryption for auth parameter
61+
-[ ] Option to switch to openssl encryption for auth parameter (e.g. aes-cbc-256)
4762

4863
## Licence
4964

0 commit comments

Comments
 (0)