Merge remote-tracking branch 'security/security/278' into QA_4_9
This commit is contained in:
commit
9c14df7ec7
@ -156,8 +156,9 @@ if ($cf->getServerCount() > 0) {
|
||||
echo '<a href="' , Url::getCommon(array('page' => 'servers', 'mode' => 'edit', 'id' => $id)), '">'
|
||||
, __('Edit') , '</a>';
|
||||
echo ' | ';
|
||||
echo '<a href="' , Url::getCommon(array('page' => 'servers', 'mode' => 'remove', 'id' => $id)), '">'
|
||||
, __('Delete') , '</a>';
|
||||
echo '<a class="delete-server" href="' . Url::getCommon(array('page' => 'servers', 'mode' => 'remove', 'id' => $id));
|
||||
echo '" data-post="' . Url::getCommon(array('token' => $_SESSION[' PMA_token ']), '') . '">';
|
||||
echo __('Delete') . '</a>';
|
||||
echo '</small>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
@ -27,7 +27,7 @@ if ($mode == 'edit' && $server_exists) {
|
||||
$page_title = __('Edit server')
|
||||
. ' ' . $id
|
||||
. ' <small>(' . htmlspecialchars($cf->getServerDSN($id)) . ')</small>';
|
||||
} elseif ($mode == 'remove' && $server_exists) {
|
||||
} elseif ($mode == 'remove' && $server_exists && $_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$cf->removeServer($id);
|
||||
header('Location: index.php' . Url::getCommonRaw());
|
||||
exit;
|
||||
|
||||
@ -216,3 +216,13 @@ $(function () {
|
||||
//
|
||||
// END: User preferences allow/disallow UI
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
$(function () {
|
||||
$('.delete-server').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
$.post($this.attr('href'), $this.attr('data-post'), function () {
|
||||
window.location.replace('index.php');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user