diff options
author | Yorhel <git@yorhel.nl> | 2019-10-03 18:01:17 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-10-03 18:01:17 +0200 |
commit | 5ab9f4c5a7008cf832330fdbc7d5337d768dc8ee (patch) | |
tree | a9a1b3b9ee1612fa3dc95962b15501b518ddfcf0 /lib/VNDB/DB | |
parent | 3f7769d2ba4047e8766e511b7a42c7aa4721f6f8 (diff) |
Disallow changing email address to one already used by another account
Diffstat (limited to 'lib/VNDB/DB')
-rw-r--r-- | lib/VNDB/DB/Users.pm | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm index 9fa7c3ac..cccac169 100644 --- a/lib/VNDB/DB/Users.pm +++ b/lib/VNDB/DB/Users.pm @@ -6,8 +6,7 @@ use warnings; use Exporter 'import'; our @EXPORT = qw| - dbUserGet dbUserEdit dbUserAdd dbUserDel dbUserLogout - dbUserEmailExists dbUserGetMail dbUserSetMail dbUserSetPerm + dbUserGet dbUserDel dbNotifyGet dbNotifyMarkRead dbNotifyRemove dbThrottleGet dbThrottleSet |; @@ -92,28 +91,6 @@ sub dbUserGet { } -# uid, %options->{ columns in users table } -sub dbUserEdit { - my($s, $uid, %o) = @_; - - my %h; - defined $o{$_} && ($h{$_.' = ?'} = $o{$_}) - for (qw| username ign_votes email_confirmed |); - - return if scalar keys %h <= 0; - return $s->dbExec(q| - UPDATE users - !H - WHERE id = ?|, - \%h, $uid); -} - - -# username, mail, [ip] -sub dbUserAdd { - $_[0]->dbRow(q|INSERT INTO users (username, mail, ip) VALUES(?, ?, ?) RETURNING id|, $_[1], $_[2], $_[3]||$_[0]->reqIP)->{id}; -} - # uid sub dbUserDel { @@ -121,32 +98,6 @@ sub dbUserDel { } -# uid, token -sub dbUserLogout { - $_[0]->dbExec(q|SELECT user_logout(?, decode(?, 'hex'))|, $_[1], unpack 'H*', $_[2]); -} - - -sub dbUserEmailExists { - $_[0]->dbRow(q|SELECT user_emailexists(?) AS r|, $_[1])->{r}; -} - - -sub dbUserGetMail { - $_[0]->dbRow(q|SELECT user_getmail(?, ?, decode(?, 'hex')) AS r|, $_[1], $_[2], $_[3])->{r}; -} - - -sub dbUserSetMail { - $_[0]->dbExec(q|SELECT user_setmail(?, ?, decode(?, 'hex'), ?)|, $_[1], $_[2], $_[3], $_[4]); -} - - -sub dbUserSetPerm { - $_[0]->dbExec(q|SELECT user_setperm(?, ?, decode(?, 'hex'), ?)|, $_[1], $_[2], $_[3], $_[4]); -} - - # %options->{ uid id what results page reverse } # what: titles sub dbNotifyGet { |