fix permissions
parent
f16cdeb673
commit
0d1f74998c
|
@ -19,7 +19,7 @@ dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
|
||||||
dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers'),
|
dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers'),
|
||||||
dcPage::getPF('myUrlHandlers/icon.png'),
|
dcPage::getPF('myUrlHandlers/icon.png'),
|
||||||
preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers')) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
|
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) {
|
dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) {
|
||||||
|
@ -28,6 +28,6 @@ dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) {
|
||||||
'url' => dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers'),
|
'url' => dcCore::app()->adminurl->get('admin.plugin.myUrlHandlers'),
|
||||||
'small-icon' => dcPage::getPF('myUrlHandlers/icon.png'),
|
'small-icon' => dcPage::getPF('myUrlHandlers/icon.png'),
|
||||||
'large-icon' => dcPage::getPF('myUrlHandlers/icon-big.png'),
|
'large-icon' => dcPage::getPF('myUrlHandlers/icon-big.png'),
|
||||||
'permissions' => dcAuth::PERMISSION_CONTENT_ADMIN,
|
'permissions' => dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]),
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,9 @@ $this->registerModule(
|
||||||
'2022.11.26',
|
'2022.11.26',
|
||||||
[
|
[
|
||||||
'requires' => [['core', '2.24']],
|
'requires' => [['core', '2.24']],
|
||||||
'permissions' => dcAuth::PERMISSION_CONTENT_ADMIN,
|
'permissions' => dcCore::app()->auth->makePermissions([
|
||||||
|
dcAuth::PERMISSION_CONTENT_ADMIN,
|
||||||
|
]),
|
||||||
'priority' => 150000,
|
'priority' => 150000,
|
||||||
'type' => 'plugin',
|
'type' => 'plugin',
|
||||||
'support' => 'https://github.com/JcDenis/myUrlHandlers',
|
'support' => 'https://github.com/JcDenis/myUrlHandlers',
|
||||||
|
|
40
index.php
40
index.php
|
@ -14,7 +14,7 @@ if (!defined('DC_CONTEXT_ADMIN')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
dcPage::check(dcAuth::PERMISSION_CONTENT_ADMIN);
|
dcPage::check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]));
|
||||||
|
|
||||||
$page_title = __('URL handlers');
|
$page_title = __('URL handlers');
|
||||||
|
|
||||||
|
@ -100,9 +100,9 @@ try {
|
||||||
--------------------------------------------------- */
|
--------------------------------------------------- */
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<html><head>
|
<html><head>
|
||||||
<title><?php echo $page_title; ?></title>
|
<title><?php echo $page_title; ?></title>
|
||||||
</head><body>
|
</head><body>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo dcPage::breadcrumb(
|
echo dcPage::breadcrumb(
|
||||||
|
@ -114,17 +114,17 @@ try {
|
||||||
dcPage::notices();
|
dcPage::notices();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (empty($handlers)): ?>
|
<?php if (empty($handlers)): ?>
|
||||||
<p class="message"><?php echo __('No URL handler to configure.'); ?></p>
|
<p class="message"><?php echo __('No URL handler to configure.'); ?></p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<p><?php echo __('You can write your own URL for each handler of this list.'); ?></p>
|
<p><?php echo __('You can write your own URL for each handler of this list.'); ?></p>
|
||||||
<form action="<?php echo dcCore::app()->admin->getPageURL(); ?>" method="post">
|
<form action="<?php echo dcCore::app()->admin->getPageURL(); ?>" method="post">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr><th>Type</th><th>URL</th></tr>
|
<tr><th>Type</th><th>URL</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
foreach ($handlers as $name => $url) {
|
foreach ($handlers as $name => $url) {
|
||||||
echo
|
echo
|
||||||
|
@ -133,11 +133,11 @@ foreach ($handlers as $name => $url) {
|
||||||
'</td></tr>' . "\n";
|
'</td></tr>' . "\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p><input type="submit" name="act_save" value="<?php echo __('Save'); ?>" />
|
<p><input type="submit" name="act_save" value="<?php echo __('Save'); ?>" />
|
||||||
<input type="submit" name="act_restore" value="<?php echo __('Reset'); ?>" />
|
<input type="submit" name="act_restore" value="<?php echo __('Reset'); ?>" />
|
||||||
<?php echo dcCore::app()->formNonce(); ?></p>
|
<?php echo dcCore::app()->formNonce(); ?></p>
|
||||||
</form>
|
</form>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</body></html>
|
</body></html>
|
||||||
|
|
Loading…
Reference in New Issue