Esempio n. 1
0
require_once "../inc/profile.class.php";
$report = '';
if (isset($_POST['report'])) {
    $report = $_POST['report'];
}
$prof = new PluginReportsProfile();
if (isset($_POST['delete']) && $report) {
    Session::checkRight('profile', 'w');
    $prof->deleteByCriteria(array('report' => $report));
} else {
    if (isset($_POST['update']) && $report) {
        Session::checkRight('profile', 'w');
        PluginReportsProfile::updateForReport($_POST);
    }
}
$tab = $prof->updatePluginRights();
echo "<form method='post' action=\"" . $_SERVER["PHP_SELF"] . "\">";
echo "<table class='tab_cadre'><tr><th colspan='2'>";
echo "<a href='config.form.php'>" . __('Reports plugin configuration', 'reports') . "</a><br>&nbsp;<br>";
echo __('Rights management by report', 'reports') . "</th></tr>\n";
echo "<tr class='tab_bg_1'><td>" . __('Report', 'Reports', 1) . "&nbsp; ";
$query = "SELECT `id`, `name`\n          FROM `glpi_profiles`\n          ORDER BY `name`";
$result = $DB->query($query);
echo "<select name='report'>";
$plugname = array();
$rap = array();
foreach ($tab as $key => $plug) {
    $mod = $plug == 'reports' ? $key : $plug . '_' . $key;
    if (!isset($plugname[$plug])) {
        // Retrieve the plugin name
        $function = "plugin_version_{$plug}";