Location: PHPKode > scripts > Support Tickets Center > zingiri-tickets/extensions/guest_login.php
<?php
/*  guest_login.php
 Copyright 2008,2009,2010 EBO
 Support site: http://www.zingiri.net

 This file is part of Tickets.

 Tickets 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 of the License, or
 (at your option) any later version.

 Tickets 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 Tickets; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
?>
<?php
/**
 * Login of guest users
 * @return unknown_type
 */
function zing_tickets_guest_login(&$http,&$post)
{
	global $current_user,$wpdb;
	if (isset($current_user)) {
		$query="select `ticketID` from `##zing_ost_ticket` where `email`='".$current_user->data->user_email."' limit 1";
		$query=str_replace("##",$wpdb->prefix,$query);
		$sql = mysql_query($query);
		if ($row = mysql_fetch_array($sql)) {
			$post['lemail']=$current_user->data->user_email;
			$post['lticket']=$row['ticketID'];
			$post['submit']='View Status';
			$http=zing_tickets_http('osticket','login.php');
		} else {
			$http=zing_tickets_http('osticket','logout.php');
		}
	} else {
		$post=array();
	}
}
zing_tickets_guest_login($http,$post);
?>
Return current item: Support Tickets Center