diff --git a/block_access.php b/block_access.php index da56d6e..d06dfcf 100644 --- a/block_access.php +++ b/block_access.php @@ -13,45 +13,32 @@ use Joomla\CMS\Uri\Uri; use Joomla\CMS\Application\CMSApplication; -class plgSystemBlock_access extends JPlugin -{ +class plgSystemBlock_access extends JPlugin { - function plgSystemBlock_access(& $subject, $config) - { - parent::__construct($subject, $config); - } - - - function onAfterInitialise() // onAfterDispatch() - { + function onAfterInitialise() { // onAfterDispatch() $app = JFactory::getApplication(); $user = JFactory::getUser(); $session= JFactory::getSession(); - if (!$this->params->get('securitykey') || $session->get('block_access')) - { + if (!$this->params->get('securitykey') || $session->get('block_access')) { return; } // Check if security key has been entered $logged = isset($_GET[$this->params->get('securitykey')]); // Check the current area the user wants so enter (site / admin) - if ($app->isClient('site')) - { + if ($app->isClient('site')) { $area = "site"; } - if ($app->isClient('administrator')) - { + if ($app->isClient('administrator')) { $area = "admin"; } $securedArea = strtolower($this->params->get('area')); - if($area == $securedArea || $securedArea == "both") - { - if ($logged) - { + if($area == $securedArea || $securedArea == "both") { + if ($logged) { $session = JFactory::getSession(); $session->set('block_access', true); // return true; @@ -59,20 +46,15 @@ function onAfterInitialise() // onAfterDispatch() else { $this->blockArea(); } - } - } - function blockArea() - { - if($this->params->get('typeOfBlock') == "message") - { + function blockArea() { + if($this->params->get('typeOfBlock') == "message") { header('HTTP/1.0 403 Forbidden'); die($this->params->get('text')); } - elseif($this->params->get('typeOfBlock') == "errorpage") - { + elseif($this->params->get('typeOfBlock') == "errorpage") { $uri = Uri::getInstance(); $url = $uri->toString(); (CMSApplication::getInstance('site'))->redirect(JUri::root(), 301); diff --git a/block_access.xml b/block_access.xml index 5c347c8..7c70eb8 100644 --- a/block_access.xml +++ b/block_access.xml @@ -1,18 +1,18 @@ - + PLG_BLOCK_ACCESS_NAME Stefan Herzog October 2021 This plugin is released under the GNU/GPL License GNU General Public License joomla@devel.stefan-herzog.com - 1.1.5 + 1.1.6 PLG_BLOCK_ACCESS_DESC block_access.php index.html language - +
@@ -30,7 +30,13 @@
+ + + de-DE.plg_system_block_access.ini + de-DE.plg_system_block_access.sys.ini + + - https://raw.githubusercontent.com/alve89/plg_block_access/master/updates.xml + https://raw.githubusercontent.com/alve89/plg_block_access/master/updates.xml
diff --git a/updates.xml b/updates.xml index 7bb0594..9fbc703 100644 --- a/updates.xml +++ b/updates.xml @@ -7,15 +7,15 @@ plugin system 0 - 1.1.5 + 1.1.6 - https://github.com/alve89/plg_block_access/archive/v1.1.5.zip + https://github.com/alve89/plg_block_access/archive/v1.1.6.zip stable Stefan Herzog https://github.com/alve89 - +