Can anyone help me. I'm tring to include a view all members and delete member option in the admin area for this script. I have it going to a flat file, here. open (FILE, ">>$cgiroot/data/address/members.txt");
How do I call it from this area and include the delete option? I can't figure out the code to include. Everthing I try causes an error. The script is below. Thanks and God Bless Dan #!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use CGI qw (:standard); $q = new CGI; @input = $q->param;foreach $input (@input){${$input} = $q->param($input);} require "config.cgi"; if($action eq ""){&login;exit;} if($action eq "main"){&main;exit;} if($action eq "email"){&send;exit;} if($action eq "Login"){&main;exit;} if($action eq "logout"){&logout;exit;} if($action eq "search"){&search;exit;} if($action eq "topbot"){⌶exit;} if($action eq "backup"){&backup;exit;} if($action eq "config"){&config;exit;} if($action eq "viewmem"){&viewmem;exit;} if($action eq "editmem"){&editmem;exit;} if($action eq "updates"){&updates;exit;} if($action eq "b_delete"){&b_delete;exit;} if($action eq "m_delete"){&m_delete;exit;} if($action eq "b_restore"){&b_restore;exit;} if($action eq "deleteall"){&deleteall;exit;} if($action eq "dailysend"){&dailysend;exit;} if($action eq "Send Message"){&dosend;exit;} if($action eq "new_backup"){&new_backup;exit;} if($action eq "revalidate"){&revalidate;exit;} if($action eq "Search Members"){&dosearch;exit;} if($action eq "dorevalidate"){&dorevalidate;exit;} if($action eq "Save News/Updates"){&doupdates;exit;} if($action eq " Edit This Member "){&doeditmem;exit;} if($action eq "Save This Configuration"){&doconfig;exit;} if($action eq "Save All Headers/Footers"){&dotopbot;exit;} if($action eq "Yes -> Reset The Daily Send"){&dodailysend;exit;} #### sub search{ print $q->header; &header; print qq| <center> <b>Search Members:</b> <form method="POST" action="$htmldir/admin.cgi"> <table border="0" cellpadding="3" cellspacing="3"> <tr> <td>Keyword:</td> <td><input type="text" name="keyword" size="20"></td> </tr> <tr> <td colspan="2" align="center"> <input type="hidden" name="password" value="$password"> <input type="submit" name="action" value="Search Members"></td> </tr> </table> </form> </center> |; exit; } #### sub dosearch{ print $q->header; &header; opendir (DIR, "$cgiroot/data/members"); @files = grep { /.txt/ } readdir(DIR); close (DIR); print qq| <center> <b>Your Search Results:</b> <table border="0" cellpadding="3" cellspacing="3"> |; $howmany = 0; foreach $file (@files){ if($file =~ $keyword){ ($memid,@junk) = split (/\./, $file); $howmany++; print qq| <tr> <td>$howmany</td> <td>Username:</td> <td>$memid</td> <td><a href="$htmldir/admin.cgi?action=viewmem&member=$memid&password=$password">vi ew</a></td> <td><a href="$htmldir/admin.cgi?action=editmem&member=$memid&password=$password">ed it</a></td> <td><a href="$htmldir/admin.cgi?action=m_delete&member=$memid&password=$password">d elete</a></td> </tr> |; } if(! $howmany){ print qq| <tr> <td colspan="5" align="center">No matches were found!</td> </tr> |; } print qq| </table> |; exit; } #### sub send{ print $q->header; &header; print qq| <CENTER> <FORM ACTION="$htmldir/admin.cgi" METHOD="POST"> <b>Send a Message or Notice to all Members Using The Form Below</b> <br> Your message/notice will go to all members CONTACT email address! <p> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> <TR> <TD ALIGN="LEFT">From:</TD> <TD ALIGN="LEFT">$admin ($listname)</TD> </TR> <TR> <TD ALIGN="LEFT">Subject:</TD> <TD ALIGN="LEFT"><INPUT TYPE="TEXT" NAME="subject" SIZE="50"></TD> </TR> <TR> <TD ALIGN="CENTER" COLSPAN="2"> Enter Your Message Below:<br> <TEXTAREA NAME="message" ROWS="12" COLS="60"></TEXTAREA> <INPUT TYPE="HIDDEN" NAME="password" VALUE="$password"> </TD> </TR> <TR> <TD COLSPAN="2" ALIGN="RIGHT"><INPUT TYPE="SUBMIT" NAME="action" VALUE="Send Message"> </TD> </TR> </TABLE> </FORM> </CENTER> <br> |; exit; } #### sub dosend{ print $q->header; &header; print qq| <center> <font size=5 color=0000ff><b> Your Send Results Will Be Displayed Below!</b> </font><br> <small>Wait until you see "The Emailing Is Complete!" at the bottom, Do not hit refresh!</small> </center> <br> <br> |; opendir (DIR, "$cgiroot/data/members"); @files = grep { /.txt/ } readdir(DIR); close (DIR); foreach $file (@files){ open (MEMDATA, "$cgiroot/data/members/$file");flock(MEMDATA, 2);(@memlines) = (<MEMDATA>);flock(MEMDATA, 8);close (MEMDATA); foreach $memline (@memlines){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode) = split (/\|/, $memline); } print "Message Sent To: $memfirst $memlast<br>\n"; open(MAIL,"|$sendmail -t"); print MAIL "From: $admin ($listname)\n"; print MAIL "To: $mememail\n"; print MAIL "Reply-To: $admin ($listname)\n"; print MAIL "Subject: $subject\n\n"; print MAIL "------------------------------------------------------------------------\n\ n"; print MAIL "$message\n\n"; print MAIL "------------------------------------------------------------------------\n" ; print MAIL "Admin - $listname\n"; close (MAIL); } print qq| <br> <br> <center> <font size=4 color=ff0000>The Emailing Is Now Complete!</font> <br> <br> <a href="$htmldir/admin.cgi?action=main&password=$password">click here to continue</a> </center> <br> |; exit; } #### sub dailysend{ print $q->header; &header; print qq| <center> <b>Confirm That You Want To Reset Todays Sending:</b> <br> this will allow all members to have one extra mailing today. <form method="POST" action="$htmldir/admin.cgi"> <table border="0" cellpadding="3" cellspacing="3"> <tr> <td colspan="2" align="center"> <input type="hidden" name="password" size="20" value="$password"> <input type="submit" name="action" value="Yes -> Reset The Daily Send"></td> </tr> </table> </form> </center> |; exit; } #### sub dodailysend{ print $q->header; &header; print qq| <center> <font size=5 color=0000ff><b> Daily Send Reset Results Will Be Displayed Below!</b> </font><br> <small>Wait until you see "Member Reset Is Now Complete!" at the bottom, Do not hit refresh!</small> </center> <br> <br> |; opendir (DIR, "$cgiroot/data/members"); @files = grep { /.txt/ } readdir(DIR); close (DIR); foreach $file (@files){ open (MEMDATA, "$cgiroot/data/members/$file");flock(MEMDATA, 2);(@memlines) = (<MEMDATA>);flock(MEMDATA, 8);close (MEMDATA); ($memid,@junk) = split (/\./, $file); foreach $memline (@memlines){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode) = split (/\|/, $memline); } print "Reset Member: $memfirst $memlast ($memid) DONE...<br>\n"; if($memlastsend eq ""){}else{ unlink "$cgiroot/data/members/$file"; open (NFILE, ">$cgiroot/data/members/$file"); flock(NFILE, 2); print NFILE "$mempass|$memfirst|$memlast|$mememail|$memsub|$memjoined||$memcode|\n"; flock(NFILE, 8); close (NFILE); } } print qq| <br> <br> <center> <font size=4 color=ff0000>Member Reset Is Now Complete!</font> <br> <br> <a href="$htmldir/admin.cgi?action=main&password=$password">click here to continue</a> </center> <br> |; exit; } #### sub revalidate{ print $q->header; &header; opendir (DIR, "$cgiroot/data/members"); @files = grep { /.txt/ } readdir(DIR); close (DIR); print qq| <center> <b>All Unvalidated Members Are Listed Below:</b> <table border="0" cellpadding="3" cellspacing="3"> |; $howmany = 0; foreach $file (@files){ ($memid,@junk) = split (/\./, $file); open (MEMDATA, "$cgiroot/data/members/$file");flock(MEMDATA, 2);(@memlines) = (<MEMDATA>);flock(MEMDATA, 8);close (MEMDATA); foreach $memline (@memlines){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode) = split (/\|/, $memline); } if($memcode eq ""){}else{ $howmany++; print qq| <tr> <td>$howmany</td> <td>Username:</td> <td>$memid</td> <td><a href="$htmldir/admin.cgi?action=dorevalidate&member=$memid&password=$passwor d">resend code</a></td> </tr> |; } } if(! $howmany){ print qq| <tr> <td colspan="4" align="center">No validations are currently needed!</td> </tr> |; } print qq| </table> |; exit; } #### sub dorevalidate{ print $q->header; &header; open (MEMDATA, "$cgiroot/data/members/$member.txt");flock(MEMDATA, 2);(@memlines) = (<MEMDATA>);flock(MEMDATA, 8);close (MEMDATA); foreach $memline (@memlines){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode) = split (/\|/, $memline); } open(MAIL,"|$sendmail -t"); print MAIL "From: $admin ($listname)\n"; print MAIL "To: $memsub\n"; print MAIL "Subject: validation code (resend)\n\n"; print MAIL "$memfirst, Here is your email validation code...\n"; print MAIL "--------------------------------------------------------------------------\ n\n"; print MAIL "Your validation code # is: $memcode\n\n"; print MAIL "Go here and enter your username and code into the form:\n"; print MAIL "$htmldir/members.cgi?action=code\n\n"; print MAIL "--------------------------------------------------------------------------\ n"; print MAIL "This validation code was resent to you by the list owner, please validate\n"; print MAIL "this email address to confirm your subscription to our optin mailing list.\n"; print MAIL "Admin - $listname\n"; close (MAIL); print qq| <center> <b>The Verification Code Has Been Re-Sent To: $member!</b><br>it was sent to address: $memsub<P> <a href="$htmldir/admin.cgi?action=revalidate&password=$password">click here to continue</a> </center> <br> |; exit; } #### sub topbot{ print $q->header; &header; print qq| <CENTER> <b>Edit Each Header / Footer File Below</b><br> then click the save button towards the bottom <form method="POST" action="$htmldir/admin.cgi"> <br> <br> <b>Signup Page Header:</b> (top) variables that you can use: <select name="none"> <option value=""> < htmldir > <option value=""> < listname > </select> <br> <TEXTAREA COLS="65" ROWS="10" NAME="signuptop"> |; open (STOP, "$cgiroot/data/html/signup_header.txt"); flock(STOP, 2); (@stop) = (<STOP>); flock(STOP, 8); close (STOP); foreach $stop (@stop){print "$stop";} print qq| </TEXTAREA> <BR> <BR> <HR> <BR> <BR> <b>Signup Page Footer:</b> (bottom) variables that you can use: <select name="none"> <option value=""> < htmldir > <option value=""> < listname > </select> <br> <TEXTAREA COLS="65" ROWS="10" NAME="signupbot"> |; open (SBOT, "$cgiroot/data/html/signup_footer.txt"); flock(SBOT, 2); (@sbot) = (<SBOT>); flock(SBOT, 8); close (SBOT); foreach $sbot (@sbot){print "$sbot";} print qq| </TEXTAREA> <BR> <BR> <HR> <BR> <BR> <b>Login Page Header:</b> (top) variables that you can use: <select name="none"> <option value=""> < htmldir > <option value=""> < listname > </select> <TEXTAREA COLS="65" ROWS="10" NAME="logintop"> |; open (LTOP, "$cgiroot/data/html/memlogin_header.txt"); flock(LTOP, 2); (@ltop) = (<LTOP>); flock(LTOP, 8); close (LTOP); foreach $ltop (@ltop){print "$ltop";} print qq| </TEXTAREA> <BR> <BR> <HR> <BR> <BR> <b>Login Page Footer:</b> (bottom) variables that you can use: <select name="none"> <option value=""> < htmldir > <option value=""> < listname > </select> <TEXTAREA COLS="65" ROWS="10" NAME="loginbot"> |; open (LBOT, "$cgiroot/data/html/memlogin_footer.txt"); flock(LBOT, 2); (@lbot) = (<LBOT>); flock(LBOT, 8); close (LBOT); foreach $lbot (@lbot){print "$lbot";} print qq| </TEXTAREA> <BR> <BR> <HR> <BR> <BR> <b>Member Account Header:</b> (top) variables that you can use: <select name="none"> <option value=""> < htmldir > <option value=""> < listname > <option value=""> < sub > <option value=""> < admin > <option value=""> < username > <option value=""> < password > </select> <TEXTAREA COLS="65" ROWS="10" NAME="memacctop"> |; open (ATOP, "$cgiroot/data/html/memacc_header.txt"); flock(ATOP, 2); (@atop) = (<ATOP>); flock(ATOP, 8); close (ATOP); foreach $atop (@atop){ print "$atop"; } print qq| </TEXTAREA> <BR> <BR> <HR> <BR> <BR> <b>Member Account Footer:</b> (bottom) variables that you can use: <select name="none"> <option value=""> < htmldir > <option value=""> < listname > <option value=""> < sub > <option value=""> < admin > <option value=""> < username > <option value=""> < password > </select> <TEXTAREA COLS="65" ROWS="10" NAME="memaccbot"> |; open (ABOT, "$cgiroot/data/html/memacc_footer.txt"); flock(ABOT, 2); (@abot) = (<ABOT>); flock(ABOT, 8); close (ABOT); foreach $abot (@abot){print "$abot";} print qq| </TEXTAREA> <BR> <BR> <input type="hidden" name="password" size="20" value="$password"> <INPUT TYPE="SUBMIT" NAME="action" VALUE="Save All Headers/Footers"> </FORM> </CENTER> |; exit; } #### sub dotopbot{ print $q->header; &header; unlink "$cgiroot/data/html/memacc_header.txt"; unlink "$cgiroot/data/html/memacc_footer.txt"; unlink "$cgiroot/data/html/memlogin_footer.txt"; unlink "$cgiroot/data/html/memlogin_header.txt"; unlink "$cgiroot/data/html/signup_footer.txt"; unlink "$cgiroot/data/html/signup_header.txt"; open (AFILE, ">$cgiroot/data/html/signup_header.txt"); flock(AFILE, 2); print AFILE "$signuptop"; flock(AFILE, 8); close (AFILE); open (BFILE, ">$cgiroot/data/html/signup_footer.txt"); flock(BFILE, 2); print BFILE "$signupbot"; flock(BFILE, 8); close (BFILE); open (CFILE, ">$cgiroot/data/html/memlogin_header.txt"); flock(CFILE, 2); print CFILE "$logintop"; flock(CFILE, 8); close (CFILE); open (DFILE, ">$cgiroot/data/html/memlogin_footer.txt"); flock(DFILE, 2); print DFILE "$loginbot"; flock(DFILE, 8); close (DFILE); open (EFILE, ">$cgiroot/data/html/memacc_header.txt"); flock(EFILE, 2); print EFILE "$memacctop"; flock(EFILE, 8); close (EFILE); open (FFILE, ">$cgiroot/data/html/memacc_footer.txt"); flock(FFILE, 2); print FFILE "$memaccbot"; flock(FFILE, 8); close (FFILE); print qq| <center> <b>All Headers / Footers Have Been Saved!</b><P> <a href="$htmldir/admin.cgi?action=topbot&password=$password">click here to continue</a> </center> <br> |; exit; } #### sub updates{ print $q->header; &header; print qq| <CENTER> <b>Edit The News / Updates File Below</b><br> then click the save button towards the bottom <form method="POST" action="$htmldir/admin.cgi"> <br> <TEXTAREA COLS="65" ROWS="10" NAME="updatesnews"> |; open (NEWS, "$cgiroot/data/news.txt"); flock(NEWS, 2); (@news) = (<NEWS>); flock(NEWS, 8); close (NEWS); foreach $news (@news){print "$news";} print qq| </TEXTAREA> <BR> <BR> <input type="hidden" name="password" size="20" value="$password"> <INPUT TYPE="SUBMIT" NAME="action" VALUE="Save News/Updates"> </FORM> </CENTER> |; exit; } #### sub doupdates{ print $q->header; &header; unlink "$cgiroot/data/news.txt"; open (AFILE, ">$cgiroot/data/news.txt"); flock(AFILE, 2); print AFILE "$updatesnews"; flock(AFILE, 8); close (AFILE); print qq| <center> <b>News/Updates Have Been Saved!</b><P> <a href="$htmldir/admin.cgi?action=updates&password=$password">click here to continue</a> </center> <br> |; exit; } #### sub backup{ print $q->header; &header; print qq| <blockquote> <br> <p align="center"> [<a href="$htmldir/admin.cgi?action=new_backup&password=$password" style="color:blue;">Create New Backup</a>] [<a href="$htmldir/admin.cgi?action=deleteall&password=$password" style="color:red;">Delete All Backups</a>] <br> <br> <br> <table border="0"> |; opendir (DIR, "$cgiroot/data/backups"); @files = grep { // } readdir(DIR); close (DIR); foreach $file (@files) { unless ($file eq "." || $file eq "..") { $num++; ($bfile,$junk) = split (/\./, $file); print qq| <tr> <td>$num.</td> <td>$bfile</td> <td>[<a href="$htmldir/admin.cgi?action=b_restore&b_file=$bfile&password=$password" style="color:green;">restore</a>]</td> <td>[<a href="$htmldir/admin.cgi?action=b_delete&b_file=$bfile&password=$password" style="color:red;">delete</a>]</td> </tr> |; } } print qq| </table> <br> <br> </p> </blockquote> |; exit; } #### sub new_backup{ use File::Path; print $q->header; &get_date; &header; mkpath("$cgiroot/data/backups/$month-$day-$year", 0, 0777); opendir (DIR1, "$cgiroot/data/members"); @members = grep { /.txt/ } readdir(DIR1); close (DIR1); foreach $member (@members){($memberid,$junk) = split (/\./, $member); open (FILE, "$cgiroot/data/members/$member");flock(FILE, 2); (@temp_list) = (<FILE>);flock(FILE, 8);close (FILE); foreach $item (@temp_list){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode) = split (/\|/, $item); $memlist .= "$memberid|$mempass|$memfirst|$memlast|$mememail|$memsub|$memjoined|$memlast send|$memcode|\n"; } } open (FILE, ">$cgiroot/data/backups/$month-$day-$year/members.txt"); flock(FILE, 2);print FILE "$memlist"; flock(FILE, 8);close (FILE); print qq| <p align="center"> <font color="green">Backup All Members....</font> <font color="red">success!</font> <br> <small>$cgiroot/data/backups/$month-$day-$year/members.txt</small> <br> <br> <br> [<a href="$htmldir/admin.cgi?action=backup&password=$password" style="color:blue;">click here to continue</a>] </p> <br> <br> |; exit; } #### sub deleteall{ print $q->header; &header; opendir (DIR, "$cgiroot/data/backups"); @files = grep { // } readdir(DIR); close (DIR); print qq| <p align="center"> <b><font color="blue">Deleting All Previous Data Backups....</font></b> <br> <br> |; $num = "0"; foreach $file (@files){ unless ($file eq "" || $file eq "." || $file eq ".."){ $num++; unlink "$cgiroot/data/backups/$file/members.txt"; rmdir "$cgiroot/data/backups/$file"; print qq| <small>$cgiroot/data/backups/$file/members.txt</small> <br> <small>$cgiroot/data/backups/$file</small> <br> <font color="green">BACKUP #$num.</font> "$file" <font color="red">SUCCESSFULLY DELETED!</font> <br> <br> |; } } print qq| <br> <font face="Arial" size="3">All Data Backups Were Deleted!</font> <br> <br> [<a href="$htmldir/admin.cgi?action=backup&password=$password" style="color:blue;">click here to continue</a>] </p> <br> <br> |; exit; } #### sub b_delete{ print $q->header; &header; print qq| <p align="center"> <b><font color="blue">Deleting Data Backup....</font> $b_file</b> <br> <br> |; unlink "$cgiroot/data/backups/$b_file/members.txt"; rmdir "$cgiroot/data/backups/$b_file"; print qq| <small>$cgiroot/data/backups/$b_file/members.txt</small> <br> <small>$cgiroot/data/backups/$b_file</small> <br> <font color="green">BACKUP:</font> "$b_file" <font color="red">SUCCESSFULLY DELETED!</font> <br> <br> |; print qq| <br> <font face="Arial" size="3">The Data Backup For $b_file Was Deleted!</font> <br> <br> [<a href="$htmldir/admin.cgi?action=backup&password=$password" style="color:blue;">click here to continue</a>] </p> <br> <br> |; exit; } #### sub b_restore{ print $q->header; &header; print qq| <p align="center"> <b><font color="blue">Restoring All Data From Backup....</font> $b_file</b> <br> <br> |; opendir (DIR1, "$cgiroot/data/members"); @members = grep { /.txt/ } readdir(DIR1); close (DIR1); foreach $member (@members){ unlink "$cgiroot/data/members/$member"; } open (FILE, "$cgiroot/data/backups/$b_file/members.txt"); flock(FILE, 2); (@temp_mem) = (<FILE>); flock(FILE, 8); close (FILE); foreach $item (@temp_mem){ ($musername,$mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlas tsend,$memcode) = split (/\|/, $item); $meminfo = "$mempass|$memfirst|$memlast|$mememail|$memsub|$memjoined|$memlastsend|$memc ode|\n"; open (FILE, ">$cgiroot/data/members/$musername.txt"); flock(FILE, 2); print FILE "$meminfo"; flock(FILE, 8); close (FILE); } print qq| <font color="green">BACKUP:</font> "$b_file" <font color="red">SUCCESSFULLY RESTORED!</font> <br> <br> |; print qq| <br> <font face="Arial" size="3">The Data Was Restored To: $b_file!</font> <br> <br> [<a href="$htmldir/admin.cgi?action=backup&password=$password" style="color:blue;">click here to continue</a>] </p> <br> <br> |; exit; } #### sub config{ print $q->header; &header; print qq| <form action="admin.cgi" method="post"> <p> <center> <table cellpadding="0" cellspacing="0" width="100%" border="0"> <tr> <td colspan="2" align="center" bgcolor="#EEEEEE"><font face="verdana,arial" size="3"><b>Safelist Configuration</b></font></td> </tr> <tr> <td colspan="2" align="center" bgcolor="#CCCCCC"> </td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Admin Password: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="20" name="newadmin_pass" value="$adminpass"> password used to login to admin.cgi</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Sendmail Path: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newsendmail" value="$sendmail"> ex: /usr/sbin/sendmail</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Admin Email: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newadmin" value="$admin"> ex: safelist\@yoursite.com</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Safelist Name: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newlistname" value="$listname"> ex: My Safelist</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Top Note: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newtop_note" value="$top_note"> ex: To be removed delete your account</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Bottom Note: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newbot_note" value="$bot_note"> ex: To be removed delete your account</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Link to safelist: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newhtmldir" value="$htmldir"> ex: http://www.YOU.com/cgi-bin/safelist</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Path to safelist: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newcgiroot" value="$cgiroot"> ex: /home/public_html/cgi-bin/safelist</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Link to Logout: </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><input type="text" size="30" name="newlogout" value="$logout"> ex: http://www.YOU.com/index.html</font></td> </tr> <tr> <td bgcolor="#EEEEEE" align="right"><font face="verdana,arial" size="1">Display Updates/News? </font> </td> <td bgcolor="#CCCCCC"><font face="verdana,arial" size="1"><select name="newnews"><option value="yes">Yes</option><option value="no">No</option></select> display a "member updates/news" section on main login page?</font></td> </tr> <tr> <td colspan="2" align="center" bgcolor="#CCCCCC"> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="#EEEEEE"><input type="hidden" name="password" value="$password"><input type="submit" name="action" value="Save This Configuration"></td> </tr> </table> </form> </body> |; exit; } #### sub doconfig{ $newadmin =~ s/\@/\\@/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newtop_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; $newbot_note =~ s/\n/\\n/; unlink "$cgiroot/config.cgi"; open (FILE, ">$cgiroot/config.cgi"); flock(FILE, 2); print FILE<<EOF; \$adminpass = \"$newadmin_pass\"; \$sendmail = \"$newsendmail\"; \$admin = \"$newadmin\"; \$listname = \"$newlistname\"; \$top_note = \"$newtop_note\"; \$bot_note = \"$newbot_note\"; \$htmldir = \"$newhtmldir\"; \$cgiroot = \"$newcgiroot\"; \$logout = \"$newlogout\"; \$news = \"$newnews\"; EOF flock(FILE, 8); close (FILE); $password = "$newadmin_pass"; print qq| <br> <font face="Arial" size="3">Your Safelist Configuration Has Been Saved!</font> <br> <br> [<a href="$htmldir/admin.cgi?action=config&password=$password" style="color:blue;">click here to continue</a>] </p> <br> <br> |; exit; } #### sub viewmem{ print $q->header; &header; open (MEMDATA, "$cgiroot/data/members/$member.txt");flock(MEMDATA, 2);(@memlines) = (<MEMDATA>);flock(MEMDATA, 8);close (MEMDATA); foreach $memline (@memlines){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode) = split (/\|/, $memline); } print qq| Username: $member<br> Password: $mempass<br> Firstname: $memfirst<br> Lastname: $memlast<br> Contact Email: $mememail<br> Subscribed Email: $memsub<br> Join Date: $memjoined<br> Last Send: $memlastsend<br> Validation Code: $memcode<br> |; exit; } #### sub editmem{ print $q->header; &header; open (MEMDATA, "$cgiroot/data/members/$member.txt");flock(MEMDATA, 2);(@memlines) = (<MEMDATA>);flock(MEMDATA, 8);close (MEMDATA); foreach $memline (@memlines){ ($mempass,$memfirst,$memlast,$mememail,$memsub,$memjoined,$memlastsend,$memc ode) = split (/\|/, $memline); } print qq| <form action="admin.cgi" method="POST"> <table border="0"> <tr> <td>Username:</td> <td>$member</td> </tr> <tr> <td>Password:</td> <td><input type="text" name="mempass" value="$mempass"></td> </tr> <tr> <td>First Name:</td> <td><input type="text" name="memfirst" value="$memfirst"></td> </tr> <tr> <td>Last Name:</td> <td><input type="text" name="memlast" value="$memlast"></td> </tr> <tr> <td>Contact Email:</td> <td><input type="text" name="mememail" value="$mememail"></td> </tr> <tr> <td>Subscribed Email:</td> <td><input type="text" name="memsub" value="$memsub"></td> </tr> <tr> <td><input type="hidden" name="memjoined" value="$memjoined"><input type="hidden" name="memlastsend" value="$memlastsend"><input type="hidden" name="memcode" value="$memcode"><input type="hidden" name="member" value="$member"><input type="hidden" name="password" value="$password"></td> <td align="center"><input type="submit" name="action" value=" Edit This Member "></form></td> </tr> </table> <br><br> |; exit; } #### sub doeditmem{ print $q->header; &header; unlink "$cgiroot/data/members/$member.txt"; open (FILE, ">$cgiroot/data/members/$member.txt"); flock(FILE, 2); print FILE "$mempass|$memfirst|$memlast|$mememail|$memsub|$memjoined|$memlastsend|$memc ode|\n"; flock(FILE, 8); close (FILE); print qq| <br> <font face="Arial" size="3">Member Information For <i>$member</i> Has Been Saved!</font> <br> <br> [<a href="$htmldir/admin.cgi?action=main&password=$password" style="color:blue;">click here to continue</a>] </p> <br> <br> |; exit; } #### sub m_delete{ print $q->header; &header; unlink "$cgiroot/data/members/$member.txt"; print qq| <br> <font face="Arial" size="3">Member Information For <i>$member</i> Has Been Deleted!</font> <br> <br> [<a href="$htmldir/admin.cgi?action=main&password=$password" style="color:blue;">click here to continue</a>] </p> <br> <br> |; exit; } #### sub main{print $q->header;&header;exit;} sub logout{print "Location: $logout\n\n";exit;} sub checklogin{if($password ne "$adminpass"){print "ERROR: Password \"$password\" does not match admin password!";exit;}else{}} sub login{print $q->header;print qq|<center>\n<br>\n$listname ADMIN Login\n<form method="POST" action="$htmldir/admin.cgi">\n<table border="0" cellpadding="3" cellspacing="3">\n<tr>\n<td>Password:</td>\n<td><input type="password" name="password" size="20"> <input type="submit" name="action" value="Login"></td>\n</tr>\n</table>\n</form>\n</center>\n|;exit;} sub get_date{if($_[0] eq ""){$testtime = time;} else {$testtime = $_[0];}($second,$minute,$hour,$day,$month,$year) = (localtime($testtime))[0,1,2,3,4,5];$month = $month + 1;if($month eq "1"){$month = "01";}if($month eq "2"){$month = "02";}if($month eq "3"){$month = "03";}if($month eq "4"){$month = "04";}if($month eq "5"){$month = "05";}if($month eq "6"){$month = "06";}if($month eq "7"){$month = "07";}if($month eq "8"){$month = "08";}if($month eq "9"){$month = "09";}$year += 1900;} sub header{&checklogin;opendir (DIR, "$cgiroot/data/members");@files = grep { /.txt/ } readdir(DIR);close (DIR);$memcount = 0;foreach $file (@files){$memcount++;}open (ADMIN, "$cgiroot/data/html/admin_header.txt");flock(ADMIN, 2);(@admin) = (<ADMIN>);flock(ADMIN, 8);close (ADMIN);foreach $line (@admin){$line =~ s/<admin>/$admin/;$line =~ s/<htmldir>/$htmldir/;$line =~ s/<listname>/$listname/;$line =~ s/<memcount>/$memcount/;$line =~ s/<password>/$password/;foreach $line (@admin){$line =~ s/<admin>/$admin/;$line =~ s/<htmldir>/$htmldir/;$line =~ s/<listname>/$listname/;$line =~ s/<memcount>/$memcount/;$line =~ s/<password>/$password/;}print "$line";}} -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]