git.cweiske.de
/
stouyapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add login for Razer Forge TV
[stouyapi.git]
/
www
/
api
/
v1
/
gamers
/
me.php
diff --git
a/www/api/v1/gamers/me.php
b/www/api/v1/gamers/me.php
index 1f20900f6d40e063d388f9069b6ea883770578ba..742e54476c5756c1416c0d8bc8d7737de0f8b06c 100644
(file)
--- a/
www/api/v1/gamers/me.php
+++ b/
www/api/v1/gamers/me.php
@@
-6,6
+6,11
@@
* @see api/v1/sessions
*/
$dbFile = __DIR__ . '/../../../../data/usernames.sqlite3';
* @see api/v1/sessions
*/
$dbFile = __DIR__ . '/../../../../data/usernames.sqlite3';
+$cfgFile = __DIR__ . '/../../../../config.php';
+if (file_exists($cfgFile)) {
+ include $cfgFile;
+}
+
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip == '') {
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip == '') {
@@
-40,13
+45,18
@@
if ($row === false) {
$data = json_decode(file_get_contents('me.json'));
$data->gamer->username = $row['username'];
$data = json_decode(file_get_contents('me.json'));
$data->gamer->username = $row['username'];
+$data->gamer->nickname = $row['username'];
switch (strtolower($row['username'])) {
case 'cweiske':
switch (strtolower($row['username'])) {
case 'cweiske':
+ $data->gamer->founder = true;
+ $data->gamer->avatar = $GLOBALS['baseUrl'] . 'avatars/cweiske.png';
+ break;
case 'szeraax':
$data->gamer->founder = true;
case 'szeraax':
$data->gamer->founder = true;
+ break;
}
header('Content-type: application/json');
}
header('Content-type: application/json');
-echo json_encode($data) . "\n";
+echo json_encode($data
, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES
) . "\n";
?>
?>