commit
5524e1c469
6 changed files with 9 additions and 3 deletions
2
auth.php
2
auth.php
|
@ -112,7 +112,7 @@ class auth_plugin_userkey extends auth_plugin_base {
|
|||
* @throws \moodle_exception If gets running via CLI or AJAX call.
|
||||
*/
|
||||
protected function redirect($url) {
|
||||
if (CLI_SCRIPT or AJAX_SCRIPT) {
|
||||
if (CLI_SCRIPT || AJAX_SCRIPT) {
|
||||
throw new moodle_exception('redirecterrordetected', 'auth_userkey', '', $url);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ class core_userkey_manager implements userkey_manager_interface {
|
|||
throw new \moodle_exception('invalidkey');
|
||||
}
|
||||
|
||||
if (!empty($key->validuntil) and $key->validuntil < time()) {
|
||||
if (!empty($key->validuntil) && $key->validuntil < time()) {
|
||||
throw new \moodle_exception('expiredkey');
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ use external_value;
|
|||
/**
|
||||
* Tests for auth_plugin_userkey class.
|
||||
*
|
||||
* @covers \auth_plugin_userkey
|
||||
*
|
||||
* @package auth_userkey
|
||||
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
|
|
|
@ -22,6 +22,8 @@ namespace auth_userkey;
|
|||
* Key validation is fully covered in auth_plugin_test.php file.
|
||||
* TODO: write tests for validate_key() function.
|
||||
*
|
||||
* @covers \auth_userkey\core_userkey_manager
|
||||
*
|
||||
* @package auth_userkey
|
||||
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
|
|
|
@ -27,6 +27,8 @@ use context_system;
|
|||
/**
|
||||
* Tests for externallib.php.
|
||||
*
|
||||
* @covers \auth_userkey_external
|
||||
*
|
||||
* @package auth_userkey
|
||||
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2022081900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2022081900; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->release = 2022081900; // Match release exactly to version.
|
||||
$plugin->requires = 2017051500; // Requires Moodle 3.3 version.
|
||||
$plugin->component = 'auth_userkey'; // Full name of the plugin (used for diagnostics).
|
||||
|
|
Loading…
Reference in a new issue