add telegram User Data reader

This commit is contained in:
jhuesser 2018-06-07 11:48:28 +02:00 committed by Thomas Nilsen
parent 8e1ae46564
commit 65f6de7289

21
telegram.php Normal file
View File

@ -0,0 +1,21 @@
<?php
/**
* Get telegram user data
*
* Gets telegram user data from cookie and save it to array
*
* @return void
*
* @author Telegram
*
*
* @since 0.1
*/
function getTelegramUserData() {
if (isset($_COOKIE['tg_user'])) {
$auth_data_json = urldecode($_COOKIE['tg_user']);
$auth_data = json_decode($auth_data_json, true);
return $auth_data;
}
return false;
}