]>
git.datanom.net - webcal.git/blob - login.php
4 if (! file_exists('config.inc.php'))
5 throw new Exception("The application is not configured yet");
7 include_once 'config.inc.php';
8 require_once 'helper.php';
10 if (isset($_SESSION['attemps']))
11 $_SESSION['attemps']++
;
13 $_SESSION['attemps'] = 1;
15 if ($_SESSION['attemps'] == 1) {
16 $_SESSION['authenticate'] = new Authenticate(DBDRIVER
);
20 * To avoid bots, script kiddeis or other password harvester
21 * add a 5 seconds delay for every 5 failed attemps
23 if ($_SESSION['attemps'] > 5) {
25 header('Location: logout.php');
28 if (isset($_POST['uid']) && isset($_POST['pwd'])) {
29 $auth = $_SESSION['authenticate'];
31 $auth->login($_POST['uid'], $_POST['pwd']);
32 if ($auth->validUser()) {
33 unset($_SESSION['attemps']);
34 $_SESSION['user_settings'] = new UserSettings($_POST['uid']);
35 $_SESSION['user_settings']->setSettings(
36 $_SESSION['authenticate']->getSettings());
37 //var_dump($_SESSION['user_settings']);
38 //var_dump($_SESSION['authenticate']->getSettings());
39 header('Location: index.php');
44 include 'include/header.inc.php';
46 $action = $_SERVER['PHP_SELF'];
50 <form action
="$action" method
="post">
53 <td
>Username
</td
><td
><input id
="uid" type
="text" name
="uid"/></td
>
56 <td
>Password
</td
><td
><input type
="password" name
="pwd"/></td
>
59 <td colspan
="2" style
="text-align: center">
60 <input type
="reset" value
="Clear"/>
61 <input type
="submit" name
="submit" value
="Login"/>
65 <td colspan
="2" style
="text-align: center">If you don
't have an account
66 <a href="mailto:$email?subject=Requesting an account">apply</a>
72 <script type="text/javascript">
77 include 'include/footer
.inc
.php
';
This page took 0.110655 seconds and 6 git commands to generate.