Remember user between sessions.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Andrea Scarpino 2008-07-08 18:56:42 +02:00 committed by Loui Chang
parent 36ee556103
commit 2feee92a75
4 changed files with 11 additions and 1 deletions

View file

@ -25,6 +25,8 @@ $_t["en"]["Password:"] = "Password:";
$_t["en"]["Username:"] = "Username:"; $_t["en"]["Username:"] = "Username:";
$_t["en"]["Remember me"] = "Remember me";
$_t["en"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."; $_t["en"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h.";
$_t["en"]["This is where the intro text will go."] = "This is where the intro text will go."; $_t["en"]["This is where the intro text will go."] = "This is where the intro text will go.";

View file

@ -19,6 +19,8 @@ $_t["it"]["Password:"] = "Password:";
$_t["it"]["Username:"] = "Nome utente:"; $_t["it"]["Username:"] = "Nome utente:";
$_t["it"]["Remember me"] = "Ricordami" ;
$_t["it"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Benvenuto in AUR! Se sei un nuovo utente, dovresti leggere le %hGuidelines%h."; $_t["it"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Benvenuto in AUR! Se sei un nuovo utente, dovresti leggere le %hGuidelines%h.";
$_t["it"]["This is where the intro text will go."] = "Qui ci andrà il testo di introduzione."; $_t["it"]["This is where the intro text will go."] = "Qui ci andrà il testo di introduzione.";

View file

@ -644,7 +644,12 @@ function try_login() {
if ($logged_in) { if ($logged_in) {
# set our SID cookie # set our SID cookie
setcookie("AURSID", $new_sid, 0, "/"); if ($_POST['remember_me'] == "on")
# Set cookies for 30 days.
$cookie_time = time() + (60 * 60 * 24 * 30);
else
$cookie_time = 0;
setcookie("AURSID", $new_sid, $cookie_time, "/");
# header("Location: /index.php"); # header("Location: /index.php");
header("Location: " . $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); header("Location: " . $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']);
$login_error = ""; $login_error = "";

View file

@ -16,6 +16,7 @@
} ?>" /> } ?>" />
<label><?php print __("Password:"); ?></label> <label><?php print __("Password:"); ?></label>
<input type="password" name="passwd" size="30" maxlength="<?php print PASSWD_MAX_LEN; ?>" /> <input type="password" name="passwd" size="30" maxlength="<?php print PASSWD_MAX_LEN; ?>" />
<input type="checkbox" name="remember_me" /><?php print __("Remember me"); ?>
<input type="submit" class="button" value="<?php print __("Login"); ?>" /> <input type="submit" class="button" value="<?php print __("Login"); ?>" />
</form> </form>
<?php } ?> <?php } ?>