diff options
| author | 2019-10-31 18:15:47 +0100 | |
|---|---|---|
| committer | 2019-10-31 18:15:47 +0100 | |
| commit | 3aa66f317b496ccd9a2df914bbc747c52081a7ad (patch) | |
| tree | 6a3f3f74899801abdca00546e213dfdc141c53cf /app/views/auth | |
| parent | 82611c9622ed23b0e9fcf5f9f651ddffa1fd7706 (diff) | |
| parent | fcae48f313d399050cb15f37a8a73ae52fc67796 (diff) | |
Merge pull request #2599 from FreshRSS/dev1.15.0
FreshRSS 1.15
Diffstat (limited to 'app/views/auth')
| -rw-r--r-- | app/views/auth/formLogin.phtml | 22 | ||||
| -rw-r--r-- | app/views/auth/index.phtml | 40 | ||||
| -rw-r--r-- | app/views/auth/register.phtml | 42 |
3 files changed, 61 insertions, 43 deletions
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml index 01d1d4736..ecac7aced 100644 --- a/app/views/auth/formLogin.phtml +++ b/app/views/auth/formLogin.phtml @@ -1,33 +1,33 @@ <div class="prompt"> - <h1><?php echo _t('gen.auth.login'); ?></h1> + <h1><?= _t('gen.auth.login') ?></h1> <?php if (!max_registrations_reached()) { ?> - <a href="<?php echo _url('auth', 'register'); ?>"><?php echo _t('gen.auth.registration.ask'); ?></a> + <a href="<?= _url('auth', 'register') ?>"><?= _t('gen.auth.registration.ask') ?></a> <?php } ?> - <form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <form id="crypto-form" method="post" action="<?= _url('auth', 'login') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <div> - <label for="username"><?php echo _t('gen.auth.username'); ?></label> - <input type="text" id="username" name="username" autocomplete="username" size="16" required="required" pattern="<?php echo FreshRSS_user_Controller::USERNAME_PATTERN; ?>" autofocus="autofocus" /> + <label for="username"><?= _t('gen.auth.username') ?></label> + <input type="text" id="username" name="username" autocomplete="username" size="16" required="required" pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" autofocus="autofocus" /> </div> <div> - <label for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <label for="passwordPlain"><?= _t('gen.auth.password') ?></label> <input type="password" id="passwordPlain" required="required" /> <input type="hidden" id="challenge" name="challenge" /><br /> - <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + <noscript><strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </div> <div> <label class="checkbox" for="keep_logged_in"> <input type="checkbox" name="keep_logged_in" id="keep_logged_in" value="1" /> - <?php echo _t('gen.auth.keep_logged_in', $this->cookie_days); ?> + <?= _t('gen.auth.keep_logged_in', $this->cookie_days) ?> </label> <br /> </div> <div> - <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('gen.auth.login'); ?></button> + <button id="loginButton" type="submit" class="btn btn-important"><?= _t('gen.auth.login') ?></button> </div> </form> - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> + <p><a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a></p> </div> diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml index 20966f24e..c1cf95b2b 100644 --- a/app/views/auth/index.phtml +++ b/app/views/auth/index.phtml @@ -1,22 +1,22 @@ <?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <form method="post" action="<?php echo _url('auth', 'index'); ?>"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> - <legend><?php echo _t('admin.auth.type'); ?></legend> + <form method="post" action="<?= _url('auth', 'index') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('admin.auth.type') ?></legend> <div class="form-group"> - <label class="group-name" for="auth_type"><?php echo _t('admin.auth.type'); ?></label> + <label class="group-name" for="auth_type"><?= _t('admin.auth.type') ?></label> <div class="group-controls"> - <select id="auth_type" name="auth_type" required="required" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->auth_type; ?>"> + <select id="auth_type" name="auth_type" required="required" data-leave-validation="<?= FreshRSS_Context::$system_conf->auth_type ?>"> <?php if (!in_array(FreshRSS_Context::$system_conf->auth_type, array('form', 'http_auth', 'none'))) { ?> <option selected="selected"></option> <?php } ?> - <option value="form"<?php echo FreshRSS_Context::$system_conf->auth_type === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo _t('admin.auth.form'); ?></option> - <option value="http_auth"<?php echo FreshRSS_Context::$system_conf->auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('admin.auth.http'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> - <option value="none"<?php echo FreshRSS_Context::$system_conf->auth_type === 'none' ? ' selected="selected"' : ''; ?>><?php echo _t('admin.auth.none'); ?></option> + <option value="form"<?= FreshRSS_Context::$system_conf->auth_type === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"' ?>><?= _t('admin.auth.form') ?></option> + <option value="http_auth"<?= FreshRSS_Context::$system_conf->auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : '' ?>><?= _t('admin.auth.http') ?> (REMOTE_USER = '<?= httpAuthUser() ?>')</option> + <option value="none"<?= FreshRSS_Context::$system_conf->auth_type === 'none' ? ' selected="selected"' : '' ?>><?= _t('admin.auth.none') ?></option> </select> </div> </div> @@ -25,8 +25,8 @@ <div class="group-controls"> <label class="checkbox" for="anon_access"> <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo FreshRSS_Context::$system_conf->allow_anonymous ? ' checked="checked"' : '', - FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->allow_anonymous; ?>"/> - <?php echo _t('admin.auth.allow_anonymous', FreshRSS_Context::$system_conf->default_user); ?> + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->allow_anonymous ?>"/> + <?= _t('admin.auth.allow_anonymous', FreshRSS_Context::$system_conf->default_user) ?> </label> </div> </div> @@ -35,8 +35,8 @@ <div class="group-controls"> <label class="checkbox" for="anon_refresh"> <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo FreshRSS_Context::$system_conf->allow_anonymous_refresh ? ' checked="checked"' : '', - FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->allow_anonymous_refresh; ?>"/> - <?php echo _t('admin.auth.allow_anonymous_refresh'); ?> + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->allow_anonymous_refresh ?>"/> + <?= _t('admin.auth.allow_anonymous_refresh') ?> </label> </div> </div> @@ -45,9 +45,9 @@ <div class="group-controls"> <label class="checkbox" for="unsafe_autologin"> <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?php echo FreshRSS_Context::$system_conf->unsafe_autologin_enabled ? ' checked="checked"' : '', - FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->unsafe_autologin_enabled; ?>"/> - <?php echo _t('admin.auth.unsafe_autologin'); ?> - <kbd><?php echo Minz_Url::display(array('c' => 'auth', 'a' => 'login', 'params' => array('u' => 'alice', 'p' => '1234')), 'html', true); ?></kbd> + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->unsafe_autologin_enabled ?>"/> + <?= _t('admin.auth.unsafe_autologin') ?> + <kbd><?= Minz_Url::display(array('c' => 'auth', 'a' => 'login', 'params' => array('u' => 'alice', 'p' => '1234')), 'html', true) ?></kbd> </label> </div> </div> @@ -56,16 +56,16 @@ <div class="group-controls"> <label class="checkbox" for="api_enabled"> <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?php echo FreshRSS_Context::$system_conf->api_enabled ? ' checked="checked"' : '', - FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->api_enabled; ?>"/> - <?php echo _t('admin.auth.api_enabled'); ?> + FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->api_enabled ?>"/> + <?= _t('admin.auth.api_enabled') ?> </label> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> - <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> </div> </div> </form> diff --git a/app/views/auth/register.phtml b/app/views/auth/register.phtml index 19e11ef76..4233f7fd4 100644 --- a/app/views/auth/register.phtml +++ b/app/views/auth/register.phtml @@ -1,22 +1,40 @@ <div class="prompt"> - <h1><?php echo _t('gen.auth.registration'); ?></h1> + <h1><?= _t('gen.auth.registration') ?></h1> - <form method="post" action="<?php echo _url('user', 'create'); ?>"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <form method="post" action="<?= _url('user', 'create') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <div> - <label class="group-name" for="new_user_name"><?php echo _t('gen.auth.username'), '<br />', _i('help'), ' ', _t('gen.auth.username.format'); ?></label> - <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" autocomplete="off" pattern="<?php echo FreshRSS_user_Controller::USERNAME_PATTERN; ?>" /> + <label class="group-name" for="new_user_name"><?= _t('gen.auth.username'), '<br />', _i('help'), ' ', _t('gen.auth.username.format') ?></label> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" autocomplete="off" pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" /> </div> + <?php if ($this->show_email_field) { ?> + <div> + <label class="group-name" for="new_user_email"> + <?= _t('gen.auth.email') ?> + </label> + <input id="new_user_email" name="new_user_email" type="email" required /> + </div> + <?php } ?> + <div> - <label class="group-name" for="new_user_passwordPlain"><?php echo _t('gen.auth.password'), '<br />', _i('help'), ' ', _t('gen.auth.password.format'); ?></label> + <label class="group-name" for="new_user_passwordPlain"><?= _t('gen.auth.password'), '<br />', _i('help'), ' ', _t('gen.auth.password.format') ?></label> <div class="stick"> <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" required="required" autocomplete="new-password" pattern=".{7,}" /> - <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?php echo _i('key'); ?></a> + <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?= _i('key') ?></a> </div> - <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + <noscript><b><?= _t('gen.js.should_be_activated') ?></b></noscript> </div> + <?php if ($this->show_tos_checkbox) { ?> + <div> + <label class="checkbox" for="accept-tos"> + <input type="checkbox" name="accept_tos" id="accept-tos" value="1" required /> + <?= _t('gen.auth.accept_tos', _url('index', 'tos')) ?> + </label> + </div> + <?php } ?> + <div> <?php $redirect_url = urlencode(Minz_Url::display( @@ -24,11 +42,11 @@ 'php', true )); ?> - <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" /> - <button type="submit" class="btn btn-important"><?php echo _t('gen.action.create'); ?></button> - <a class="btn" href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.cancel'); ?></a> + <input type="hidden" name="r" value="<?= $redirect_url ?>" /> + <button type="submit" class="btn btn-important"><?= _t('gen.action.create') ?></button> + <a class="btn" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.cancel') ?></a> </div> </form> - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> + <p><a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a></p> </div> |
