Refactor login / ban authentication steps
Relates to https://github.com/shaarli/Shaarli/issues/324 Added: - Add the `LoginManager` class to manage logins and bans Changed: - Refactor IP ban management - Simplify logic - Avoid using globals, inject dependencies Fixed: - Use `ban_duration` instead of `ban_after` when setting a new ban Signed-off-by: VirtualTam <virtualtam@flibidi.net>
This commit is contained in:
parent
a381c373b3
commit
44acf70681
6 changed files with 385 additions and 103 deletions
tpl
|
@ -5,7 +5,7 @@
|
|||
</head>
|
||||
<body>
|
||||
{include="page.header"}
|
||||
{if="!ban_canLogin($conf)"}
|
||||
{if="!$user_can_login"}
|
||||
<div class="pure-g pure-alert pure-alert-error pure-alert-closable center">
|
||||
<div class="pure-u-2-24"></div>
|
||||
<div class="pure-u-20-24">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>{include="includes"}</head>
|
||||
<body
|
||||
{if="ban_canLogin($conf)"}
|
||||
{if="$user_can_login"}
|
||||
{if="empty($username)"}
|
||||
onload="document.loginform.login.focus();"
|
||||
{else}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue