Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -259,7 +259,17 @@ class _admin extends \IPS\Dispatcher\Controller
|
||||
'row_updated' => time()
|
||||
);
|
||||
\IPS\Db::i()->insert( 'core_admin_permission_rows', $current );
|
||||
\IPS\Session::i()->log( 'acplog__acpr_created', array( ( $values['acprestrictions_type'] == 'group' ? \IPS\Member\Group::load( $values['acprestrictions_group'] )->name : $values['acprestrictions_member']->name ) => FALSE ) );
|
||||
|
||||
if( $values['acprestrictions_type'] == 'group' )
|
||||
{
|
||||
$logValue = array( 'core_group_' . $values['acprestrictions_group'] => TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
$logValue = array( $values['acprestrictions_member']->name => FALSE );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__acpr_created', $logValue );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -316,24 +326,37 @@ class _admin extends \IPS\Dispatcher\Controller
|
||||
$restrictions = array();
|
||||
foreach ( \IPS\Application::applications() as $app )
|
||||
{
|
||||
$restrictions['applications'][ $app->directory ] = $app->id;
|
||||
|
||||
$_restrictions = array();
|
||||
$file = \IPS\ROOT_PATH . "/applications/{$app->directory}/data/acprestrictions.json";
|
||||
if ( file_exists( $file ) )
|
||||
{
|
||||
$_restrictions = json_decode( file_get_contents( $file ), TRUE );
|
||||
}
|
||||
|
||||
foreach ( $app->modules( 'admin' ) as $module )
|
||||
{
|
||||
if ( !$module->protected )
|
||||
if ( !\IPS\CIC or !\in_array( "{$app->directory}", \IPS\Member::$cicBlockedAcpRestrictions ) )
|
||||
{
|
||||
$restrictions['applications'][ $app->directory ] = $app->id;
|
||||
|
||||
$_restrictions = array();
|
||||
$file = $app->getApplicationPath() . '/data/acprestrictions.json';
|
||||
|
||||
if ( file_exists( $file ) )
|
||||
{
|
||||
$restrictions['modules'][ $app->id ][ $module->key ] = $module->id;
|
||||
|
||||
if ( isset( $_restrictions[ $module->key ] ) )
|
||||
$_restrictions = json_decode( file_get_contents( $file ), TRUE );
|
||||
}
|
||||
|
||||
foreach ( $app->modules( 'admin' ) as $module )
|
||||
{
|
||||
if ( !$module->protected and ( !\IPS\CIC or !\in_array( "{$app->directory}.{$module->key}", \IPS\Member::$cicBlockedAcpRestrictions ) ) )
|
||||
{
|
||||
$restrictions['items'][ $module->id ] = $_restrictions[ $module->key ];
|
||||
$restrictions['modules'][ $app->id ][ $module->key ] = $module->id;
|
||||
|
||||
if ( isset( $_restrictions[ $module->key ] ) )
|
||||
{
|
||||
foreach ( $_restrictions[ $module->key ] as $group => $items )
|
||||
{
|
||||
foreach ( $items as $restrictionKey => $langKey )
|
||||
{
|
||||
if ( !\IPS\CIC or !\in_array( "{$app->directory}.{$module->key}.{$restrictionKey}", \IPS\Member::$cicBlockedAcpRestrictions ) )
|
||||
{
|
||||
$restrictions['items'][ $module->id ][ $group ][ $restrictionKey ] = $langKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -369,7 +392,16 @@ class _admin extends \IPS\Dispatcher\Controller
|
||||
unset( \IPS\Data\Store::i()->administrators );
|
||||
|
||||
/* Log */
|
||||
\IPS\Session::i()->log( 'acplog__acpr_edited', array( ( $current['row_id_type'] == 'group' ? \IPS\Member\Group::load( $current['row_id'] )->name : \IPS\Member::load( $current['row_id'] )->name ) => FALSE ) );
|
||||
if( $current['row_id_type'] == 'group' )
|
||||
{
|
||||
$logValue = array( 'core_group_' . $current['row_id'] => TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
$logValue = array( \IPS\Member::load( $current['row_id'] )->name => FALSE );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__acpr_edited', $logValue );
|
||||
|
||||
/* Boink */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=staff&controller=admin' ), 'saved' );
|
||||
@@ -400,12 +432,14 @@ class _admin extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
try
|
||||
{
|
||||
$name = \IPS\Member\Group::load( $current['row_id'] )->name;
|
||||
$name = 'core_group_' . $current['row_id'];
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
$name = \IPS\Member::loggedIn()->language()->get('deleted_group');
|
||||
$name = 'deleted_group';
|
||||
}
|
||||
|
||||
$logValue = array( $name => TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -413,15 +447,16 @@ class _admin extends \IPS\Dispatcher\Controller
|
||||
|
||||
if( $member->member_id )
|
||||
{
|
||||
$name = $member->name;
|
||||
$logValue = array( $member->name => FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
$name = \IPS\Member::loggedIn()->language()->get('deleted_member');
|
||||
$logValue = array( 'deleted_member' => TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__acpr_deleted', array( $name => FALSE ) );
|
||||
\IPS\Session::i()->log( 'acplog__acpr_deleted', $logValue );
|
||||
|
||||
\IPS\Db::i()->delete( 'core_admin_permission_rows', array( 'row_id=? AND row_id_type=?', \intval( \IPS\Request::i()->id ), \IPS\Request::i()->type ) );
|
||||
unset ( \IPS\Data\Store::i()->administrators );
|
||||
|
||||
|
||||
Reference in new issue
Block a user