Files
tyforum/script/note_delete.pl
2012-04-09 03:30:19 +02:00

42 lines
1.3 KiB
Perl

#!/usr/bin/perl
#------------------------------------------------------------------------------
# mwForum - Web-based discussion forum
# Copyright (c) 1999-2012 Markus Wichitill
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#------------------------------------------------------------------------------
use strict;
use warnings;
no warnings qw(uninitialized redefine);
# Imports
use MwfMain;
#------------------------------------------------------------------------------
# Init
my ($m, $cfg, $lng, $user, $userId) = MwfMain->new(@_);
# Check if access should be denied
$userId or $m->error('errNoAccess');
# Check request source authentication
$m->checkSourceAuth() or $m->error('errSrcAuth');
# Delete notifications
$m->dbDo("
DELETE FROM notes WHERE userId = ?", $userId);
# Log action and finish
$m->logAction(1, 'note', 'delete', $userId);
$m->redirect('forum_show', msg => 'NotesDel');