BLUE
PHP 7.4.33
Path:
/usr/share/phpmyadmin/libraries/classes/Controllers/Preferences
Run
Logout
Edit File
Size: 3.30 KB
Close
/usr/share/phpmyadmin/libraries/classes/Controllers/Preferences/FeaturesController.php
Text
Base64
<?php declare(strict_types=1); namespace PhpMyAdmin\Controllers\Preferences; use PhpMyAdmin\Config; use PhpMyAdmin\Config\ConfigFile; use PhpMyAdmin\Config\Forms\User\FeaturesForm; use PhpMyAdmin\ConfigStorage\Relation; use PhpMyAdmin\Controllers\AbstractController; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\TwoFactor; use PhpMyAdmin\Url; use PhpMyAdmin\UserPreferences; use function define; use function ltrim; class FeaturesController extends AbstractController { /** @var UserPreferences */ private $userPreferences; /** @var Relation */ private $relation; /** @var Config */ private $config; public function __construct( ResponseRenderer $response, Template $template, UserPreferences $userPreferences, Relation $relation, Config $config ) { parent::__construct($response, $template); $this->userPreferences = $userPreferences; $this->relation = $relation; $this->config = $config; } public function __invoke(): void { global $cfg, $cf, $error, $tabHash, $hash, $server, $route; $cf = new ConfigFile($this->config->baseSettings); $this->userPreferences->pageInit($cf); $formDisplay = new FeaturesForm($cf, 1); if (isset($_POST['revert'])) { // revert erroneous fields to their default values $formDisplay->fixErrors(); $this->redirect('/preferences/features'); return; } $error = null; if ($formDisplay->process(false) && ! $formDisplay->hasErrors()) { // Load 2FA settings $twoFactor = new TwoFactor($cfg['Server']['user']); // save settings $result = $this->userPreferences->save($cf->getConfigArray()); // save back the 2FA setting only $twoFactor->save(); if ($result === true) { // reload config $this->config->loadUserPreferences(); $tabHash = $_POST['tab_hash'] ?? null; $hash = ltrim($tabHash, '#'); $this->userPreferences->redirect('index.php?route=/preferences/features', null, $hash); return; } $error = $result; } $this->addScriptFiles(['config.js']); $relationParameters = $this->relation->getRelationParameters(); $this->render('preferences/header', [ 'route' => $route, 'is_saved' => ! empty($_GET['saved']), 'has_config_storage' => $relationParameters->userPreferencesFeature !== null, ]); if ($formDisplay->hasErrors()) { $formErrors = $formDisplay->displayErrors(); } $this->render('preferences/forms/main', [ 'error' => $error ? $error->getDisplay() : '', 'has_errors' => $formDisplay->hasErrors(), 'errors' => $formErrors ?? null, 'form' => $formDisplay->getDisplay( true, Url::getFromRoute('/preferences/features'), ['server' => $server] ), ]); if ($this->response->isAjax()) { $this->response->addJSON('disableNaviSettings', true); } else { define('PMA_DISABLE_NAVI_SETTINGS', true); } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ExportController.php
3.29 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FeaturesController.php
3.30 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ImportController.php
3.29 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MainPanelController.php
3.30 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ManageController.php
10.04 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NavigationController.php
3.30 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SqlController.php
3.27 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TwoFactorController.php
2.45 KB
lrwxr-xr-x
2023-02-07 16:26:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).