<?php
// go to the index if not logged in.
if ($name == "") Header("Location: logout.php?".SID);
/* Check to see if user can log in */
require("mail.inc.php");
// open an IMAP connection
$mbox = @imap_open("{".$imap_server.":143}".$folder,$name,$passwd, OP_HALFOPEN);
if ($mbox == FALSE) {
die("<h2>Login Failed.</h2> <A HREF=\"index.php\" target=\"_top\">try again</A>");
} else {
// close the stream
$dummy = imap_close($mbox);
}
?>