Example #1
0
         setcookie("sympaMd5", $md5);
     } else {
         echo "<P ALIGN=\"center\"><FONT COLOR=\"#ff0000\">Authentication failed</FONT></P>\n";
     }
 }
 if (isset($userEmail)) {
     echo "<FONT COLOR=\"99ccff\">logged in as " . $userEmail . "</FONT><BR>\n";
     echo "[<A HREF=\"" . $_SERVER['PHP_SELF'] . "?logout=1\">logout</A>]\n";
 } else {
     echo "You need to login first?\n Use your email address and the password obtained from <a href=\"http://demo.sympa.org/sympa\">demo.sympa.org</a> :<BR><BR>\n";
     echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\">\n    Email:  <input type=\"text\" name=\"email\"><br>\n    Password: <input type=\"password\" name=\"pwd\">\n    <input type=\"submit\" name=\"submit\" value=\"Login\">\n</form>\n";
 }
 if (isset($userEmail)) {
     // SIGNOFF
     if ($_GET['signoff'] == 1) {
         $res = $soapclient->authenticateAndRun($userEmail, $md5, 'signoff', array($_GET['list']));
         if (gettype($res) == 'array') {
             echo "<P ALIGN=\"center\"><FONT COLOR=\"#ff0000\">Unsubscription failed<BR>" . $res['faultstring'] . " : " . $res['detail'] . "</FONT></P>\n";
         } else {
             echo "<P ALIGN=\"center\"><FONT COLOR=\"#99ccff\">Successfully unsubscribed</FONT></P>\n";
         }
         // SUBSCRIBE
     } elseif ($_GET['subscribe'] == 1) {
         $res = $soapclient->authenticateAndRun($userEmail, $md5, 'subscribe', array($_GET['list']));
         if (gettype($res) == 'array') {
             echo "<P ALIGN=\"center\"><FONT COLOR=\"#ff0000\">Subscription failed<BR>" . $res['faultstring'] . " : " . $res['detail'] . "</FONT></P>\n";
         } else {
             echo "<P ALIGN=\"center\"><FONT COLOR=\"#99ccff\">Successfully subscribed</FONT></P>\n";
         }
     }
     // WHICH