diff options
author | Simon Rettberg | 2021-05-05 10:53:00 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-05-11 14:50:11 +0200 |
commit | 34cd38967a05141b9c2236510c0e4f3fcec452da (patch) | |
tree | cf3c8588bc4b12c5b5826061c8e8d1c9cec443a8 /modules-available | |
parent | [main+Session] Move session from /tmp/ to session table (diff) | |
download | slx-admin-34cd38967a05141b9c2236510c0e4f3fcec452da.tar.gz slx-admin-34cd38967a05141b9c2236510c0e4f3fcec452da.tar.xz slx-admin-34cd38967a05141b9c2236510c0e4f3fcec452da.zip |
[session] Add option to bind session to IP address
Diffstat (limited to 'modules-available')
4 files changed, 12 insertions, 5 deletions
diff --git a/modules-available/session/lang/de/template-tags.json b/modules-available/session/lang/de/template-tags.json index c7b6d881..fb594521 100644 --- a/modules-available/session/lang/de/template-tags.json +++ b/modules-available/session/lang/de/template-tags.json @@ -2,9 +2,9 @@ "lang_changePassword": "Passwort \u00e4ndern", "lang_currentPassword": "Aktuelles Passwort", "lang_enter": "Anmeldung", + "lang_fixedIpSession": "Sitzung an IP-Adresse binden", "lang_login": "Anmelden", "lang_newPassword": "Neues Passwort", "lang_register": "Registrieren", - "lang_rememberID": "Angemeldet bleiben", "lang_repeatPassword": "Passwort wiederholen" -} +}
\ No newline at end of file diff --git a/modules-available/session/lang/en/template-tags.json b/modules-available/session/lang/en/template-tags.json index f9e0b393..77854ce6 100644 --- a/modules-available/session/lang/en/template-tags.json +++ b/modules-available/session/lang/en/template-tags.json @@ -2,9 +2,9 @@ "lang_changePassword": "Change password", "lang_currentPassword": "Current password", "lang_enter": "Enter", + "lang_fixedIpSession": "Bind session to IP address", "lang_login": "Login", "lang_newPassword": "New password", "lang_register": "Register", - "lang_rememberID": "Remember ID", "lang_repeatPassword": "Repeat password" -} +}
\ No newline at end of file diff --git a/modules-available/session/page.inc.php b/modules-available/session/page.inc.php index 0a6eac77..1af5280c 100644 --- a/modules-available/session/page.inc.php +++ b/modules-available/session/page.inc.php @@ -12,8 +12,11 @@ class Page_Session extends Page if (User::isLoggedIn()) // and then just redirect Util::redirect('?do=main'); // Else, try to log in - if (User::login(Request::post('user'), Request::post('pass'))) + if (User::login(Request::post('user'), + Request::post('pass'), + Request::post('fixedip', false, 'bool'))) { Util::redirect('?do=main'); + } // Login credentials wrong - delay and show error message sleep(1); Message::addError('loginfail'); diff --git a/modules-available/session/templates/page-login.html b/modules-available/session/templates/page-login.html index 4be7232a..94b69f7d 100644 --- a/modules-available/session/templates/page-login.html +++ b/modules-available/session/templates/page-login.html @@ -3,6 +3,10 @@ <div> <input type="text" name="user" class="form-control" placeholder="{{lang_username}}" autofocus> <input type="password" name="pass" class="form-control" placeholder="{{lang_password}}"> + <div class="checkbox"> + <input type="checkbox" id="fixed-ip" name="fixedip" value="1" checked> + <label for="fixed-ip">{{lang_fixedIpSession}}</label> + </div> </div> <button class="btn btn-lg btn-primary btn-block" type="submit">{{lang_login}}</button> <a class="btn btn-lg btn-default btn-block" href="?do=AddUser">{{lang_register}}</a> |