Error: You don't have access to do this." unless LJ::check_priv($remote, "supporthelp"); # perform action if (LJ::did_post()) { my $u = LJ::load_user($POST{user}) or return "Error: Invalid user: $POST{user}"; unless ($POST{area} =~ /^[LTMSRKPCO]$/) { return "Error: Invalid area: $POST{area}"; } my $dbh = LJ::get_db_writer() or return "Error: Unable to contact global master"; my $rv = $dbh->do ("DELETE FROM usercounter WHERE journalid=? AND area=?", undef, $u->{userid}, $POST{area}); if ($dbh->err) { return "Error: Error in query: " . $dbh->errstr; } unless ($rv) { return "Error: Unknown error in query"; } return "User counter successfully reset\n"; } # form $ret .= ""; $ret .= ""; $ret .= ""; $ret .= "Notes: When specifying a username, you must give the username of " . "the journal on which the problem is happening, not necessarly the " . "journal of the logged in user. This means that if there is an error posting " . "to a community, the username of that community should be given. Likewise if " . "there is an error posting a comment to a journal, the username should be that " . "of the comment to which the comment is being posted. p?>"; $ret .= "
"; $ret .= "User: " . LJ::html_text ({ name => 'user', size => '15', maxlength => '15' }) . " "; $ret .= "Area: " . LJ::html_select ({ name => 'area', size => 1 }, L => 'Journal Post', T => 'Journal Comment', M => 'Moderated Post', S => 'Login Session', R => 'Memory', K => 'Keyword (Userpics, Tags, etc)', P => 'Phone Post', C => 'Pending Comment', O => 'Portal Box', ) . " "; $ret .= LJ::html_submit('reset' => 'Reset'); return $ret; } _code?>