53 lines
1.4 KiB
Perl
53 lines
1.4 KiB
Perl
# Selima Website Content Management System
|
|
# Deletion.pm: The data deletion processor.
|
|
|
|
# Copyright (c) 2006-2018 imacat.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Author: imacat <imacat@mail.imacat.idv.tw>
|
|
# First written: 2006-03-17
|
|
|
|
package Selima::Processor::Deletion;
|
|
use 5.008;
|
|
use strict;
|
|
use warnings;
|
|
use base qw(Selima::Processor);
|
|
|
|
use Selima::DataVars qw($DBH);
|
|
|
|
# new: Initialize the processor
|
|
sub new : method {
|
|
local ($_, %_);
|
|
my ($self, $class);
|
|
($class, @_) = @_;
|
|
$_[0]->param("form", "del");
|
|
$self = $class->SUPER::new(@_);
|
|
$self->{"cond"} = $self->{"form"}->param("cond");
|
|
return $self;
|
|
}
|
|
|
|
# _update_cols: Update the columns
|
|
sub _update_cols : method {
|
|
local ($_, %_);
|
|
my $self;
|
|
$self = $_[0];
|
|
# Process the update
|
|
$_ = "DELETE FROM " . $self->{"table"}
|
|
. " WHERE " . $self->{"cond"} . ";\n";
|
|
$DBH->gdo($_);
|
|
return;
|
|
}
|
|
|
|
return 1;
|