diff --git a/_admin.php b/_admin.php index 96621e2..7931596 100644 --- a/_admin.php +++ b/_admin.php @@ -18,6 +18,6 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( __('Noodles'), dcCore::app()->adminurl->get('admin.plugin.noodles'), dcPage::getPF('noodles/icon.png'), - preg_match('/noodles(&.*)?$/', $_SERVER['REQUEST_URI']), - dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, dcCore::app()->blog->id) + preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.noodles')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), + dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id) ); diff --git a/_define.php b/_define.php index 87d0b0c..d2632b7 100644 --- a/_define.php +++ b/_define.php @@ -17,7 +17,9 @@ $this->registerModule( '0.9', [ 'requires' => [['core', '2.24']], - 'permissions' => dcAuth::PERMISSION_CONTENT_ADMIN, + 'permissions' => dcCore::app()->auth->makePermissions([ + dcAuth::PERMISSION_CONTENT_ADMIN, + ]), 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/noodles', 'details' => 'http://plugins.dotaddict.org/dc2/details/noodles', diff --git a/index.php b/index.php index 1cfb65b..fa458d1 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])); include __DIR__ . '/inc/_default_noodles.php';