[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS Update: gleipnir
- To: cvs@lists.cleannorth.org
- Subject: CVS Update: gleipnir
- From: Dan Brosemer <odin@cleannorth.org>
- Date: Sun, 17 Aug 2008 18:20:43 -0401 (EDT)
- List-help: <mailto:cvs-request@lists.cleannorth.org?subject=help>
- List-post: <mailto:cvs@lists.cleannorth.org>
- List-subscribe: <mailto:cvs-request@lists.cleannorth.org?subject=subscribe>
- List-unsubscribe: <mailto:cvs-request@lists.cleannorth.org?subject=unsubscribe>
- Resent-date: Sun, 17 Aug 2008 18:20:46 -0401 (EDT)
- Resent-from: cvs@lists.cleannorth.org
- Resent-message-id: <laLGU.A.3iE.URKqIB@skroob.cleannorth.org>
- Resent-sender: cvs-request@lists.cleannorth.org
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/');
};
- Prev by Date: CVS Update: svartalfheim.net
- Next by Date: CVS Update: svartalfheim.net
- Previous by thread: CVS Update: gleipnir
- Next by thread: CVS Update: gleipnir
- Index(es):