5 Commits
1.1.0 ... main

Author SHA1 Message Date
Paweł Suwiński
17c7d55cd2 one-time login 2022-01-20 09:59:08 +01:00
Paweł Suwiński
ae7ab59097 docs: misspelled fields mapping PCRE pattern example (Fix #1) 2021-01-05 10:49:57 +01:00
Paweł Suwiński
53162e2a91 version and CHANGELOG update 2020-11-26 09:13:44 +01:00
Paweł Suwiński
50699c4caa fix notice only variables should be passed by reference 2020-11-26 09:10:36 +01:00
Paweł Suwiński
6d9b5f8300 README.md reediting 2020-11-19 12:35:14 +01:00
8 changed files with 29 additions and 14 deletions

View File

@@ -1,5 +1,19 @@
# Changelog # Changelog
## [1.1.2] - 2021-01-05
### Fixed
- docs: misspelled fields mapping PCRE pattern example (issue #1)
## [1.1.1] - 2020-11-26
### Fixed
- notice "only variables should be passed by reference"
## [1.1.0] - 2020-11-19 ## [1.1.0] - 2020-11-19
### Added ### Added

View File

@@ -9,12 +9,12 @@ Additional security can be set:
- *revoke threshold*: login failures limit causing revoke of the generated password - *revoke threshold*: login failures limit causing revoke of the generated password
- *minimum request period*: a time in seconds after which another password can be generated - *minimum request period*: a time in seconds after which another password can be generated
Signup and user creation on first login takes place only in case of using email Signup and user creation on first login if not prevented (global setting
as username (not to be confused with the `authloginviaemail` global setting) if `authpreventaccountcreation`) takes place only in case of using email as
not prevented (global setting `authpreventaccountcreation`) and parts of email username (not to be confused with the `authloginviaemail` global setting) and
address may be mapped to profile fields using PCRE expressions. parts of email address may be mapped to profile fields using PCRE expressions.
Auth instruction setting (global `auth_instructions`) is recommended depending Auth instruction setting (global `auth_instructions`) is recommended depending
on the adopted user account policy and plugin settings. on the adopted user account policy and plugin configuration.
See also: `fieldsmapping_help` setting form for [mapping usage example](lang/en/auth_emailotp.php). See also: `fieldsmapping_help` setting form for [mapping usage example](lang/en/auth_emailotp.php).

View File

@@ -1,5 +1,6 @@
TODO: TODO:
- one-time login link / form autosubmit
- configurable takeover of user authtype after self singup in other auth module - configurable takeover of user authtype after self singup in other auth module
in case of standard not email based logins in case of standard not email based logins
- js snippet to change login form (ex. to add "Generate OTP" button) on valid - js snippet to change login form (ex. to add "Generate OTP" button) on valid

View File

@@ -239,10 +239,9 @@ class auth_plugin_emailotp extends auth_plugin_base {
return true; return true;
} }
// Log reader required - silently return failure on absence. // Log reader required - silently return failure on absence.
if (!$reader = reset(get_log_manager()->get_readers('\core\log\sql_reader'))) { $readers = get_log_manager()->get_readers('\core\log\sql_reader');
return false; $reader = reset($readers);
} return $reader && $reader->get_events_select_count(
return $reader->get_events_select_count(
'component = ? AND action = ? AND timecreated >= ? AND other = ?', 'component = ? AND action = ? AND timecreated >= ? AND other = ?',
array( array(
self::COMPONENT_NAME, self::COMPONENT_NAME,

View File

@@ -47,7 +47,7 @@ $string['fieldsmapping_help'] = <<<'EOT'
Pattern:<br /> Pattern:<br />
<pre> <pre>
'#/?P&lt;FIRST&gt;[^\.]+)\.(?P&lt;LAST&gt;[^@]+)@(?P&lt;COMPANY&gt;[^\.]+).*#', #/(?P&lt;FIRST&gt;[^\.]+)\.(?P&lt;LAST&gt;[^@]+)@(?P&lt;COMPANY&gt;[^\.]+).*#
</pre> </pre>
Mapping:<br /> Mapping:<br />

View File

@@ -47,7 +47,7 @@ $string['fieldsmapping_help'] = <<<'EOT'
Wzorzec:<br /> Wzorzec:<br />
<pre> <pre>
'#/?P&lt;FIRST&gt;[^\.]+)\.(?P&lt;LAST&gt;[^@]+)@(?P&lt;COMPANY&gt;[^\.]+).*#', #/(?P&lt;FIRST&gt;[^\.]+)\.(?P&lt;LAST&gt;[^@]+)@(?P&lt;COMPANY&gt;[^\.]+).*#
</pre> </pre>
Mapowanie:<br /> Mapowanie:<br />

View File

@@ -65,7 +65,8 @@ if ($ADMIN->fulltree) {
get_string('minrequestperiod_help', 'auth_emailotp') get_string('minrequestperiod_help', 'auth_emailotp')
) extends admin_setting_configtext { ) extends admin_setting_configtext {
public function __construct($name, $visiblename, $description) { public function __construct($name, $visiblename, $description) {
$logreader = reset(get_log_manager()->get_readers('\core\log\sql_reader')); $readers = get_log_manager()->get_readers('\core\log\sql_reader');
$logreader = reset($readers);
parent::__construct($name, $visiblename, $description, $logreader ? 120 : 0, PARAM_INT); parent::__construct($name, $visiblename, $description, $logreader ? 120 : 0, PARAM_INT);
if (!$logreader && !empty($this->get_setting())) { if (!$logreader && !empty($this->get_setting())) {
$this->description .= ' '.get_string('logstorerequired', 'auth_emailotp', $this->description .= ' '.get_string('logstorerequired', 'auth_emailotp',

View File

@@ -24,8 +24,8 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020111903; // The current plugin version (Date: YYYYMMDDXX). $plugin->version = 2021010500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2018120304; // Requires this Moodle version. $plugin->requires = 2018120304; // Requires this Moodle version.
$plugin->component = 'auth_emailotp'; // Full name of the plugin (used for diagnostics). $plugin->component = 'auth_emailotp'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
$plugin->release = '1.1.0'; $plugin->release = '1.1.2';