glpi / src / plugins / vigilo / front / menu.php @ c24d7938
History | View | Annotate | Download (967 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 | cf9d65ba | Francois POIROTTE | Session::checkRight("config", UPDATE); |
10 | |||
11 | Html::header( |
||
12 | __('Vigilo', 'vigilo'), |
||
13 | $_SERVER["PHP_SELF"], |
||
14 | "plugins",
|
||
15 | "PluginVigiloMenu",
|
||
16 | "menu"
|
||
17 | ); |
||
18 | |||
19 | $res = null; |
||
20 | $pipes = array(); |
||
21 | |||
22 | if (!empty($_POST["deploy"])) { |
||
23 | $fds = array( |
||
24 | 1 => array("pipe", "w"), |
||
25 | 2 => array("pipe", "w"), |
||
26 | ); |
||
27 | |||
28 | $debug = empty($_POST['debug']) ? '' : '--debug'; |
||
29 | $force = empty($_POST['force']) ? '' : '--force'; |
||
30 | $cmd = "/usr/bin/sudo -n /usr/bin/vigiconf deploy $force $debug"; |
||
31 | $env = array( |
||
32 | "LC_ALL" => isset($_SESSION["glpilanguage"]) ? $_SESSION["glpilanguage"] : "en", |
||
33 | "PATH" => getenv("PATH") |
||
34 | 077e4de7 | Francois POIROTTE | ); |
35 | b58488b5 | Francois POIROTTE | $res = proc_open($cmd, $fds, $pipes, null, $env); |
36 | efcf5ecf | Francois POIROTTE | |
37 | cf9d65ba | Francois POIROTTE | if (!is_resource($res)) { |
38 | $res = false; |
||
39 | efcf5ecf | Francois POIROTTE | } |
40 | } |
||
41 | cf9d65ba | Francois POIROTTE | PluginVigiloMenu::displayMenu($res, $pipes); |
42 | efcf5ecf | Francois POIROTTE | |
43 | Html::footer(); |