Template/Update (Part 11)
* convert signin/signout functionality * implement 'log out all devices' option
This commit is contained in:
parent
b3ea80c6cc
commit
b3b790d424
17 changed files with 223 additions and 106 deletions
141
endpoints/account/signin.php
Normal file
141
endpoints/account/signin.php
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
/*
|
||||
2 modes
|
||||
A) show form
|
||||
B) execute login and forward to
|
||||
* self on failure
|
||||
* next on success
|
||||
*/
|
||||
|
||||
class AccountSigninResponse extends TemplateResponse
|
||||
{
|
||||
use TrGetNext;
|
||||
|
||||
protected string $template = 'text-page-generic';
|
||||
|
||||
protected array $expectedPOST = array(
|
||||
'username' => ['filter' => FILTER_CALLBACK, 'options' => [Util::class, 'validateLogin'] ],
|
||||
'password' => ['filter' => FILTER_CALLBACK, 'options' => [Util::class, 'validatePassword']],
|
||||
'remember_me' => ['filter' => FILTER_CALLBACK, 'options' => [self::class, 'checkRememberMe'] ]
|
||||
);
|
||||
protected array $expectedGET = array(
|
||||
'token' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-zA-Z0-9]{32}$/']],
|
||||
'next' => ['filter' => FILTER_SANITIZE_URL, 'flags' => FILTER_FLAG_STRIP_AOWOW ]
|
||||
);
|
||||
|
||||
private bool $success = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// if the user is logged in, goto user dashboard
|
||||
if (User::isLoggedIn())
|
||||
$this->forward('?user='.User::$username);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
$username = '';
|
||||
$message = '';
|
||||
|
||||
$this->title = [Lang::account('title')];
|
||||
|
||||
if ($this->_get['token'])
|
||||
{
|
||||
// coming from username recovery, prefill username
|
||||
if ($_ = DB::Aowow()->selectCell('SELECT `login` FROM ?_account WHERE `status` IN (?a) AND `token` = ? AND `statusTimer` > UNIX_TIMESTAMP()', [ACC_STATUS_RECOVER_USER, ACC_STATUS_OK], $this->_get['token']))
|
||||
$username = $_;
|
||||
}
|
||||
|
||||
$message = $this->doSignIn();
|
||||
if (!$this->success)
|
||||
User::destroy();
|
||||
else
|
||||
$this->forward($this->getNext(true));
|
||||
|
||||
$this->inputbox = ['inputbox-form-signin', array(
|
||||
'head' => Lang::account('doSignIn'),
|
||||
'action' => '?account=signin&next='.$this->getNext(),
|
||||
'error' => $message,
|
||||
'username' => $username,
|
||||
'rememberMe' => !!$this->_post['remember_me'],
|
||||
'hasRecovery' => Cfg::get('ACC_EXT_RECOVER_URL') || Cfg::get('ACC_AUTH_MODE') == AUTH_MODE_SELF,
|
||||
)];
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
|
||||
private function doSignIn() : string
|
||||
{
|
||||
if (is_null($this->_post['username']) && is_null($this->_post['password']))
|
||||
return '';
|
||||
|
||||
if (!$this->assertPOST('username'))
|
||||
return Lang::account('userNotFound');
|
||||
|
||||
if (!$this->assertPOST('password'))
|
||||
return Lang::account('wrongPass');
|
||||
|
||||
$error = match (User::authenticate($this->_post['username'], $this->_post['password']))
|
||||
{
|
||||
AUTH_OK, AUTH_BANNED => $this->onAuthSuccess(),
|
||||
// AUTH_BANNED => Lang::account('accBanned'); // ToDo: should this return an error? the actual account functionality should be blocked elsewhere
|
||||
AUTH_WRONGUSER => Lang::account('userNotFound'),
|
||||
AUTH_WRONGPASS => Lang::account('wrongPass'),
|
||||
AUTH_IPBANNED => Lang::account('loginExceeded', [Util::formatTime(Cfg::get('ACC_FAILED_AUTH_BLOCK') * 1000)]),
|
||||
AUTH_INTERNAL_ERR => Lang::main('intError'),
|
||||
default => Lang::main('intError')
|
||||
};
|
||||
|
||||
if (!$error)
|
||||
$this->success = true;
|
||||
|
||||
return $error;
|
||||
}
|
||||
|
||||
private function onAuthSuccess() : string
|
||||
{
|
||||
if (!User::$ip)
|
||||
{
|
||||
trigger_error('AccountSigninResponse::onAuthSuccess() - tried to login user without ip set', E_USER_ERROR);
|
||||
return Lang::main('intError');
|
||||
}
|
||||
|
||||
$email = filter_var($this->_post['username'], FILTER_VALIDATE_EMAIL);
|
||||
|
||||
// reset account status, update expiration
|
||||
$ok = DB::Aowow()->query('UPDATE ?_account SET `prevIP` = IF(`curIp` = ?, `prevIP`, `curIP`), `curIP` = IF(`curIp` = ?, `curIP`, ?), `status` = IF(`status` = ?d, `status`, 0), `statusTimer` = IF(`status` = ?d, `statusTimer`, 0), `token` = IF(`status` = ?d, `token`, "") WHERE { `email` = ? } { `login` = ? }',
|
||||
User::$ip, User::$ip, User::$ip,
|
||||
ACC_STATUS_NEW, ACC_STATUS_NEW, ACC_STATUS_NEW,
|
||||
$email ?: DBSIMPLE_SKIP,
|
||||
!$email ? $this->_post['username'] : DBSIMPLE_SKIP
|
||||
);
|
||||
|
||||
if (!is_int($ok)) // num updated fields or null on fail
|
||||
{
|
||||
trigger_error('AccountSigninResponse::onAuthSuccess() - failed to update account status', E_USER_ERROR);
|
||||
return Lang::main('intError');
|
||||
}
|
||||
|
||||
session_regenerate_id(true); // user status changed => regenerate id
|
||||
|
||||
// create new session entry
|
||||
DB::Aowow()->query('INSERT INTO ?_account_sessions (`userId`, `sessionId`, `created`, `expires`, `touched`, `deviceInfo`, `ip`, `status`) VALUES (?d, ?, ?d, ?d, ?d, ?, ?, ?d)',
|
||||
User::$id, session_id(), time(), $this->_post['remember_me'] ? 0 : time() + Cfg::get('SESSION_TIMEOUT_DELAY'), time(), User::$agent, User::$ip, SESSION_ACTIVE);
|
||||
|
||||
if (User::init()) // reinitialize the user
|
||||
User::save();
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
40
endpoints/account/signout.php
Normal file
40
endpoints/account/signout.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class AccountSignoutResponse extends TextResponse
|
||||
{
|
||||
use TrGetNext;
|
||||
|
||||
protected array $expectedGET = array(
|
||||
'next' => ['filter' => FILTER_SANITIZE_URL, 'flags' => FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH],
|
||||
'global' => ['filter' => FILTER_CALLBACK, 'options' => [self::class, 'checkEmptySet'] ]
|
||||
);
|
||||
|
||||
public function __construct(string $pageParam)
|
||||
{
|
||||
// if the user not is logged in goto login page
|
||||
if (!User::isLoggedIn())
|
||||
$this->forwardToSignIn();
|
||||
|
||||
parent::__construct($pageParam);
|
||||
}
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
if ($this->_get['global'])
|
||||
DB::Aowow()->query('UPDATE ?_account_sessions SET `touched` = ?d, `status` = ?d WHERE `userId` = ?d', time(), SESSION_FORCED_LOGOUT, User::$id);
|
||||
else
|
||||
DB::Aowow()->query('UPDATE ?_account_sessions SET `touched` = ?d, `status` = ?d WHERE `sessionId` = ?', time(), SESSION_LOGOUT, session_id());
|
||||
|
||||
User::destroy();
|
||||
|
||||
$this->redirectTo = $this->getNext(true);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -885,7 +885,7 @@ $lang = array(
|
|||
"Screenshot-Verwalter", "Video-Verwalter", "API-Partner", "Ausstehend"
|
||||
),
|
||||
// signIn
|
||||
'doSignIn' => "Mit Eurem AoWoW-Konto anmelden",
|
||||
'doSignIn' => "Mit Eurem Konto anmelden",
|
||||
'signIn' => "Anmelden",
|
||||
'user' => "Benutzername",
|
||||
'pass' => "Kennwort",
|
||||
|
|
@ -894,6 +894,8 @@ $lang = array(
|
|||
'forgotUser' => "Benutzername",
|
||||
'forgotPass' => "Kennwort",
|
||||
'accCreate' => 'Noch kein Konto? <a href="?account=signup">Jetzt eins erstellen!</a>',
|
||||
'resendMail' => "Bestätigungsmail erneut senden",
|
||||
'resendHint' => "Wenn Sie sich registriert haben, aber keine Bestätigungs-E-Mail erhalten haben, geben Sie Ihre E-Mail-Adresse unten ein und senden Sie das Formular ab. (Bitte überprüfen Sie Ihre Spam- oder Papierkorb-Ordner, um sicherzustellen, dass die E-Mail nicht versehentlich an der falschen Stelle abgelegt wurde!)",
|
||||
|
||||
// recovery
|
||||
'recoverUser' => "Benutzernamenanfrage",
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ $lang = array(
|
|||
"Screenshot manager", "Video manager", "API partner", "Pending"
|
||||
),
|
||||
// signIn
|
||||
'doSignIn' => "Log in to your AoWoW Account",
|
||||
'doSignIn' => "Log in to your Account",
|
||||
'signIn' => "Log In",
|
||||
'user' => "Username",
|
||||
'pass' => "Password",
|
||||
|
|
@ -894,6 +894,8 @@ $lang = array(
|
|||
'forgotUser' => "Username",
|
||||
'forgotPass' => "Password",
|
||||
'accCreate' => 'Don\'t have an account? <a href="?account=signup">Create one now!</a>',
|
||||
'resendMail' => "Re-Send Verification Email",
|
||||
'resendHint' => "If you registered but did not receive a verification email, enter your email address below and submit the form. (Please be sure to check your spam or trash folders to make sure the email didn't accidentally get put in the wrong place!)",
|
||||
|
||||
// recovery
|
||||
'recoverUser' => "Username Request",
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ $lang = array(
|
|||
"Gestor de Capturas de pantalla","Gestor de vídeos", "Partner de API", "Pendiente"
|
||||
),
|
||||
// signIn
|
||||
'doSignIn' => "Iniciar sesión con tu cuenta de Aowow",
|
||||
'doSignIn' => "Iniciar sesión con tu cuenta",
|
||||
'signIn' => "Iniciar sesión",
|
||||
'user' => "Nombre de usuario",
|
||||
'pass' => "Contraseña",
|
||||
|
|
@ -894,6 +894,8 @@ $lang = array(
|
|||
'forgotUser' => "Nombre de usuario",
|
||||
'forgotPass' => "Contraseña",
|
||||
'accCreate ' => '¿No tienes una cuenta? <a href="?account=signup">¡Crea una ahora!</a>',
|
||||
'resendMail' => "Reenviar correo de verificación",
|
||||
'resendHint' => "Si te has registrado pero no recibiste un correo de verificación, introduce tu dirección de correo más abajo y completa el formulario. (¡Por favor, asegúrate de comprobar tus directorios de correo no deseado o papelera por si el correo acabara en el lugar equivocado!)",
|
||||
|
||||
// recovery
|
||||
'recoverUser' => "Pedir nombre de usuario",
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ $lang = array(
|
|||
"Gestionnaire de capture d'écran","Gestionnaire de vidéos", "Partenaire API", "En attente"
|
||||
),
|
||||
// signIn
|
||||
'doSignIn' => "Connexion à votre compte Aowow",
|
||||
'doSignIn' => "Connexion à votre compte",
|
||||
'signIn' => "Connexion",
|
||||
'user' => "Nom d'utilisateur",
|
||||
'pass' => "Mot de passe",
|
||||
|
|
@ -894,6 +894,8 @@ $lang = array(
|
|||
'forgotUser' => "Nom d'utilisateur",
|
||||
'forgotPass' => "Mot de passe",
|
||||
'accCreate' => 'Vous n\'avez pas encore de compte ? <a href="/?account=signup">Créez-en un maintenant !</a>',
|
||||
'resendMail' => "Renvoyer le courriel de vérification",
|
||||
'resendHint' => "Si vous vous êtes enregistré mais n'avez pas reçu de courriel de vérification, entrez votre adresse électronique ci-dessous et validez le formulaire. (Assurez-vous de vérifier vos dossiers de courrier indésirable et votre corbeille pour vous assurer que le courriel ne s'y soit pas perdu !)",
|
||||
|
||||
// recovery
|
||||
'recoverUser' => "Demande de nom d'utilisateur",
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ $lang = array(
|
|||
"Менеджер изображений", "Менеджер видео", "API партнер", "Ожидающее"
|
||||
),
|
||||
// signIn
|
||||
'doSignIn' => "Войти в вашу учетную запись Aowow",
|
||||
'doSignIn' => "Войти в вашу учетную запись",
|
||||
'signIn' => "Вход",
|
||||
'user' => "Логин",
|
||||
'pass' => "Пароль",
|
||||
|
|
@ -894,6 +894,8 @@ $lang = array(
|
|||
'forgotUser' => "Имя пользователя",
|
||||
'forgotPass' => "Пароль",
|
||||
'accCreate' => 'У вас еще нет учетной записи? <a href="?account=signup">Зарегистрируйтесь прямо сейчас!</a>',
|
||||
'resendMail' => "Вновь выслать верификационное письмо",
|
||||
'resendHint' => "Если вы зарегистрировались, но не получили проверочного письма, пожалуйста, введите ваш email адрес ниже и подтвердите отправку формы. (Пожалуйста, удостоверьтесь, что Вы проверили папку со спамом и/или корзину Вашего почтового сервиса)",
|
||||
|
||||
// recovery
|
||||
'recoverUser' => "Запрос имени пользователя",
|
||||
|
|
|
|||
|
|
@ -894,6 +894,8 @@ $lang = array(
|
|||
'forgotUser' => "用户名",
|
||||
'forgotPass' => "密码",
|
||||
'accCreate' => '没有账号?<a href="?account=signup">现在创建一个!</a>',
|
||||
'resendMail' => "重新发送验证邮件",
|
||||
'resendHint' => "[If you registered but did not receive a verification email, enter your email address below and submit the form. (Please be sure to check your spam or trash folders to make sure the email didn't accidentally get put in the wrong place!)]",
|
||||
|
||||
// recovery
|
||||
'recoverUser' => "用户名需求",
|
||||
|
|
|
|||
|
|
@ -25,9 +25,7 @@ class AccountPage extends GenericPage
|
|||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $category = null;
|
||||
protected $validCats = array(
|
||||
'signin' => [false],
|
||||
'signup' => [false],
|
||||
'signout' => [true],
|
||||
'forgotpassword' => [false],
|
||||
'forgotusername' => [false]
|
||||
);
|
||||
|
|
@ -128,20 +126,6 @@ class AccountPage extends GenericPage
|
|||
}
|
||||
|
||||
$this->head = Lang::account('recoverUser');
|
||||
break;
|
||||
case 'signin':
|
||||
$this->tpl = 'acc-signIn';
|
||||
$this->next = $this->getNext();
|
||||
if ($this->_post['username'] || $this->_post['password'])
|
||||
{
|
||||
if ($err = $this->doSignIn())
|
||||
$this->error = $err;
|
||||
else
|
||||
header('Location: '.$this->getNext(true), true, 302);
|
||||
}
|
||||
else if ($this->_get['token'] && ($_ = DB::Aowow()->selectCell('SELECT `username` FROM ?_account WHERE `status` IN (?a) AND `token` = ? AND `statusTimer` > UNIX_TIMESTAMP()', [ACC_STATUS_RECOVER_USER, ACC_STATUS_OK], $this->_get['token'])))
|
||||
$this->user = $_;
|
||||
|
||||
break;
|
||||
case 'signup':
|
||||
if (!Cfg::get('ACC_ALLOW_REGISTER'))
|
||||
|
|
@ -180,10 +164,6 @@ class AccountPage extends GenericPage
|
|||
|
||||
$this->head = sprintf(Lang::account('register'), $nStep);
|
||||
break;
|
||||
case 'signout':
|
||||
DB::Aowow()->query('UPDATE ?_account_sessions SET `touched` = ?d, `status` = ?d WHERE `sessionId` = ?', time(), SESSION_LOGOUT, session_id());
|
||||
|
||||
User::destroy();
|
||||
default:
|
||||
header('Location: '.$this->getNext(true), true, 302);
|
||||
break;
|
||||
|
|
@ -347,60 +327,6 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
|||
return false;
|
||||
}
|
||||
|
||||
private function doSignIn()
|
||||
{
|
||||
// check username
|
||||
if (!User::isValidName($this->_post['username']))
|
||||
return Lang::account('userNotFound');
|
||||
|
||||
// check password
|
||||
if (!User::isValidPass($this->_post['password']))
|
||||
return Lang::account('wrongPass');
|
||||
|
||||
switch (User::authenticate($this->_post['username'], $this->_post['password']))
|
||||
{
|
||||
case AUTH_OK:
|
||||
if (!User::$ip)
|
||||
return Lang::main('intError');
|
||||
|
||||
// reset account status, update expiration
|
||||
DB::Aowow()->query('UPDATE ?_account SET `prevIP` = IF(`curIp` = ?, `prevIP`, `curIP`), `curIP` = IF(`curIp` = ?, `curIP`, ?), `status` = IF(`status` = ?d, `status`, 0), `statusTimer` = IF(`status` = ?d, `statusTimer`, 0), `token` = IF(`status` = ?d, `token`, "") WHERE LOWER(`username`) = LOWER(?)',
|
||||
User::$ip, User::$ip, User::$ip,
|
||||
ACC_STATUS_NEW, ACC_STATUS_NEW, ACC_STATUS_NEW,
|
||||
$this->_post['username']
|
||||
);
|
||||
|
||||
session_regenerate_id(true); // user status changed => regenerate id
|
||||
|
||||
// create new session entry
|
||||
DB::Aowow()->query('INSERT INTO ?_account_sessions (`userId`, `sessionId`, `created`, `expires`, `touched`, `deviceInfo`, `ip`, `status`) VALUES (?d, ?, ?d, ?d, ?d, ?, ?, ?d)',
|
||||
User::$id, session_id(), time(), $this->_post['remember_me'] ? 0 : time() + Cfg::get('SESSION_TIMEOUT_DELAY'), time(), User::$agent, User::$ip, SESSION_ACTIVE);
|
||||
|
||||
if (User::init()) // reinitialize the user
|
||||
User::save();
|
||||
|
||||
return;
|
||||
case AUTH_BANNED:
|
||||
if (User::init())
|
||||
User::save();
|
||||
return Lang::account('accBanned');
|
||||
case AUTH_WRONGUSER:
|
||||
User::destroy();
|
||||
return Lang::account('userNotFound');
|
||||
case AUTH_WRONGPASS:
|
||||
User::destroy();
|
||||
return Lang::account('wrongPass');
|
||||
case AUTH_IPBANNED:
|
||||
User::destroy();
|
||||
return sprintf(Lang::account('loginExceeded'), Util::formatTime(Cfg::get('ACC_FAILED_AUTH_BLOCK') * 1000));
|
||||
case AUTH_INTERNAL_ERR:
|
||||
User::destroy();
|
||||
return Lang::main('intError');
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private function doSignUp()
|
||||
{
|
||||
// check username
|
||||
|
|
|
|||
|
|
@ -535,7 +535,8 @@ var PageTemplate = new function()
|
|||
}
|
||||
|
||||
// Sign Out
|
||||
menu.push(['sign-out', LANG.signout, '?account=signout']);
|
||||
menu.push(['sign-out', LANG.signout, '?account=signout']);
|
||||
menu.push(['sign-out-global', LANG.logOutEverywhere, '?account=signout&global']);
|
||||
|
||||
Menu.add($link, menu);
|
||||
$link.addClass('hassubmenu');
|
||||
|
|
|
|||
|
|
@ -2605,6 +2605,7 @@ var LANG = {
|
|||
lastbluepost: "Letzter Blizzard-Forenbeitrag",
|
||||
level: "Stufe",
|
||||
location: "Standort",
|
||||
logOutEverywhere: "Alle Geräte abmelden",
|
||||
losses: "Niederlagen",
|
||||
members: "Mitglieder",
|
||||
model: "Modell",
|
||||
|
|
|
|||
|
|
@ -2653,6 +2653,7 @@ var LANG = {
|
|||
lastbluepost: "Last blue post",
|
||||
level: "Level",
|
||||
location: "Location",
|
||||
logOutEverywhere: "Log Out All Devices",
|
||||
losses: "Losses",
|
||||
members: "Members",
|
||||
model: "Model",
|
||||
|
|
|
|||
|
|
@ -2605,6 +2605,7 @@ var LANG = {
|
|||
lastbluepost: "Último mensaje azul",
|
||||
level: "Nivel",
|
||||
location: "Lugar",
|
||||
logOutEverywhere: "Desconectar de todos los dispositivos",
|
||||
losses: "Pérdidas",
|
||||
members: "Miembros",
|
||||
model: "Modelo",
|
||||
|
|
@ -2654,7 +2655,7 @@ var LANG = {
|
|||
settings: "Configuración",
|
||||
side: "Lado",
|
||||
signature: "Firma",
|
||||
signout: "Salir",
|
||||
signout: "Cerrar sesión",
|
||||
sockets: "Ranuras",
|
||||
source: "Fuente",
|
||||
skill: "Habilidad",
|
||||
|
|
|
|||
|
|
@ -2605,6 +2605,7 @@ var LANG = {
|
|||
lastbluepost: "Dernier sujet de Blizzard",
|
||||
level: "Niveau",
|
||||
location: "Lieu",
|
||||
logOutEverywhere: "Se déconnecter de tous les appareils",
|
||||
losses: "Pertes",
|
||||
members: "Membres",
|
||||
model: "Modèle",
|
||||
|
|
|
|||
|
|
@ -2605,6 +2605,7 @@ var LANG = {
|
|||
lastbluepost: "Последний блю-пост",
|
||||
level: "Уровень",
|
||||
location: "Местонахождение",
|
||||
logOutEverywhere: "Выйти на всех устройствах",
|
||||
losses: "Поражения",
|
||||
members: "Участники",
|
||||
model: "Модель",
|
||||
|
|
|
|||
|
|
@ -2652,6 +2652,7 @@ var LANG = {
|
|||
lastbluepost: "最新蓝贴",
|
||||
level: "等级",
|
||||
location: "地点",
|
||||
logOutEverywhere: "全局登出",
|
||||
losses: "损失",
|
||||
members: "成员",
|
||||
model: "模型",
|
||||
|
|
|
|||
|
|
@ -1,16 +1,10 @@
|
|||
<?php namespace Aowow; ?>
|
||||
|
||||
<?php $this->brick('header'); ?>
|
||||
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
<?php
|
||||
$this->brick('announcement');
|
||||
namespace Aowow\Template;
|
||||
|
||||
$this->brick('pageTemplate');
|
||||
use \Aowow\Lang;
|
||||
?>
|
||||
<div class="pad3"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function inputBoxValidate(f)
|
||||
{
|
||||
|
|
@ -32,22 +26,22 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<form action="?account=signin&next=<?=$this->next; ?>" method="post" onsubmit="return inputBoxValidate(this)">
|
||||
<form action="<?=$action ?? '.'; ?>" method="post" onsubmit="return inputBoxValidate(this)">
|
||||
<div class="inputbox" style="position: relative">
|
||||
<h1><?=Lang::account('doSignIn'); ?></h1>
|
||||
<div id="inputbox-error"><?=$this->error; ?></div>
|
||||
<h1><?=$head ?? ''; ?></h1>
|
||||
<div id="inputbox-error"><?=$error ?? ''; ?></div>
|
||||
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td align="right"><?=Lang::account('user').Lang::main('colon'); ?></td>
|
||||
<td><input type="text" name="username" value="<?=$this->user; ?>" id="username-generic" style="width: 10em" /></td>
|
||||
<td><input type="text" name="username" value="<?=$username ?? ''; ?>" id="username-generic" style="width: 10em" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><?=Lang::account('pass').Lang::main('colon'); ?></td>
|
||||
<td><input type="password" name="password" style="width: 10em" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="top"><input type="checkbox" name="remember_me" id="remember_me" value="yes" checked="checked" /></td>
|
||||
<td align="right" valign="top"><input type="checkbox" name="remember_me" id="remember_me" value="yes"<?=($rememberMe ?? '' ? ' checked="checked"' : ''); ?> /></td>
|
||||
<td>
|
||||
<label for="remember_me"><?=Lang::account('rememberMe'); ?></label>
|
||||
<div class="pad2"></div>
|
||||
|
|
@ -56,20 +50,17 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<div style="position: absolute; right: 5px; bottom: 5px;"><?=Lang::account('forgot').Lang::main('colon'); ?><a href="?account=forgotusername"><?=Lang::account('forgotUser'); ?></a> | <a href="?account=forgotpassword"><?=Lang::account('forgotPass'); ?></a></div>
|
||||
<?php if ($hasRecovery): ?>
|
||||
<br />
|
||||
<div style="position: absolute; right: 5px; bottom: 5px; white-space: nowrap;"><?=Lang::account('forgot').Lang::main('colon'); ?><a href="?account=forgotusername"><?=Lang::account('forgotUser'); ?></a> | <a href="?account=forgotpassword"><?=Lang::account('forgotPass'); ?></a> | <a href="?account=resend"><?=Lang::account('resendMail'); ?></a></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="pad3"></div>
|
||||
<?php
|
||||
if (Cfg::get('ACC_ALLOW_REGISTER')):
|
||||
echo ' <div style="text-align: center; line-height: 1.5em; font-size: 125%">'.Lang::account('accCreate')."</div>\n";
|
||||
endif;
|
||||
?>
|
||||
<?php if ($this->cfg('ACC_ALLOW_REGISTER')): ?>
|
||||
<div style="text-align: center; line-height: 1.5em; font-size: 125%"><?=Lang::account('accCreate'); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<script type="text/javascript">$WH.ge('username-generic').focus()</script>
|
||||
<div class="clear"></div>
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
<?php $this->brick('footer'); ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue