Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ajax/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

use Glpi\Http\Response;

if (isset($_GET['action']) && $_GET['action'] === 'get_fields_html') {

$right = PluginFieldsProfile::getRightOnContainer($_SESSION['glpiactiveprofile']['id'], $_GET['id']);
if ($right < READ) {
Response::sendError(403, 'Forbidden');
return;
}

$containers_id = $_GET['id'];
$itemtype = $_GET['itemtype'];
$items_id = (int) $_GET['items_id'];
Expand Down
1 change: 1 addition & 0 deletions ajax/container_display_condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

if (isset($_GET['action'])) {
if ($_GET['action'] === 'get_add_form') {
Expand Down
1 change: 1 addition & 0 deletions ajax/container_itemtypes_dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

PluginFieldsContainer::showFormItemtype($_REQUEST);
1 change: 1 addition & 0 deletions ajax/container_subtype_dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

PluginFieldsContainer::showFormSubtype($_REQUEST, true);
1 change: 1 addition & 0 deletions ajax/reorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

if (
!array_key_exists('container_id', $_POST)
Expand Down
1 change: 1 addition & 0 deletions ajax/status_override.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

if (isset($_GET['action'])) {
if ($_GET['action'] === 'get_status_dropdown') {
Expand Down
1 change: 1 addition & 0 deletions front/commondropdown.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include '../../../inc/includes.php';
Session::checkLoginUser();
if (preg_match('/[a-z]/i', $_REQUEST['ddtype']) !== 1) {
throw new \RuntimeException(sprintf('Invalid itemtype "%1$s"', $_REQUEST['ddtype']));
}
Expand Down
1 change: 1 addition & 0 deletions front/commondropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include '../../../inc/includes.php';
Session::checkLoginUser();
if (preg_match('/[a-z]/i', $_REQUEST['ddtype']) !== 1) {
throw new \RuntimeException(sprintf('Invalid itemtype "%1$s"', $_REQUEST['ddtype']));
}
Expand Down
7 changes: 7 additions & 0 deletions front/container.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

if (empty($_GET['id'])) {
$_GET['id'] = '';
Expand Down Expand Up @@ -59,6 +60,12 @@
}
Html::back();
} else {

$right = PluginFieldsProfile::getRightOnContainer($_SESSION['glpiactiveprofile']['id'], $_GET['id']);
if ($right < READ) {
Html::displayRightError("User is missing the " . READ . " ('read') right for container");
}

Html::header(
__('Additional fields', 'fields'),
$_SERVER['PHP_SELF'],
Expand Down
3 changes: 2 additions & 1 deletion front/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkLoginUser();

Html::header(
__('Additional fields', 'fields'),
Expand All @@ -38,7 +39,7 @@
'fieldscontainer',
);

Session::checkRight('entity', READ);
Session::checkRight('config', READ);

PluginFieldsContainer::titleList();
Search::show('PluginFieldsContainer');
Expand Down
1 change: 1 addition & 0 deletions front/containerdisplaycondition.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkRight('config', READ);

$status_override = new PluginFieldsContainerDisplayCondition();
if (isset($_POST['add'])) {
Expand Down
2 changes: 1 addition & 1 deletion front/export_to_yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
include('../../../inc/includes.php');
include('../hook.php');

Session::checkRight('entity', READ);
Session::checkRight('config', READ);

$ID = null;
if (isset($_GET['id'])) {
Expand Down
2 changes: 1 addition & 1 deletion front/field.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$_GET['id'] = '';
}

Session::checkRight('entity', READ);
Session::checkRight('config', READ);

$field = new PluginFieldsField();

Expand Down
1 change: 1 addition & 0 deletions front/labeltranslation.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkRight('config', UPDATE);

$translation = new PluginFieldsLabelTranslation();
if (isset($_POST['add'])) {
Expand Down
1 change: 1 addition & 0 deletions front/profile.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkRight('config', UPDATE);

if (isset($_POST['update'])) {
PluginFieldsProfile::updateProfile($_POST);
Expand Down
2 changes: 1 addition & 1 deletion front/regenerate_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
include('../../../inc/includes.php');
include('../hook.php');

Session::checkRight('entity', READ);
Session::checkRight('config', READ);

plugin_fields_checkFiles();

Expand Down
1 change: 1 addition & 0 deletions front/statusoverride.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

include('../../../inc/includes.php');
Session::checkRight('config', READ);

$status_override = new PluginFieldsStatusOverride();
if (isset($_POST['add'])) {
Expand Down