// BASE 64 avatar !!! // // include_once 'Config.php'; require 'vendor/autoload.php'; include_once ('classes/DB.php'); include_once ('classes/Webmaster.php'); use \Firebase\JWT\JWT; if (count($args)<2) { exit; } $width = $height = "100%"; $src = HOME_HTTP . '/html5-chat/chat2/'; foreach ($args as $arg) { $src.=$arg.'/'; } $uri = $_SERVER['REQUEST_URI']; $queryString = strpos($uri, '?') ? substr($uri, strpos($uri, '?') + 0) : ''; $src.=$queryString; if ($args && strlen($args[1])>120) { $webmasterid = (isset($args[0]))?$args[0]:1; $webmaster = Webmaster::get($webmasterid); $jwt = $args[1]; try { $decoded = JWT::decode($jwt, $webmaster->password, array('HS256')); } catch(Exception $e) { exit('Security error JWT'); } if (gettype($decoded)=='object') { $myuser = (array)($decoded); } else { $myuser = json_decode($decoded, true); } //print_r($myuser); $width = isset($myuser['width'])?$myuser['width']:'100%'; $height = isset($myuser['height'])?$myuser['height']:'100%'; if (stripos($width,'px')===FALSE && stripos($width,'%')===FALSE) { $width.='px'; } if (stripos($height,'px')===FALSE && stripos($height,'%')===FALSE) { $height.='px'; } } ob_start(); ?>