Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-11-24 09:18:05 +01:00
commit 31d00c97b0
3 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,63 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Second authentication factor handling
*
* @package PhpMyAdmin
*/
namespace PhpMyAdmin\Plugins\TwoFactor;
use PhpMyAdmin\Plugins\TwoFactorPlugin;
use PhpMyAdmin\Template;
/**
* Invalid two-factor authentication showing that configured choice is not available.
*/
class Invalid extends TwoFactorPlugin
{
/**
* @var string
*/
public static $id = 'invalid';
/**
* Checks authentication, returns true on success
*
* @return boolean
*/
public function check()
{
return false;
}
/**
* Renders user interface to enter two-factor authentication
*
* @return string HTML code
*/
public function render()
{
return Template::get('login/twofactor/invalid')->render();
}
/**
* Get user visible name
*
* @return string
*/
public static function getName()
{
return 'Invalid two-factor authentication';
}
/**
* Get user visible description
*
* @return string
*/
public static function getDescription()
{
return 'Error fallback only!';
}
}

View File

@ -126,6 +126,8 @@ class TwoFactor
$result = 'PhpMyAdmin\\Plugins\\TwoFactorPlugin';
if (in_array($name, $this->_available)) {
$result = 'PhpMyAdmin\\Plugins\\TwoFactor\\' . ucfirst($name);
} elseif (! empty($name)) {
$result = 'PhpMyAdmin\\Plugins\\TwoFactor\\Invalid';
}
return $result;
}

View File

@ -0,0 +1,3 @@
<div class="error">
{% trans "The configured two factor authentication is not available, please install missing dependencies." %}
</div>