|
8 | 8 | use PhpMyAdmin\ConfigStorage\Relation; |
9 | 9 | use PhpMyAdmin\ConfigStorage\RelationCleanup; |
10 | 10 | use PhpMyAdmin\Controllers\AbstractController; |
11 | | -use PhpMyAdmin\Controllers\Database\PrivilegesController as DatabaseController; |
12 | | -use PhpMyAdmin\Controllers\Table\PrivilegesController as TableController; |
13 | 11 | use PhpMyAdmin\Core; |
14 | 12 | use PhpMyAdmin\DatabaseInterface; |
15 | 13 | use PhpMyAdmin\Html\Generator; |
|
26 | 24 | use function implode; |
27 | 25 | use function is_array; |
28 | 26 | use function is_string; |
29 | | -use function ob_get_clean; |
30 | | -use function ob_start; |
31 | 27 | use function str_replace; |
32 | 28 | use function urlencode; |
33 | 29 |
|
@@ -102,15 +98,7 @@ public function __invoke(): void |
102 | 98 | new Plugins($this->dbi) |
103 | 99 | ); |
104 | 100 |
|
105 | | - $databaseController = new DatabaseController($this->response, $this->template, $serverPrivileges, $this->dbi); |
106 | | - |
107 | | - $tableController = new TableController($this->response, $this->template, $serverPrivileges, $this->dbi); |
108 | | - |
109 | | - if ( |
110 | | - (isset($_GET['viewing_mode']) |
111 | | - && $_GET['viewing_mode'] === 'server') |
112 | | - && $relationParameters->configurableMenusFeature !== null |
113 | | - ) { |
| 101 | + if ($relationParameters->configurableMenusFeature !== null) { |
114 | 102 | $this->response->addHTML('<div class="container-fluid">'); |
115 | 103 | $this->render('server/privileges/subnav', [ |
116 | 104 | 'active' => 'privileges', |
@@ -371,26 +359,7 @@ public function __invoke(): void |
371 | 359 | /** |
372 | 360 | * Displays the links |
373 | 361 | */ |
374 | | - if (isset($_GET['viewing_mode']) && $_GET['viewing_mode'] === 'db') { |
375 | | - $GLOBALS['db'] = $_REQUEST['db'] = $_GET['checkprivsdb']; |
376 | | - |
377 | | - // Gets the database structure |
378 | | - $GLOBALS['sub_part'] = '_structure'; |
379 | | - ob_start(); |
380 | | - |
381 | | - [ |
382 | | - $GLOBALS['tables'], |
383 | | - $GLOBALS['num_tables'], |
384 | | - $GLOBALS['total_num_tables'], |
385 | | - $GLOBALS['sub_part'],,, |
386 | | - $GLOBALS['tooltip_truename'], |
387 | | - $GLOBALS['tooltip_aliasname'], |
388 | | - $GLOBALS['pos'], |
389 | | - ] = Util::getDbInfo($GLOBALS['db'], $GLOBALS['sub_part']); |
390 | | - |
391 | | - $content = ob_get_clean(); |
392 | | - $this->response->addHTML($content . "\n"); |
393 | | - } elseif (! empty($GLOBALS['message'])) { |
| 362 | + if (! empty($GLOBALS['message'])) { |
394 | 363 | $this->response->addHTML(Generator::getMessage($GLOBALS['message'])); |
395 | 364 | unset($GLOBALS['message']); |
396 | 365 | } |
@@ -420,22 +389,6 @@ public function __invoke(): void |
420 | 389 | $this->response->addHTML($serverPrivileges->getHtmlForAddUser( |
421 | 390 | Util::escapeMysqlWildcards(is_string($GLOBALS['dbname']) ? $GLOBALS['dbname'] : '') |
422 | 391 | )); |
423 | | - } elseif (isset($_GET['checkprivsdb']) && is_string($_GET['checkprivsdb'])) { |
424 | | - if (isset($_GET['checkprivstable']) && is_string($_GET['checkprivstable'])) { |
425 | | - $this->response->addHTML($tableController([ |
426 | | - 'checkprivsdb' => $_GET['checkprivsdb'], |
427 | | - 'checkprivstable' => $_GET['checkprivstable'], |
428 | | - ])); |
429 | | - $this->render('export_modal'); |
430 | | - } elseif ($this->response->isAjax() === true && empty($_REQUEST['ajax_page_request'])) { |
431 | | - $GLOBALS['message'] = Message::success(__('User has been added.')); |
432 | | - $this->response->addJSON('message', $GLOBALS['message']); |
433 | | - |
434 | | - return; |
435 | | - } else { |
436 | | - $this->response->addHTML($databaseController(['checkprivsdb' => $_GET['checkprivsdb']])); |
437 | | - $this->render('export_modal'); |
438 | | - } |
439 | 392 | } else { |
440 | 393 | if (isset($GLOBALS['dbname']) && ! is_array($GLOBALS['dbname'])) { |
441 | 394 | $GLOBALS['url_dbname'] = urlencode( |
@@ -488,11 +441,7 @@ public function __invoke(): void |
488 | 441 | } |
489 | 442 | } |
490 | 443 |
|
491 | | - if ( |
492 | | - ! isset($_GET['viewing_mode']) |
493 | | - || $_GET['viewing_mode'] !== 'server' |
494 | | - || $relationParameters->configurableMenusFeature === null |
495 | | - ) { |
| 444 | + if ($relationParameters->configurableMenusFeature === null) { |
496 | 445 | return; |
497 | 446 | } |
498 | 447 |
|
|
0 commit comments