aboutsummaryrefslogtreecommitdiff
path: root/app/views/auth
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-31 14:45:37 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-31 14:45:37 +0100
commita97bbd9bd54c5fa56d54b3c214cf4e8af96af8b2 (patch)
tree6e83890bc1b3814a12c3b7bedc0d5944f30f507b /app/views/auth
parent42fd539a1b14f883077048a35864b4294b6efe94 (diff)
parente91b72b63cd11ae3c4f59e48439e93955242c673 (diff)
Merge branch 'dev'
Conflicts: CHANGELOG README.fr.md README.md app/Controllers/feedController.php app/Controllers/indexController.php app/i18n/en.php app/i18n/fr.php app/views/helpers/view/normal_view.phtml app/views/stats/index.phtml app/views/stats/repartition.phtml constants.php p/scripts/main.js
Diffstat (limited to 'app/views/auth')
-rw-r--r--app/views/auth/formLogin.phtml28
-rw-r--r--app/views/auth/index.phtml85
-rw-r--r--app/views/auth/logout.phtml0
-rw-r--r--app/views/auth/personaLogin.phtml24
-rw-r--r--app/views/auth/reset.phtml33
5 files changed, 170 insertions, 0 deletions
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml
new file mode 100644
index 000000000..979e17349
--- /dev/null
+++ b/app/views/auth/formLogin.phtml
@@ -0,0 +1,28 @@
+<div class="prompt">
+ <h1><?php echo _t('gen.auth.login'); ?></h1>
+
+ <form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>">
+ <div>
+ <label for="username"><?php echo _t('gen.auth.username'); ?></label>
+ <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" />
+ </div>
+ <div>
+ <label for="passwordPlain"><?php echo _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>
+ </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'); ?>
+ </label>
+ <br />
+ </div>
+ <div>
+ <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('gen.auth.login'); ?></button>
+ </div>
+ </form>
+
+ <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p>
+</div>
diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml
new file mode 100644
index 000000000..f7a862ac9
--- /dev/null
+++ b/app/views/auth/index.phtml
@@ -0,0 +1,85 @@
+<?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>
+
+ <form method="post" action="<?php echo _url('auth', 'index'); ?>">
+ <legend><?php echo _t('admin.auth.type'); ?></legend>
+
+ <div class="form-group">
+ <label class="group-name" for="auth_type"><?php echo _t('admin.auth.type'); ?></label>
+ <div class="group-controls">
+ <select id="auth_type" name="auth_type" required="required">
+ <?php if (!in_array(FreshRSS_Context::$system_conf->auth_type, array('form', 'persona', '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="persona"<?php echo FreshRSS_Context::$system_conf->auth_type === 'persona' ? ' selected="selected"' : '', FreshRSS_Context::$user_conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('admin.auth.persona'); ?></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>
+ </select>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <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"'; ?> />
+ <?php echo _t('admin.auth.allow_anonymous', FreshRSS_Context::$system_conf->default_user); ?>
+ </label>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <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"'; ?> />
+ <?php echo _t('admin.auth.allow_anonymous_refresh'); ?>
+ </label>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <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"'; ?> />
+ <?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>
+ </label>
+ </div>
+ </div>
+
+ <?php if (FreshRSS_Auth::accessNeedsAction()) { ?>
+ <div class="form-group">
+ <label class="group-name" for="token"><?php echo _t('admin.auth.token'); ?></label>
+ <?php $token = FreshRSS_Context::$user_conf->token; ?>
+ <div class="group-controls">
+ <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>"<?php
+ echo FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> />
+ <?php echo _i('help'); ?> <?php echo _t('admin.auth.token_help'); ?>
+ <kbd><?php echo Minz_Url::display(array('params' => array('output' => 'rss', 'token' => $token)), 'html', true); ?></kbd>
+ </div>
+ </div>
+ <?php } ?>
+
+ <div class="form-group">
+ <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"'; ?> />
+ <?php echo _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>
+ </div>
+ </div>
+ </form>
+</div>
diff --git a/app/views/auth/logout.phtml b/app/views/auth/logout.phtml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/app/views/auth/logout.phtml
diff --git a/app/views/auth/personaLogin.phtml b/app/views/auth/personaLogin.phtml
new file mode 100644
index 000000000..545ed2eac
--- /dev/null
+++ b/app/views/auth/personaLogin.phtml
@@ -0,0 +1,24 @@
+<?php if ($this->res === false) { ?>
+<div class="prompt">
+ <h1><?php echo _t('gen.auth.login'); ?></h1>
+
+ <p>
+ <a class="signin btn btn-important" href="<?php echo _url('auth', 'login'); ?>">
+ <?php echo _i('login'); ?> <?php echo _t('gen.auth.login_persona'); ?>
+ </a>
+
+ <br /><br />
+
+ <?php echo _i('help'); ?>
+ <small>
+ <a href="<?php echo _url('auth', 'reset'); ?>"><?php echo _t('gen.auth.login_persona_problem'); ?></a>
+ </small>
+ </p>
+
+ <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p>
+</div>
+<?php
+} else {
+ echo json_encode($this->res);
+}
+?>
diff --git a/app/views/auth/reset.phtml b/app/views/auth/reset.phtml
new file mode 100644
index 000000000..6e9816ad3
--- /dev/null
+++ b/app/views/auth/reset.phtml
@@ -0,0 +1,33 @@
+<div class="prompt">
+ <h1><?php echo _t('gen.auth.reset'); ?></h1>
+
+ <?php if (!empty($this->message)) { ?>
+ <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>">
+ <span class="alert-head"><?php echo $this->message['title']; ?></span><br />
+ <?php echo $this->message['body']; ?>
+ </p>
+ <?php } ?>
+
+ <?php if (!$this->no_form) { ?>
+ <form id="crypto-form" method="post" action="<?php echo _url('auth', 'reset'); ?>">
+ <p class="alert alert-warn">
+ <span class="alert-head"><?php echo _t('gen.short.attention'); ?></span><br />
+ <?php echo _t('gen.auth.will_reset'); ?>
+ </p>
+
+ <div>
+ <label for="username"><?php echo _t('gen.auth.username_admin'); ?></label>
+ <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" />
+ </div>
+ <div>
+ <label for="passwordPlain"><?php echo _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>
+ </div>
+ <div>
+ <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
+ </div>
+ </form>
+ <?php } ?>
+</div>