Commit | Line | Data |
---|---|---|
2aa91ff2 S |
1 | <?php |
2 | namespace dns\page; | |
3 | use dns\system\DNS; | |
4 | use dns\system\User; | |
5 | ||
6 | /** | |
7 | * @author Jan Altensen (Stricted) | |
8 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | |
d4779364 | 9 | * @copyright 2014-2016 Jan Altensen (Stricted) |
2aa91ff2 S |
10 | */ |
11 | class LoginPage extends AbstractPage { | |
12 | const AVAILABLE_DURING_OFFLINE_MODE = true; | |
13 | ||
14 | public function prepare() { | |
15 | if (isset($_POST['submit']) && isset($_POST['username']) && isset($_POST['password'])) { | |
16 | if (!empty($_POST['submit']) && !empty($_POST['username']) && !empty($_POST['password'])) { | |
17 | $remember = false; | |
18 | if (isset($_POST['remember']) && !empty($_POST['remember'])) { | |
19 | $remember = true; | |
20 | } | |
21 | ||
22 | User::login(trim($_POST['username']), trim($_POST['password']), $remember); | |
ff49a0be | 23 | header("Location: index.php?index"); |
2aa91ff2 S |
24 | } |
25 | } | |
26 | } | |
27 | } |