Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTP #493

Merged
merged 10 commits into from
Nov 15, 2024
Merged

OTP #493

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Loading