subscribe.html 3.19 KB
Newer Older
Eric Petit's avatar
Eric Petit committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
<?
   $title = "VideoLAN - mailing-lists subscription";
   $lang = "en";
   $date = "30 March 2001";
?>

<?
    $valid = 0;
    $message = "";
    $ok = 0;

    if( $subscribe != "" ) {
        if( $unsubscribe != "" ) {
            $error = "invalid submit query";
            $prefix = "";
        } else {
            $ok = 1;
        }
    } else {
        if( $unsubscribe != "" ) {
            $ok = 1;
            $prefix = "un";
        } else {
            $error = "invalid submit query";
        }
    }

    if( $ok != "" ) {
        /* Lame syntax checking. More than enough. */
        $from = ereg_replace("[\\\\|\\(\\)\n]","",$from);

        if( ereg( "[a-z0-9]+.*@([a-z0-9-]+\.)*[a-z0-9-]+[\.]*$", $from ) ) {
            if( $videolanannounce != "" ) {
                $message.= $prefix."subscribe videolan-announce $from\n"; $valid = 1;
            }
            if( $vlc != "" ) {
                $message.= $prefix."subscribe vlc $from\n"; $valid = 1;
            }
            if( $streaming != "" ) {
                $message.= $prefix."subscribe streaming $from\n"; $valid = 1;
            }
            if( $vlcdevel != "" ) {
                $message.= $prefix."subscribe vlc-devel $from\n"; $valid = 1;
            }
            if( $vlsdevel != "" ) {
                $message.= $prefix."subscribe vls-devel $from\n"; $valid = 1;
            }
            if( $vlcsdevel != "" ) {
                $message.= $prefix."subscribe vlcs-devel $from\n"; $valid = 1;
            }
            if( $libdvbpsidevel != "" ) {
                $message.= $prefix."subscribe libdvbpsi-devel $from\n"; $valid = 1;
            }
            if( $libdvdcssdevel != "" ) {
                $message.= $prefix."subscribe libdvdcss-devel $from\n"; $valid = 1;
            }
            if( $libdvdplaydevel != "" ) {
                $message.= $prefix."subscribe libdvdplay-devel $from\n"; $valid = 1;
            }
Gildas Bazin's avatar
 
Gildas Bazin committed
60 61 62
            if( $libdtsdevel != "" ) {
                $message.= $prefix."subscribe libdts-devel $from\n"; $valid = 1;
            }
Eric Petit's avatar
Eric Petit committed
63 64 65
            if( $managerdevel != "" ) {
                $message.= $prefix."subscribe manager-devel $from\n"; $valid = 1;
            }
Anil Daoud's avatar
 
Anil Daoud committed
66 67 68
            if( $wwwdoc != "" ) {
                $message.= $prefix."subscribe www-doc $from\n"; $valid = 1;
            }
Eric Petit's avatar
Eric Petit committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
            if( !$valid ) {
                $error = "no mailing-list specified";
            }
        } else {
            $error = "invalid e-mail address";
        }
    } else {
        $error = "no submission";
    }

    if( $valid ) {

        $header = "From: ecartis@via.ecp.fr\n";
        $message .= "-- \nSent via http://www.videolan.org/lists.html\n";

        mail("ecartis@videolan.org", "(no subject)", $message, $header);

        ?><p> The following request has been sent to <a
        href="mailto:ecartis@videolan.org">listar@videolan.org</a>:
        </p> <pre><? echo $header."\n".$message; ?></pre> <p> You
        should receive a confirmation request within the next few
        minutes. Reply to this email to confirm you subscription or
        unsubscription.</p> <?

    } else {

        ?><p> We are afraid your subscription failed for the following
        reason: <b><? echo $error; ?></b>. </p> <?

    }
?>