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

   require_once("config.php");

   $num = (isset($_REQUEST["num"]))? $_REQUEST["num"]: "";
   $login = (isset($_REQUEST["login"]))? $_REQUEST["login"]: "";
   $pass = (isset($_REQUEST["pass"]))? $_REQUEST["pass"]: ""; 
   $tz = (isset($_REQUEST["tz"]))? 0+$_REQUEST["tz"] : 0;  
   $tz2 = (isset($_REQUEST["tz2"]))? 0+$_REQUEST["tz2"] : 0; 

   $accindex = (isset($_REQUEST["accindex"]))? $_REQUEST["accindex"] : 0; 
   
   if (!(strlen($login) == 0 || strlen($pass) == 0)) {
      setcookie("TZ", $tz); 
      setcookie("TZ2",$tz2); 
   } 
   
   
   $gm = new GMailer();
   if (!$gm->created) {
      die("fail to create gmailer");
   }
   quick_init($gm);
   $tz = $tz + $tz2;

   list($login) = split('@', $login);
   $gm->setLoginInfo($login, $pass, $tz);
   if (!$gm->connect()) {
		header("Content-type: text/html; charset=utf-8");
		header("Pragma: no-cache");  // stop caching	

?> 

			<script>
				top.ACCOUNT.failed('<? echo $accindex ?>', '<? echo $login ?>@gmail.com', "Please check your login/password/cookie setting.");
			</script>

<?

   }else{
   
		header("Content-type: text/html; charset=utf-8");
		header("Pragma: no-cache");  // stop caching	

?> 

			<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 $login ?>@gmail.com', val);
			}else{
				top.ACCOUNT.failed('<? echo $accindex ?>', '<? echo $login ?>@gmail.com', "Weird error.");
			}
			</script>

<?
   }
?> 
Return current item: Laikwan WMC