65 lines
1.2 KiB
PHP
65 lines
1.2 KiB
PHP
<?php
|
||
require_once('config.php');
|
||
require_once('lib/Gchange.class.php');
|
||
require_once('lib/Fred.class.php');
|
||
require_once('lib/Keygen.class.php');
|
||
|
||
|
||
if (isset($_POST['salt'], $_POST['pepper'])) {
|
||
|
||
$fred = new Fred();
|
||
$keygen = new Keygen();
|
||
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
|
||
|
||
$_SESSION['player_pubkey'] = $playerG1Id;
|
||
|
||
$gchange = new Gchange();
|
||
$user = $gchange->getUser($_SESSION['player_pubkey']);
|
||
|
||
$_SESSION['player_lat'] = $user->_source->geoPoint->lat;
|
||
$_SESSION['player_lon'] = $user->_source->geoPoint->lon;
|
||
$_SESSION['radius'] = DEFAULT_RADIUS;
|
||
|
||
$_SESSION['salt'] = $_POST['salt'];
|
||
$_SESSION['pepper'] = $_POST['pepper'];
|
||
|
||
header('Location:home.php');
|
||
|
||
} else {
|
||
|
||
$bodyIds = 'login-page';
|
||
$webpageTitle = $games[$_SESSION['gameId']]['title'];
|
||
|
||
include_once('header.php');
|
||
|
||
echo '
|
||
<form method="post" action="">
|
||
|
||
<fieldset>
|
||
<legend>Identification par Ğchange</legend>
|
||
|
||
<p>
|
||
<label>
|
||
Identifiant :
|
||
<input type="text" name="salt" />
|
||
</label>
|
||
</p>
|
||
|
||
<p>
|
||
<label>
|
||
Mot de passe :
|
||
<input type="password" name="pepper" />
|
||
</label>
|
||
</p>
|
||
|
||
|
||
<p>
|
||
<input type="submit" value="Jouer" />
|
||
</p>
|
||
</fieldset>
|
||
</form>
|
||
';
|
||
|
||
include_once('footer.php');
|
||
|
||
} |