|
31 | 31 |
|
32 | 32 | $output = ""; |
33 | 33 |
|
| 34 | + $web_dir = Plugin::getWebDir('mantis'); |
| 35 | + |
34 | 36 | switch ($_POST['action']) { |
35 | 37 |
|
36 | 38 | // TEST CONNECTION TO MANTIS |
|
43 | 45 | $_POST['login'], |
44 | 46 | $_POST['pwd']); |
45 | 47 | if ($res) { |
46 | | - echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/check24.png'/>"; |
| 48 | + echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/check24.png'/>"; |
47 | 49 | } else { |
48 | | - echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>Access denied"; |
| 50 | + echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/cross24.png'/>Access denied"; |
49 | 51 | } |
50 | 52 | } catch (Exception $e) { |
51 | | - echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>Error IP or Path"; |
| 53 | + echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/cross24.png'/>Error IP or Path"; |
52 | 54 | } |
53 | 55 | break; |
54 | 56 |
|
|
58 | 60 | $ws->initializeConnection(); |
59 | 61 | $res = $ws->existIssueWithId($_POST['id']); |
60 | 62 | if ($res) { |
61 | | - echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/check24.png' />"; |
| 63 | + echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/check24.png' />"; |
62 | 64 | } else { |
63 | | - echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>"; |
| 65 | + echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/cross24.png'/>"; |
64 | 66 | } |
65 | 67 | break; |
66 | 68 |
|
|
70 | 72 | $ws->initializeConnection(); |
71 | 73 | $res = $ws->existProjectWithName($_POST['name']); |
72 | 74 | if ($res) { |
73 | | - echo "<img id='resultImg' src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/check24.png' />"; |
| 75 | + echo "<img id='resultImg' src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/check24.png' />"; |
74 | 76 | } else { |
75 | | - echo "<img id='resultImg' src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/cross24.png'/>"; |
| 77 | + echo "<img id='resultImg' src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/cross24.png'/>"; |
76 | 78 | } |
77 | 79 | break; |
78 | 80 |
|
|
83 | 85 | $ws->getConnexion($_POST['host'], |
84 | 86 | $_POST['url'], |
85 | 87 | $_POST['login'], |
86 | | - Toolbox::decrypt($_POST['pwd'], GLPIKEY)); |
| 88 | + Toolbox::sodiumDecrypt($_POST['pwd'])); |
87 | 89 | $result = $ws->getStateMantis(); |
88 | 90 |
|
89 | 91 | if (! $result) { |
|
168 | 170 | $mantis = new PluginMantisMantis(); |
169 | 171 | // verify if a link already exists |
170 | 172 | if ($mantis->IfExistLink($idItem, $id_mantis_issue, $itemType)) { |
171 | | - echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/warning24.png'/>" |
| 173 | + echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/warning24.png'/>" |
172 | 174 | ."ERROR :". __("This GLPi object is already linked to the selected MantisBT issue", "mantis"); |
173 | 175 | } else { |
174 | 176 | $result = $ws->getIssueById($id_mantis_issue); |
|
209 | 211 | $mantis = new PluginMantisMantis(); |
210 | 212 | // on verifie si un lien est deja creé |
211 | 213 | if ($mantis->IfExistLink($id_ticket, $id_mantis_issue, $itemType)) { |
212 | | - echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $CFG_GLPI['root_doc'] . "/plugins/mantis/pics/warning24.png'/>" |
| 214 | + echo "<img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E" . $web_dir . "/pics/warning24.png'/>" |
213 | 215 | . __("This GLPi object is already linked to the selected MantisBT issue", "mantis"); |
214 | 216 | } else { |
215 | 217 |
|
|
0 commit comments