| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/GXModules/Gambio/StyleEdit/Api/Controllers/ |
Upload File : |
<?php
/* --------------------------------------------------------------
JwtController.php 2019-08-05
Gambio GmbH
http://www.gambio.de
Copyright (c) 2019 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------*/
namespace Gambio\StyleEdit\Api\Controllers;
use Exception;
use Firebase\JWT\JWT;
use Gambio\StyleEdit\Core\Components\BasicController;
use stdClass;
use StyleEdit4AuthenticationController;
/**
* Class JwtController
*/
class JwtController extends BasicController
{
/**
* @var \Slim\Slim
*/
protected $app;
/**
* BasicController constructor.
*
* @param \Slim\Slim $app
*/
public function __construct(\Slim\Slim $app)
{
$this->app = $app;
}
/**
* @param array $uri
*
* @return mixed
* @throws Exception
*/
public function get(array $uri)
{
if ($this->app->config('mode') === 'development') {
$secret = StyleEdit4AuthenticationController::getSecret();
$tokenArray = StyleEdit4AuthenticationController::getTokenArray();
$result = new stdClass;
$result->token = JWT::encode($tokenArray, $secret);
echo json_encode($result);
} else {
return $this->app->response()->setStatus(403);
}
}
/**
* @param array $uri
* @param $data
*
* @return mixed
*/
public function put(array $uri, $data)
{
// TODO: Implement put() method.
}
/**
* @param array $uri
* @param $data
*
* @return mixed
*/
public function post(array $uri, $data)
{
// TODO: Implement post() method.
}
/**
* @param array $uri
* @param $data
*
* @return mixed
*/
public function delete(array $uri, $data)
{
// TODO: Implement delete() method.
}
/**
* @param array $uri
* @param $data
*
* @return mixed
*/
public function patch(array $uri, $data)
{
// TODO: Implement patch() method.
}
/**
* @return BasicController
*/
public function __clone()
{
// TODO: Implement __clone() method.
}
/**
* @return bool
*/
public function requiresAuthentication(): bool
{
return false;
}
}