Skip to content

Commit

Permalink
Merge pull request #153 from lem9/bug_3784
Browse files Browse the repository at this point in the history
Bug #3784 Disabling "Confirm DROP queries" in user preferences does not ...
  • Loading branch information
nijel committed Feb 6, 2013
2 parents 69fdf72 + bd38287 commit 22f4623
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion js/functions.js
Expand Up @@ -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;
}
Expand Down Expand Up @@ -3823,4 +3834,4 @@ AJAX.registerOnload('functions.js', function () {
$('a.login-link').live('click', function(e) {
e.preventDefault();
window.location.reload(true);
});
});
3 changes: 2 additions & 1 deletion libraries/Header.class.php
Expand Up @@ -219,7 +219,8 @@ public function getJsParams()
),
'pma_text_left_default_tab' => PMA_Util::getTitleForTarget(
$GLOBALS['cfg']['NavigationTreeDefaultTabTable']
)
),
'confirm' => $GLOBALS['cfg']['Confirm']
);
}

Expand Down

0 comments on commit 22f4623

Please sign in to comment.