It is knooown…
This commit is contained in:
parent
d7a6f9b49b
commit
f2886bcc8d
17
home.php
17
home.php
|
@ -1,11 +1,28 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('config.php');
|
require_once('config.php');
|
||||||
|
require_once('lib/Gchange.class.php');
|
||||||
|
|
||||||
$bodyIds = 'home';
|
$bodyIds = 'home';
|
||||||
include_once('header.php');
|
include_once('header.php');
|
||||||
|
|
||||||
|
$gchange = new Gchange();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$player = $gchange->getUser($_SESSION['player_pubkey']);
|
||||||
|
|
||||||
|
} catch (Exception $errMsg) {
|
||||||
|
|
||||||
|
ErrorsHandler::kaput($errMsg);
|
||||||
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
|
<header>
|
||||||
|
Bienvenue '. $player->getUserName() . ' !
|
||||||
|
<!-- ('. substr($player->getUserGchangeId(), 0, 8) . ') -->
|
||||||
|
</header>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li id="dashboard-map">
|
<li id="dashboard-map">
|
||||||
|
|
|
@ -100,8 +100,9 @@ class Fred {
|
||||||
);
|
);
|
||||||
|
|
||||||
$context = stream_context_create($opts);
|
$context = stream_context_create($opts);
|
||||||
$page1 = file_get_contents($url, false, $context)
|
|
||||||
or die('<p>On a fait du sale.</p>');
|
|
||||||
|
$page1 = file_get_contents($url, false, $context);
|
||||||
|
|
||||||
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
|
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
|
||||||
|
|
||||||
|
@ -134,7 +135,7 @@ class Fred {
|
||||||
|
|
||||||
sleep($this->gatewayDelay);
|
sleep($this->gatewayDelay);
|
||||||
|
|
||||||
$page2 = file_get_contents($url, false, $context2) or die('<pre>'. var_dump($page2, true) . '</pre>');
|
$page2 = file_get_contents($url, false, $context2);
|
||||||
}
|
}
|
||||||
|
|
||||||
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
||||||
|
|
|
@ -267,7 +267,7 @@ class Gchange {
|
||||||
|
|
||||||
$queryParams = [
|
$queryParams = [
|
||||||
'size' => $n,
|
'size' => $n,
|
||||||
'fields' => ['_id'],
|
// 'fields' => ['_id'],
|
||||||
'query' => [
|
'query' => [
|
||||||
'bool' => [
|
'bool' => [
|
||||||
'filter' => [
|
'filter' => [
|
||||||
|
@ -417,7 +417,7 @@ class Gchange {
|
||||||
|
|
||||||
$queryParams = [
|
$queryParams = [
|
||||||
'size' => $n
|
'size' => $n
|
||||||
,'fields' => ['_id']
|
// ,'fields' => ['_id']
|
||||||
,'query' => [
|
,'query' => [
|
||||||
'nested' => [
|
'nested' => [
|
||||||
'path' => 'socials',
|
'path' => 'socials',
|
||||||
|
|
31
login.php
31
login.php
|
@ -3,25 +3,42 @@ require_once('config.php');
|
||||||
require_once('lib/Gchange.class.php');
|
require_once('lib/Gchange.class.php');
|
||||||
require_once('lib/Fred.class.php');
|
require_once('lib/Fred.class.php');
|
||||||
require_once('lib/Keygen.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'])) {
|
if (isset($_POST['salt'], $_POST['pepper'])) {
|
||||||
|
|
||||||
$fred = new Fred();
|
$fred = new Fred();
|
||||||
$keygen = new Keygen();
|
$keygen = new Keygen();
|
||||||
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
|
|
||||||
|
|
||||||
$toto = 'QP1VkfaFUMdHZmHgPMi7q5wJJHaQhZcEqs5A86NigKr';
|
try {
|
||||||
$boris = '25zB1gSC7Qhwnx463cuDLDCKLRVieLAgFiPbYq6jVHG9';
|
|
||||||
// $playerG1Id = $toto;
|
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
|
||||||
|
|
||||||
|
} catch (Exception $errMsg) {
|
||||||
|
|
||||||
|
ErrorsHandler::kaput($errMsg);
|
||||||
|
}
|
||||||
|
|
||||||
$_SESSION['player_pubkey'] = $playerG1Id;
|
$_SESSION['player_pubkey'] = $playerG1Id;
|
||||||
|
|
||||||
$gchange = new Gchange();
|
$gchange = new Gchange();
|
||||||
$user = $gchange->getUser($_SESSION['player_pubkey']);
|
|
||||||
|
|
||||||
$_SESSION['player_lat'] = $user->_source->geoPoint->lat;
|
try {
|
||||||
$_SESSION['player_lon'] = $user->_source->geoPoint->lon;
|
|
||||||
|
$player = $gchange->getUser($_SESSION['player_pubkey']);
|
||||||
|
|
||||||
|
} catch (Exception $errMsg) {
|
||||||
|
|
||||||
|
ErrorsHandler::kaput($errMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['player_lat'] = $player->_source->geoPoint->lat;
|
||||||
|
$_SESSION['player_lon'] = $player->_source->geoPoint->lon;
|
||||||
$_SESSION['radius'] = DEFAULT_RADIUS;
|
$_SESSION['radius'] = DEFAULT_RADIUS;
|
||||||
|
|
||||||
$_SESSION['salt'] = $_POST['salt'];
|
$_SESSION['salt'] = $_POST['salt'];
|
||||||
|
|
Loading…
Reference in New Issue