2013-07-31 20:38:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function login(){
|
|
|
|
if ( helpers :: check_if_game_client () ){
|
2013-08-27 17:08:10 +00:00
|
|
|
//check if you are logged in ingame.
|
2013-07-31 20:38:47 +00:00
|
|
|
$result = Helpers::check_login_ingame();
|
|
|
|
if( $result != "FALSE"){
|
|
|
|
//handle successful login
|
|
|
|
$_SESSION['user'] = $result['name'];
|
2013-07-31 22:08:35 +00:00
|
|
|
$_SESSION['id'] = WebUsers::getId($result['name']);
|
2013-07-31 20:38:47 +00:00
|
|
|
$_SESSION['ticket_user'] = Ticket_User::constr_ExternId($_SESSION['id']);
|
|
|
|
//go back to the index page.
|
|
|
|
header( 'Location: index.php' );
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
2013-07-31 22:08:35 +00:00
|
|
|
}
|