summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-14 15:15:46 +0200
committerYorhel <git@yorhel.nl>2019-10-14 16:27:07 +0200
commitb539ea56c2406a110ca6666e9f42c3b4af8e1a10 (patch)
tree0da99d8f6d3a0134a44585ae05d041d764161c39 /lib/VNDB
parent77f3a2933ea14bdec59354e40075b7faa3ff96ea (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')
-rw-r--r--lib/VNDB/DB/Users.pm9
-rw-r--r--lib/VNDB/Handler/Users.pm44
-rw-r--r--lib/VNDB/Util/CommonHTML.pm6
3 files changed, 1 insertions, 58 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm
index 276ce202..d80e6547 100644
--- a/lib/VNDB/DB/Users.pm
+++ b/lib/VNDB/DB/Users.pm
@@ -6,7 +6,7 @@ use warnings;
use Exporter 'import';
our @EXPORT = qw|
- dbUserGet dbUserDel
+ dbUserGet
|;
@@ -79,12 +79,5 @@ sub dbUserGet {
return wantarray ? ($r, $np) : $r;
}
-
-
-# uid
-sub dbUserDel {
- $_[0]->dbExec(q|DELETE FROM users WHERE id = ?|, $_[1]);
-}
-
1;
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) = @_;
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm
index 0a09655c..3d18bdf5 100644
--- a/lib/VNDB/Util/CommonHTML.pm
+++ b/lib/VNDB/Util/CommonHTML.pm
@@ -82,12 +82,6 @@ sub htmlMainTabs {
end;
}
- if($type eq 'u' && ($self->authInfo->{id}||0) == 2) {
- li $sel eq 'del' ? (class => 'tabselected') : ();
- a href => "/$id/del", 'remove';
- end;
- }
-
if($type eq 'v') {
li $sel eq 'releases' ? (class => 'tabselected') : ();
a href => "/$id/releases", 'releases';