summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-09-12 16:40:32 +0100
committerlsces <lester@lsces.co.uk>2025-09-12 16:40:32 +0100
commitcb01c597657dfc7a32fd575930a9ff9a6c007555 (patch)
treeb8ebca8b5856671cab40679c5ff270afbf4c21d0
parent6354daa965bae825ac3007be6dcdc518ed212428 (diff)
downloadprotector-cb01c597657dfc7a32fd575930a9ff9a6c007555.tar.gz
protector-cb01c597657dfc7a32fd575930a9ff9a6c007555.tar.bz2
protector-cb01c597657dfc7a32fd575930a9ff9a6c007555.zip
PHP8.4 style fixes to make role selection work
-rwxr-xr-xincludes/classes/LibertyProtector.php4
-rwxr-xr-xtemplates/choose_protection.tpl4
2 files changed, 4 insertions, 4 deletions
diff --git a/includes/classes/LibertyProtector.php b/includes/classes/LibertyProtector.php
index 6fbb685..cd5fccf 100755
--- a/includes/classes/LibertyProtector.php
+++ b/includes/classes/LibertyProtector.php
@@ -22,7 +22,7 @@ class LibertyProtector extends LibertyBase {
/**
* During initialisation, be sure to call our base constructors
**/
- function __construct( $pContentId=0 ) {
+ public function __construct( $pContentId=0 ) {
$this->mContentId = $pContentId ;
parent::__construct();
}
@@ -34,7 +34,7 @@ class LibertyProtector extends LibertyBase {
*
* @param object $pParamHash
*/
- function storeProtection( &$pParamHash ) {
+ public function storeProtection( &$pParamHash ) {
global $gBitSystem;
if( \Bitweaver\BitBase::verifyId( $pParamHash['protector']['role_id'] ?? 0 ) ) {
$this->mDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_content_role_map` WHERE `content_id`=?", [ $pParamHash['content_id'] ] );
diff --git a/templates/choose_protection.tpl b/templates/choose_protection.tpl
index 9084600..81bfbd5 100755
--- a/templates/choose_protection.tpl
+++ b/templates/choose_protection.tpl
@@ -4,12 +4,12 @@
{forminput}
{if $gBitSystem->isFeatureActive( 'protector_single_role' )}
Assign content to the following user role:<br/>
- {html_options name="$protector[role_id]" options=$protectorRolesId selected=$serviceHash.protector.role_id}
+ {html_options name="protector[role_id]" options=$protectorRolesId selected=$serviceHash.protector.role_id}
{formhelp note="Users assigned to this role can view this content item."}
{else}
Limit access to the following user roles:<br/>
{foreach from=$protectorRoles key=roleId item=role}
- <input type="checkbox" name="$protector[role_id][]" value="{$roleId}" {if isset($serviceHash.protector.role.$roleId)}checked="checked"{/if} /> {$role.role_name}<br/>
+ <input type="checkbox" name="protector[role_id][]" value="{$roleId}" {if isset($serviceHash.protector.role.$roleId)}checked="checked"{/if} /> {$role.role_name}<br/>
{/foreach}
{formhelp note="Users assigned to these roles can view this content item."}
{/if}