Location: PHPKode > projects > Laikwan WMC > wmc_20070325/hail/login.php
<?

/*
 * Hail is a PHP-Hotmail gateway. It will allow you to
 * check your hotmail account via any webserver with PHP.
 *
 * Created by: Craig Marshall <hide@address.com> and
 * Justin Carlson <hide@address.com>, 30-May-2003
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

require("MailFolderItem.class.php");
require("MailFolder.class.php");
require("HTTPMail.class.php");


header("Content-type: text/html; charset=utf-8");
header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

@ini_set("session.use_cookies",	 0);
@ini_set("session.use_trans_sid", 1);					 
session_start();

flush();

if (array_key_exists('logout',$_GET)) {
	unset($_SESSION['hail']);
}

if (array_key_exists('login',$_GET)) {
	$user = $_GET['user'];
	$pass = $_GET['pass'];
	$accindex = $_GET['accindex'];

	$_SESSION['hail']['sess_user'] = $user;
	$_SESSION['hail']['sess_pass'] = $pass;
	$_SESSION['hail']['hm'] = new HTTPMail($user, $pass);

	if ($_SESSION['hail']['hm']->login()){
?> 
		<div style="display: none">
			<a id="a" href='a'>a</a>
		</div>

		<script>

		var p = document.getElementById('a').href.split('?');
		if(p.length>=2){
			var val = p[1].substr('PHPSESSID='.length);
			top.ACCOUNT.success('<? echo $accindex ?>', '<? echo $user ?>', val);
		}else{
			top.ACCOUNT.failed('<? echo $accindex ?>', '<? echo $user ?>', "Weird error.");
		}
		</script>
<?
	}else{
?> 
<html>
<script>
		top.ACCOUNT.failed('<? echo $accindex ?>', '<? echo $user ?>', 'Login Failure: <? echo $_SESSION['hail']['hm']->last_error ?>');
</script>
</html>

<?
	}
}
?>

Return current item: Laikwan WMC