glpi / src / plugins / vigilo / front / menu.php @ 14b31af4
History | View | Annotate | Download (967 Bytes)
1 |
<?php
|
---|---|
2 |
|
3 |
include(
|
4 |
dirname(dirname(dirname(__DIR__))) . |
5 |
DIRECTORY_SEPARATOR . "inc" . |
6 |
DIRECTORY_SEPARATOR . "includes.php" |
7 |
); |
8 |
|
9 |
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 |
); |
35 |
$res = proc_open($cmd, $fds, $pipes, null, $env); |
36 |
|
37 |
if (!is_resource($res)) { |
38 |
$res = false; |
39 |
} |
40 |
} |
41 |
PluginVigiloMenu::displayMenu($res, $pipes); |
42 |
|
43 |
Html::footer();
|