Restrict Content by Username Plugin 1.0.2

Submitted On: 11 Jan 2024
File Size: 10
Downloads: 56
File Version: 1.0.2
File Author: Martin Brampton
File HomePage: Click to visit site

The Black Sheep Research Plugin for selecting content by user groups in Joomla

This plugin enables the portions of text to be displayed on account of the current user being a member of specified group(s). This is achieved by surrounding the relevant text with, for example:

{user_group 5 || 7}...{/user_group}

or:

{user_group editor}...{/user_group}

or:

{user_group !8}...{/user_group}

You can specify as many groups as you wish, and they are separated by ||. By default the separator is interpreted as OR. The first group can be preceded by ! which means that the user must NOT be a member of any of the listed groups for the enclosed text to be displayed.

Note that if you want to show something to all logged in users apart from a specific group, you also need to exclude guest as in:

{user_group ! mygroup || guest}...{/user_group}

You can use group numbers or group names. If names are used, they must be the actual names in use on your site, which may vary according to the language in use.

The plugin will honour a request referring to public (group 1) but it has no point, since it permits (or refuses) everyone.

File Rating (0/0)
Log in to cast your vote
Be the first to comment! Please sign in or register.

RELATED DOCUMENTS

This report falls under the following categories. Click on a link below to explore similar documents.

ProductLines: Tools

Is there anything we can help you with in this morning ?

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.

3.739MBMemory Usage186msRequest Duration
Joomla! Version5.2.5
PHP Version8.2.28
Identityguest
Response200
Templatecassiopeia
Database
Server
mysql
Version
10.11.6-MariaDB-0+deb12u1-log
Collation
utf8mb4_unicode_ci
Conn Collation
utf8mb4_general_ci
$_GET
array:2 [ "view" => "fileinfo" "id" => 690 ]
$_POST
[]
$_SESSION
array:2 [ "aliro_auth" => array:5 [ "subj_found" => & array:1 [ "remosFolder" => array:2...
$_COOKIE
array:1 [ "d5da79bc0b36f7f37f1d1beb5d2efb16" => "sb9lt789ec3dhmg5ce18hiln8t" ]
$_SERVER
array:55 [ "USER" => "remos" "HOME" => "/var/www/remos" "SCRIPT_NAME" => "" "REQUEST_URI" =>...
session
array:3 [ "counter" => 2 "timer" => array:3 [ "start" => 1742020876 "last" => 1742020876...
registry
array:3 [ "data" => [] "initialized" => false "separator" => "." ]
user
array:21 [ "id" => 0 "name" => null "username" => null "email" => null "password" => "***r...
gtag
false
  • afterLoad (73.79KB) (906μs)
  • afterInitialise (1.04MB) (43.36ms)
  • afterRoute (347.54KB) (20.4ms)
  • beforeRenderComponent com_remository (46.16KB) (12.11ms)
  • afterRenderComponent com_remository (1.21MB) (66.12ms)
  • afterDispatch (2.27KB) (427μs)
  • beforeRenderRawModule mod_menu (Main Menu) (59.41KB) (3.64ms)
  • afterRenderRawModule mod_menu (Main Menu) (188.33KB) (4.14ms)
  • beforeRenderRawModule mod_login (Login Form) (976B) (43μs)
  • afterRenderRawModule mod_login (Login Form) (38.06KB) (1.46ms)
  • beforeRenderRawModule mod_remositorytree (Explore Repository) (704B) (41μs)
  • afterRenderRawModule mod_remositorytree (Explore Repository) (10.38KB) (4.69ms)
  • beforeRenderRawModule mod_whatsapp_agent (WhatsApp Multi Agent) (4.79KB) (660μs)
  • afterRenderRawModule mod_whatsapp_agent (WhatsApp Multi Agent) (42.06KB) (1.74ms)
  • beforeRenderModule mod_whatsapp_agent (WhatsApp Multi Agent) (736B) (17μs)
  • Before Access::preloadComponents (all components) (12.5KB) (1.4ms)
  • After Access::preloadComponents (all components) (114.68KB) (1.99ms)
  • Before Access::getAssetRules (id:1 name:root.1) (536B) (51μs)
  • After Access::getAssetRules (id:1 name:root.1) (7.05KB) (100μs)
  • afterRenderModule mod_whatsapp_agent (WhatsApp Multi Agent) (520B) (392μs)
  • beforeRenderModule mod_menu (Main Menu) (12.26KB) (218μs)
  • afterRenderModule mod_menu (Main Menu) (4.19KB) (248μs)
  • beforeRenderModule mod_login (Login Form) (640B) (24μs)
  • afterRenderModule mod_login (Login Form) (6.47KB) (113μs)
  • beforeRenderModule mod_remositorytree (Explore Repository) (5.86KB) (21μs)
  • afterRenderModule mod_remositorytree (Explore Repository) (4.48KB) (100μs)
  • beforeRenderRawModule mod_breadcrumbs (Breadcrumbs) (7.02KB) (144μs)
  • afterRenderRawModule mod_breadcrumbs (Breadcrumbs) (10.55KB) (2.18ms)
  • beforeRenderModule mod_breadcrumbs (Breadcrumbs) (704B) (17μs)
  • afterRenderModule mod_breadcrumbs (Breadcrumbs) (3.56KB) (226μs)
  • afterRender (78.67KB) (17.67ms)
  • 1 x afterRenderComponent com_remository (1.21MB) (35.63%)
    66.12ms
    1 x afterInitialise (1.04MB) (23.37%)
    43.36ms
    1 x afterRoute (347.54KB) (10.99%)
    20.40ms
    1 x afterRender (78.67KB) (9.52%)
    17.67ms
    1 x beforeRenderComponent com_remository (46.16KB) (6.53%)
    12.11ms
    1 x afterRenderRawModule mod_remositorytree (Explore Repository) (10.38KB) (2.53%)
    4.69ms
    1 x afterRenderRawModule mod_menu (Main Menu) (188.33KB) (2.23%)
    4.14ms
    1 x beforeRenderRawModule mod_menu (Main Menu) (59.41KB) (1.96%)
    3.64ms
    1 x afterRenderRawModule mod_breadcrumbs (Breadcrumbs) (10.55KB) (1.17%)
    2.18ms
    1 x After Access::preloadComponents (all components) (114.68KB) (1.07%)
    1.99ms
    1 x afterRenderRawModule mod_whatsapp_agent (WhatsApp Multi Agent) (42.06KB) (0.94%)
    1.74ms
    1 x afterRenderRawModule mod_login (Login Form) (38.06KB) (0.79%)
    1.46ms
    1 x Before Access::preloadComponents (all components) (12.5KB) (0.76%)
    1.40ms
    1 x afterLoad (73.79KB) (0.49%)
    906μs
    1 x beforeRenderRawModule mod_whatsapp_agent (WhatsApp Multi Agent) (4.79KB) (0.36%)
    660μs
    1 x afterDispatch (2.27KB) (0.23%)
    427μs
    1 x afterRenderModule mod_whatsapp_agent (WhatsApp Multi Agent) (520B) (0.21%)
    392μs
    1 x afterRenderModule mod_menu (Main Menu) (4.19KB) (0.13%)
    248μs
    1 x afterRenderModule mod_breadcrumbs (Breadcrumbs) (3.56KB) (0.12%)
    226μs
    1 x beforeRenderModule mod_menu (Main Menu) (12.26KB) (0.12%)
    218μs
    1 x beforeRenderRawModule mod_breadcrumbs (Breadcrumbs) (7.02KB) (0.08%)
    144μs
    1 x afterRenderModule mod_login (Login Form) (6.47KB) (0.06%)
    113μs
    1 x afterRenderModule mod_remositorytree (Explore Repository) (4.48KB) (0.05%)
    100μs
    1 x After Access::getAssetRules (id:1 name:root.1) (7.05KB) (0.05%)
    100μs
    1 x Before Access::getAssetRules (id:1 name:root.1) (536B) (0.03%)
    51μs
    1 x beforeRenderRawModule mod_login (Login Form) (976B) (0.02%)
    43μs
    1 x beforeRenderRawModule mod_remositorytree (Explore Repository) (704B) (0.02%)
    41μs
    1 x beforeRenderModule mod_login (Login Form) (640B) (0.01%)
    24μs
    1 x beforeRenderModule mod_remositorytree (Explore Repository) (5.86KB) (0.01%)
    21μs
    1 x beforeRenderModule mod_whatsapp_agent (WhatsApp Multi Agent) (736B) (0.01%)
    17μs
    1 x beforeRenderModule mod_breadcrumbs (Breadcrumbs) (704B) (0.01%)
    17μs
32 statements were executed, 4 of which were duplicates, 28 unique33.81ms86.73KB
  • SELECT @@SESSION.sql_mode;171μs968B/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:308Copy
  • SELECT `data` FROM `jos_session` WHERE `session_id` = ?385μs1KBParams/libraries/vendor/joomla/session/src/Handler/DatabaseHandler.php:250Copy
  • SELECT `session_id` FROM `jos_session` WHERE `session_id` = :session_id LIMIT 1236μs1.31KBParams/libraries/src/Session/MetadataManager.php:187Copy
  • UPDATE `jos_session` SET `guest` = :guest , `time` = :time , `userid` = :user_id , `username` = :username , `client_id` = :client_id WHERE `session_id` = :session_id5.05ms992BParams/libraries/src/Session/MetadataManager.php:316Copy
  • SELECT `extension_id` AS `id`,`element` AS `option`,`params`,`enabled` FROM `jos_extensions` WHERE `type` = 'component' AND `state` = 0 AND `enabled` = 1945μs17.69KB/libraries/src/Component/ComponentHelper.php:399Copy
  • SELECT `id`,`rules` FROM `jos_viewlevels`341μs656B/libraries/src/Access/Access.php:955Copy
  • SELECT `b`.`id` FROM `jos_usergroups` AS `a` LEFT JOIN `jos_usergroups` AS `b` ON `b`.`lft` <= `a`.`lft` AND `b`.`rgt` >= `a`.`rgt` WHERE `a`.`id` = :guest488μs1.33KBParams/libraries/src/Access/Access.php:868Copy
  • SELECT `folder` AS `type`,`element` AS `name`,`params` AS `params`,`extension_id` AS `id` FROM `jos_extensions` WHERE `enabled` = 1 AND `type` = 'plugin' AND `state` IN (0,1) AND `access` IN (:preparedArray1,:preparedArray2) ORDER BY `ordering`1.91ms4.48KBParams/libraries/src/Plugin/PluginHelper.php:294Copy
  • SET sql_mode=(SELECT REPLACE(@@sql_mode,'STRICT_TRANS_TABLES',''));544μs640B/administrator/components/com_osmembership/loader.php:95Copy
  • SELECT `m`.`id`,`m`.`menutype`,`m`.`title`,`m`.`alias`,`m`.`note`,`m`.`link`,`m`.`type`,`m`.`level`,`m`.`language`,`m`.`browserNav`,`m`.`access`,`m`.`params`,`m`.`home`,`m`.`img`,`m`.`template_style_id`,`m`.`component_id`,`m`.`parent_id`,`m`.`path` AS `route`,`e`.`element` AS `component` FROM `jos_menu` AS `m` LEFT JOIN `jos_extensions` AS `e` ON `m`.`component_id` = `e`.`extension_id` WHERE ( (`m`.`published` = 1 AND `m`.`parent_id` > 0 AND `m`.`client_id` = 0) AND (`m`.`publish_up` IS NULL OR `m`.`publish_up` <= :currentDate1)) AND (`m`.`publish_down` IS NULL OR `m`.`publish_down` >= :currentDate2) ORDER BY `m`.`lft`1.29ms19.8KBParams/libraries/src/Menu/SiteMenu.php:166Copy
  • SHOW TABLES LIKE 'jos_downloads_repository'1.99ms520B/libraries/BlackSheepResearch/aliro/database/ExtendedDatabase.php:143Copy
  • SELECT `path`, `link` FROM `jos_menu` WHERE `link` LIKE '%remository%' AND `published` > 0 AND `client_id` = 01.25ms608BsameCopy
  • SELECT f.id, f.containerid, f.filetitle, f.realname FROM jos_downloads_files AS f WHERE f.containerid = 1181.4ms752BsameCopy
  • SELECT `config_key`,`config_value` FROM jos_osmembership_configs631μs3.06KB/administrator/components/com_osmembership/libraries/mpf/config/config.php:42Copy
  • SELECT * FROM `jos_languages` WHERE `published` = 1 ORDER BY `ordering` ASC1.39ms1.59KB/libraries/src/Language/LanguageHelper.php:177Copy
  • SELECT `id`,`home`,`template`,`s`.`params`,`inheritable`,`parent` FROM `jos_template_styles` AS `s` LEFT JOIN `jos_extensions` AS `e` ON `e`.`element` = `s`.`template` AND `e`.`type` = 'template' AND `e`.`client_id` = `s`.`client_id` WHERE `s`.`client_id` = 0 AND `e`.`enabled` = 11.57ms832B/administrator/components/com_templates/src/Model/StyleModel.php:775Copy
  • SELECT role, subject_id, action FROM jos_permissions WHERE subject_type = 'remosFolder' AND action IN('download','edit')549μs2.38KBsameCopy
  • SELECT NOW()185μs536B/components/com_userpoints/src/Problems/SQL.php:31Copy
  • SELECT UNIX_TIMESTAMP(NOW())120μs536B/components/com_userpoints/src/Problems/SQL.php:74Copy
  • SELECT COUNT(`id`) FROM `jos_usergroups`1.03ms536B/libraries/src/Helper/UserGroupsHelper.php:207Copy
  • SELECT * FROM `jos_usergroups` ORDER BY `lft` ASC1.82ms976B/libraries/src/Helper/UserGroupsHelper.php:266Copy
  • SELECT NOW()1.01ms536BsameCopy
  • SELECT f.*, AVG(l.value) AS vote_value, COUNT(l.value) AS vote_count, CASE WHEN fv.user_id IS NULL THEN 0 WHEN fv.user_id = 0 THEN 0 ELSE 1 END AS favourite FROM jos_downloads_files AS f LEFT JOIN jos_downloads_log AS l ON l.type=3 AND l.fileid=f.id LEFT JOIN jos_downloads_favour AS fv ON fv.file_id = f.id AND fv.user_id = 0 WHERE f.id = 690 AND published=1 GROUP BY f.id1.35ms9.72KBsameCopy
  • SELECT c.*, CASE WHEN c.type = 'ProductLines' THEN 0 WHEN c.type = 'Services' THEN 1 ELSE 9 END AS typseq FROM jos_downloads_classify AS c INNER JOIN jos_downloads_file_classify AS fc ON c.id = fc.classify_id WHERE c.published != 0 AND c.hidden = 0 AND fc.file_id = 690 ORDER BY typseq, c.name1.58ms1.44KB/libraries/BlackSheepResearch/aliro/database/ExtendedDatabase.php:173Copy
  • SELECT COUNT(*) FROM jos_downloads_log WHERE type=3 AND ipaddress='18.191.37.140' AND fileid=690473μs536B/libraries/BlackSheepResearch/aliro/database/ExtendedDatabase.php:143Copy
  • SELECT COUNT(*) FROM jos_downloads_log WHERE type=3 AND ipaddress='18.191.37.140' AND fileid=690334μs0BsameCopy
  • SELECT c.id, c.title, c.comment, c.date, c.imgcount, u.id as userid, u.name, u.username FROM jos_downloads_reviews AS c INNER JOIN jos_users AS u ON c.userid=u.id WHERE c.itemid=690 ORDER BY c.date DESC537μs912B/libraries/BlackSheepResearch/aliro/database/ExtendedDatabase.php:173Copy
  • SELECT `m`.`id`,`m`.`title`,`m`.`module`,`m`.`position`,`m`.`content`,`m`.`showtitle`,`m`.`params`,`mm`.`menuid` FROM `jos_modules` AS `m` LEFT JOIN `jos_modules_menu` AS `mm` ON `mm`.`moduleid` = `m`.`id` LEFT JOIN `jos_extensions` AS `e` ON `e`.`element` = `m`.`module` AND `e`.`client_id` = `m`.`client_id` WHERE ( ( (`m`.`published` = 1 AND `e`.`enabled` = 1 AND `m`.`client_id` = :clientId AND `m`.`access` IN (:preparedArray1,:preparedArray2)) AND (`m`.`publish_up` IS NULL OR `m`.`publish_up` <= :publishUp)) AND (`m`.`publish_down` IS NULL OR `m`.`publish_down` >= :publishDown)) AND (`mm`.`menuid` = :itemId OR `mm`.`menuid` <= 0) ORDER BY `m`.`position`,`m`.`ordering`1.19ms1.89KBParams/libraries/src/Cache/Controller/CallbackController.php:51Copy
  • SELECT `id`,`name`,`rules`,`parent_id` FROM `jos_assets` WHERE `name` IN (:preparedArray1,:preparedArray2,:preparedArray3,:preparedArray4,:preparedArray5,:preparedArray6,:preparedArray7,:preparedArray8,:preparedArray9,:preparedArray10,:preparedArray11,:preparedArray12,:preparedArray13,:preparedArray14,:preparedArray15,:preparedArray16,:preparedArray17,:preparedArray18,:preparedArray19,:preparedArray20,:preparedArray21,:preparedArray22,:preparedArray23,:preparedArray24,:preparedArray25,:preparedArray26,:preparedArray27,:preparedArray28,:preparedArray29,:preparedArray30,:preparedArray31,:preparedArray32,:preparedArray33,:preparedArray34,:preparedArray35,:preparedArray36,:preparedArray37,:preparedArray38,:preparedArray39,:preparedArray40,:preparedArray41,:preparedArray42,:preparedArray43,:preparedArray44)911μs7.81KBParams/libraries/src/Access/Access.php:357Copy
  • SELECT SUM(CASE WHEN `a`.`next_execution` <= :now THEN 1 ELSE 0 END) AS due_count,SUM(CASE WHEN `a`.`locked` IS NULL THEN 0 ELSE 1 END) AS locked_count FROM `jos_scheduler_tasks` AS `a` WHERE `a`.`state` = 1437μs1.37KBParams/administrator/components/com_scheduler/src/Model/TasksModel.php:517Copy
  • SELECT `session_id` FROM `jos_session` WHERE `session_id` = ?301μs1KBParams/libraries/vendor/joomla/session/src/Handler/DatabaseHandler.php:277Copy
  • UPDATE `jos_session` SET `data` = ? , `time` = ? WHERE `session_id` = ?2.39ms592BParams/libraries/vendor/joomla/session/src/Handler/DatabaseHandler.php:301Copy