Annotation of mp3/bin/deleteplaylist.pl, Revision 1.1
1.1 ! andrew 1: #!/usr/bin/perl -w
! 2: ########################################################################
! 3: # DeletePlaylist.plx ***
! 4: #
! 5: # 01-10-??
! 6: # Written by andrew fresh <andrew@mad-techies.org>
! 7: ########################################################################
! 8: use strict;
! 9: use diagnostics;
! 10:
! 11: use CGI qw/:standard/; # load standard CGI routines
! 12: use CGI::Carp qw(fatalsToBrowser);
! 13:
! 14: my $list = '/var/www/mp3/playlist/playlist.lst';
! 15:
! 16: my $query = new CGI;
! 17:
! 18: my $vars = $query->Vars;
! 19:
! 20:
! 21: ########################################################################
! 22: # *** MAIN ***
! 23: ########################################################################
! 24: print "Content-Type: text/html\n\n";
! 25: print "<html>\n<head>\n\t<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'> <title>Deleting Playlist</title>\n";
! 26: print "<body>\n\n";
! 27:
! 28: #MakeTemp("$configs{DIRftp}/$station/$configs{FILESnew}");
! 29: #use File::Copy;
! 30: #copy("$configs{DIRcfgs}/$station.$configs{FILEplaylist}", "$configs{DIRftp}/$station/$station.$configs{FILEplaylist}");
! 31:
! 32: #Print_Nav();
! 33:
! 34: if ($$vars{confirm} && ($$vars{confirm} eq "true")) {
! 35: delplaylist();
! 36: } else {
! 37: confirm();
! 38: }
! 39:
! 40: print "<a href=\"showfiles.pl\">Back to Beginning</a>";
! 41: print "</body>\n</head>\n</html>\n";
! 42:
! 43: sub confirm {
! 44: print "<h2>Confirm Playlist Delete</h2>\n";
! 45: print "<P>Do you really want to do this? Would you want someone deleting <I>YOUR</I> playlist?</P>\n";
! 46: print "<p><a href=\"deleteplaylist.pl\?confirm=true\">Click here to confirm Playlist Deletion</a></p>\n";
! 47: }
! 48:
! 49:
! 50: sub delplaylist {
! 51: print "<h2>Deleting Playlist</h2>\n";
! 52: if (-e $list) {
! 53: if (open FILE, ">$list") {
! 54: print FILE "";
! 55: print "<p>Playlist deleted</p>\n";
! 56: close FILE;
! 57: } else {
! 58: print "<p>Could not delete playlist. Maybe it's already deleted? If not, please wait 90 seconds and try again and if that doesn't work contact the system administrator</p>\n";
! 59: }
! 60: } else {
! 61: print "<p>Could not delete playlist. It doesn't seem that there was a playlist. You know it plays all the time now right?</p>\n";
! 62: }
! 63: }
! 64:
! 65:
! 66: sub Print_Nav
! 67: {
! 68: open FILE, 'nav.inc' or die "\n\ncouldn't open FILE nav.inc: $!";
! 69: while (<FILE>) {
! 70: print;
! 71: }
! 72: close FILE;
! 73: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>