Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e79fe04c69
@ -356,22 +356,23 @@ foreach ($tables as $keyname => $each_table) {
|
||||
$browse_table_label = '<a href="sql.php?' . $tbl_url_query . '&pos=0">' . $truename . '</a>';
|
||||
|
||||
if (! $db_is_information_schema) {
|
||||
$empty_table = '<a ';
|
||||
if ($GLOBALS['cfg']['AjaxEnable']) {
|
||||
$empty_table .= 'class="truncate_table_anchor"';
|
||||
}
|
||||
$empty_table .= ' href="sql.php?' . $tbl_url_query
|
||||
. '&sql_query=';
|
||||
$empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
|
||||
. '&message_to_show='
|
||||
. urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME'])))
|
||||
.'">';
|
||||
if ($may_have_rows) {
|
||||
$empty_table = '<a ';
|
||||
if ($GLOBALS['cfg']['AjaxEnable']) {
|
||||
$empty_table .= 'class="truncate_table_anchor"';
|
||||
}
|
||||
$empty_table .= ' href="sql.php?' . $tbl_url_query
|
||||
. '&sql_query=';
|
||||
$empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
|
||||
. '&message_to_show='
|
||||
. urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME'])))
|
||||
.'">';
|
||||
|
||||
$empty_table .= $titles['Empty'];
|
||||
$empty_table .= '</a>';
|
||||
} else {
|
||||
$empty_table .= $titles['NoEmpty'];
|
||||
$empty_table = $titles['NoEmpty'];
|
||||
}
|
||||
$empty_table .= '</a>';
|
||||
// truncating views doesn't work
|
||||
if ($table_is_view) {
|
||||
$empty_table = ' ';
|
||||
|
||||
@ -231,6 +231,7 @@ $js_messages['strCancel'] = __('Cancel');
|
||||
$js_messages['strLoading'] = __('Loading');
|
||||
$js_messages['strProcessingRequest'] = __('Processing Request');
|
||||
$js_messages['strErrorProcessingRequest'] = __('Error in Processing Request');
|
||||
$js_messages['strNoDatabasesSelected'] = __('No databases selected.');
|
||||
$js_messages['strDroppingColumn'] = __('Dropping Column');
|
||||
$js_messages['strAddingPrimaryKey'] = __('Adding Primary Key');
|
||||
$js_messages['strOK'] = __('OK');
|
||||
|
||||
69
js/server_databases.js
Normal file
69
js/server_databases.js
Normal file
@ -0,0 +1,69 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* @fileoverview functions used on the server databases list page
|
||||
* @name Server Databases
|
||||
*
|
||||
* @requires jQuery
|
||||
* @requires jQueryUI
|
||||
* @required js/functions.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* AJAX scripts for server_databases.php
|
||||
*
|
||||
* Actions ajaxified here:
|
||||
* Drop Databases
|
||||
*
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
/**
|
||||
* Attach Event Handler for 'Drop Databases'
|
||||
*
|
||||
* (see $GLOBALS['cfg']['AjaxEnable'])
|
||||
*/
|
||||
$("button[name=drop_selected_dbs].ajax").live('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $form = $(this.form);
|
||||
|
||||
/**
|
||||
* @var selected_dbs Array containing the names of the checked databases
|
||||
*/
|
||||
var selected_dbs = [];
|
||||
$form.find('input:checkbox:checked').each(function () {
|
||||
selected_dbs[selected_dbs.length] = 'DROP DATABASE `' + escapeHtml($(this).val()) + '`;';
|
||||
});
|
||||
if (! selected_dbs.length) {
|
||||
PMA_ajaxShowMessage(PMA_messages.strNoDatabasesSelected, 2000);
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question =
|
||||
PMA_messages.strDropDatabaseStrongWarning + ' '
|
||||
+ $.sprintf(PMA_messages.strDoYouReally, selected_dbs.join('<br />'));
|
||||
|
||||
$(this).PMA_confirm(
|
||||
question,
|
||||
$form.prop('action')
|
||||
+ '?' + $(this.form).serialize()
|
||||
+ '&drop_selected_dbs=1&is_js_confirmed=1&ajax_request=true',
|
||||
function(url) {
|
||||
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest, false);
|
||||
|
||||
$.post(url, function(data) {
|
||||
if(data.success == true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
if (window.parent && window.parent.frame_navigation) {
|
||||
window.parent.frame_navigation.location.reload();
|
||||
}
|
||||
$('#tableslistcontainer').load('server_databases.php form#dbStatsForm');
|
||||
}
|
||||
else {
|
||||
PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + ": " + data.error, false);
|
||||
}
|
||||
}); // end $.post()
|
||||
}); // end $.PMA_confirm()
|
||||
}) ; //end of Drop Database action
|
||||
}); // end $(document).ready()
|
||||
@ -263,6 +263,7 @@ $(document).ready(function() {
|
||||
displayPasswordGenerateButton();
|
||||
PMA_convertFootnotesToTooltips($div);
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
$div.find("input[autofocus]").focus();
|
||||
}); // end $.get()
|
||||
|
||||
});//end of Add New User AJAX event handler
|
||||
|
||||
@ -132,12 +132,14 @@ function editVariable(link)
|
||||
var mySaveLink = $(saveLink);
|
||||
var myCancelLink = $(cancelLink);
|
||||
var $cell = $(link).parent();
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
|
||||
$cell.addClass('edit');
|
||||
// remove edit link
|
||||
$cell.find('a.editLink').remove();
|
||||
|
||||
mySaveLink.click(function() {
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
$.get('server_variables.php?' + url_query, {
|
||||
ajax_request: true,
|
||||
type: 'setval',
|
||||
@ -146,6 +148,7 @@ function editVariable(link)
|
||||
}, function(data) {
|
||||
if (data.success) {
|
||||
$cell.html(data.variable);
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
} else {
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
$cell.html($cell.find('span.oldContent').html());
|
||||
@ -184,6 +187,7 @@ function editVariable(link)
|
||||
// Escape key
|
||||
if(event.keyCode == 27) myCancelLink.trigger('click');
|
||||
});
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
});
|
||||
|
||||
return false;
|
||||
|
||||
@ -874,7 +874,7 @@ class PMA_Tracker
|
||||
$result = self::parseQuery($query);
|
||||
|
||||
// Get database name
|
||||
$dbname = trim($GLOBALS['db'], '`');
|
||||
$dbname = trim(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', '`');
|
||||
// $dbname can be empty, for example when coming from Synchronize
|
||||
// and this is a query for the remote server
|
||||
if (empty($dbname)) {
|
||||
|
||||
@ -10,6 +10,9 @@
|
||||
*/
|
||||
require_once 'libraries/common.inc.php';
|
||||
|
||||
$GLOBALS['js_include'][] = 'server_databases.js';
|
||||
$GLOBALS['js_include'][] = 'functions.js';
|
||||
|
||||
require 'libraries/server_common.inc.php';
|
||||
if (! PMA_DRIZZLE) {
|
||||
include_once 'libraries/replication.inc.php';
|
||||
@ -85,11 +88,20 @@ if ((isset($_REQUEST['drop_selected_dbs']) || isset($_REQUEST['query_type']))
|
||||
$message = PMA_Message::error(__('No databases selected.'));
|
||||
} else {
|
||||
$action = 'server_databases.php';
|
||||
$submit_mult = 'drop_db' ;
|
||||
$submit_mult = 'drop_db';
|
||||
$err_url = 'server_databases.php?' . PMA_generate_common_url();
|
||||
if (isset($_REQUEST['selected_dbs'])) {
|
||||
if (isset($_REQUEST['selected_dbs'])
|
||||
&& !isset($_REQUEST['is_js_confirmed'])) {
|
||||
$selected_db = $_REQUEST['selected_dbs'];
|
||||
}
|
||||
if (isset($_REQUEST['is_js_confirmed'])) {
|
||||
$_REQUEST = array(
|
||||
'query_type' => $submit_mult,
|
||||
'selected' => $_REQUEST['selected_dbs'],
|
||||
'mult_btn' => __('Yes'),
|
||||
'db' => $GLOBALS['db'],
|
||||
'table' => $GLOBALS['table']);
|
||||
}
|
||||
include 'libraries/mult_submits.inc.php';
|
||||
unset($action, $submit_mult, $err_url, $selected_db, $GLOBALS['db']);
|
||||
if (empty($message)) {
|
||||
@ -101,7 +113,9 @@ if ((isset($_REQUEST['drop_selected_dbs']) || isset($_REQUEST['query_type']))
|
||||
$message = PMA_Message::success(_ngettext('%1$d database has been dropped successfully.', '%1$d databases have been dropped successfully.', $number_of_databases));
|
||||
$message->addParam($number_of_databases);
|
||||
}
|
||||
|
||||
}
|
||||
if ($GLOBALS['is_ajax_request'] && $message instanceof PMA_Message) {
|
||||
PMA_ajaxResponse($message, $message->isSuccess());
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,7 +296,7 @@ if ($databases_count > 0) {
|
||||
. '<a href="server_databases.php' . $common_url_query . '" onclick="if (unMarkAllRows(\'tabledatabases\')) return false;">' . "\n"
|
||||
. ' ' . __('Uncheck All') . '</a>' . "\n"
|
||||
. '<i>' . __('With selected:') . '</i>' . "\n";
|
||||
PMA_buttonOrImage('drop_selected_dbs', 'mult_submit', 'drop_selected_dbs', __('Drop'), 'b_deltbl.png');
|
||||
PMA_buttonOrImage('drop_selected_dbs', 'mult_submit' . ($cfg['AjaxEnable'] ? ' ajax' : ''), 'drop_selected_dbs', __('Drop'), 'b_deltbl.png');
|
||||
}
|
||||
|
||||
if (empty($dbstats)) {
|
||||
|
||||
@ -882,7 +882,7 @@ function PMA_displayLoginInformationFields($mode = 'new')
|
||||
: $GLOBALS['username']
|
||||
) . '"'
|
||||
)
|
||||
. ' onchange="pred_username.value = \'userdefined\';" />' . "\n"
|
||||
. ' onchange="pred_username.value = \'userdefined\';" autofocus="autofocus" />' . "\n"
|
||||
. '</div>' . "\n"
|
||||
. '<div class="item">' . "\n"
|
||||
. '<label for="select_pred_hostname">' . "\n"
|
||||
|
||||
@ -1334,32 +1334,32 @@ if (! isset($_REQUEST['submit_connect'])
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="even toggler remote-server">
|
||||
<td><?php echo __('Server'); ?></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_host" class="server-host" <?php echo $possibly_readonly; ?>/></td>
|
||||
<tr class="even toggler remote-server vmiddle">
|
||||
<td><label for="<?php echo $type; ?>_host"><?php echo __('Server'); ?></label></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_host" id="<?php echo $type; ?>_host" class="server-host" <?php echo $possibly_readonly; ?>/></td>
|
||||
</tr>
|
||||
<tr class="odd toggler remote-server">
|
||||
<td><?php echo __('Port'); ?></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_port" class="server-port" <?php echo $possibly_readonly; ?> value="3306" maxlength="5" size="5" /></td>
|
||||
<tr class="odd toggler remote-server vmiddle">
|
||||
<td><label for="<?php echo $type; ?>_port"><?php echo __('Port'); ?></label></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_port" id="<?php echo $type; ?>_port" class="server-port" <?php echo $possibly_readonly; ?> value="3306" maxlength="5" size="5" /></td>
|
||||
</tr>
|
||||
<tr class="even toggler remote-server">
|
||||
<td><?php echo __('Socket'); ?></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_socket" class="server-socket" <?php echo $possibly_readonly; ?>/></td>
|
||||
<tr class="even toggler remote-server vmiddle">
|
||||
<td><label for="<?php echo $type; ?>_socket"><?php echo __('Socket'); ?></label></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_socket" id="<?php echo $type; ?>_socket" class="server-socket" <?php echo $possibly_readonly; ?>/></td>
|
||||
</tr>
|
||||
<tr class="odd toggler remote-server">
|
||||
<td><?php echo __('User name'); ?></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_username" class="server-user" /></td>
|
||||
<tr class="odd toggler remote-server vmiddle">
|
||||
<td><label for="<?php echo $type; ?>_username"><?php echo __('User name'); ?></label></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_username" id="<?php echo $type; ?>_username" class="server-user" /></td>
|
||||
</tr>
|
||||
<tr class="even toggler remote-server">
|
||||
<td><?php echo __('Password'); ?></td>
|
||||
<td><input type="password" name="<?php echo $type; ?>_pass" class="server-pass" /> </td>
|
||||
<tr class="even toggler remote-server vmiddle">
|
||||
<td><label for="<?php echo $type; ?>_pass"><?php echo __('Password'); ?></label></td>
|
||||
<td><input type="password" name="<?php echo $type; ?>_pass" id="<?php echo $type; ?>_pass" class="server-pass" /> </td>
|
||||
</tr>
|
||||
<tr class="odd toggler remote-server">
|
||||
<td><?php echo __('Database'); ?></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_db" class="server-db" /></td>
|
||||
<tr class="odd toggler remote-server vmiddle">
|
||||
<td><label for="<?php echo $type; ?>_db"><?php echo __('Database'); ?></label></td>
|
||||
<td><input type="text" name="<?php echo $type; ?>_db" id="<?php echo $type; ?>_db" class="server-db" /></td>
|
||||
</tr>
|
||||
<tr class="even toggler current-server" style="display: none;">
|
||||
<td><?php echo __('Database'); ?></td>
|
||||
<tr class="even toggler current-server vmiddle" style="display: none;">
|
||||
<td><label for="<?php echo $type; ?>_db_sel"><?php echo __('Database'); ?></label></td>
|
||||
<td>
|
||||
<?php
|
||||
$options_list = '';
|
||||
@ -1374,7 +1374,7 @@ if (! isset($_REQUEST['submit_connect'])
|
||||
if (count($databases) == 0) {
|
||||
echo __('No databases');
|
||||
} else {
|
||||
echo '<select name="' . $type . '_db_sel">'
|
||||
echo '<select name="' . $type . '_db_sel" id="' . $type . '_db_sel">'
|
||||
. $options_list
|
||||
. '</select>';
|
||||
unset($options_list);
|
||||
|
||||
@ -175,14 +175,14 @@ function PMA_changePassAuthType($_url_params, $password)
|
||||
* Changes password cookie if required
|
||||
* Duration = till the browser is closed for password (we don't want this to be saved)
|
||||
*/
|
||||
if ($cfg['Server']['auth_type'] == 'cookie') {
|
||||
if ($GLOBALS['cfg']['Server']['auth_type'] == 'cookie') {
|
||||
$GLOBALS['PMA_Config']->setCookie('pmaPass-' . $server, PMA_blowfish_encrypt($password, $GLOBALS['cfg']['blowfish_secret']));
|
||||
}
|
||||
/**
|
||||
* For http auth. mode, the "back" link will also enforce new
|
||||
* authentication
|
||||
*/
|
||||
if ($cfg['Server']['auth_type'] == 'http') {
|
||||
if ($GLOBALS['cfg']['Server']['auth_type'] == 'http') {
|
||||
$_url_params['old_usr'] = 'relog';
|
||||
}
|
||||
return $_url_params;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user