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