[BACK]Return to deleteplaylist.pl CVS log [TXT][DIR] Up to [local] / mp3 / bin

Annotation of mp3/bin/deleteplaylist.pl, Revision 1.2

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>