/** * 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&auth_action=modifyUser&user=#%0%#" class="Browse">' . displayPics('edit.png', $GLOBALS['traduct']->get(14)) . '</a> <a href="?action=auth&auth_action=deleteUser&user=#%0%#" class="Browse">' . displayPics('edittrash.png', $GLOBALS['traduct']->get(15)) . '</a> <a href="?action=auth&auth_action=passwdUser&user=#%0%#" class="Browse">' . displayPics('encrypted.png', $GLOBALS['traduct']->get(157)) . '</a> ', 'center', 999); $tabUser->addCaption('bottom', '<a href="?action=auth&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&auth_action=modifyGroupe&groupe=#%0%#" class="Browse">' . displayPics('edit.png', $GLOBALS['traduct']->get(14)) . '</a> <a href="?action=auth&auth_action=deleteGroupe&groupe=#%0%#" class="Browse">' . displayPics('edittrash.png', $GLOBALS['traduct']->get(15)) . '</a> ', 'center', 999); $tabGroupe->addCaption('bottom', '<a href="?action=auth&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>'; }
$DbGrid->setGetVars('?dbsel=' . $GLOBALS['dbsel'] . '&table=' . $table . '&action=browseItem&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"] . "&table=" . $accessResult . "&action=deleteElement&query=#%QUERY%#&pos=#%POS%#&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"] . "&table=" . $accessResult . "&action=modifyElement&query=#%QUERY%#&pos=#%POS%#&currentPage=browseItem\" class=\"Browse\" target=\"main\">" . displayPics("edit.png", $GLOBALS["traduct"]->get(14)) . "</a>"; } else { $modifyLink = displayPics("edit_off.png", $GLOBALS["traduct"]->get(14)); } $DbGrid->addCalcColumn($GLOBALS["traduct"]->get(33), "<div class=\"BrowseImages\">" . $modifyLink . " " . $deleteLink . "</div>", "center", 0); } $showTime = '<div class="time" align="center">' . $GLOBALS['traduct']->get(213) . ' ' . $SQLiteQuery->queryTime . ' ' . $GLOBALS['traduct']->get(214) . '</div>'; if ($allFullText) { $caption = '<a href="main.php?dbsel=' . $GLOBALS["dbsel"] . '&' . $linkItem . '&action=browseItem&fullText=0" target="main">' . displayPics("nofulltext.png", $GLOBALS['traduct']->get(225)) . '</a>'; } else { $caption = '<a href="?dbsel=' . $GLOBALS["dbsel"] . '&' . $linkItem . '&action=browseItem&fullText=1">' . displayPics("fulltext.png", $GLOBALS['traduct']->get(226)) . '</a>'; } if ($allHTML) { $capHTML = '<a href="main.php?dbsel=' . $GLOBALS["dbsel"] . '&' . $linkItem . '&action=browseItem&HTMLon=0" target="main">' . displayPics("HTML_on.png", "HTML") . '</a>'; } else { $capHTML = '<a href="main.php?dbsel=' . $GLOBALS["dbsel"] . '&' . $linkItem . '&action=browseItem&HTMLon=1" target="main">' . displayPics("HTML_off.png", "Texte") . '</a>'; } // $DbGrid->addCaption("top", '<div><div style="float: left">'.$caption.str_repeat(' ', 3).$capHTML.'</div>'.$showTime.'</div>'); $capTable = '<div><div style="float: left">' . $caption . str_repeat(' ', 3) . $capHTML . '</div>' . $showTime . '</div>'; $DbGrid->build();