Scoop -- the swiss army chainsaw of content management
Front Page Everything News Code Help! Wishlist Project Scoop Sites Dev Notes Latest CVS changes Development Activities
Scoop Box Exchange - Show Box: erase_user 1.00

Author: janra [Info]


erases all of a user's comments, ratings, stories, etc, and anonymizes the account. Intended for spammers. Put this box on the user info page.

Box Code:

return unless $S->have_perm('edit_user');

my $uid = $S->cgi->param('uid');
my $nick = $S->cgi->param('nick');
unless ($uid) {
$uid = $S->get_uid_from_nick($nick);
my $erase = $S->cgi->param('erase');
my $confirm = $S->cgi->param('confirm');

#warn "Nick is: $nick, uid is $uid\n";
return unless ($uid);

my $return;

if ($erase && $confirm && $uid) {
$return = "Erasing $nick...<br>";

# First, wipe user ratings
$return .= 'Wiped ratings...<br>';

# Make anonymous
my ($rv, $sth) = $S->db_update({
WHAT => "users",
SET => qq{perm_group = "Anonymous"},
WHERE => "uid = $uid"});
$return .= 'Anonymized account...<br>';

# Remove all comments
($rv, $sth) = $S->db_select({
WHAT => 'sid, cid, pid',
FROM => 'comments',
WHERE => "uid = $uid"});
my $i = 0;
my ($sid, $cid, $pid) = $sth->fetchrow();
while ($cid) {
$S->_delete_comment($sid, $cid, $pid);
($sid, $cid, $pid) = $sth->fetchrow();
$return .= "Erased $i comments...<br>";

# Hide stories
($rv, $sth) = $S->db_update({
WHAT => 'stories',
SET => "displaystatus = '-1'",
WHERE => "aid = $uid"
$return .= "Hid all stories...<br>";
$return .= "Done.";
} else {
#my $urlnick = $S->urlify($nick);
$return = qq{
<form name="eraseuser" method="GET" action="|rootdir|/erase">|norm_font|
<input type="hidden" name="nick" value="$nick">
<input type="submit" name="erase" value="Erase $nick">
<input type="checkbox" name="confirm"> Are you sure?

return $return;
Display: Sort:
Question about the /erase command (none / 0) (#1)
by dnaworks on Wed Feb 28, 2007 at 06:33:21 PM PST

Hi there - I get a 404 error trying to use this box; have I missed something to enable the /erase command?

Error (none / 0) (#2)
by Neon383 on Tue Aug 20, 2019 at 12:20:05 AM PST

I also facing an error while using this code box I don't know where I am doing mistake. The also share a video in which they explain about it's working and run it as well.

create account
report bugs
Scoop Administrators Guide
Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
Cooler than

Make a new account

Hosted by Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest 1999 The Management

create account | faq | search