Hi all,
this patch add a checkbox for "remember me" action which create a
cookie for 30 days.

-- 
Andrea `BaSh` Scarpino
Arch Linux Trusted User
Linux User: #430842
diff -Naur aur-git.orig/web/lang/en/index_po.inc aur-git/web/lang/en/index_po.inc
--- aur-git.orig/web/lang/en/index_po.inc	2008-06-28 23:19:47.000000000 +0200
+++ aur-git/web/lang/en/index_po.inc	2008-06-28 23:24:11.000000000 +0200
@@ -25,6 +25,8 @@
 
 $_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"]["This is where the intro text will go."] = "This is where the intro text will go.";
diff -Naur aur-git.orig/web/lang/it/index_po.inc aur-git/web/lang/it/index_po.inc
--- aur-git.orig/web/lang/it/index_po.inc	2008-06-28 23:19:47.000000000 +0200
+++ aur-git/web/lang/it/index_po.inc	2008-06-28 23:24:05.000000000 +0200
@@ -19,6 +19,8 @@
 
 $_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"]["This is where the intro text will go."] = "Qui ci andrà il testo di introduzione.";
@@ -95,4 +97,4 @@
 
 $_t["it"]["DISCLAIMER"] = "Avviso: i PKGBUILD presenti in unsupported sono stati inviati dagli utenti e, scaricandoli, accetti di usarli a tuo rischio e pericolo.";
 
-?>
\ No newline at end of file
+?>
diff -Naur aur-git.orig/web/lib/acctfuncs.inc aur-git/web/lib/acctfuncs.inc
--- aur-git.orig/web/lib/acctfuncs.inc	2008-06-28 23:19:47.000000000 +0200
+++ aur-git/web/lib/acctfuncs.inc	2008-06-28 23:06:10.000000000 +0200
@@ -642,8 +642,12 @@
 		        }
 			if ($logged_in) {
 				# set our SID cookie
-
-				setcookie("AURSID", $new_sid, 0, "/");
+				
+				if ($_POST['remember_me'] == 1)
+					$cookie_time = time() + (60 * 60 * 24 * 30); // Set cookies for 30 days
+				else
+					$cookie_time = 0;
+				setcookie("AURSID", $new_sid, $cookie_time, "/");
 #				header("Location: /index.php");
 				header("Location: " . $_SERVER['PHP_SELF']);
 				$login_error = "";
diff -Naur aur-git.orig/web/template/login_form.php aur-git/web/template/login_form.php
--- aur-git.orig/web/template/login_form.php	2008-06-28 23:19:47.000000000 +0200
+++ aur-git/web/template/login_form.php	2008-06-28 23:14:10.000000000 +0200
@@ -19,6 +19,8 @@
          <?php print __("Password:"); ?>
 	<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"); ?>'>
 </form>

Reply via email to