Merge pull request #153 from lem9/bug_3784

Bug #3784 Disabling "Confirm DROP queries" in user preferences does not ...
This commit is contained in:
Michal Čihař 2013-02-06 02:10:35 -08:00
commit 22f4623ae3
2 changed files with 14 additions and 2 deletions

View File

@ -1890,6 +1890,17 @@ function PMA_SQLPrettyPrint(string)
*/
jQuery.fn.PMA_confirm = function(question, url, callbackFn) {
var confirmState = PMA_commonParams.get('confirm');
// when the Confirm directive is set to false in config.inc.php
// and not changed in user prefs, confirmState is ""
// when it's unticked in user prefs, confirmState is 1
if (confirmState === "" || confirmState === "1") {
// user does not want to confirm
if ($.isFunction(callbackFn)) {
callbackFn.call(this, url);
return true;
}
}
if (PMA_messages['strDoYouReally'] == '') {
return true;
}
@ -3823,4 +3834,4 @@ AJAX.registerOnload('functions.js', function () {
$('a.login-link').live('click', function(e) {
e.preventDefault();
window.location.reload(true);
});
});

View File

@ -219,7 +219,8 @@ class PMA_Header
),
'pma_text_left_default_tab' => PMA_Util::getTitleForTarget(
$GLOBALS['cfg']['NavigationTreeDefaultTabTable']
)
),
'confirm' => $GLOBALS['cfg']['Confirm']
);
}