Skip to content

Commit b334187

Browse files
committed
Fix rights
Bump version
1 parent c50b73d commit b334187

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

addressing.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
<author>Nelly Mahu-Lasson</author>
2828
</authors>
2929
<versions>
30+
<version>
31+
<num>3.0.3</num>
32+
<compatibility>~10.0</compatibility>
33+
<download_url>https://github.com/pluginsGLPI/addressing/releases/download/3.0.3/glpi-addressing-3.0.3.tar.bz2</download_url>
34+
</version>
3035
<version>
3136
<num>3.0.2</num>
3237
<compatibility>~10.0</compatibility>

front/addressing.form.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

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

32+
Session::checkLoginUser();
33+
3234
if (!isset($_GET["id"])) {
3335
$_GET["id"] = "";
3436
}

front/addressing.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,25 @@
2929

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

32+
Session::checkLoginUser();
33+
34+
$PluginAddressingAddressing = new PluginAddressingAddressing();
35+
3236
if (isset($_GET['action']) && $_GET['action'] == 'isName') {
33-
$item = new $_GET['type']();
34-
$datas = $item->find(['name' => ['LIKE', $_GET['name']]]);
35-
if (count($datas) > 0) {
36-
echo json_encode(true);
37-
} else {
38-
echo json_encode(false);
39-
}
37+
38+
if ($PluginAddressingAddressing->canView() || Session::haveRight("config", UPDATE)) {
39+
$item = new $_GET['type']();
40+
$datas = $item->find(['name' => ['LIKE', $_GET['name']]]);
41+
if (count($datas) > 0) {
42+
echo json_encode(true);
43+
} else {
44+
echo json_encode(false);
45+
}
46+
}
4047
} else {
4148

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

44-
$PluginAddressingAddressing = new PluginAddressingAddressing();
45-
4651
if ($PluginAddressingAddressing->canView() || Session::haveRight("config", UPDATE)) {
4752
Search::show("PluginAddressingAddressing");
4853

front/filter.form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

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

32-
32+
Session::checkLoginUser();
3333

3434
$filter = new PluginAddressingFilter();
3535

front/report.form.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

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

38+
Session::checkLoginUser();
39+
3840
if (!isset($_GET["start"])) {
3941
$_GET["start"] = 0;
4042
}

front/reserveip.form.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

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

32+
Session::checkLoginUser();
33+
3234
$reserveip = new PluginAddressingReserveip();
3335

3436
if (isset($_POST['add'])) {

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
--------------------------------------------------------------------------
2828
*/
2929

30-
define('PLUGIN_ADDRESSING_VERSION', '3.0.2');
30+
define('PLUGIN_ADDRESSING_VERSION', '3.0.3');
3131

3232
if (!defined("PLUGIN_ADDRESSING_DIR")) {
3333
define("PLUGIN_ADDRESSING_DIR", Plugin::getPhpDir("addressing"));

0 commit comments

Comments
 (0)