glpi / src / plugins / vigilo / front / menu.php @ 166be9d2
History | View | Annotate | Download (871 Bytes)
1 | efcf5ecf | Francois POIROTTE | <?php
|
---|---|---|---|
2 | |||
3 | 166be9d2 | Francois POIROTTE | include(
|
4 | dirname(dirname(dirname(__DIR__))) . |
||
5 | DIRECTORY_SEPARATOR . "inc" . |
||
6 | DIRECTORY_SEPARATOR . "includes.php" |
||
7 | ); |
||
8 | efcf5ecf | Francois POIROTTE | |
9 | if (PluginVigiloMenu::canView()) { |
||
10 | 077e4de7 | Francois POIROTTE | Html::header( |
11 | __('Vigilo', 'vigilo'), |
||
12 | $_SERVER["PHP_SELF"], |
||
13 | "plugins",
|
||
14 | "PluginVigiloMenu",
|
||
15 | "menu"
|
||
16 | ); |
||
17 | efcf5ecf | Francois POIROTTE | |
18 | $res = null; |
||
19 | 0e0753c8 | Romain CHOLLET | $pipes = array(); |
20 | |||
21 | efcf5ecf | Francois POIROTTE | if (!empty($_POST["deploy"])) { |
22 | $fds = array( |
||
23 | 1 => array("pipe", "w"), |
||
24 | 2 => array("pipe", "w"), |
||
25 | ); |
||
26 | 166be9d2 | Francois POIROTTE | |
27 | $debug = empty($_POST['debug']) ? '' : '--debug'; |
||
28 | $cmd = "/usr/bin/sudo -n /usr/bin/vigiconf deploy -f $debug"; |
||
29 | $res = proc_open($cmd, $fds, $pipes); |
||
30 | |||
31 | 077e4de7 | Francois POIROTTE | if (!is_resource($res)) { |
32 | e0c97dab | Francois POIROTTE | $res = false; |
33 | 077e4de7 | Francois POIROTTE | } |
34 | efcf5ecf | Francois POIROTTE | } |
35 | PluginVigiloMenu::displayMenu($res, $pipes); |
||
36 | } else {
|
||
37 | Html::displayRightError();
|
||
38 | } |
||
39 | |||
40 | Html::footer(); |