Esempio n. 1
0
    /**
     * 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>';
    }
Esempio n. 2
0
        $caption = '<a href="?dbsel=' . $GLOBALS["dbsel"] . '&amp;' . $linkItem . '&amp;action=browseItem&amp;fullText=1">' . displayPics("fulltext.png", $GLOBALS['traduct']->get(226)) . '</a>';
    }
    if ($allHTML) {
        $capHTML = '<a href="main.php?dbsel=' . $GLOBALS["dbsel"] . '&amp;' . $linkItem . '&amp;action=browseItem&amp;HTMLon=0" target="main">' . displayPics("HTML_on.png", "HTML") . '</a>';
    } else {
        $capHTML = '<a href="main.php?dbsel=' . $GLOBALS["dbsel"] . '&amp;' . $linkItem . '&amp;action=browseItem&amp;HTMLon=1" target="main">' . displayPics("HTML_off.png", "Texte") . '</a>';
    }
    //    $DbGrid->addCaption("top", '<div><div style="float: left">'.$caption.str_repeat('&nbsp;', 3).$capHTML.'</div>'.$showTime.'</div>');
    $capTable = '<div><div style="float: left">' . $caption . str_repeat('&nbsp;', 3) . $capHTML . '</div>' . $showTime . '</div>';
    $DbGrid->build();
    if (!isset($noDisplay) || !$noDisplay) {
        displayQuery($DbGrid->getRealQuery());
    }
    if ($DbGrid->getNbRecord()) {
        echo '<table align="center"><tr><td>' . $capTable . '</td></tr><tr><td>';
        $DbGrid->show();
        echo '<!-- browse.php -->' . "\n";
        echo '<div class="BrowseOptions">';
        if (empty($view) && (!$workDb->isReadOnly() && displayCondition("properties"))) {
            echo '<hr width="60%">
					<form name="addView" action="main.php?dbsel=' . $GLOBALS['dbsel'] . '" method="POST" target="main">
					<table class="BrowseOption"><tr><td>
					&nbsp;&raquo;&nbsp;' . $GLOBALS['traduct']->get(97) . '
					<input type="text" class="text" name="ViewName" value="" /> ' . $GLOBALS['traduct']->get(98) . '
					<input class="button" type="submit" value="' . $GLOBALS['traduct']->get(69) . '" />
					</td></tr></table>
					<input type="hidden" name="action" value="save" />
					<input type="hidden" name="ViewProp" value="' . urlencode($DisplayQuery) . '" />
					</form>';
        }
        if ($accessResult && displayCondition('export')) {