Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit dd36225

Browse files
committed
Merge branch 'release/4.4.0'
2 parents 9910ac3 + e49b6e9 commit dd36225

25 files changed

+2690
-2006
lines changed

.travis.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
11
language: php
22
php:
3-
- 5.6
4-
- 7.0
5-
- 7.1
63
- 7.2
7-
- nightly
8-
9-
env:
10-
# global:
11-
# matrix:
12-
# - GLPI_BRANCH=9.2.1
13-
# - GLPI_BRANCH=9.2/bugfixes
14-
# - GLPI_BRANCH=master
15-
16-
matrix:
17-
allow_failures:
18-
- php: nightly
4+
- 7.4
195

206
before_script:
21-
# - mysql -u root -e 'create database glpitest;'
22-
# - git clone --depth=1 $GLPI_SOURCE -b $GLPI_BRANCH ../glpi && cd ../glpi
23-
# - mv ../formcreator plugins/formcreator
24-
# - composer install --no-dev
25-
# - if [ -e scripts/cliinstall.php ] ; then php scripts/cliinstall.php --db=glpitest --user=root --tests ; fi
26-
# - if [ -e tools/cliinstall.php ] ; then php tools/cliinstall.php --db=glpitest --user=root --tests ; fi
27-
# - cd plugins/formcreator
287
- composer self-update
29-
- composer install
8+
- composer install --optimize-autoloader --prefer-dist --no-interaction --no-progress --no-suggest
309

3110
script:
32-
- vendor/bin/robo --no-interaction code:cs
11+
- vendor/bin/robo --no-interaction code:cs --strict
3312

3413
cache:
3514
directories:

ajax/ajax.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
$output = "";
3333

34+
$web_dir = Plugin::getWebDir('mantis');
35+
3436
switch ($_POST['action']) {
3537

3638
// TEST CONNECTION TO MANTIS
@@ -43,12 +45,12 @@
4345
$_POST['login'],
4446
$_POST['pwd']);
4547
if ($res) {
46-
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/check24.png'/>";
48+
echo "<img src='" . $web_dir . "/pics/check24.png'/>";
4749
} else {
48-
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>Access denied";
50+
echo "<img src='" . $web_dir . "/pics/cross24.png'/>Access denied";
4951
}
5052
} catch (Exception $e) {
51-
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>Error IP or Path";
53+
echo "<img src='" . $web_dir . "/pics/cross24.png'/>Error IP or Path";
5254
}
5355
break;
5456

@@ -58,9 +60,9 @@
5860
$ws->initializeConnection();
5961
$res = $ws->existIssueWithId($_POST['id']);
6062
if ($res) {
61-
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/check24.png' />";
63+
echo "<img src='" . $web_dir . "/pics/check24.png' />";
6264
} else {
63-
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>";
65+
echo "<img src='" . $web_dir . "/pics/cross24.png'/>";
6466
}
6567
break;
6668

@@ -70,9 +72,9 @@
7072
$ws->initializeConnection();
7173
$res = $ws->existProjectWithName($_POST['name']);
7274
if ($res) {
73-
echo "<img id='resultImg' src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/check24.png' />";
75+
echo "<img id='resultImg' src='" . $web_dir . "/pics/check24.png' />";
7476
} else {
75-
echo "<img id='resultImg' src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>";
77+
echo "<img id='resultImg' src='" . $web_dir . "/pics/cross24.png'/>";
7678
}
7779
break;
7880

@@ -83,7 +85,7 @@
8385
$ws->getConnexion($_POST['host'],
8486
$_POST['url'],
8587
$_POST['login'],
86-
Toolbox::decrypt($_POST['pwd'], GLPIKEY));
88+
Toolbox::sodiumDecrypt($_POST['pwd']));
8789
$result = $ws->getStateMantis();
8890

8991
if (! $result) {
@@ -168,7 +170,7 @@
168170
$mantis = new PluginMantisMantis();
169171
// verify if a link already exists
170172
if ($mantis->IfExistLink($idItem, $id_mantis_issue, $itemType)) {
171-
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/warning24.png'/>"
173+
echo "<img src='" . $web_dir . "/pics/warning24.png'/>"
172174
."ERROR :". __("This GLPi object is already linked to the selected MantisBT issue", "mantis");
173175
} else {
174176
$result = $ws->getIssueById($id_mantis_issue);
@@ -209,7 +211,7 @@
209211
$mantis = new PluginMantisMantis();
210212
// on verifie si un lien est deja creé
211213
if ($mantis->IfExistLink($id_ticket, $id_mantis_issue, $itemType)) {
212-
echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/warning24.png'/>"
214+
echo "<img src='" . $web_dir . "/pics/warning24.png'/>"
213215
. __("This GLPi object is already linked to the selected MantisBT issue", "mantis");
214216
} else {
215217

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"require": {
3-
"php": ">= 5.6.0"
3+
"php": "^7.2"
44
},
55
"require-dev": {
66
"glpi-project/tools": "^0.1"
77
},
88
"config": {
9+
"optimize-autoloader": true,
910
"platform": {
10-
"php": "5.6"
11-
}
11+
"php": "7.2.0"
12+
},
13+
"sort-packages": true
1214
}
1315
}

0 commit comments

Comments
 (0)