Conditional Ajax in Privileges
This commit is contained in:
@@ -19,6 +19,12 @@ $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
|
||||
|
||||
require './libraries/server_common.inc.php';
|
||||
|
||||
if ($GLOBALS['cfg']['AjaxEnable']) {
|
||||
$conditional_class = 'ajax';
|
||||
} else {
|
||||
$conditional_class = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Messages are built using the message name
|
||||
*/
|
||||
@@ -1346,7 +1352,7 @@ if (isset($_REQUEST['flush_privileges'])) {
|
||||
/**
|
||||
* defines some standard links
|
||||
*/
|
||||
$link_edit = '<a class="edit_user_anchor" href="server_privileges.php?' . $GLOBALS['url_query']
|
||||
$link_edit = '<a class="edit_user_anchor ' . $conditional_class . '" href="server_privileges.php?' . $GLOBALS['url_query']
|
||||
. '&username=%s'
|
||||
. '&hostname=%s'
|
||||
. '&dbname=%s'
|
||||
@@ -1363,7 +1369,7 @@ $link_revoke = '<a href="server_privileges.php?' . $GLOBALS['url_query']
|
||||
. PMA_getIcon('b_usrdrop.png', __('Revoke'))
|
||||
. '</a>';
|
||||
|
||||
$link_export = '<a class="export_user_anchor" href="server_privileges.php?' . $GLOBALS['url_query']
|
||||
$link_export = '<a class="export_user_anchor ' . $conditional_class . '" href="server_privileges.php?' . $GLOBALS['url_query']
|
||||
. '&username=%s'
|
||||
. '&hostname=%s'
|
||||
. '&initial=%s'
|
||||
@@ -1583,7 +1589,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
||||
|
||||
uksort($array_initials, "strnatcasecmp");
|
||||
|
||||
echo '<table id="initials_table" cellspacing="5"><tr>';
|
||||
echo '<table id="initials_table" class="' . $conditional_class . '" <cellspacing="5"><tr>';
|
||||
foreach ($array_initials as $tmp_initial => $initial_was_found) {
|
||||
if ($initial_was_found) {
|
||||
echo '<td><a href="server_privileges.php?' . $GLOBALS['url_query'] . '&initial=' . urlencode($tmp_initial) . '">' . $tmp_initial . '</a></td>' . "\n";
|
||||
@@ -1685,7 +1691,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
||||
|
||||
// add/delete user fieldset
|
||||
echo ' <fieldset id="fieldset_add_user">' . "\n"
|
||||
. ' <a href="server_privileges.php?' . $GLOBALS['url_query'] . '&adduser=1">' . "\n"
|
||||
. ' <a href="server_privileges.php?' . $GLOBALS['url_query'] . '&adduser=1" class="' . $conditional_class . '">' . "\n"
|
||||
. PMA_getIcon('b_usradd.png')
|
||||
. ' ' . __('Add a new User') . '</a>' . "\n"
|
||||
. ' </fieldset>' . "\n"
|
||||
@@ -1702,7 +1708,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
||||
. ' </label>' . "\n"
|
||||
. ' </fieldset>' . "\n"
|
||||
. ' <fieldset id="fieldset_delete_user_footer" class="tblFooters">' . "\n"
|
||||
. ' <input type="submit" name="delete" value="' . __('Go') . '" id="buttonGo" />' . "\n"
|
||||
. ' <input type="submit" name="delete" value="' . __('Go') . '" id="buttonGo" class="' . $conditional_class . '"/>' . "\n"
|
||||
. ' </fieldset>' . "\n"
|
||||
. '</form>' . "\n";
|
||||
} else {
|
||||
@@ -1720,7 +1726,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
||||
}
|
||||
|
||||
$flushnote = new PMA_Message(__('Note: phpMyAdmin gets the users\' privileges directly from MySQL\'s privilege tables. The content of these tables may differ from the privileges the server uses, if they have been changed manually. In this case, you should %sreload the privileges%s before you continue.'), PMA_Message::NOTICE);
|
||||
$flushnote->addParam('<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&flush_privileges=1" id="reload_privileges_anchor">', false);
|
||||
$flushnote->addParam('<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&flush_privileges=1" id="reload_privileges_anchor" class="' . $conditional_class . '">', false);
|
||||
$flushnote->addParam('</a>', false);
|
||||
$flushnote->display();
|
||||
}
|
||||
|
Reference in New Issue
Block a user