/**
     * View all privileges information
     *
     * @access public
     */
    function viewPrivileges($withFormUser = false, $withFormGroupe = false)
    {
        $query = '	SELECT user_id, user_name AS ' . quotes($GLOBALS['traduct']->get(163)) . ',
						user_login AS ' . quotes($GLOBALS['traduct']->get(164)) . ',
						groupe_name AS ' . quotes($GLOBALS['traduct']->get(165)) . '
					FROM users, groupes WHERE user_groupe_id=groupe_id;';
        include_once INCLUDE_LIB . 'SQLiteToGrid.class.php';
        $tabUser = new SQLiteToGrid($GLOBALS['db'], $query, 'PrivUser', true, 10, '95%');
        $tabUser->enableSortStyle(false);
        $tabUser->hideColumn(0);
        $tabUser->setGetVars('?action=auth');
        if ($tabUser->getNbRecord() <= 10) {
            $tabUser->disableNavBarre();
        }
        $tabUser->addCalcColumn($GLOBALS['traduct']->get(33), '	<a href="?action=auth&amp;auth_action=modifyUser&amp;user=#%0%#" class="Browse">' . displayPics('edit.png', $GLOBALS['traduct']->get(14)) . '</a>&nbsp;
											<a href="?action=auth&amp;auth_action=deleteUser&amp;user=#%0%#" class="Browse">' . displayPics('edittrash.png', $GLOBALS['traduct']->get(15)) . '</a>&nbsp;
											<a href="?action=auth&amp;auth_action=passwdUser&amp;user=#%0%#" class="Browse">' . displayPics('encrypted.png', $GLOBALS['traduct']->get(157)) . '</a>&nbsp;', 'center', 999);
        $tabUser->addCaption('bottom', '<a href="?action=auth&amp;auth_action=addUser" class="Browse">' . $GLOBALS['traduct']->get(159) . '</a>');
        $tabUser->disableOnClick();
        $tabUser->build();
        // ------------------------------------------------------------------------
        $query = 'SELECT groupe_id, groupe_name AS ' . quotes($GLOBALS['traduct']->get(163)) . ',
						CASE properties WHEN 1 THEN ' . quotes($GLOBALS['traduct']->get(191)) . ' ELSE ' . quotes($GLOBALS['traduct']->get(192)) . ' END AS ' . quotes($GLOBALS['traduct']->get(61)) . ',
						CASE execSQL WHEN 1 THEN ' . quotes($GLOBALS['traduct']->get(191)) . ' ELSE ' . quotes($GLOBALS['traduct']->get(192)) . ' END AS ' . quotes($GLOBALS['traduct']->get(166)) . ',
						CASE data WHEN 1 THEN ' . quotes($GLOBALS['traduct']->get(191)) . ' ELSE ' . quotes($GLOBALS['traduct']->get(192)) . ' END AS ' . quotes($GLOBALS['traduct']->get(167)) . ',
						CASE export WHEN 1 THEN ' . quotes($GLOBALS['traduct']->get(191)) . ' ELSE ' . quotes($GLOBALS['traduct']->get(192)) . ' END AS ' . quotes($GLOBALS['traduct']->get(168)) . ',
						CASE empty WHEN 1 THEN ' . quotes($GLOBALS['traduct']->get(191)) . ' ELSE ' . quotes($GLOBALS['traduct']->get(192)) . ' END AS ' . quotes($GLOBALS['traduct']->get(169)) . ',
						CASE del WHEN 1 THEN ' . quotes($GLOBALS['traduct']->get(191)) . ' ELSE ' . quotes($GLOBALS['traduct']->get(192)) . ' END AS ' . quotes($GLOBALS['traduct']->get(170)) . '
					FROM groupes;';
        include_once INCLUDE_LIB . 'SQLiteToGrid.class.php';
        $tabGroupe = new SQLiteToGrid($GLOBALS['db'], $query, 'PrivGroupe', true, 10, '95%');
        $tabGroupe->enableSortStyle(false);
        $tabGroupe->hideColumn(0);
        $tabGroupe->setGetVars('?action=auth');
        if ($tabGroupe->getNbRecord() <= 10) {
            $tabGroupe->disableNavBarre();
        }
        $tabGroupe->addCalcColumn($GLOBALS['traduct']->get(33), '	<a href="?action=auth&amp;auth_action=modifyGroupe&amp;groupe=#%0%#" class="Browse">' . displayPics('edit.png', $GLOBALS['traduct']->get(14)) . '</a>&nbsp;
											<a href="?action=auth&amp;auth_action=deleteGroupe&amp;groupe=#%0%#" class="Browse">' . displayPics('edittrash.png', $GLOBALS['traduct']->get(15)) . '</a>&nbsp;', 'center', 999);
        $tabGroupe->addCaption('bottom', '<a href="?action=auth&amp;auth_action=addGroupe" class="Browse">' . $GLOBALS['traduct']->get(160) . '</a>');
        $tabGroupe->disableOnClick();
        $tabGroupe->build();
        echo '<table align="center" class="Browse"><tr><td align="center" valign="top">';
        echo '<div class="Rights"><div style="text-align: center;">' . $GLOBALS['traduct']->get(161) . '</div>';
        $tabUser->show();
        if ($withFormUser) {
            echo '<hr style="border: 1px dashed black; width: 90%;">';
            $this->formUser();
        }
        if (isset($_REQUEST['auth_action']) && $_REQUEST['auth_action'] == 'passwdUser') {
            echo '<hr style="border: 1px dashed black; width: 90%;">';
            $this->changePasswd();
        }
        echo '</div></td>';
        echo '<td align="center" valign="top">';
        echo '<div class="Rights"><div align="center">' . $GLOBALS['traduct']->get(162) . '</div>';
        $tabGroupe->show();
        if ($withFormGroupe) {
            echo '<hr style="border: 1px dashed black; width: 90%;">';
            $this->formGroupe();
        }
        echo '</div></td></tr></table>';
    }
Beispiel #2
0
}
$SQLiteQuery = new sql($workDb, $DisplayQuery);
if ($sql_action != 'modify') {
    $error = $SQLiteQuery->verify(false);
} else {
    $error = false;
}
if ($SQLiteQuery->withReturn && !$error && $displayResult) {
    include_once INCLUDE_LIB . 'SQLiteToGrid.class.php';
    if (!empty($GLOBALS["table"])) {
        $linkItem = 'table=' . $GLOBALS["table"];
    } else {
        $linkItem = 'view=' . $GLOBALS["view"];
    }
    $accessResult = $SQLiteQuery->checkAccessResult($DisplayQuery);
    $DbGrid = new SQLiteToGrid($workDb->connId, $SQLiteQuery->query, 'Browse', true, BROWSE_NB_RECORD_PAGE, '70%');
    $DbGrid->enableSortStyle(false);
    $DbGrid->setGetVars('?dbsel=' . $GLOBALS['dbsel'] . '&amp;table=' . $table . '&amp;action=browseItem&amp;DisplayQuery=' . urlencode($DisplayQuery));
    if ($DbGrid->getNbRecord() <= BROWSE_NB_RECORD_PAGE) {
        $DbGrid->disableNavBarre();
    }
    if ($accessResult && (!$workDb->isReadOnly() && displayCondition('data'))) {
        if (displayCondition('del')) {
            $deleteLink = "<a href=\"main.php?dbsel=" . $GLOBALS["dbsel"] . "&amp;table=" . $accessResult . "&amp;action=deleteElement&amp;query=#%QUERY%#&amp;pos=#%POS%#&amp;currentPage=browseItem\" class=\"Browse\" target=\"main\">" . displayPics("deleterow.png", $GLOBALS["traduct"]->get(15)) . "</a>";
        } else {
            $deleteLink = displayPics("deleterow_off.png", $GLOBALS["traduct"]->get(15));
        }
        if (displayCondition('data')) {
            $modifyLink = "<a href=\"main.php?dbsel=" . $GLOBALS["dbsel"] . "&amp;table=" . $accessResult . "&amp;action=modifyElement&amp;query=#%QUERY%#&amp;pos=#%POS%#&amp;currentPage=browseItem\" class=\"Browse\" target=\"main\">" . displayPics("edit.png", $GLOBALS["traduct"]->get(14)) . "</a>";
        } else {
            $modifyLink = displayPics("edit_off.png", $GLOBALS["traduct"]->get(14));