[Affelio-cvs 1194] CVS update: affelio/lib/Affelio/Managing

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 3月 28日 (火) 18:15:23 JST


Index: affelio/lib/Affelio/Managing/AccessLogManager.pm
diff -u affelio/lib/Affelio/Managing/AccessLogManager.pm:1.13 affelio/lib/Affelio/Managing/AccessLogManager.pm:1.14
--- affelio/lib/Affelio/Managing/AccessLogManager.pm:1.13	Tue Mar  7 23:39:10 2006
+++ affelio/lib/Affelio/Managing/AccessLogManager.pm	Tue Mar 28 18:15:22 2006
@@ -14,7 +14,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: AccessLogManager.pm,v 1.13 2006/03/07 14:39:10 slash5234 Exp $
+# $Id: AccessLogManager.pm,v 1.14 2006/03/28 09:15:22 slash5234 Exp $
 
 package Affelio::Managing::AccessLogManager;
 {
@@ -32,16 +32,17 @@
 
     #######################################################################
     #Constructor
+    # param:
+    #    af : reference to Affelio
     #######################################################################
     sub new{
 	my $class = shift;
-	my $af = shift;
+	my %param = @_;
+	my $af = $param{af};
 
 	debug_print("AccessLogManager::new: start.");
 
-	my $self = {af => $af
-		    };
-
+	my $self = {af => $af };
 	bless $self, $class;
 
 	debug_print("AccessLogManager::new: end.");
@@ -50,33 +51,23 @@
 
     #######################################################################
     #save_log
+    # param:
+    #    afid       Visitor's Affelio URL (AFID)
+    #    nickname   Visitor's nickname
+    #    type       Visitor's type (self, f1, f2, or pb)
     #######################################################################
     sub save_log{
 	my $self=shift;
-	my $afid = shift;
-	my $nickname = shift;
-	my $type=shift;
-
-	#AFuser_CORE_accesslog
-	# id id2 timestamp INT, nickname TEXT, afid TEXT, type TEXT
+	my %param = @_;
+	my $afid = $param{afid};
+	my $nickname = $param{nickname};
+	my $type = $param{type};
 
 	my $af=$self->{af};
 	my $cur_time = get_timestamp();
 	my $startoftheday = get_today();
 
 	################################
-	#Check the table
-	################################
-	my $create_tbl_cmd = "CREATE TABLE $af->{site__dbtbl_prefix}_CORE_accesslog(id INTEGER PRIMARY KEY, id2 INTEGER, timestamp BIGINT, nickname TEXT, afid TEXT, type TEXT)";
-	eval{
-	    $af->getDB()->do($create_tbl_cmd);
-	};
-	if($@){
-	}else{
-	    debug_print("AccessLog:save: Table created.");
-	}
-
-	################################
 	#check today's past access of this user
 	################################
 	my $query1; my $sth1; 	$@="";
@@ -177,19 +168,21 @@
 		throw Affelio::exception::DBException($af->getDB()->errstr);
 	    };
 	}
-
     }
 
+
     #######################################################################
     #get_log
+    # param:
+    #    t_begin
+    #    t_end
+    #    t_view
     #######################################################################
     sub get_log{
 	my $self=shift;
-
-	my %param = @_;
-
 	my $af = $self->{af};
 
+	my %param = @_;
 	my $from = $param{t_begin};
 	my $to = $param{t_end};
 	my $type = $param{view};


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