diff --git a/js/functions.js b/js/functions.js index 2e313c2d77..619b2ca4d1 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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); -}); \ No newline at end of file +}); diff --git a/libraries/Header.class.php b/libraries/Header.class.php index c295c47076..9ce2aabc8e 100644 --- a/libraries/Header.class.php +++ b/libraries/Header.class.php @@ -219,7 +219,8 @@ class PMA_Header ), 'pma_text_left_default_tab' => PMA_Util::getTitleForTarget( $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] - ) + ), + 'confirm' => $GLOBALS['cfg']['Confirm'] ); }