forked from e107inc/twofactorauth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe_event.php
More file actions
50 lines (38 loc) · 905 Bytes
/
e_event.php
File metadata and controls
50 lines (38 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/*
* TwoFactorAuth
*
* Copyright (C) 2021-2022 e107 Inc. (https://www.e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
if (!defined('e107_INIT')) { exit; }
require_once(e_PLUGIN."twofactorauth/twofactorauth_class.php");
class twofactorauth_event
{
function config()
{
$event = array();
// User login
$event[] = array(
'name' => "user_validlogin",
'function' => "init_tfa",
);
// User has submitted Forgotten Password form
$event[] = array(
'name' => "user_fpw_request",
'function' => "init_tfa",
);
return $event;
}
function init_tfa($data, $eventname)
{
// Check to see if Two Factor Authentication is active for all users
if(e107::getPlugPref('twofactorauth', 'tfa_active'))
{
$tfa = new tfa_class();
$tfa->init($data, $eventname);
}
}
}