From 0d1f74998ca28181ec584b99eee804b80d805797 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Fri, 2 Dec 2022 01:04:39 +0100 Subject: [PATCH] fix permissions --- _admin.php | 4 ++-- _define.php | 4 +++- index.php | 40 ++++++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/_admin.php b/_admin.php index f6710b3..ec74d95 100644 --- a/_admin.php +++ b/_admin.php @@ -19,7 +19,7 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers'), dcPage::getPF('myUrlHandlers/icon.png'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), - dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, dcCore::app()->blog->id) + dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id) ); dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) { @@ -28,6 +28,6 @@ dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) { 'url' => dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers'), 'small-icon' => dcPage::getPF('myUrlHandlers/icon.png'), 'large-icon' => dcPage::getPF('myUrlHandlers/icon-big.png'), - 'permissions' => dcAuth::PERMISSION_CONTENT_ADMIN, + 'permissions' => dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), ]); }); diff --git a/_define.php b/_define.php index 789cb7d..d896fb9 100644 --- a/_define.php +++ b/_define.php @@ -21,7 +21,9 @@ $this->registerModule( '2022.11.26', [ 'requires' => [['core', '2.24']], - 'permissions' => dcAuth::PERMISSION_CONTENT_ADMIN, + 'permissions' => dcCore::app()->auth->makePermissions([ + dcAuth::PERMISSION_CONTENT_ADMIN, + ]), 'priority' => 150000, 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/myUrlHandlers', diff --git a/index.php b/index.php index 03c56ec..9f45142 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,7 @@ if (!defined('DC_CONTEXT_ADMIN')) { return null; } -dcPage::check(dcAuth::PERMISSION_CONTENT_ADMIN); +dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN])); $page_title = __('URL handlers'); @@ -100,9 +100,9 @@ try { --------------------------------------------------- */ ?> - -<?php echo $page_title; ?> - + +<?php echo $page_title; ?> + - + -

+

-

-
- - - - - +

+ +
TypeURL
+ + + + $url) { echo @@ -133,11 +133,11 @@ foreach ($handlers as $name => $url) { '' . "\n"; } ?> - -
TypeURL
-

- - formNonce(); ?>

-
+ + +

+ + formNonce(); ?>

+ - +