added 'remember me option'
This commit is contained in:
parent
efba13e55c
commit
d7556a9edb
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$SESSION_COOKIE_NAME = "connection_id";
|
||||
$MAX_COOKIE_LIFE = time() + 86400 * 30; // 30 days max
|
||||
$MAX_COOKIE_LIFE = 86400 * 30; // 30 days max
|
||||
$MINIMAL_PASSWORD_LENGTH = 8;
|
||||
|
||||
$config_array = json_decode(file_get_contents("config.json", true));
|
||||
|
@ -35,7 +35,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if (get_username_count($username) == 1) {
|
||||
if (correct_email_password($username, $password)) {
|
||||
if (is_https()) {
|
||||
connect_user(get_user_id_from_email($username), false);
|
||||
connect_user(get_user_id_from_email($username), isset($_POST["stay_loggedin"]));
|
||||
|
||||
// Redirect user to welcome page
|
||||
header("location: welcome.php");
|
||||
@ -86,6 +86,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
<input type="password" name="password" class="form-control">
|
||||
<span class="help-block"><?php echo $password_err; ?></span>
|
||||
</div>
|
||||
<div>
|
||||
<label>Remember me</label>
|
||||
<input type="checkbox" name="stay_loggedin"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" class="btn btn-primary" value="Login">
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user