Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

glpi / src / plugins / vigilo / front / menu.php @ d825ef2b

History | View | Annotate | Download (934 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
        $force  = empty($_POST['force']) ? '' : '--force';
29
        $cmd    = "/usr/bin/sudo -n /usr/bin/vigiconf deploy $force $debug";
30
        $res    = proc_open($cmd, $fds, $pipes);
31

    
32
        if (!is_resource($res)) {
33
            $res = false;
34
        }
35
    }
36
    PluginVigiloMenu::displayMenu($res, $pipes);
37
} else {
38
    Html::displayRightError();
39
}
40

    
41
Html::footer();