[livejournal] r22603: LJSUP-13229 (refactor userlog code into ...
Committer: ailyin
LJSUP-13229 (refactor userlog code into LJ::User::Userlog / LJ::User::UserlogRecord)U trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm 2012-08-08 12:40:36 UTC (rev 22602)
+++ trunk/cgi-bin/LJ/User.pm 2012-08-08 12:59:46 UTC (rev 22603)
@@ -591,35 +591,6 @@
return $validated;
}
-# log a line to our userlog
-sub log_event {
- my $u = shift;
-
- my ($type, $info) = @_;
- return undef unless $type;
- $info ||= {};
-
- # now get variables we need; we use delete to remove them from the hash so when we're
- # done we can just encode what's left
- my $ip = delete($info->{ip}) || LJ::get_remote_ip() || undef;
- my $uniq = delete $info->{uniq};
- unless ($uniq) {
- eval {
- $uniq = LJ::Request->notes('uniq');
- };
- }
- my $remote = delete($info->{remote}) || LJ::get_remote() || undef;
- my $targetid = (delete($info->{actiontarget})+0) || undef;
- my $extra = %$info ? join('&', map { LJ::eurl($_) . '=' . LJ::eurl($info->{$_}) } keys %$info) : undef;
-
- # now insert the data we have
- $u->do("INSERT INTO userlog (userid, logtime, action, actiontarget, remoteid, ip, uniq, extra) " .
- "VALUES (?, UNIX_TIMESTAMP(), ?, ?, ?, ?, ?, ?)", undef, $u->{userid}, $type,
- $targetid, $remote ? $remote->{userid} : undef, $ip, $uniq, $extra);
- return undef if $u->err;
- return 1;
-}
-
# return or set the underage status userprop
sub underage_status {
return undef unless LJ::class_bit("underage");
