diff options
author | Yorhel <git@yorhel.nl> | 2019-10-14 15:15:46 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-10-14 16:27:07 +0200 |
commit | b539ea56c2406a110ca6666e9f42c3b4af8e1a10 (patch) | |
tree | 0da99d8f6d3a0134a44585ae05d041d764161c39 /lib/VNDB/Handler | |
parent | 77f3a2933ea14bdec59354e40075b7faa3ff96ea (diff) |
Delete the user deletion feature
It's rather much code just to run a single SQL statement that I almost
never need. Incidentally, the feature was also broken because the DELETE
permission wasn't granted in perms.sql.
Diffstat (limited to 'lib/VNDB/Handler')
-rw-r--r-- | lib/VNDB/Handler/Users.pm | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm index 933825e7..56a00d2a 100644 --- a/lib/VNDB/Handler/Users.pm +++ b/lib/VNDB/Handler/Users.pm @@ -13,7 +13,6 @@ use PWLookup; TUWF::register( qr{u([1-9]\d*)/posts} => \&posts, - qr{u([1-9]\d*)/del(/[od])?} => \&delete, qr{u/(all|[0a-z])} => \&list, ); @@ -71,49 +70,6 @@ sub posts { } -sub delete { - my($self, $uid, $act) = @_; - return $self->htmlDenied if ($self->authInfo->{id}) != 2; # Yeah, yorhel-only function - - # rarely used admin function, won't really need translating - - # confirm - if(!$act) { - my $code = $self->authGetCode("/u$uid/del/o"); - my $u = $self->dbUserGet(uid => $uid, what => 'hide_list')->[0]; - return $self->resNotFound if !$u->{id}; - $self->htmlHeader(title => 'Delete user', noindex => 1); - $self->htmlMainTabs('u', $u, 'del'); - div class => 'mainbox'; - div class => 'warning'; - h2 'Delete user'; - p; - lit qq|Are you sure you want to remove <a href="/u$uid">$u->{username}</a>'s account?<br /><br />| - .qq|<a href="/u$uid/del/o?formcode=$code">Yes, I'm not kidding!</a>|; - end; - end; - end; - $self->htmlFooter; - } - # delete - elsif($act eq '/o') { - return if !$self->authCheckCode; - $self->dbUserDel($uid); - $self->resRedirect("/u$uid/del/d", 'post'); - } - # done - elsif($act eq '/d') { - $self->htmlHeader(title => 'Delete user', noindex => 1); - div class => 'mainbox'; - div class => 'notice'; - p 'User deleted.'; - end; - end; - $self->htmlFooter; - } -} - - sub list { my($self, $char) = @_; |