Related to https://github.com/phpmyadmin/phpmyadmin/pull/17427. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpMyAdmin\Controllers\Table;
|
|
|
|
use PhpMyAdmin\Controllers\AbstractController;
|
|
use PhpMyAdmin\DbTableExists;
|
|
use PhpMyAdmin\Url;
|
|
use PhpMyAdmin\Util;
|
|
|
|
use function __;
|
|
|
|
final class DropColumnConfirmationController extends AbstractController
|
|
{
|
|
public function __invoke(): void
|
|
{
|
|
$GLOBALS['urlParams'] = $GLOBALS['urlParams'] ?? null;
|
|
$GLOBALS['errorUrl'] = $GLOBALS['errorUrl'] ?? null;
|
|
|
|
$selected = $_POST['selected_fld'] ?? null;
|
|
|
|
if (empty($selected)) {
|
|
$this->response->setRequestStatus(false);
|
|
$this->response->addJSON('message', __('No column selected.'));
|
|
|
|
return;
|
|
}
|
|
|
|
$this->checkParameters(['db', 'table']);
|
|
|
|
$GLOBALS['urlParams'] = ['db' => $GLOBALS['db'], 'table' => $GLOBALS['table']];
|
|
$GLOBALS['errorUrl'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table');
|
|
$GLOBALS['errorUrl'] .= Url::getCommon($GLOBALS['urlParams'], '&');
|
|
|
|
DbTableExists::check($GLOBALS['db'], $GLOBALS['table']);
|
|
|
|
$this->render('table/structure/drop_confirm', [
|
|
'db' => $GLOBALS['db'],
|
|
'table' => $GLOBALS['table'],
|
|
'fields' => $selected,
|
|
]);
|
|
}
|
|
}
|