Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

@@ -12,25 +12,33 @@
namespace IPS\nexus\extensions\core\GroupForm;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\Db;
use IPS\Extensions\GroupFormAbstract;
use IPS\Helpers\Form;
use IPS\Member\Group;
use UnderflowException;
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;
}
/**
* Admin CP Group Form
*/
class _PreventDeletion
class PreventDeletion extends GroupFormAbstract
{
/**
* Process Form
*
* @param \IPS\Helpers\Form $form The form
* @param \IPS\Member\Group $group Existing Group
* @param Form $form The form
* @param Group $group Existing Group
* @return void
*/
public function process( &$form, $group )
public function process( Form $form, Group $group ): void
{
}
@@ -39,10 +47,10 @@ class _PreventDeletion
* Save
*
* @param array $values Values from form
* @param \IPS\Member\Group $group The group
* @param Group $group The group
* @return void
*/
public function save( $values, &$group )
public function save( array $values, Group $group ) : void
{
}
@@ -50,28 +58,28 @@ class _PreventDeletion
/**
* Can this group be deleted?
*
* @param \IPS\Member\Group $group The group
* @return void
* @param Group $group The group
* @return bool
*/
public function canDelete( $group ) : bool
public function canDelete( Group $group ) : bool
{
// Is this group used for group promotion after a product purchase?
try
{
\IPS\Db::i()->select( '*', 'nexus_packages', ['p_primary_group=? OR ' . \IPS\Db::i()->findInSet('p_secondary_group', [$group->g_id] ), $group->g_id ] )->first();
Db::i()->select( '*', 'nexus_packages', ['p_primary_group=? OR ' . Db::i()->findInSet('p_secondary_group', [$group->g_id] ), $group->g_id ] )->first();
return FALSE;
}
catch(\UnderflowException $e )
catch(UnderflowException )
{
}
// Is this group used for group promotion after a subscription purchase?
try
{
\IPS\Db::i()->select( '*', 'nexus_member_subscription_packages', ['sp_primary_group=? OR ' . \IPS\Db::i()->findInSet('sp_secondary_group', [$group->g_id] ), $group->g_id ] )->first();
Db::i()->select( '*', 'nexus_member_subscription_packages', ['sp_primary_group=? OR ' . Db::i()->findInSet('sp_secondary_group', [$group->g_id] ), $group->g_id ] )->first();
return FALSE;
}
catch(\UnderflowException $e )
catch(UnderflowException )
{
}