mirror of
https://github.com/PawelSuwinski/moodle-auth_emailotp.git
synced 2026-05-17 05:48:40 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae7ab59097 | ||
|
|
53162e2a91 | ||
|
|
50699c4caa | ||
|
|
6d9b5f8300 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -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
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -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).
|
||||||
|
|||||||
7
auth.php
7
auth.php
@@ -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,
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ $string['fieldsmapping_help'] = <<<'EOT'
|
|||||||
|
|
||||||
Pattern:<br />
|
Pattern:<br />
|
||||||
<pre>
|
<pre>
|
||||||
'#/?P<FIRST>[^\.]+)\.(?P<LAST>[^@]+)@(?P<COMPANY>[^\.]+).*#',
|
#/(?P<FIRST>[^\.]+)\.(?P<LAST>[^@]+)@(?P<COMPANY>[^\.]+).*#
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Mapping:<br />
|
Mapping:<br />
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ $string['fieldsmapping_help'] = <<<'EOT'
|
|||||||
|
|
||||||
Wzorzec:<br />
|
Wzorzec:<br />
|
||||||
<pre>
|
<pre>
|
||||||
'#/?P<FIRST>[^\.]+)\.(?P<LAST>[^@]+)@(?P<COMPANY>[^\.]+).*#',
|
#/(?P<FIRST>[^\.]+)\.(?P<LAST>[^@]+)@(?P<COMPANY>[^\.]+).*#
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Mapowanie:<br />
|
Mapowanie:<br />
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|||||||
Reference in New Issue
Block a user