regles v2
This commit is contained in:
parent
a35fd4aafb
commit
f41686b17d
@ -78,11 +78,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'PATCH') {
|
|||||||
$id = $data['id'] ?? 0;
|
$id = $data['id'] ?? 0;
|
||||||
$dir = $data['dir'] ?? 'up';
|
$dir = $data['dir'] ?? 'up';
|
||||||
|
|
||||||
$stmt = db()->prepare("SELECT channel_id, position FROM channel_rules WHERE id = ?");
|
// Check permission
|
||||||
|
$stmt = db()->prepare("SELECT c.server_id, r.channel_id, r.position FROM channels c JOIN channel_rules r ON c.id = r.channel_id WHERE r.id = ?");
|
||||||
$stmt->execute([$id]);
|
$stmt->execute([$id]);
|
||||||
$current = $stmt->fetch();
|
$current = $stmt->fetch();
|
||||||
|
|
||||||
if ($current) {
|
if ($current && Permissions::hasPermission($user_id, $current['server_id'], Permissions::MANAGE_CHANNELS)) {
|
||||||
$channel_id = $current['channel_id'];
|
$channel_id = $current['channel_id'];
|
||||||
$pos = $current['position'];
|
$pos = $current['position'];
|
||||||
|
|
||||||
|
|||||||
@ -987,6 +987,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (e.target.classList.contains('move-rule-btn')) {
|
if (e.target.classList.contains('move-rule-btn')) {
|
||||||
|
if (!window.canManageChannels) return;
|
||||||
const id = e.target.dataset.id;
|
const id = e.target.dataset.id;
|
||||||
const dir = e.target.dataset.dir;
|
const dir = e.target.dataset.dir;
|
||||||
const resp = await fetch('api_v1_rules.php', {
|
const resp = await fetch('api_v1_rules.php', {
|
||||||
@ -1905,7 +1906,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const rulesListSortable = document.getElementById('rules-list-sortable');
|
const rulesListSortable = document.getElementById('rules-list-sortable');
|
||||||
if (typeof Sortable !== 'undefined' && rulesListSortable) {
|
if (typeof Sortable !== 'undefined' && rulesListSortable && window.canManageChannels) {
|
||||||
new Sortable(rulesListSortable, {
|
new Sortable(rulesListSortable, {
|
||||||
animation: 150,
|
animation: 150,
|
||||||
ghostClass: 'sortable-ghost',
|
ghostClass: 'sortable-ghost',
|
||||||
|
|||||||
@ -58,3 +58,6 @@
|
|||||||
2026-02-15 23:57:30 - GET /index.php?server_id=1&channel_id=11 - POST: []
|
2026-02-15 23:57:30 - GET /index.php?server_id=1&channel_id=11 - POST: []
|
||||||
2026-02-15 23:57:46 - GET /index.php?server_id=1&channel_id=6 - POST: []
|
2026-02-15 23:57:46 - GET /index.php?server_id=1&channel_id=6 - POST: []
|
||||||
2026-02-15 23:57:49 - GET /index.php?server_id=1&channel_id=11 - POST: []
|
2026-02-15 23:57:49 - GET /index.php?server_id=1&channel_id=11 - POST: []
|
||||||
|
2026-02-15 23:59:43 - GET /?fl_project=38443 - POST: []
|
||||||
|
2026-02-16 00:02:15 - GET /index.php?server_id=1&channel_id=11 - POST: []
|
||||||
|
2026-02-16 00:02:20 - GET /index.php?server_id=1&channel_id=11 - POST: []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user