BLUE
PHP 7.4.33
Path:
/usr/share/phpmyadmin/libraries/classes/Controllers/Preferences
Run
Logout
Edit File
Size: 2.45 KB
Close
/usr/share/phpmyadmin/libraries/classes/Controllers/Preferences/TwoFactorController.php
Text
Base64
<?php declare(strict_types=1); namespace PhpMyAdmin\Controllers\Preferences; use PhpMyAdmin\ConfigStorage\Relation; use PhpMyAdmin\Controllers\AbstractController; use PhpMyAdmin\Message; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\TwoFactor; use function __; use function count; class TwoFactorController extends AbstractController { /** @var Relation */ private $relation; public function __construct(ResponseRenderer $response, Template $template, Relation $relation) { parent::__construct($response, $template); $this->relation = $relation; } public function __invoke(): void { global $cfg, $route; $relationParameters = $this->relation->getRelationParameters(); echo $this->template->render('preferences/header', [ 'route' => $route, 'is_saved' => ! empty($_GET['saved']), 'has_config_storage' => $relationParameters->userPreferencesFeature !== null, ]); $twoFactor = new TwoFactor($cfg['Server']['user']); if (isset($_POST['2fa_remove'])) { if (! $twoFactor->check(true)) { echo $this->template->render('preferences/two_factor/confirm', [ 'form' => $twoFactor->render(), ]); return; } $twoFactor->configure(''); echo Message::rawNotice(__('Two-factor authentication has been removed.'))->getDisplay(); } elseif (isset($_POST['2fa_configure'])) { if (! $twoFactor->configure($_POST['2fa_configure'])) { echo $this->template->render('preferences/two_factor/configure', [ 'form' => $twoFactor->setup(), 'configure' => $_POST['2fa_configure'], ]); return; } echo Message::rawNotice(__('Two-factor authentication has been configured.'))->getDisplay(); } $backend = $twoFactor->getBackend(); echo $this->template->render('preferences/two_factor/main', [ 'enabled' => $twoFactor->isWritable(), 'num_backends' => count($twoFactor->getAvailable()), 'backend_id' => $backend::$id, 'backend_name' => $backend::getName(), 'backend_description' => $backend::getDescription(), 'backends' => $twoFactor->getAllBackends(), 'missing' => $twoFactor->getMissingDeps(), ]); } }
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).