[Midnightbsd-cvs] mports: delete_lock.cgi: add delete_lock cgi.
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Wed Apr 9 16:56:44 EDT 2008
Log Message:
-----------
add delete_lock cgi.
Added Files:
-----------
mports/Tools/magus/www/data/magus/auth:
delete_lock.cgi (r1.1)
-------------- next part --------------
--- /dev/null
+++ Tools/magus/www/data/magus/auth/delete_lock.cgi
@@ -0,0 +1,34 @@
+#!/usr/local/bin/perl
+
+use strict;
+use warnings;
+use lib qw(/home/mbsd/magus/mports/Tools/lib);
+
+use Magus;
+use CGI;
+
+
+eval { main() };
+
+if ($@) {
+ print "Content-Type: text/html\n\n";
+ print <<END_OF_ERROR;
+<html>
+<head><title>Error</title></head>
+<body>
+<h1>Error</h1>
+<p>The following error occured:</p>
+<pre>$@</pre>
+END_OF_ERROR
+}
+
+sub main {
+ my $q = CGI->new;
+ my $id = $q->param('id') || die "No id given.\n";
+
+ my $lock = Magus::Lock->retrieve($id) || die "No such port: $id\n";
+
+ $lock->delete;
+
+ print $q->redirect($q->referer);
+}
More information about the Midnightbsd-cvs
mailing list