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