-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.php
34 lines (23 loc) · 991 Bytes
/
Main.php
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
<?php
namespace IdnoPlugins\TwoFactorAuth {
class Main extends \Idno\Common\Plugin {
function registerTranslations()
{
\Idno\Core\Idno::site()->language()->register(
new \Idno\Core\GetTextTranslation(
'twofactorauth', dirname(__FILE__) . '/languages/'
)
);
} // , FILE_APPEND
function registerPages() {
// Register an account menu
\Idno\Core\Idno::site()->template()->extendTemplate('account/menu/items', 'twofactorauth/menu');
// Register the callback URL
\Idno\Core\Idno::site()->routes()->addRoute('account/twofactorauth', '\IdnoPlugins\TwoFactorAuth\Pages\Settings');
// Replace login
\Idno\Core\Idno::site()->routes()->addRoute('/session/login', '\IdnoPlugins\TwoFactorAuth\Pages\Login', true);
// QR Code
\Idno\Core\Idno::site()->routes()->addRoute('/twofactorauth/qr\.png', '\IdnoPlugins\TwoFactorAuth\Pages\QR', true);
}
}
}