Fixed the ofice typo in the permission names to office

This commit is contained in:
2026-06-13 23:25:27 +02:00
parent 98d5d1cb18
commit a7e3c54a89
5 changed files with 12 additions and 8 deletions

View File

@@ -36,7 +36,7 @@ if ($API_office_stompjes->request_method === 'GET') {
} elseif ($API_office_stompjes->request_method === 'DELETE') {
# Only superuser can delete permission due to fact that the backend needs programming when setting a permission
$API_office_stompjes->checkPermissions('ofice-stompjes', 'RW');
$API_office_stompjes->checkPermissions('office-stompjes', 'RW');
# when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection
$API_office_stompjes->return_url = false;

View File

@@ -19,7 +19,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
# Check permissions
$API = new API();
if (!$API->checkPermissions('ofice-stompjes', 'RO', true)) {
if (!$API->checkPermissions('office-stompjes', 'RO', true)) {
echo 'error 401 unauthorized';
exit;
}
@@ -135,7 +135,7 @@ while ($row = $stmt->fetch_assoc()) {
</div>
</div>
<div class="col col-stats ms-3 ms-sm-0">
<a href="#" class="btn btn-warning btn-lg btn-rounded stomp-btn w-100 <?php echo (!$API->checkPermissions('ofice-stompjes-canstomp', 'RW', true)) ? 'disabled' : '' ?>" data-item-uuid="<?php echo $administrator['user_uuid'] ?>" data-item-name="user_uuid" data-api-url="/api/v1/office/stompjes/"><i class="fa-solid fa-hand-fist"></i></a>
<a href="#" class="btn btn-warning btn-lg btn-rounded stomp-btn w-100 <?php echo (!$API->checkPermissions('office-stompjes-canstomp', 'RW', true)) ? 'disabled' : '' ?>" data-item-uuid="<?php echo $administrator['user_uuid'] ?>" data-item-name="user_uuid" data-api-url="/api/v1/office/stompjes/"><i class="fa-solid fa-hand-fist"></i></a>
</div>
</div>
</div>
@@ -154,7 +154,7 @@ while ($row = $stmt->fetch_assoc()) {
<th></th>
<th><?php echo __('first_name') ?></th>
<th><?php echo __('time') ?></th>
<?php if ($API->checkPermissions('ofice-stompjes', 'RW', true)) { ?>
<?php if ($API->checkPermissions('office-stompjes', 'RW', true)) { ?>
<th><?php echo __('actions') ?></th>
<?php } ?>
</tr>
@@ -164,7 +164,7 @@ while ($row = $stmt->fetch_assoc()) {
<th></th>
<th><?php echo __('first_name') ?></th>
<th><?php echo __('time') ?></th>
<?php if ($API->checkPermissions('ofice-stompjes', 'RW', true)) { ?>
<?php if ($API->checkPermissions('office-stompjes', 'RW', true)) { ?>
<th><?php echo __('actions') ?></th>
<?php } ?>
</tr>
@@ -180,7 +180,7 @@ while ($row = $stmt->fetch_assoc()) {
</td>
<td class="text-nowrap"><?php echo $administrators[$stompje['user_uuid']]['user_first_name'] ?></td>
<td class="text-nowrap"><?php echo date('d-m-y H:i:s', $stompje['stomp_timestamp']) ?></td>
<?php if ($API->checkPermissions('ofice-stompjes', 'RW', true)) { ?>
<?php if ($API->checkPermissions('office-stompjes', 'RW', true)) { ?>
<td>
<a href="#" class="btn btn-danger btn-sm btn-rounded stomp-delete-btn" data-item-uuid="<?php echo $stompje['stomp_uuid'] ?>" data-api-url="/api/v1/office/stompjes/" data-item-name="stomp_uuid"><i class="fas fa-trash-alt"></i></a>
</td>

View File

@@ -47,7 +47,7 @@ function showCard($module_name, $page_name, $width = 3)
showCard('servers', 'server_overview', '6');
}
if ($GLOBALS['modules_enabled']['office'] && $API->checkPermissions('ofice-stompjes', 'RO', true)) {
if ($GLOBALS['modules_enabled']['office'] && $API->checkPermissions('office-stompjes', 'RO', true)) {
showCard('office', 'stompjeslist');
}

View File

@@ -237,7 +237,7 @@ class pageBuilder extends API
<?php
showPage('portal-management', 'dashboard');
if ($GLOBALS['modules_enabled']['office'] && $API->checkPermissions('ofice-stompjes', 'RO', true)) {
if ($GLOBALS['modules_enabled']['office'] && $API->checkPermissions('office-stompjes', 'RO', true)) {
showSpan('office');
showPage('office', 'stompjeslist');
}

View File

@@ -1 +1,5 @@
ALTER TABLE `system_users` CHANGE COLUMN `user_pref_language` `user_pref_language` ENUM("en","nl") NOT NULL DEFAULT 'en' COLLATE 'utf8mb4_general_ci' AFTER `user_login_attempts`;
UPDATE `sentri`.`system_permissions` SET `permission_name`='office-stompjes-canstomp' WHERE `permission_uuid`='5f284b11-de7c-11f0-9d57-00155d00153f';
UPDATE `sentri`.`system_permissions` SET `permission_name`='office-stompjes' WHERE `permission_uuid`='11abc93d-c265-11f0-95da-7e99ed98b725';
UPDATE `sentri`.`system_permissions` SET `permission_slugify`='office-stompjes' WHERE `permission_uuid`='11abc93d-c265-11f0-95da-7e99ed98b725';
UPDATE `sentri`.`system_permissions` SET `permission_slugify`='office-stompjes-canstomp' WHERE `permission_uuid`='5f284b11-de7c-11f0-9d57-00155d00153f';