Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -12,39 +12,45 @@
|
||||
namespace IPS\Widget;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Member;
|
||||
use IPS\Widget;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Widget PermissionCache Class
|
||||
*/
|
||||
class _PermissionCache extends \IPS\Widget
|
||||
class PermissionCache extends Widget
|
||||
{
|
||||
/**
|
||||
* @brief cacheKey
|
||||
*/
|
||||
public $cacheKey = "";
|
||||
public string $cacheKey = "";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param String $uniqueKey Unique key for this specific instance
|
||||
* @param String $uniqueKey Unique key for this specific instance
|
||||
* @param array $configuration Widget custom configuration
|
||||
* @param null|string|array $access Array/JSON string of executable apps (core=sidebar only, content=IP.Content only, etc)
|
||||
* @param null|string $orientation Orientation (top, bottom, right, left)
|
||||
* @param array|string|null $access Array/JSON string of executable apps (core=sidebar only, content=IP.Content only, etc)
|
||||
* @param string|null $orientation Orientation (top, bottom, right, left)
|
||||
* @param string $layout
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $uniqueKey, array $configuration, $access=null, $orientation=null )
|
||||
public function __construct(string $uniqueKey, array $configuration, array|string $access=null, string $orientation=null, string $layout='table' )
|
||||
{
|
||||
parent::__construct( $uniqueKey, $configuration, $access, $orientation );
|
||||
parent::__construct( $uniqueKey, $configuration, $access, $orientation, $layout );
|
||||
|
||||
if( !$this->cacheKey )
|
||||
{
|
||||
/* We want to use the user's permissions array which will validate social groups, clubs and groups. But, we need to remove the individual member entry */
|
||||
$member = \IPS\Member::loggedIn() ?: new \IPS\Member;
|
||||
$member = Member::loggedIn() ?: new Member;
|
||||
$permissions = $member->permissionArray();
|
||||
|
||||
foreach( $permissions as $key => $entry )
|
||||
|
||||
Reference in new issue
Block a user