\n";
//print_r( $_GET );
//print_r( $_POST );
//print_r( $_SERVER );
//echo "

\n"; $Remote_Admin_Hosts = array( "gbuchanan.dyndns-ip.com", "gbuchanan.homeip.net", "sportflight.homeip.net", "quadmax.dnsalias.net", "matronics.homeip.net", "drax.matronics.com", "domino.matronics.com", "kissy.matronics.com", "romanova.matronics.com" ); $LocalAdmin = "NO"; for( $Count = 0; $Count < count( $Remote_Admin_Hosts ); $Count++ ) { if( $_SERVER[ REMOTE_ADDR ] == gethostbyname( $Remote_Admin_Hosts[ $Count ] ) ) { $LocalAdmin = "YES"; break; } } $EmailAddress = $_GET[ EmailAddress ]; $Service = $_GET[ Service ]; if( $EmailAddress == "" ) $EmailAddress = $_GET[ EmailAddress ]; if( $EmailAddress == "" ) $EmailAddress = $_COOKIE[ MatronicsListEmailAddress ]; //if( $EmailAddress == "" ) $EmailAddress = ""; $User = $_GET[ User ]; if( $User == "" ) $Frame = "Normal"; $Frame = $_GET[ Frame ]; if( $Frame == "" ) $Frame = "frameset"; $Functions = $_GET[ Functions ]; if( $Functions == "" ) $Functions = "Subscription"; switch( $Frame ) { case "frameset": Draw_Frameset( $Service, $Functions ); break; case "header": Draw_Header( $Service, $Functions ); break; case "centerselection": Draw_CenterSelection( $Service, $Functions ); break; case "left": switch( $Functions ) { case "Subscription": Draw_LeftSubscriptions( $Service, $Functions, $EmailAddress, $LocalAdmin, $HomeDir ); break; default: break; } break; case "center": switch( $Functions ) { case "Subscription": case "Confirm": Draw_Center_Frame( $Service, $Functions, $EmailAddress, $LocalAdmin, $HomeDir, $User ); break; default: break; } break; case "right": echo "Right Frame
\n"; break; case "bottom": Draw_Bottom( $Service, $Functions ); break; } ///////////////////// Functions ///////////////////// function Draw_CenterSelection( $Service, $Functions ) { echo <<<_HTML_ Center Selection _HTML_; $Functions_Descriptor = fopen( "./.functions.txt", "r" ); if( !$Functions_Descriptor ) { echo "Error opening functions.txt; aborting...\n"; exit(); } $Count = 0; echo "\n"; for( $RawFunction = fgets( $Functions_Descriptor ); !feof( $Functions_Descriptor ); $RawFunction = fgets( $Functions_Descriptor ), $Count++ ) { if( $RawFunction[0] == "#" ) continue; list( $FunctionName, $FunctionService, $FunctionDescription ) = explode( ";", $RawFunction ); if( $FunctionService == $Functions ) echo ""; else echo ""; if( $Count != 0 && $Count % 13 == 0 ) { echo "\n"; } } echo "
$FunctionName $FunctionName
"; if( $Functions_Descriptor ) fclose( $Functions_Descriptor ); echo <<<_HTML_ _HTML_; } function Draw_Bottom( $Service, $Functions ) { echo <<<_HTML_ Bottom Header
_HTML_; } function Draw_Header( $Service, $Functions ) { echo <<<_HTML_ Main Header
       
_HTML_; } function Draw_Frameset( $Service, $Functions ) { $FrameBorders = "NO"; $FrameBorderWidth = "0"; switch( $Functions ) { case "Subscription": $LeftColWidth = "362"; $LeftScroll = "NO"; $CenterScroll = "YES"; $RightColWidth = "0"; $RightScroll = "AUTO"; break; case "Home": default: $LeftColWidth = "0"; $LeftScroll = "NO"; $CenterScroll = "AUTO"; $RightColWidth = "0"; $RightScroll = "NO"; break; } echo <<<_HTML_ Matronics Email List Portal <body> <b>YOUR BROWSER DOESN'T SUPPORT FRAMES! - UPDATE TO INTERNET EXPLORER 7 or FIREFOX 2.0 NOW!</b> </body> _HTML_; } function Draw_LeftSubscriptions( $Service, $Functions, $EmailAddress, $LocalAdmin, $HomeDir ) { //// Read in all of the Email Lists $Email_Lists_Handle = fopen( "./.emaillists", "r" ); if( !$Email_Lists_Handle ) { printf( "Error opening Email Lists file (./.emaillists); Aborting.
\n" ); exit( 0 ); } $Loop_Count = 0; while( $Email_Lists_Handle && !feof( $Email_Lists_Handle )) { $Email_Lists = fgets( $Email_Lists_Handle ); if( $Loop_Count++ > 1000 ) { printf( "Error reading Email Lists; Stuck in loop; Aborting.
\n" ); exit(0); } if( $Email_Lists[0] == "#" || strlen( $Email_Lists ) < 10 ) continue; else break; } if( $Email_Lists_Handle ) fclose( $Email_Lists_Handle ); $Email_Lists_Mixed_Case = explode( " ", $Email_Lists ); $List_Count = count( $Email_Lists_Mixed_Case ); for( $a = 0; $a < $List_Count; $a++ ) $Email_Lists_Mixed_Case[ $a ] = str_replace( "\n", "", $Email_Lists_Mixed_Case[ $a ] ); for( $a = 0; $a < $List_Count; $a++ ) $Email_Lists_Mixed_Case_Clean[ $a ] = str_replace( "-List", "", $Email_Lists_Mixed_Case[ $a ] ); for( $a = 0; $a < $List_Count; $a++ ) $Email_Lists_Lower_Case[ $a ] = strtolower( $Email_Lists_Mixed_Case[ $a ] ); for( $a = 0; $a < $List_Count; $a++ ) $Email_Lists_Upper_Case[ $a ] = strtoupper( $Email_Lists_Mixed_Case[ $a ] ); if( $EmailAddress == "" && $_POST[EmailAddress] == "" ) $EmailAddress = $_COOKIE[ MatronicsListEmailAddress ]; else if( $_POST[EmailAddress] != "" ) $EmailAddress = $_POST[EmailAddress]; setcookie( "MatronicsListEmailAddress", $EmailAddress, time()+31500000 ); $CheckBoxEnabled = "ENABLED"; if( $Service == "" ) $Service = "Find"; $Subscriptions = 0; if( $Service == "CheckAll" ) { $AllRealtime = "YES"; $AllDigest = "YES"; } else if( $Service == "UncheckAll" ) { $AllRealtime = "NO"; $AllDigest = "NO"; } else if( $Service == "CheckAllRealtime" ) { $AllRealtime = "YES"; $AllDigest = "NO"; } else if( $Service == "CheckAllDigest" ) { $AllRealtime = "NO"; $AllDigest = "YES"; } else if( $Service == "SubmitNewSubscriptions" || $Service == "Find" ) { $AllRealtime = "NO"; $AllDigest = "NO"; for( $a = 0; $a < $List_Count; $a++ ) { $CheckBoxStatus = LookupSubscription( "$Email_Lists_Lower_Case[$a]", $EmailAddress); if( $CheckBoxStatus == "CHECKED" ) { $Service = "SubmitNewSubscriptions"; $ERROR_STRING = ""; $Subscriptions++; } $CheckBoxStatus = LookupSubscription( "$Email_Lists_Lower_Case[$a]-digest", $EmailAddress); if( $CheckBoxStatus == "CHECKED" ) { $Service = "SubmitNewSubscriptions"; $ERROR_STRING = ""; $Subscriptions++; } } if( $Subscriptions ) $ERROR_STRING = "
Subscriptions Found: $Subscriptions
"; else $ERROR_STRING = "
Subscriptions Found: $Subscriptions
"; } if( $_POST[SubscribeFunction] == "Find" ) { $SubscribeChecked = "CHECKED"; $FindChecked = ""; $ShowSubscriptions = "YES"; } else if( $_POST[SubscribeFunction] == "Subscribe" ) { $SubscribeChecked = ""; $FindChecked = "CHECKED"; $ShowSubscriptions = "NO"; } else if( $Subscriptions > 0 || $EmailAddress != "" ) { $SubscribeChecked = "CHECKED"; $FindChecked = ""; $ShowSubscriptions = "YES"; } else { $SubscribeChecked = ""; $FindChecked = "CHECKED"; $ShowSubscriptions = "YES"; } if( $ERROR_STRING == "" || $ShowSubscriptions == "NO" ) $ERROR_STRING = "
--
\n"; else if( $EmailAddress == "" ) $ERROR_STRING = "
Enter Email Address
\n"; // echo <<<_HTML_ Matronics Email List Subscription Control Panel

_HTML_; $Actual_List_Count = $List_Count; if( $List_Count % 2 != 0 ) $List_Count++; if( $ShowSubscriptions == "YES" ) { echo <<<_HTML_ _HTML_; for( $a = 0, $b = ($List_Count/2); $b < $List_Count; $a++, $b++ ) { echo ""; if( $b <= $Actual_List_Count ) { if( $Service == "SubmitNewSubscriptions" ) $CheckBoxStatus = LookupSubscription( "$Email_Lists_Lower_Case[$a]", $EmailAddress); else if( $AllRealtime == "YES" ) $CheckBoxStatus = "CHECKED"; else $CheckBoxStatus = "UNCHECKED"; echo ""; if( $Service == "SubmitNewSubscriptions" ) $CheckBoxStatus = LookupSubscription( "$Email_Lists_Lower_Case[$a]-digest", $EmailAddress); else if( $AllDigest == "YES" ) $CheckBoxStatus = "CHECKED"; else $CheckBoxStatus = "UNCHECKED"; echo ""; echo ""; } // else // { // echo " "; // } echo "\n"; if( $b < $Actual_List_Count ) { if( $Service == "SubmitNewSubscriptions" ) $CheckBoxStatus = LookupSubscription( "$Email_Lists_Lower_Case[$b]", $EmailAddress); else if( $AllRealtime == "YES" ) $CheckBoxStatus = "CHECKED"; else $CheckBoxStatus = "UNCHECKED"; echo ""; if( $Service == "SubmitNewSubscriptions" ) $CheckBoxStatus = LookupSubscription( "$Email_Lists_Lower_Case[$b]-digest", $EmailAddress); else if( $AllDigest == "YES" ) $CheckBoxStatus = "CHECKED"; else $CheckBoxStatus = "UNCHECKED"; echo ""; echo ""; echo "\n"; } // else // { // echo " "; // } } } else { $RandomNumber1 = (string) time( void ); $RandomNumber2 = (string) (mt_rand( 10000000, 99999999 ) ); $SubscribeFileHandle = fopen( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.txt", "w" ); $SubscriptionRequests = fopen( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.requests", "w" ); if( !$SubscribeFileHandle ) { echo "\n"; echo "\n"; echo "\n"; } else { fwrite( $SubscribeFileHandle, "From list-admin@matronics.com\n" ); fwrite( $SubscribeFileHandle, "To: majordomo@matronics.com (Matronics Majordomo List Processor)\n" ); fwrite( $SubscribeFileHandle, "To: $EmailAddress (Matronics List Subscriber)\n" ); fwrite( $SubscribeFileHandle, "Bcc: list-admin@matronics.com (Matronics List Administrator)\n" ); fwrite( $SubscribeFileHandle, "From: list-admin@matronics.com (Matronics List Subscription Processor)\n" ); fwrite( $SubscribeFileHandle, "Errors-To: bounces@matronics.com\n" ); fwrite( $SubscribeFileHandle, "Authentication: Official Web Request\n" ); fwrite( $SubscribeFileHandle, "Subject: Matronics List Subscription ($EmailAddress)...\n" ); fwrite( $SubscribeFileHandle, "\n" ); fwrite( $SubscribeFileHandle, "\n" ); $RightNow = date( "m/d/y h:i:s A" ); $WhoDidIt = "$_SERVER[REMOTE_HOST] - $_SERVER[REMOTE_ADDR]"; $FoundUpdates = "NO"; // $List_Count = $Actual_List_Count; for( $a = 0; $a < $List_Count; $a++ ) { if( $_POST[$Email_Lists_Lower_Case[$a]] == "on" && $Email_Lists_Lower_Case[$a] ) { if( LookupSubscription( "$Email_Lists_Lower_Case[$a]", $EmailAddress ) == "UNCHECKED" ) { $FoundUpdates = "YES"; fwrite( $SubscriptionRequests, "\tSubscribe: $Email_Lists_Lower_Case[$a] $EmailAddress ($WhoDidIt - $RightNow)\n" ); if( "$Email_Lists_Lower_Case[$a]" == "kitfox-list" ) { fwrite( $SubscribeFileHandle, "approve flyafox04 subscribe $Email_Lists_Lower_Case[$a] $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); $adminflag = fopen( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.adminflag", "a" ); fwrite( $adminflag, "\t$Email_Lists_Lower_Case[$a] $EmailAddress ($WhoDidIt - $RightNow)\n" ); if( $adminflag ) fclose( $adminflag ); } else { fwrite( $SubscribeFileHandle, "approve PASSWORD subscribe $Email_Lists_Lower_Case[$a] $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); } } } else if ( $Email_Lists_Lower_Case[$a] ) { if( LookupSubscription( "$Email_Lists_Lower_Case[$a]", $EmailAddress ) == "CHECKED" ) { $FoundUpdates = "YES"; fwrite( $SubscriptionRequests, "\tUnsubscribe: $Email_Lists_Lower_Case[$a] $EmailAddress ($WhoDidIt - $RightNow)\n" ); if( "$Email_Lists_Lower_Case[$a]" == "kitfox-list" ) { fwrite( $SubscribeFileHandle, "approve flyafox04 unsubscribe $Email_Lists_Lower_Case[$a] $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); } else { fwrite( $SubscribeFileHandle, "approve PASSWORD unsubscribe $Email_Lists_Lower_Case[$a] $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); } } } $String = "$Email_Lists_Lower_Case[$a]" . "-digest"; if( $_POST[$String] == "on" && $Email_Lists_Lower_Case[$a] ) { if( LookupSubscription( "$Email_Lists_Lower_Case[$a]-digest", $EmailAddress ) == "UNCHECKED" ) { $FoundUpdates = "YES"; fwrite( $SubscriptionRequests, "\tSubscribe: $Email_Lists_Lower_Case[$a]-digest $EmailAddress ($WhoDidIt - $RightNow)\n" ); if( "$Email_Lists_Lower_Case[$a]" == "kitfox-list" ) { fwrite( $SubscribeFileHandle, "approve flyafox04 subscribe $Email_Lists_Lower_Case[$a]-digest $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); $adminflag = fopen( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.adminflag", "a" ); fwrite( $adminflag, "\t$Email_Lists_Lower_Case[$a]-digest $EmailAddress ($WhoDidIt - $RightNow)\n" ); if( $adminflag ) fclose( $adminflag ); } else { fwrite( $SubscribeFileHandle, "approve PASSWORD subscribe $Email_Lists_Lower_Case[$a]-digest $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); } } } else if ( $Email_Lists_Lower_Case[$a] ) { if( LookupSubscription( "$Email_Lists_Lower_Case[$a]-digest", $EmailAddress ) == "CHECKED" ) { $FoundUpdates = "YES"; fwrite( $SubscriptionRequests, "\tUnsubscribe: $Email_Lists_Lower_Case[$a]-digest $EmailAddress ($WhoDidIt - $RightNow)\n" ); if( "$Email_Lists_Lower_Case[$a]" == "kitfox-list" ) { fwrite( $SubscribeFileHandle, "approve flyafox04 unsubscribe $Email_Lists_Lower_Case[$a]-digest $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); } else { fwrite( $SubscribeFileHandle, "approve PASSWORD unsubscribe $Email_Lists_Lower_Case[$a]-digest $EmailAddress\t\t(Requested by: $WhoDidIt - $RightNow)\n" ); } } } } fwrite( $SubscribeFileHandle, "\n" ); fwrite( $SubscribeFileHandle, "\n" ); echo <<<_HTML_ \n"; unlink( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.txt" ); } else if( $FoundUpdates == "YES" ) { $SubscriberEmail = fopen( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.email", "w" ); if( !$SubscriberEmail ) { echo "\n"; echo "\n"; echo "\n"; } else { $string = file_get_contents( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.requests" ); fwrite( $SubscriberEmail, "From list-admin@matronics.com\n" ); fwrite( $SubscriberEmail, "To: $EmailAddress (Matronics List Subscriber)\n" ); fwrite( $SubscriberEmail, "Bcc: list-admin@mail.matronics.com (Matronics List Administrator)\n" ); fwrite( $SubscriberEmail, "From: list-admin@mail.matronics.com (Matronics List Administrator)\n" ); fwrite( $SubscriberEmail, "Errors-To: bounces@matronics.com\n" ); fwrite( $SubscriberEmail, "Subject: Matronics Subscription Verification ($EmailAddress)...\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "Dear $EmailAddress,\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "The Matronics Email List Administrator has received a request indicating that you would like your email address ($EmailAddress) added or removed from one or more Email List Forums at Matronics ( http://www.matronics.com/emaillists ).\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "If you initiated this request, please click on the Web Link below to complete the subscription process. For each respective Subscribe request, you will receive a confirmation email that will include the Email List FAQ indicating the process was successful. You will not receive a confirmation email for Unsubscribe requests.\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, " Click Here To Confirm (Requests Detailed Below):\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, " http://www.matronics.com/$HomeDir/index.php?Frame=center&Functions=Confirm&Service=Confirm&ConfirmID=$RandomNumber1$RandomNumber2\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "If you did not initiate this subscription request, do nothing. The request will be ignored.\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "Thank you,\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "Matronics Email List Administrator\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "Request Detail\n" ); fwrite( $SubscriberEmail, "--------------\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "$string\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "\n" ); fwrite( $SubscriberEmail, "\n" ); if( $SubscriberEmail ) fclose( $SubscriberEmail ); if( $_POST[DO_NOT_SEND_EMAIL_CONFIRM] != "on" ) { $SystemString = "cat /tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.email | /usr/sbin/sendmail -t -flist-admin@matronics.com"; exec( $SystemString ); } unlink( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.email" ); } if( $_POST[DO_NOT_SEND_EMAIL_CONFIRM] != "on" ) { echo "
A web link was just emailed to:

\"$EmailAddress\"

Please open your email client and click on this web link. "; echo "This will complete the Subscription/Unsubscription process and update this window with the new Subscription results.

Thank you!"; } else { echo "
EMAIL NOT SENT
PER ADMIN REQUEST

But subscription/unsubscription request built.

Click \"Process ConfirmID: xxxxx\" Link Below To Complete Request!
\n"; } echo "\n"; } else { echo "
No changes were required to execute your subscription/unsubscription request.
"; echo "\n"; unlink( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.txt" ); } } echo "\n"; for( $a = (($List_Count/2) - 17); $a; $a-- ) { echo "\n"; } unlink( "/tmp/web/.subscriptions/SubscriptionRequest.$RandomNumber1$RandomNumber2.requests" ); } if( $LocalAdmin == "YES" ) { echo "\n"; echo "\n"; echo "\n"; if( $RandomNumber2 ) { echo "\n"; } else { echo "\n"; } if( $EmailAddress ) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "\n"; } echo <<<_HTML_

List Subscriptions

Enter Your Email Address
Subscription
Find
$ERROR_STRING

 Realtime Distribution Realtime Distribution
 |   Digest Distribution |   Digest Distribution
 |  / |  /
 $Email_Lists_Mixed_Case_Clean[$a]     $Email_Lists_Mixed_Case_Clean[$b]
ERROR - Couldn't Generate Request - Aborted
--
Please Report to:
Matt Dralle dralle@matronics.com
 LycomingEngines  M14PEngines
_HTML_; if( $SubscribeFileHandle ) fclose( $SubscribeFileHandle ); if( $SubscriptionRequests ) fclose( $SubscriptionRequests ); $Blocks = file( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks" ); if( preg_grep( "/$EmailAddress.*\n/", $Blocks ) ) # Person currently blocked from subscribing to Lists { echo "
Due to abuse reports, you are currently banned from subscribing to any Lists on this service.
"; echo "
ERROR - Couldn't Generate Request - Aborted
--
Please Report to:
Matt Dralle dralle@matronics.com
 
 

Matronics Admin Panel

  • No Subscription Requests
  • Do NOT Send Confirmation Email:

_HTML_; } function LookupSubscription( $List, $EmailAddress ) { //printf( "$List " ); $ListDescriptor = fopen( "/roxy/usr/local/lists/$List", "r" ); if( !$ListDescriptor ) { return( "UNCHECKED" ); } for( $Addr = fgets( $ListDescriptor ); !feof( $ListDescriptor ); $Addr = fgets( $ListDescriptor ) ) { $Addr = str_replace( "\n", "", $Addr ); if( stristr( $EmailAddress, $Addr ) && stristr( $Addr, $EmailAddress ) ) { if( $ListDescriptor ) fclose( $ListDescriptor ); return( "CHECKED" ); } } if( $ListDescriptor ) fclose( $ListDescriptor ); return( "UNCHECKED" ); } function Draw_Center_Frame( $Service, $Functions, $EmailAddress, $LocalAdmin, $HomeDir, $User ) { switch( $Functions ) { case "Confirm": if( $User == "Admin" ) $BackgroundGraphic = "./images/MatronicsWallpaper.jpg"; else $BackgroundGraphic = "./images/stars.jpg"; echo <<<_HTML_ Matronics Email List Subscription Control Panel



_HTML_; $ConfirmID = $_GET[ ConfirmID ]; $RightNow = date( "m-d-y.h:i:s.A" ); $WhoDidIt = "$_SERVER[REMOTE_HOST] - $_SERVER[REMOTE_ADDR]"; if( $Service == "Block" ) { if( $ConfirmID != "117123144149874968" ) { echo ""; printf( "\n", implode( "", $Blocks )); } } else if( $Service == "Confirm" ) { $ConfirmID = $_GET[ ConfirmID ]; if( $ConfirmID != "" && file_exists( "/tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.txt" ) ) { # To the subscriber #$SystemString = "cat /tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.txt | egrep -v \"Matronics Majordomo List Processor|Authentication:\" | sed 's/approve PASSWORD //' | /usr/sbin/sendmail -t -flist-admin@matronics.com" ; #exec( $SystemString ); # Create an information email message for Kitfox Admins if( file_exists( "/tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.adminflag" ) ) { $AdminEmail = fopen( "/tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.adminemail", "w" ); $string = file_get_contents( "/tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.adminflag" ); fwrite( $AdminEmail, "From list-admin@matronics.com\n" ); #fwrite( $AdminEmail, "To: dralle@matronics.com\n" ); # fwrite( $AdminEmail, "To: fox5flyer@idealwifi.net, MichaelGibbs@cox.net\n" ); fwrite( $AdminEmail, "To: MichaelGibbs@cox.net\n" ); fwrite( $AdminEmail, "From: list-admin@matronics.com (Matronics List Administrator)\n" ); fwrite( $AdminEmail, "Errors-To: bounces@matronics.com\n" ); fwrite( $AdminEmail, "Subject: New Kitfox List Subscription Received...\n" ); fwrite( $AdminEmail, "Bcc: dralle@matronics.com\n" ); fwrite( $AdminEmail, "\n" ); fwrite( $AdminEmail, "The following Kitfox subscription requests were recently processed:\n" ); fwrite( $AdminEmail, "\n" ); fwrite( $AdminEmail, $string ); fwrite( $AdminEmail, "\n" ); fwrite( $AdminEmail, "FYI\n" ); fwrite( $AdminEmail, "\n" ); fwrite( $AdminEmail, "Matt Dralle\n" ); fwrite( $AdminEmail, "Matronics Email List Administrator\n" ); fwrite( $AdminEmail, "\n" ); fwrite( $AdminEmail, "\n" ); fwrite( $AdminEmail, "\n" ); if( $AdminEmail ) fclose( $AdminEmail ); $SystemString = "cat /tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.adminemail | /usr/sbin/sendmail -t -flist-admin@matronics.com"; exec( $SystemString ); unlink( "/tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.adminemail" ); unlink( "/tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.adminflag" ); } # To Majordomo $SystemString = "cat /tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.txt | egrep -v \"Matronics List Subscriber\" | /usr/sbin/sendmail -t -flist-admin@matronics.com" ; exec( $SystemString ); unlink( "/tmp/web/.subscriptions/SubscriptionRequest.$ConfirmID.txt" ); echo "
  "; echo "Error
-
Invalid Request ID"; echo "
"; } else { echo "
"; $Blocks = file_get_contents( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks" ); if( strstr( "$Blocks", "$EmailAddress" ) == "" ) { $BlocksFile = fopen( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks", "a" ); fwrite( $BlocksFile, "$EmailAddress (Blocked by: $WhoDidIt - $RightNow)\n" ); if( $BlocksFile ) fclose( $BlocksFile ); echo "Email Address
 
$EmailAddress
 
Administrativly Blocked"; } else { echo "Email Address
 
$EmailAddress
 
Already Blocked"; } echo "
"; } } else if( $Service == "Unblock" ) { if( $ConfirmID != "117123144149874968" ) { echo "
"; echo "Error
-
Invalid Request ID"; echo "
"; } else { echo "
"; $Blocks = file( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks" ); if( !preg_grep( "/$EmailAddress.*\n/", $Blocks ) ) { echo "Email Address
 
$EmailAddress
 
Not Currently Blocked"; } else { $NewBlocks = preg_grep( "/$EmailAddress.*\n/", $Blocks, PREG_GREP_INVERT ); $BlocksString = implode( "", $NewBlocks ); copy( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks", "/usr/home/httpd/htdocs/$HomeDir/.blocks/.Blocks.old.$RightNow" ); $Blocksfile = fopen( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks", "w" ); if( !$Blocksfile || !fwrite( $Blocksfile, $BlocksString ) ) { echo "Email Address
 
$EmailAddress
 
Unblock FAILED
Internal Error
"; } else { echo "Email Address
 
$EmailAddress
 
Administrativly Unblocked"; } if( $Blocksfile ) fclose( $Blocksfile ); } echo "
"; } } else if( $Service == "BlockStatus" ) { if( $ConfirmID != "117123144149874968" ) { echo "
"; echo "Error
-
Invalid Request ID"; echo "
"; } else { echo "
"; $Blocks = file( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks" ); if( !preg_grep( "/$EmailAddress.*\n/", $Blocks ) ) { echo "Email Address
 
$EmailAddress
 
Not Currently Blocked"; } else { echo "Email Address
 
$EmailAddress
 
Currently Blocked"; } echo "
"; } } else if( $Service == "AllBlockStatus" ) { if( $ConfirmID != "117123144149874968" ) { echo "
"; echo "Error
-
Invalid Request ID"; echo "
"; } else { echo "
"; $Blocks = file( "/usr/home/httpd/htdocs/$HomeDir/.blocks/Blocks" ); echo "All Currently Blocked Addresses"; echo "
"; echo "

%s
"; echo "Subscription Requests Confirmed
-
Please close this browser window."; echo "
"; touch( "/roxy/tmp/.pending_subscription_request" ); } else { echo "
"; echo "Error
-
Already Processed or Invalid Request ID"; echo "
"; } } echo <<<_HTML_
_HTML_; if( $User != "Admin" ) echo ""; echo <<<_HTML_
Matronics Email List Subscription Status _HTML_; break; case "Subscription": $filename = "./.instructions-subscribe.html"; $HTML_Text = fopen( $filename, "r" ); if( $HTML_Text ) printf( "%s", fread( $HTML_Text, filesize( $filename ) ) ); else echo "Error: Can't read from instrucntions file. Aborting."; if( $HTML_Text ) fclose( $HTML_Text ); break; default: echo <<<_HTML_ Matronics Email List Subscription Control Panel Nothing here yet... _HTML_; break; } } ?>