Merge branch 'master' of https://github.com/phpmyadmin/phpmyadmin into serverview_refactor

This commit is contained in:
xmujay 2013-07-29 22:13:55 +08:00
commit 81e8891cc5
86 changed files with 127276 additions and 112566 deletions

View File

@ -86,6 +86,7 @@
<arg line="
--ignore=*/php-gettext/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/PMAStandard/*,*/phpseclib/*,*/recaptchalib.php,*/swekey.php
--report=checkstyle
--extensions=php
--report-file='${basedir}/build/logs/checkstyle.xml'
--standard=PMAStandard
${source}" />

View File

@ -119,6 +119,15 @@ Basic settings
Show warning about incomplete translations on certain threshold.
.. config:option:: $cfg['AllowThirdPartyFraming']
:type: boolean
:default: false
Setting this to ``true`` allows phpMyAdmin to be included inside a frame,
and is a potential security hole allowing cross-frame scripting attacks or
clickjacking.
Server connection settings
--------------------------

View File

@ -125,7 +125,7 @@ if ($_POST == array() && $_GET == array()) {
*/
if (! in_array(
$format,
$format,
array(
'csv',
'ldi',
@ -606,12 +606,21 @@ if (isset($my_die)) {
if ($go_sql) {
// parse sql query
require_once 'libraries/parse_analyze.inc.php';
PMA_executeQueryAndSendQueryResponse(
$analyzed_sql_results, false, $db, $table, null, null, null, false, null,
null, null, null, $goto, $pmaThemeImage, null, null, null, $sql_query,
null, null
);
} else if ($result) {
$response = PMA_Response::getInstance();
$response->isSuccess(true);
$response->addJSON('message', PMA_Message::success($msg));
$response->addJSON('sql_query', PMA_Util::getMessage($msg, $sql_query, 'success'));
} else if ($result == false) {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', PMA_Message::error($msg));
} else {
$active_page = $goto;
include '' . $goto;

View File

@ -0,0 +1,9 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Conditionally included if framing is not allowed
*/
if(self == top) {
document.documentElement.style.display = 'block' ;
} else {
top.location = self.location ;
}

View File

@ -128,13 +128,13 @@ function PMA_current_version(data)
{
if (data && data.version && data.date) {
var current = parseVersionString(pmaversion);
var latest = parseVersionString(data['version']);
var version_information_message = PMA_messages.strLatestAvailable + ' ' + escapeHtml(data['version']);
var latest = parseVersionString(data.version);
var version_information_message = PMA_messages.strLatestAvailable + ' ' + escapeHtml(data.version);
if (latest > current) {
var message = $.sprintf(
PMA_messages.strNewerVersion,
escapeHtml(data['version']),
escapeHtml(data['date'])
escapeHtml(data.version),
escapeHtml(data.date)
);
var htmlClass = 'notice';
if (Math.floor(latest / 10000) === Math.floor(current / 10000)) {
@ -334,10 +334,10 @@ function confirmQuery(theForm1, sqlQuery1)
var do_confirm_re_2 = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i');
var do_confirm_re_3 = new RegExp('^\\s*TRUNCATE\\s', 'i');
if (do_confirm_re_0.test(sqlQuery1.value)
|| do_confirm_re_1.test(sqlQuery1.value)
|| do_confirm_re_2.test(sqlQuery1.value)
|| do_confirm_re_3.test(sqlQuery1.value)) {
if (do_confirm_re_0.test(sqlQuery1.value) ||
do_confirm_re_1.test(sqlQuery1.value) ||
do_confirm_re_2.test(sqlQuery1.value) ||
do_confirm_re_3.test(sqlQuery1.value)) {
var message = (sqlQuery1.value.length > 100)
? sqlQuery1.value.substr(0, 100) + '\n ...'
: sqlQuery1.value;
@ -1584,8 +1584,8 @@ function PMA_ajaxShowMessage(message, timeout)
* to the created AJAX message
*/
var $retval = $(
'<span class="ajax_notification" id="ajax_message_num_'
+ ajax_message_count +
'<span class="ajax_notification" id="ajax_message_num_' +
ajax_message_count +
'"></span>'
)
.hide()
@ -1876,9 +1876,9 @@ function PMA_SQLPrettyPrint(string)
}
// Normal indentatin and spaces for everything else
else {
if (! spaceExceptionsBefore[tokens[i][1]]
&& ! (i > 0 && spaceExceptionsAfter[tokens[i - 1][1]])
&& output.charAt(output.length - 1) != ' ') {
if (! spaceExceptionsBefore[tokens[i][1]] &&
! (i > 0 && spaceExceptionsAfter[tokens[i - 1][1]]) &&
output.charAt(output.length - 1) != ' ') {
output += " ";
}
if (tokens[i][0] == 'keyword') {
@ -1889,15 +1889,15 @@ function PMA_SQLPrettyPrint(string)
}
// split columns in select and 'update set' clauses, but only inside statements blocks
if ((lastStatementPart == 'select' || lastStatementPart == 'where' || lastStatementPart == 'set')
&& tokens[i][1] == ',' && blockStack[0] == 'statement') {
if ((lastStatementPart == 'select' || lastStatementPart == 'where' || lastStatementPart == 'set') &&
tokens[i][1] == ',' && blockStack[0] == 'statement') {
output += "\n" + tabs(indentLevel + 1);
}
// split conditions in where clauses, but only inside statements blocks
if (lastStatementPart == 'where'
&& (tokens[i][1] == 'and' || tokens[i][1] == 'or' || tokens[i][1] == 'xor')) {
if (lastStatementPart == 'where' &&
(tokens[i][1] == 'and' || tokens[i][1] == 'or' || tokens[i][1] == 'xor')) {
if (blockStack[0] == 'statement') {
output += "\n" + tabs(indentLevel + 1);
@ -2574,6 +2574,7 @@ AJAX.registerOnload('functions.js', function () {
// Get the name of the column that is being edited
var colname = $(this).closest('tr').find('input:first').val();
var title;
var i;
// And use it to make up a title for the page
if (colname.length < 1) {
title = PMA_messages.enum_newColumnVals;
@ -2597,7 +2598,7 @@ AJAX.registerOnload('functions.js', function () {
var values = [];
var in_string = false;
var curr, next, buffer = '';
for (var i = 0; i < inputstring.length; i++) {
for (i = 0; i < inputstring.length; i++) {
curr = inputstring.charAt(i);
next = i == inputstring.length ? '' : inputstring.charAt(i + 1);
if (! in_string && curr == "'") {
@ -2628,35 +2629,35 @@ AJAX.registerOnload('functions.js', function () {
}
// Add the parsed values to the editor
var drop_icon = PMA_getImage('b_drop.png');
for (var i = 0; i < values.length; i++) {
fields += "<tr><td>"
+ "<input type='text' value='" + values[i] + "'/>"
+ "</td><td class='drop'>"
+ drop_icon
+ "</td></tr>";
for (i = 0; i < values.length; i++) {
fields += "<tr><td>" +
"<input type='text' value='" + values[i] + "'/>" +
"</td><td class='drop'>" +
drop_icon +
"</td></tr>";
}
/**
* @var dialog HTML code for the ENUM/SET dialog
*/
var dialog = "<div id='enum_editor'>"
+ "<fieldset>"
+ "<legend>" + title + "</legend>"
+ "<p>" + PMA_getImage('s_notice.png')
+ PMA_messages.enum_hint + "</p>"
+ "<table class='values'>" + fields + "</table>"
+ "</fieldset><fieldset class='tblFooters'>"
+ "<table class='add'><tr><td>"
+ "<div class='slider'></div>"
+ "</td><td>"
+ "<form><div><input type='submit' class='add_value' value='"
+ $.sprintf(PMA_messages.enum_addValue, 1)
+ "'/></div></form>"
+ "</td></tr></table>"
+ "<input type='hidden' value='" // So we know which column's data is being edited
+ $(this).closest('td').find("input").attr("id")
+ "' />"
+ "</fieldset>"
+ "</div>";
var dialog = "<div id='enum_editor'>" +
"<fieldset>" +
"<legend>" + title + "</legend>" +
"<p>" + PMA_getImage('s_notice.png') +
PMA_messages.enum_hint + "</p>" +
"<table class='values'>" + fields + "</table>" +
"</fieldset><fieldset class='tblFooters'>" +
"<table class='add'><tr><td>" +
"<div class='slider'></div>" +
"</td><td>" +
"<form><div><input type='submit' class='add_value' value='" +
$.sprintf(PMA_messages.enum_addValue, 1) +
"'/></div></form>" +
"</td></tr></table>" +
"<input type='hidden' value='" + // So we know which column's data is being edited
$(this).closest('td').find("input").attr("id") +
"' />" +
"</fieldset>" +
"</div>";
/**
* @var Defines functions to be called when the buttons in
* the buttonOptions jQuery dialog bar are pressed
@ -2724,11 +2725,11 @@ AJAX.registerOnload('functions.js', function () {
while (num_new_rows--) {
$enum_editor_dialog.find('.values')
.append(
"<tr style='display: none;'><td>"
+ "<input type='text' />"
+ "</td><td class='drop'>"
+ PMA_getImage('b_drop.png')
+ "</td></tr>"
"<tr style='display: none;'><td>" +
"<input type='text' />" +
"</td><td class='drop'>" +
PMA_getImage('b_drop.png') +
"</td></tr>"
)
.find('tr:last')
.show('fast');
@ -2983,9 +2984,12 @@ function PMA_getRowNumber(classlist)
*/
function PMA_set_status_label($element)
{
var text = $element.css('display') == 'none'
? '+ '
: '- ';
var text;
if ($element.css('display') == 'none') {
text = '+ ';
} else {
text = '- ';
}
$element.closest('.slide-wrapper').prev().find('span').text(text);
}
@ -3326,8 +3330,8 @@ function PMA_slidingMessage(msg, $obj)
// we might have to create a new DOM node.
if ($('#PMA_slidingMessage').length === 0) {
$('#page_content').prepend(
'<span id="PMA_slidingMessage" '
+ 'style="display: inline-block;"></span>'
'<span id="PMA_slidingMessage" ' +
'style="display: inline-block;"></span>'
);
}
$obj = $('#PMA_slidingMessage');
@ -3698,17 +3702,17 @@ AJAX.registerOnload('functions.js', function () {
$(this).closest('.ui-dialog').find('.ui-button:first').click();
}
}); // end $.live()
var $elm = $('textarea[name="view[as]"]');
if ($elm.length > 0) {
if (typeof CodeMirror != 'undefined') {
syntaxHighlighter = CodeMirror.fromTextArea(
$elm[0],
$elm[0],
{
lineNumbers: true,
matchBrackets: true,
indentUnit: 4,
mode: "text/x-mysql",
lineNumbers: true,
matchBrackets: true,
indentUnit: 4,
mode: "text/x-mysql",
lineWrapping: true
}
);
@ -3804,6 +3808,7 @@ $(function () {
});
});
var checkboxes_sel = "input.checkall:checkbox:enabled";
/**
* Watches checkboxes in a form to set the checkall box accordingly
*/
@ -3824,7 +3829,6 @@ var checkboxes_changed = function () {
$checkall.prop({checked: false, indeterminate: false});
}
};
var checkboxes_sel = "input.checkall:checkbox:enabled";
$(checkboxes_sel).live("change", checkboxes_changed);
$("input.checkall_box").live("change", function () {

View File

@ -158,6 +158,12 @@ class PMA_Header
$this->_scripts->addFile('jquery/jquery.ba-hashchange-1.3.js');
$this->_scripts->addFile('jquery/jquery.debounce-1.0.5.js');
$this->_scripts->addFile('jquery/jquery.menuResizer-1.0.js');
// Cross-framing protection
if ($GLOBALS['cfg']['AllowThirdPartyFraming'] === false) {
$this->_scripts->addFile('cross_framing_protection.js');
}
$this->_scripts->addFile('rte.js');
// Here would not be a good place to add CodeMirror because
@ -450,6 +456,12 @@ class PMA_Header
*/
$GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
if (! defined('TESTSUITE')) {
/* Prevent against ClickJacking by disabling framing */
if (! $GLOBALS['cfg']['AllowThirdPartyFraming']) {
header(
'X-Frame-Options: DENY'
);
}
header(
"X-Content-Security-Policy: default-src 'self' "
. 'https://www.google.com '
@ -528,6 +540,7 @@ class PMA_Header
$retval = '<meta charset="utf-8" />';
$retval .= '<meta name="robots" content="noindex,nofollow" />';
$retval .= '<meta http-equiv="X-UA-Compatible" content="IE=Edge">';
$retval .= '<style>html{display: none;}</style>';
return $retval;
}

View File

@ -129,6 +129,7 @@ class PMA_Scripts
|| strpos($filename, 'ajax.js') !== false
|| strpos($filename, 'navigation.js') !== false
|| strpos($filename, 'get_image.js.php') !== false
|| strpos($filename, 'cross_framing_protection.js') !== false
) {
return 0;
} else {

View File

@ -83,6 +83,14 @@ $cfg['ReservedWordDisableWarning'] = false;
*/
$cfg['TranslationWarningThreshold'] = 80;
/**
* Allows phpMyAdmin to be included from a other document in a frame;
* setting this to true is a potential security hole
*
* @global boolean $cfg['AllowThirdPartyFraming']
*/
$cfg['AllowThirdPartyFraming'] = false;
/**
* The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
* at least one server configuration uses 'cookie' auth_type, enter here a

View File

@ -16,6 +16,8 @@ if (!function_exists('__')) {
$strConfigAllowArbitraryServer_desc = __('If enabled user can enter any MySQL server in login form for cookie auth');
$strConfigAllowArbitraryServer_name = __('Allow login to any MySQL server');
$strConfigAllowThirdPartyFraming_desc = __('Enabling this allows a page located on a different domain to call phpMyAdmin inside a frame, and is a potential [strong]security hole[/strong] allowing cross-frame scripting attacks');
$strConfigAllowThirdPartyFraming_name = __('Allow third party framing');
$strConfigAllowUserDropDatabase_name = __('Show &quot;Drop database&quot; link to normal users');
$strConfigblowfish_secret_desc = __('Secret passphrase used for encrypting cookies in [kbd]cookie[/kbd] authentication');
$strConfigblowfish_secret_name = __('Blowfish secret');

View File

@ -145,7 +145,8 @@ $forms['Features']['Other_core_settings'] = array(
'VersionCheck',
'VersionCheckProxyUrl',
'VersionCheckProxyUser',
'VersionCheckProxyPass'
'VersionCheckProxyPass',
'AllowThirdPartyFraming',
);
$forms['Sql_queries']['Sql_queries'] = array(
'ShowSQL',

View File

@ -87,7 +87,7 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false,
) {
global $import_run_buffer, $go_sql, $complete_query, $display_query,
$sql_query, $my_die, $error, $reload,
$last_query_with_results,
$last_query_with_results, $result, $msg,
$skip_queries, $executed_queries, $max_sql_len, $read_multiply,
$cfg, $sql_query_disabled, $db, $run_query, $is_superuser;
$read_multiply = 1;

View File

@ -3195,7 +3195,7 @@ function PMA_getHtmlForListingUsersofAGroup($userGroup)
if ($result) {
if ($GLOBALS['dbi']->numRows($result) == 0) {
$html_output .= '<p>'
. __('No users were found belonging to this user group')
. __('No users were found belonging to this user group.')
. '</p>';
} else {
$html_output .= '<table>'
@ -3367,7 +3367,7 @@ function PMA_getHtmlToEditUserGroup($userGroup = null)
. '</legend>';
if ($userGroup == null) {
$html_output .= '<label for="userGroup">' . __('Group name: ') . '</label>';
$html_output .= '<label for="userGroup">' . __('Group name:') . '</label>';
$html_output .= '<input type="text" name="userGroup" autocomplete="off" />';
$html_output .= '<div class="clearfloat"></div>';
}
@ -3399,7 +3399,7 @@ function PMA_getHtmlToEditUserGroup($userGroup = null)
}
$html_output .= _getTabList(
__('Sever level tabs'), 'server', $allowedTabs['server']
__('Server level tabs'), 'server', $allowedTabs['server']
);
$html_output .= _getTabList(
__('Database level tabs'), 'db', $allowedTabs['db']

View File

@ -1,7 +1,7 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Inlcude specialized String handling for phpMyAdmin
* Include specialized String handling for phpMyAdmin
*
* @package PhpMyAdmin-String
*/
@ -15,4 +15,4 @@ if (! defined('PHPMYADMIN')) {
require_once 'libraries/String.class.php';
$PMA_String = new PMA_String();
?>
?>

3244
po/af.po

File diff suppressed because it is too large Load Diff

3242
po/ar.po

File diff suppressed because it is too large Load Diff

3263
po/az.po

File diff suppressed because it is too large Load Diff

3317
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3266
po/bg.po

File diff suppressed because it is too large Load Diff

3268
po/bn.po

File diff suppressed because it is too large Load Diff

3260
po/br.po

File diff suppressed because it is too large Load Diff

3249
po/bs.po

File diff suppressed because it is too large Load Diff

3318
po/ca.po

File diff suppressed because it is too large Load Diff

3211
po/ckb.po

File diff suppressed because it is too large Load Diff

3264
po/cs.po

File diff suppressed because it is too large Load Diff

3272
po/cy.po

File diff suppressed because it is too large Load Diff

3304
po/da.po

File diff suppressed because it is too large Load Diff

3322
po/de.po

File diff suppressed because it is too large Load Diff

3315
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3299
po/es.po

File diff suppressed because it is too large Load Diff

3288
po/et.po

File diff suppressed because it is too large Load Diff

3267
po/eu.po

File diff suppressed because it is too large Load Diff

3253
po/fa.po

File diff suppressed because it is too large Load Diff

3299
po/fi.po

File diff suppressed because it is too large Load Diff

3316
po/fr.po

File diff suppressed because it is too large Load Diff

3735
po/gl.po

File diff suppressed because it is too large Load Diff

3290
po/he.po

File diff suppressed because it is too large Load Diff

3272
po/hi.po

File diff suppressed because it is too large Load Diff

3305
po/hr.po

File diff suppressed because it is too large Load Diff

3308
po/hu.po

File diff suppressed because it is too large Load Diff

3193
po/hy.po

File diff suppressed because it is too large Load Diff

3213
po/ia.po

File diff suppressed because it is too large Load Diff

3288
po/id.po

File diff suppressed because it is too large Load Diff

3324
po/it.po

File diff suppressed because it is too large Load Diff

3317
po/ja.po

File diff suppressed because it is too large Load Diff

3294
po/ka.po

File diff suppressed because it is too large Load Diff

3229
po/kk.po

File diff suppressed because it is too large Load Diff

3179
po/kn.po

File diff suppressed because it is too large Load Diff

3384
po/ko.po

File diff suppressed because it is too large Load Diff

3288
po/lt.po

File diff suppressed because it is too large Load Diff

3272
po/lv.po

File diff suppressed because it is too large Load Diff

3266
po/mk.po

File diff suppressed because it is too large Load Diff

3219
po/ml.po

File diff suppressed because it is too large Load Diff

3260
po/mn.po

File diff suppressed because it is too large Load Diff

3242
po/ms.po

File diff suppressed because it is too large Load Diff

3288
po/nb.po

File diff suppressed because it is too large Load Diff

3315
po/nl.po

File diff suppressed because it is too large Load Diff

3179
po/pa.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3317
po/pl.po

File diff suppressed because it is too large Load Diff

3295
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3287
po/ro.po

File diff suppressed because it is too large Load Diff

3322
po/ru.po

File diff suppressed because it is too large Load Diff

3294
po/si.po

File diff suppressed because it is too large Load Diff

3297
po/sk.po

File diff suppressed because it is too large Load Diff

3308
po/sl.po

File diff suppressed because it is too large Load Diff

3264
po/sq.po

File diff suppressed because it is too large Load Diff

3290
po/sr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3337
po/sv.po

File diff suppressed because it is too large Load Diff

3238
po/ta.po

File diff suppressed because it is too large Load Diff

3248
po/te.po

File diff suppressed because it is too large Load Diff

3263
po/th.po

File diff suppressed because it is too large Load Diff

3179
po/tk.po

File diff suppressed because it is too large Load Diff

3312
po/tr.po

File diff suppressed because it is too large Load Diff

3283
po/tt.po

File diff suppressed because it is too large Load Diff

3247
po/ug.po

File diff suppressed because it is too large Load Diff

3313
po/uk.po

File diff suppressed because it is too large Load Diff

3269
po/ur.po

File diff suppressed because it is too large Load Diff

3290
po/uz.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

3183
po/vls.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff