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>';
    }