diff --git a/_admin.php b/_admin.php index 26f1c26..4091b09 100644 --- a/_admin.php +++ b/_admin.php @@ -21,7 +21,7 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( cinecturlink2AdminUrl(), cinecturlink2AdminIcon(), preg_match('/' . preg_quote(cinecturlink2AdminUrl()) . '(&.*)?$/', $_SERVER['REQUEST_URI']), - cinecturlink2AdmiPerm(), + dcCore::app()->auth->check(cinecturlink2AdminPerm(), dcCore::app()->blog->id) ); dcCore::app()->addBehavior('adminColumnsListsV2', function (ArrayObject $cols) { @@ -62,7 +62,7 @@ dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $f 'url' => cinecturlink2AdminUrl() . '#links', 'small-icon' => cinecturlink2AdminIcon(), 'large-icon' => cinecturlink2AdminIcon(), - 'permissions' => cinecturlink2AdmiPerm(), + 'permissions' => cinecturlink2AdminPerm(), ]); }); @@ -76,7 +76,7 @@ function cinecturlink2AdminIcon(): string return urldecode(dcPage::getPF('cinecturlink2/icon.svg')); } -function cinecturlink2AdmiPerm(): bool +function cinecturlink2AdminPerm(): bool { - return dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, dcCore::app()->blog->id); + return dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]); } diff --git a/_config.php b/_config.php index e309ef6..f543271 100644 --- a/_config.php +++ b/_config.php @@ -15,7 +15,7 @@ if (!defined('DC_CONTEXT_MODULE')) { } # Check user perms -dcPage::check(dcAuth::PERMISSION_ADMIN); +dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_ADMIN])); $redir = empty($_REQUEST['redir']) ? dcCore::app()->admin->list->getURL() . '#plugins' : $_REQUEST['redir']; diff --git a/_define.php b/_define.php index 8d61558..078cb50 100644 --- a/_define.php +++ b/_define.php @@ -27,7 +27,9 @@ $this->registerModule( '1.1.0', [ '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/cinecturlink2', 'details' => 'https://plugins.dotaddict.org/dc2/details/cinecturlink2', diff --git a/index.php b/index.php index 0f29120..bf49e77 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,9 @@ if (!defined('DC_CONTEXT_ADMIN')) { return null; } -dcPage::check(dcAuth::PERMISSION_CONTENT_ADMIN); +dcPage::check(dcCore::app()->auth->makePermissions([ + dcAuth::PERMISSION_CONTENT_ADMIN, +])); $linkid = $_REQUEST['linkid'] ?? ''; $linktitle = $_POST['linktitle'] ?? '';