[Affelio-cvs 1060] CVS update: affelio/bin

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 1月 28日 (土) 17:47:22 JST


Index: affelio/bin/get_content.cgi
diff -u affelio/bin/get_content.cgi:1.31 affelio/bin/get_content.cgi:1.32
--- affelio/bin/get_content.cgi:1.31	Mon Dec 19 12:50:10 2005
+++ affelio/bin/get_content.cgi	Sat Jan 28 17:47:22 2006
@@ -16,7 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-# $Id: get_content.cgi,v 1.31 2005/12/19 03:50:10 slash5234 Exp $
+# $Id: get_content.cgi,v 1.32 2006/01/28 08:47:22 slash5234 Exp $
 
 use strict;
 
@@ -40,7 +40,8 @@
 #Load Affelio and CGI
 my $q = new CGI;
 my $cfg_dir = "../config/";
-my $af = new Affelio(ConfigDir => $cfg_dir);
+my $af = new Affelio(ConfigDir => $cfg_dir,
+		     CGI => $q);
 my $wi = new Affelio::misc::WebInput(); 
 
 #Retrieve args
@@ -54,33 +55,24 @@
     error($q,"Input parameters are not defined.(content)");
 }
 
-my $sid = $q->cookie("affelio-$af->{user__nickname}");
-debug_print("getcontent.cgi: sid from cookie = $sid");
-
 my $ck_visitor_type=0;
 my $ck_visitor_type_str="pb"; 
 my $ck_visitor_afid = "";
-my $session;
-if($sid ==0 || !defined($sid)){
+
+############################################################################
+#Load session from cookie
+############################################################################
+my $session = $af->getSM()->get_session();
+
+if(!$session){
+    debug_print("get_content: session not found.");
+    $ck_visitor_type=0;
+    $ck_visitor_type_str="pb"; 
+    $ck_visitor_afid = "";
 }else{
-    $session = new CGI::Session(undef, 
-				$sid, 
-				{Directory=> $af->{site__session_dir}});
-    debug_print("getcontent.cgi: startup sid given=[" . $sid   . "]");
-    debug_print("getcontent.cgi: startup sid new  =[" . $session->id . "]");
     my $type = $session->param("type");
-    if( $sid != $session->id ){
-	debug_print("getcontent.cgi: session deleted.");
-	$session->delete();
-	undef($session);
-    }
 
-    if(!$session){
-	debug_print("get_content: session not found.");
-	$ck_visitor_type=0;
-	$ck_visitor_type_str="pb"; 
-	$ck_visitor_afid = "";
-    }elsif($type eq "self"){
+    if($type eq "self"){
 	debug_print("get_content: session found. [self]");
 	$ck_visitor_type=3; 
 	$ck_visitor_type_str="self"; 
Index: affelio/bin/loginexec.cgi
diff -u affelio/bin/loginexec.cgi:1.15 affelio/bin/loginexec.cgi:1.16
--- affelio/bin/loginexec.cgi:1.15	Mon Dec 19 12:35:04 2005
+++ affelio/bin/loginexec.cgi	Sat Jan 28 17:47:22 2006
@@ -16,7 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Id: loginexec.cgi,v 1.15 2005/12/19 03:35:04 slash5234 Exp $
+# $Id: loginexec.cgi,v 1.16 2006/01/28 08:47:22 slash5234 Exp $
 
 use strict;
 
@@ -94,7 +94,7 @@
 	#OLD protocol (V1)
 	if(  (verify_password($password, $af->{site__password}) > 0) 
 	     && ($username eq $af->{site__username}) ){
-	    debug_print("loginexec.cgi: AUTH Ok.\n");
+	    debug_print("loginexec.cgi: AUTH OK.\n");
 	    #login OK
 	}else{
 	    #login failed.
@@ -122,6 +122,7 @@
 
 	    show_checkpassword_screen(mode => "login_as_owner");
 	    exit(1);
+
 	}else{
 	    ##################################
 	    #Format adjustment of AffelioURL
@@ -226,8 +227,9 @@
     $af->getSM->startup_session(user_afid => $af->{site__web_root},
 				user_nickname => $af->{user__nickname},
 				type => "self");
-    
-    $af->getSM->get_session->expire('+7d');
+    $af->getSM->get_session->expire("+3d");
+    $af->getSM->get_session->flush();
+
     debug_print("loginexec.cgi: startup_session finished.\n");    
 
     #Prepare a cookie with the session_id
Index: affelio/bin/logoutexec.cgi
diff -u affelio/bin/logoutexec.cgi:1.6 affelio/bin/logoutexec.cgi:1.7
--- affelio/bin/logoutexec.cgi:1.6	Fri Dec 16 18:04:31 2005
+++ affelio/bin/logoutexec.cgi	Sat Jan 28 17:47:22 2006
@@ -16,7 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Id: logoutexec.cgi,v 1.6 2005/12/16 09:04:31 slash5234 Exp $
+# $Id: logoutexec.cgi,v 1.7 2006/01/28 08:47:22 slash5234 Exp $
 
 use strict;
 
@@ -63,6 +63,7 @@
 if($session){
     #Output expired cookie and redirect the user to index.
     $session->delete();
+    $session->flush();
     undef($session);
 
     #Output expired cookie and redirect the user to index.


Affelio-cvs メーリングリストの案内
Back to archive index