X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Faccess_user_log.pm;h=552dd2ad89385c2d5b513cde7c3715661e985c4d;hp=15437b77237dbcf9c31748c60b47ef819d0f8271;hb=dc83512c36dc6bea2585abada4f88d714c600e55;hpb=d1803f981555834967c8164aa7dba45e96cd6569 diff --git a/FS/FS/access_user_log.pm b/FS/FS/access_user_log.pm index 15437b772..552dd2ad8 100644 --- a/FS/FS/access_user_log.pm +++ b/FS/FS/access_user_log.pm @@ -2,6 +2,7 @@ package FS::access_user_log; use base qw( FS::Record ); use strict; +use FS::UID qw( dbh ); #use FS::Record qw( qsearch qsearchs ); use FS::CurrentUser; @@ -52,6 +53,10 @@ _date =back +=item pid + +=back + =head1 METHODS =over 4 @@ -83,8 +88,14 @@ sub insert_new_path { 'path' => $path, '_date' => time, 'render_seconds' => $render_seconds, + 'pid' => $$, } ); + #so we can still log pages after a transaction-aborting SQL error (and then + # show the # error page) + local($FS::UID::dbh) = dbh->clone; + #if current transaction is aborted (if we had a way to check for it) + my $error = $self->insert; die $error if $error; @@ -121,6 +132,7 @@ sub check { || $self->ut_text('path') || $self->ut_number('_date') || $self->ut_numbern('render_seconds') + || $self->ut_numbern('pid') ; return $error if $error; @@ -129,6 +141,17 @@ sub check { =back +=cut + +sub _upgrade_schema { + my ($class, %opts) = @_; + + my $sql = 'DROP TABLE IF EXISTS h_access_user_log'; + + my $sth = dbh->prepare($sql) or die dbh->errstr; + $sth->execute or die $sth->errstr; +} + =head1 BUGS =head1 SEE ALSO