diff options
author | Yorhel <git@yorhel.nl> | 2008-11-26 14:38:21 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-11-26 14:38:21 +0100 |
commit | 28169946d608f6a24ebf31adf4afbb8be69f7fac (patch) | |
tree | f409ab24cb6a8deda02e0614551ba04d0cc05d2c /lib/VNDB/DB/Misc.pm | |
parent | 16fe3375acf9eb17f519afd903ca07c6b9074e51 (diff) |
All db*(Edit|add) functions accept an uid option, reverse relation updates go to Multi again
Diffstat (limited to 'lib/VNDB/DB/Misc.pm')
-rw-r--r-- | lib/VNDB/DB/Misc.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm index d8348e71..5b810583 100644 --- a/lib/VNDB/DB/Misc.pm +++ b/lib/VNDB/DB/Misc.pm @@ -32,7 +32,7 @@ sub dbStats { # Arguments: type [0..2], item ID, edit summary # Returns: local revision, global revision sub dbRevisionInsert { - my($self, $type, $iid, $editsum) = @_; + my($self, $type, $iid, $editsum, $uid) = @_; my $table = [qw|vn releases producers|]->[$type]; @@ -47,7 +47,7 @@ sub dbRevisionInsert { LIMIT 1 )) RETURNING id, rev|, - $type, $self->authInfo->{id}, $self->reqIP, $editsum, + $type, $uid||$self->authInfo->{id}, $self->reqIP, $editsum, $table, [qw|v r p|]->[$type], $iid ); @@ -59,16 +59,16 @@ sub dbRevisionInsert { # Comparable to RevisionInsert, but creates a new item with a corresponding # change. Same things about inconsistent state, etc. -# Argumments: type [0..2], edit summary +# Argumments: type [0..2], edit summary, [uid] # Returns: item id, global revision sub dbItemInsert { - my($self, $type, $editsum) = @_; + my($self, $type, $editsum, $uid) = @_; my $cid = $self->dbRow(q| INSERT INTO changes (type, requester, ip, comments) VALUES (?, ?, ?, ?) RETURNING id|, - $type, $self->authInfo->{id}, $self->reqIP, $editsum + $type, $uid||$self->authInfo->{id}, $self->reqIP, $editsum )->{id}; my $iid = $self->dbRow(q| |