Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

glpi / src / plugins / vigilo / front / menu.php @ 166be9d2

History | View | Annotate | Download (871 Bytes)

1
<?php
2

    
3
include(
4
    dirname(dirname(dirname(__DIR__))) .
5
    DIRECTORY_SEPARATOR . "inc" .
6
    DIRECTORY_SEPARATOR . "includes.php"
7
);
8

    
9
if (PluginVigiloMenu::canView()) {
10
    Html::header(
11
        __('Vigilo', 'vigilo'),
12
        $_SERVER["PHP_SELF"],
13
        "plugins",
14
        "PluginVigiloMenu",
15
        "menu"
16
    );
17

    
18
    $res = null;
19
    $pipes = array();
20

    
21
    if (!empty($_POST["deploy"])) {
22
        $fds = array(
23
            1 => array("pipe", "w"),
24
            2 => array("pipe", "w"),
25
        );
26

    
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
        if (!is_resource($res)) {
32
            $res = false;
33
        }
34
    }
35
    PluginVigiloMenu::displayMenu($res, $pipes);
36
} else {
37
    Html::displayRightError();
38
}
39

    
40
Html::footer();