Skip to content

Commit

Permalink
FrontEnd de /shoot/index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Baena committed Apr 16, 2013
1 parent 0b75ffc commit f8bbe97
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 22 deletions.
6 changes: 3 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,11 @@ function showPerson($person){
} else {
$show=$person->user;
}
return $show;
return utf8_encode($show);
}

function showPlace($place){
return $place->name;
return utf8_encode($place->name);
}
/* AUTENTICACIÓN ADMINISTRADOR */

Expand All @@ -447,7 +447,7 @@ function isAdmin(){
//Busca si el usuario es administrador, y si no redirecciona a la web de login
session_start();
if((!isset($_SESSION['admin']))||($_SESSION['admin']!=true)){
header("Location: /admin/login");
header("Location: ".$GLOBALS['gameurl']."/admin/login");
}
}

Expand Down
6 changes: 3 additions & 3 deletions register/setSession/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
?>

<!DOCTYPE html>
<html lang="en">
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Detectando...</title>
Expand All @@ -24,9 +24,9 @@

<div class="jumbotron">
<h1>Abre el link en Safari</h1>
<h3>Abajo a mano derecha tienes el icono de Safari, pulsa en él y haz clic en este botón</h3>
<h3>Pulsa el el icono de Safari, abajo a la derecha</h3>
<br>
<a class="btn btn-large btn-success" href="http://qea.me/register/setSession/forceRegister.php?code=<?php echo substr($_SERVER['QUERY_STRING'],1); ?>">Clic aquí</a>
<a class="btn btn-large btn-success" href="<?php echo $GLOBALS['gameurl']; ?>/register/setSession/forceRegister.php?code=<?php echo substr($_SERVER['QUERY_STRING'],1); ?>">Clic aquí</a>
<hr>
</div>
</div>
Expand Down
21 changes: 21 additions & 0 deletions shoot/forceShoot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
// -/register/index.php
include("../functions.php");
$code=$_GET['code'];

if($code==""){
header("Location: ../");
}

$user = getPlayer(controlUserSession(false));
$thing = getInfoOf($code);

if ($user!=-1){
shoot($user->id,$code);
header("Location: ../user/?id=".$thing->id."&type=".$thing->type);
} else {
header("Location: ../");
}


?>
52 changes: 36 additions & 16 deletions shoot/index.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,52 @@
<?php
// -/register/index.php
$disparo=false;
include("../functions.php");
$code=substr($_SERVER['QUERY_STRING'],1);

if($code==""){
header("Location: ../");
}

$user = getPlayer(controlUserSession(false));
$thing=getInfoOf($code);
$user = getPlayer(controlUserSession(false));
$thing = getInfoOf($code);

if ($user!=-1){
$disparo=true;
shoot($user->id,$code);
}
/*
if(!preg_match('/iPhone/i', $agent)){
setUserSession(substr();
header("Location: ../../user");
if ($user!=-1){
shoot($user->id,$code);
header("Location: ../user/?id=".$thing->id."&type=".$thing->type);
} else {
if(!preg_match('/iPhone/i', $agent)){
header("Location: ../");
}
}
*/



?>

<P align=center>Has disparado a <?php echo ($thing->type==1?showPerson($thing):showPlace($thing)); ?><br><br>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Detectando...</title>
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body>
<div class="container">
<div class="masthead">
<img src="../img/logoetsii.png" width="40px" height="auto" class="alignleft" style="margin-right:3px"><h3 class="muted">ETSI Informática</h3>
</div>

<div class="jumbotron">
<h1>Abre el link en Safari</h1>
<h3>Pulsa el el icono de Safari, abajo a la derecha</h3>
<p align="center">Para disparar a <?php echo ($thing->type==1?showPerson($thing):showPlace($thing)); ?></p>
<br>
<a class="btn btn-large btn-success" href="<?php echo $GLOBALS['gameurl']; ?>/shoot/forceShoot.php?code=<?php echo substr($_SERVER['QUERY_STRING'],1); ?>">Y HAZ CLIC AQUÍ</a>
<hr>
</div>
</div>
</body>
</html>

Para confirmar, pulsa
<!-- boton -->
<br>AQU&Iacute;</p> <!-- (si es un iPhone, no aparecerá este botón, sino que para confirmar debes abrir con Safari)-->

0 comments on commit f8bbe97

Please sign in to comment.