credential_id = $credential_id;
$this->accounts = $accounts;
$this->password_hash = $password_hash;
}
function credentials() {
$password = $this->verifiedPassword(Adminer\get_password());
if ($password !== null) {
// the server doesn't know the password derived from the passkey so send only the stored password, empty for servers not requiring it
return array(Adminer\SERVER, $_GET["username"], $password);
}
}
function login($login, $password) {
if ($this->verifiedPassword($password) !== null) {
return true; // the passkey has verified the user
}
if ($this->password_hash != "") {
return $this->lang('Log in with the passkey.');
}
}
/** Get the stored password from the password verified by the passkey
* @param string|false|null $password the password derived from the passkey, a colon and the stored password
* @return string|null null if the passkey has not verified the password
*/
protected function verifiedPassword($password) {
if ($this->password_hash != "" && is_string($password) && preg_match('~^([0-9a-f]{64}):~', $password, $match) && hash('sha256', $match[1]) === $this->password_hash) {
return substr($password, strlen($match[0]));
}
}
function loginFormField($name, $heading, $value) {
if ($name == 'db') { // the last field, the row is printed right above the submit button
ob_start();
$this->printRow();
return $heading . $value . "\n" . ob_get_clean();
}
}
/** Print the login form row with the passkey buttons; the buttons are displayed only if the passkey can be used, otherwise the requirements are */
protected function printRow() {
// 1 - JSON_HEX_TAG because the values are printed to a script element, 256 - JSON_UNESCAPED_UNICODE
$lang = json_encode(array(
'unsupported' => $this->lang('The passkey does not support storing passwords.'),
'invalid' => $this->lang('The accounts cannot be decrypted by this passkey.'),
'browser' => $this->lang('This browser does not support passkeys.'),
), 1 | 256);
?>
array(
'' => 'Vyžaduje k přihlášení passkey, ve které jsou uložená hesla',
'Unlock with passkey' => 'Odemknout pomocí passkey',
'Set up passkey' => 'Nastavit passkey',
'Fill in the login form and add it to the passkey.' => 'Vyplňte přihlašovací formulář a přidejte ho do passkey.',
'Label' => 'Popis',
'Add to passkey' => 'Přidat do passkey',
'Passkeys require HTTPS and JavaScript.' => 'Passkey vyžaduje HTTPS a JavaScript.',
'This browser does not support passkeys.' => 'Tento prohlížeč nepodporuje passkey.',
'Add this line to %s:' => 'Přidejte tento řádek do %s:',
'The passkey does not support storing passwords.' => 'Tato passkey neumí ukládat hesla.',
'The accounts cannot be decrypted by this passkey.' => 'Touto passkey se přístupy nepodařilo dešifrovat.',
'Log in with the passkey.' => 'Přihlaste se pomocí passkey.',
),
'de' => array(
'' => 'Anmeldung nur mit einem Passkey, der die Passwörter enthält', // Claude Opus 5
),
'ja' => array(
'' => 'パスワードを保存したパスキーでのみログイン', // Claude Opus 5
),
'pl' => array(
'' => 'Logowanie wyłącznie za pomocą passkey przechowującego hasła', // Claude Opus 5
),
'ro' => array(
'' => 'Autentificare doar cu un passkey care conține parolele', // Claude Opus 5
),
'sk' => array(
'' => 'Prihlásenie iba pomocou passkey, ktorý obsahuje heslá', // Claude Opus 5
),
'zh' => array(
'' => '仅使用保存了密码的通行密钥登录', // Claude Opus 5
'Log in with the passkey.' => '使用通行密钥登录。', // Claude Opus 5
'The passkey does not support storing passwords.' => '此通行密钥不支持保存密码。', // Claude Opus 5
'The accounts cannot be decrypted by this passkey.' => '无法用此通行密钥解密这些账号。', // Claude Opus 5
'This browser does not support passkeys.' => '此浏览器不支持通行密钥。', // Claude Opus 5
'Unlock with passkey' => '用通行密钥解锁', // Claude Opus 5
'Set up passkey' => '设置通行密钥', // Claude Opus 5
'Passkeys require HTTPS and JavaScript.' => '通行密钥需要 HTTPS 和 JavaScript。', // Claude Opus 5
'Fill in the login form and add it to the passkey.' => '填写登录表单并将其添加到通行密钥。', // Claude Opus 5
'Label' => '标签', // Claude Opus 5
'Add to passkey' => '添加到通行密钥', // Claude Opus 5
'Add this line to %s:' => '把这一行添加到 %s:', // Claude Opus 5
),
);
}