[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS Update: gleipnir



Log Message:
-----------
Add Delete

Modified Files:
--------------
    gleipnir/public_html/gallery:
        index.pl

Revision Data
-------------
Index: index.pl
===================================================================
RCS file: /cvs/gleipnir/public_html/gallery/index.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lpublic_html/gallery/index.pl -Lpublic_html/gallery/index.pl -u -r1.7 -r1.8
--- public_html/gallery/index.pl
+++ public_html/gallery/index.pl
@@ -43,6 +43,10 @@
 	{
 		$gleipnir = ShowEdit( -gleipnir => $gleipnir );
 	}
+elsif ( $gleipnir->access('galleryadmin') && ($cgi->param('action') eq 'delete') )
+	{
+		$gleipnir = Delete( -gleipnir => $gleipnir );
+	}
 elsif ( defined($cgi->param('gallery')) )
 	{
 		$gleipnir = ShowCategory( -gleipnir => $gleipnir );
@@ -213,4 +217,21 @@
 			};
 
 		return $gleipnir->body($template->output);
+	};
+
+sub Delete
+	{
+		my %options  = @_;
+		my $gleipnir = $options{-gleipnir};
+		my $cgi      = $gleipnir->cgi;
+		my $dbh      = $gleipnir->dbh;
+
+		my $SQL = <<EOT;
+delete from gallery
+where galleryid = ?
+EOT
+
+		my $cursor = $dbh->prepare($SQL);
+		$cursor->execute($cgi->param('gallery'));
+		return $gleipnir->url('/gallery/');
 	};


Main Menu:

Site Tools:


Here, spammer, have some addresses.