diff options
author | 3dB <3db@3decibels.net> | 2009-07-29 16:45:59 -0400 |
---|---|---|
committer | 3dB <3db@3decibels.net> | 2009-07-29 16:45:59 -0400 |
commit | a04360aa66453809395a09a66ccd63e46a4cf519 (patch) | |
tree | 6be0c93ebc01a0e1a1ae432782d65d61ed1a90c5 /lib/VNDB/DB/Users.pm | |
parent | f713f21acfba72a9a5567592389fad8bcddbebc8 (diff) |
Changed sessions.expiration column to timestamp
-- Updated SQL files to reflect column type change.
-- Subroutine dbSessionAdd rewritten to accept an expiration
timestap as an optional third argument.
Diffstat (limited to 'lib/VNDB/DB/Users.pm')
-rw-r--r-- | lib/VNDB/DB/Users.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm index 07ccaf1e..eaed1234 100644 --- a/lib/VNDB/DB/Users.pm +++ b/lib/VNDB/DB/Users.pm @@ -112,11 +112,18 @@ sub dbUserDel { } -# uid, 40 character session token, expiration time (int) +# Adds a session to the database +# If no expiration is supplied the database default is used +# uid, 40 character session token, expiration time (timestamp) sub dbSessionAdd { my($s, @o) = @_; - $s->dbExec(q|INSERT INTO sessions (uid, token, expiration) VALUES(?, ?, ?)|, - @o[0..2]); + if (defined $o[2]) { + $s->dbExec(q|INSERT INTO sessions (uid, token, expiration) VALUES(?, ?, ?)|, + @o); + } else { + $s->dbExec(q|INSERT INTO sessions (uid, token) VALUES(?, ?)|, + @o); + } } |