Skip to content

Commit

Permalink
OTP (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel authored Nov 15, 2024
1 parent 57d9886 commit e831c6e
Show file tree
Hide file tree
Showing 2,268 changed files with 6,880 additions and 268,862 deletions.
22 changes: 17 additions & 5 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,30 @@
* @psalm-scope-this rex_addon
*/

// include __DIR__.'/vendor/guzzlehttp/promises/src/functions_include.php';
// include __DIR__.'/vendor/guzzlehttp/guzzle/src/functions_include.php';
//
rex_ycom_auth::addInjection(new rex_ycom_injection_otp(), 1);
rex_ycom_auth::addInjection(new rex_ycom_injection_passwordchange(), 4);
rex_ycom_auth::addInjection(new rex_ycom_injection_termsofuse(), 8);

if (rex::isBackend()) {
rex_extension::register('PACKAGES_INCLUDED', static function ($params) {
$addon = rex_addon::get('yform');
$plugin = rex_plugin::get('yform', 'manager');

if ($plugin->isAvailable()) {
// YForm <= 5
$pages = $plugin->getProperty('pages');
$ycom_tables = rex_ycom::getTables();

if (isset($pages) && is_array($pages)) {
foreach ($pages as $page) {
if (in_array($page->getKey(), $ycom_tables, true)) {
$page->setBlock('ycom');
// $page->setRequiredPermissions('ycom[]');
}
}
}
} else {
// YForm >= 5
$pages = $addon->getProperty('pages');
$ycom_tables = rex_ycom::getTables();
if (isset($pages) && is_array($pages)) {
foreach ($pages as $page) {
if (in_array($page->getKey(), $ycom_tables, true)) {
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"onelogin/php-saml": "^3",
"apereo/phpcas": "^1",
"league/oauth2-client": "^2",
"psr/log": "^1"
"psr/log": "^1",
"spomky-labs/otphp": "^11.0"
},
"replace": {
"psr/container": "*",
Expand Down
Loading

0 comments on commit e831c6e

Please sign in to comment.