Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+48 -1
View File
@@ -338,6 +338,11 @@ class _GroupPromotion extends \IPS\Node\Model
*/
protected static $extensions = NULL;
/**
* @brief Flag to indicate whether or not to check secondary groups
*/
public $memberFilterCheckSecondaryGroups = FALSE;
/**
* Check if a member matches the rule
*
@@ -357,7 +362,7 @@ class _GroupPromotion extends \IPS\Node\Model
if( isset( static::$extensions[ $key ] ) )
{
/* Ask the extension if this member matches the defined rule...if not, just return FALSE now */
if( !static::$extensions[ $key ]->matches( $member, $filter ) )
if( !static::$extensions[ $key ]->matches( $member, $filter, $this ) )
{
return FALSE;
}
@@ -367,4 +372,46 @@ class _GroupPromotion extends \IPS\Node\Model
/* If we are still here, then the rule matched */
return TRUE;
}
/**
* Return a warning if this promotion uses not existing groups
*
* @return string|NULL
*/
public function get__description()
{
$action = $this->_actions;
$showWarning = FALSE;
if ( $action['primary_group'] )
{
try
{
$group = \IPS\Member\Group::load( $action['primary_group'] );
}
catch ( \OutOfRangeException $e )
{
$showWarning = TRUE;
}
}
if ( count( $action['secondary_group'] ) )
{
foreach ( $action['secondary_group'] as $key => $group )
{
try
{
$group = \IPS\Member\Group::load( $group );
}
catch ( \OutOfRangeException $e )
{
$showWarning = TRUE;
}
}
}
if ( $showWarning )
{
return \IPS\Member::loggedIn()->language()->addToStack( 'grouppromotion_warning' );
}
}
}