Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

@@ -135,6 +135,7 @@ class _groups extends \IPS\Dispatcher\Controller
$return['copy'] = array(
'icon' => 'files-o',
'title' => 'copy',
'data' => array( 'confirm' => '', 'confirmMessage' => \IPS\Member::loggedIn()->language()->addToStack( 'group_clone_confirm_message' ), 'confirmSubMessage' => \IPS\Member::loggedIn()->language()->addToStack( 'group_clone_confirm_sub_message' ) ),
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=groups&do=copy&id=' . $row['g_id'] )->csrf(),
);
}
@@ -148,7 +149,7 @@ class _groups extends \IPS\Dispatcher\Controller
);
}
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'groups_delete' ) AND !\in_array( $row['g_id'], array( \IPS\Settings::i()->guest_group, \IPS\Settings::i()->member_group, \IPS\Settings::i()->admin_group ) ) )
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'groups_delete' ) AND \IPS\Member\Group::load($row['g_id'] )->canDelete() )
{
$return['delete'] = array(
'icon' => 'times-circle',
@@ -279,6 +280,7 @@ class _groups extends \IPS\Dispatcher\Controller
$form->addTab( '__app_' . $class::$permApp );
$matrix = new \IPS\Helpers\Form\Matrix( $class );
$matrix->classes = array( 'cGroupPermissions' );
$matrix->styledRowTitle = TRUE;
$matrix->showTooltips = TRUE;
/* Remove delete buttons and add row button */
@@ -286,9 +288,24 @@ class _groups extends \IPS\Dispatcher\Controller
/* Call the callable callbacks */
$matrix->columns = array(
'label' => function( $key, $value, $data )
'label' => function( $key, $value, $data ) use ( $class )
{
return $value;
$nodeId = explode( '[', $key )[0];
$acpUrl = NULL;
/* Let's try to get a link to the node's permissions */
try
{
$node = $class::load( $nodeId );
if ( !$node->canManagePermissions() )
throw new \DomainException;
$acpUrl = $node->acpUrl( 'permissions' );
}
catch ( \Exception $e ) { }
return \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->titleWithLink( $value, $acpUrl, 'all_permissions', \IPS\Member::loggedIn()->language()->addToStack( "all_permissions_node_hovertitle", FALSE, array( 'sprintf' => [ $value ] ) ) );
}
);
$matrix->widths = array( 'label' => 30 );
@@ -416,6 +433,10 @@ class _groups extends \IPS\Dispatcher\Controller
try
{
$group = \IPS\Member\Group::load( \IPS\Request::i()->id );
if( !$group->canDelete() )
{
\IPS\Output::i()->error( 'cannot_delete_group', '2C108/5', 403, '' );
}
$count = \IPS\Db::i()->select( 'COUNT(*)', 'core_members', array( 'member_group_id=?', $group->g_id ) )->first();
/* Any members in it? */