diff options
| author | 2014-01-12 03:10:31 +0100 | |
|---|---|---|
| committer | 2014-01-12 03:10:31 +0100 | |
| commit | d58886a937cbe425163526fc2ba3d2a118602035 (patch) | |
| tree | 4769024f513d927c45fe3a6475e8dcdf92f01d0f /app/views/helpers | |
| parent | 43f1b227b459f8edade9d551164c18f56cfa1925 (diff) | |
Implémentation de l'indentification par mot de passe
Implémentation de
https://github.com/marienfressinaud/FreshRSS/issues/104
Diffstat (limited to 'app/views/helpers')
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 4 | ||||
| -rw-r--r-- | app/views/helpers/view/login.phtml | 43 |
2 files changed, 45 insertions, 2 deletions
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 92c068f7e..935294e60 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -30,8 +30,8 @@ if ($mail != 'null') { $mail = '"' . $mail . '"'; } - echo 'use_persona=', Minz_Configuration::authType() === 'persona' ? 'true' : 'false', - ',url_freshrss="', _url ('index', 'index'), '",', + echo 'authType="', Minz_Configuration::authType(), '",', + 'url_freshrss="', _url ('index', 'index'), '",', 'url_login="', _url ('index', 'login'), '",', 'url_logout="', _url ('index', 'logout'), '",', 'current_user_mail=', $mail, ",\n"; diff --git a/app/views/helpers/view/login.phtml b/app/views/helpers/view/login.phtml new file mode 100644 index 000000000..e4a24f9ed --- /dev/null +++ b/app/views/helpers/view/login.phtml @@ -0,0 +1,43 @@ +<div class="post content"> + +<?php +if (Minz_Configuration::canLogIn()) { + ?><h1><?php echo Minz_Translate::t('login'); ?></h1><?php + switch (Minz_Configuration::authType()) { + + case 'form': + ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> + <div class="form-group"> + <label class="group-name" for="username"><?php echo Minz_Translate::t('username'); ?></label> + <div class="group-controls"> + <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" /> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password'); ?></label> + <div class="group-controls"> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /> + <noscript><strong><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button> + </div> + </div> + </form><?php + break; + + case 'persona': + ?><p><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t('login'); ?></a></p><?php + break; + } +} else { + ?><h1>FreshRSS</h1> + <p><?php echo Minz_Translate::t('forbidden_access', Minz_Configuration::authType()); ?></p><?php +} +?> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p> +</div> |
