forked from La_Bureautique/zeg1jeux
80 lines
1.4 KiB
PHP
80 lines
1.4 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');
|
||
require_once('lib/ErrorsHandler.class.php');
|
||
|
||
|
||
$toto = 'QP1VkfaFUMdHZmHgPMi7q5wJJHaQhZcEqs5A86NigKr';
|
||
$boris = '25zB1gSC7Qhwnx463cuDLDCKLRVieLAgFiPbYq6jVHG9';
|
||
$playerG1Id = null;
|
||
|
||
if (isset($_POST['salt'], $_POST['pepper'])) {
|
||
|
||
try {
|
||
|
||
$keygen = new Keygen();
|
||
|
||
$playerG1Id = $keygen->getG1Pub($_POST['salt'], $_POST['pepper']);
|
||
$keygen->generatePubsec($_POST['salt'], $_POST['pepper']);
|
||
|
||
} catch (Exception $errMsg) {
|
||
|
||
try {
|
||
|
||
$fred = new Fred();
|
||
|
||
$playerG1Id = $fred->donneMoiSaPutainDeG1Pub($_POST['salt'], $_POST['pepper']);
|
||
|
||
} catch (Exception $errMsg) {
|
||
|
||
ErrorsHandler::kaput($errMsg);
|
||
}
|
||
}
|
||
|
||
$_SESSION['salt'] = $_POST['salt'];
|
||
$_SESSION['pepper'] = $_POST['pepper'];
|
||
$_SESSION['player_pubkey'] = $playerG1Id;
|
||
|
||
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');
|
||
|
||
}
|