Skip to content

Commit

Permalink
Fix rights
Browse files Browse the repository at this point in the history
Bump version
  • Loading branch information
tsmr committed Nov 27, 2024
1 parent c50b73d commit b334187
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 11 deletions.
5 changes: 5 additions & 0 deletions addressing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<author>Nelly Mahu-Lasson</author>
</authors>
<versions>
<version>
<num>3.0.3</num>
<compatibility>~10.0</compatibility>
<download_url>https://github.com/pluginsGLPI/addressing/releases/download/3.0.3/glpi-addressing-3.0.3.tar.bz2</download_url>
</version>
<version>
<num>3.0.2</num>
<compatibility>~10.0</compatibility>
Expand Down
2 changes: 2 additions & 0 deletions front/addressing.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

include ('../../../inc/includes.php');

Session::checkLoginUser();

if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
Expand Down
23 changes: 14 additions & 9 deletions front/addressing.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,25 @@

include ('../../../inc/includes.php');

Session::checkLoginUser();

$PluginAddressingAddressing = new PluginAddressingAddressing();

if (isset($_GET['action']) && $_GET['action'] == 'isName') {
$item = new $_GET['type']();
$datas = $item->find(['name' => ['LIKE', $_GET['name']]]);
if (count($datas) > 0) {
echo json_encode(true);
} else {
echo json_encode(false);
}

if ($PluginAddressingAddressing->canView() || Session::haveRight("config", UPDATE)) {
$item = new $_GET['type']();
$datas = $item->find(['name' => ['LIKE', $_GET['name']]]);
if (count($datas) > 0) {
echo json_encode(true);
} else {
echo json_encode(false);
}
}
} else {

Html::header(PluginAddressingAddressing::getTypeName(2), '', "tools", "pluginaddressingaddressing");

$PluginAddressingAddressing = new PluginAddressingAddressing();

if ($PluginAddressingAddressing->canView() || Session::haveRight("config", UPDATE)) {
Search::show("PluginAddressingAddressing");

Expand Down
2 changes: 1 addition & 1 deletion front/filter.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

include ('../../../inc/includes.php');


Session::checkLoginUser();

$filter = new PluginAddressingFilter();

Expand Down
2 changes: 2 additions & 0 deletions front/report.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

Html::header(PluginAddressingAddressing::getTypeName(2), '', "tools", "pluginaddressingaddressing");

Session::checkLoginUser();

if (!isset($_GET["start"])) {
$_GET["start"] = 0;
}
Expand Down
2 changes: 2 additions & 0 deletions front/reserveip.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

include ('../../../inc/includes.php');

Session::checkLoginUser();

$reserveip = new PluginAddressingReserveip();

if (isset($_POST['add'])) {
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
--------------------------------------------------------------------------
*/

define('PLUGIN_ADDRESSING_VERSION', '3.0.2');
define('PLUGIN_ADDRESSING_VERSION', '3.0.3');

if (!defined("PLUGIN_ADDRESSING_DIR")) {
define("PLUGIN_ADDRESSING_DIR", Plugin::getPhpDir("addressing"));
Expand Down

0 comments on commit b334187

Please sign in to comment.