Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+133 -117
View File
@@ -11,7 +11,7 @@
namespace IPS\core\modules\admin\overview;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -23,14 +23,9 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
class _files extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
* @brief Has been CSRF-protected
*/
public function execute()
{
parent::execute();
}
public static $csrfProtected = TRUE;
/**
* Manage Attachment Types
@@ -93,14 +88,14 @@ class _files extends \IPS\Dispatcher\Controller
{
if ( $row['attach_is_image'] and $table->filter === 'images' )
{
$url = \IPS\Http\Url::external( \IPS\File::get( 'core_Attachment', $row['attach_location'] )->url )->makeSafeForAcp( TRUE );
$url = \IPS\Http\Url::external( \IPS\File::get( 'core_Attachment', $row['attach_location'] )->url );
return "<a href='{$url}' target='_blank' rel='noopener'><img src='{$url}' style='max-height:200px'></a>";
}
else
{
$url = \IPS\Http\Url::external( \IPS\Settings::i()->base_url . "applications/core/interface/file/attachment.php" )->setQueryString( 'id', $row['attach_id'] )->makeSafeForAcp( FALSE );
$url = \IPS\Http\Url::external( \IPS\Settings::i()->base_url . "applications/core/interface/file/attachment.php" )->setQueryString( 'id', $row['attach_id'] );
$val = htmlentities( $val, ENT_DISALLOWED, 'UTF-8', FALSE );
return "<a href='{$url}' target='_blank' rel='noopener'>{$val}</a>";
return "<a href='{$url}' target='_blank' rel='noreferrer'>{$val}</a>";
}
},
'attach_filesize' => function( $val )
@@ -138,7 +133,7 @@ class _files extends \IPS\Dispatcher\Controller
}
else
{
return "<a href='" . \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=edit&id=' . $val ) . "'>" . htmlentities( \IPS\Member::load( $val )->name, ENT_DISALLOWED, 'UTF-8', FALSE ) . '</a>';
return "<a href='" . \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=view&id=' . $val ) . "'>" . htmlentities( \IPS\Member::load( $val )->name, ENT_DISALLOWED, 'UTF-8', FALSE ) . '</a>';
}
}
@@ -191,7 +186,7 @@ class _files extends \IPS\Dispatcher\Controller
$loadedExtensions = array();
$locations = array();
foreach ( \IPS\Db::i()->select( '*', 'core_attachments_map', array( 'attachment_id=?', intval( \IPS\Request::i()->id ) ) ) as $map )
foreach ( \IPS\Db::i()->select( '*', 'core_attachments_map', array( 'attachment_id=?', \intval( \IPS\Request::i()->id ) ) ) as $map )
{
if ( !isset( $loadedExtensions[ $map['location_key'] ] ) )
{
@@ -207,7 +202,7 @@ class _files extends \IPS\Dispatcher\Controller
catch ( \OutOfRangeException $e ){ }
}
if ( isset( $loadedExtensions[ $map['location_key'] ] ) )
if ( isset( $loadedExtensions[ $map['location_key'] ] ) AND method_exists( $loadedExtensions[ $map['location_key'] ], 'attachmentLookup' ) )
{
try
{
@@ -311,7 +306,8 @@ class _files extends \IPS\Dispatcher\Controller
$configurations = array();
foreach ( \IPS\Db::i()->select( '*', 'core_file_storage' ) as $row )
{
$classname = 'IPS\File\\' . $row['method'];
$handlers = \IPS\File::storageHandlers( $row );
$classname = $handlers[ $row['method'] ];
$configurations[ $row['id'] ] = $classname::displayName( json_decode( $row['configuration'], TRUE ) );
}
@@ -319,12 +315,12 @@ class _files extends \IPS\Dispatcher\Controller
$form->addMessage( 'filestorage_move_info' );
foreach ( \IPS\Application::allExtensions( 'core', 'FileStorage', FALSE, NULL, NULL, TRUE ) as $name => $obj )
{
$disabled = ( isset( $settings[ "filestorage__{$name}" ] ) and is_array( $settings[ "filestorage__{$name}" ] ) ) ? TRUE : FALSE;
$disabled = ( isset( $settings[ "filestorage__{$name}" ] ) and \is_array( $settings[ "filestorage__{$name}" ] ) ) ? TRUE : FALSE;
$value = NULL;
if ( isset( $settings[ "filestorage__{$name}" ] ) )
{
if ( is_array( $settings[ "filestorage__{$name}" ] ) )
if ( \is_array( $settings[ "filestorage__{$name}" ] ) )
{
$copyOfSettings = $settings[ "filestorage__{$name}" ];
$value = array_shift( $copyOfSettings );
@@ -335,73 +331,91 @@ class _files extends \IPS\Dispatcher\Controller
}
}
$form->add( new \IPS\Helpers\Form\Select( 'filestorage__' . $name, (int) $value, TRUE, array( 'options' => $configurations, 'disabled' => $disabled ) ) );
$toggles = array();
foreach( $configurations as $id => $title )
{
if( $id != $value )
{
$toggles[ $id ] = array( 'filestorage_move' );
}
}
$form->add( new \IPS\Helpers\Form\Select( 'filestorage__' . $name, (int) $value, TRUE, array( 'options' => $configurations, 'disabled' => $disabled, 'toggles' => $toggles ) ) );
if ( $disabled )
{
\IPS\Member::loggedIn()->language()->words[ 'filestorage__' . $name . '_warning' ] = \IPS\Member::loggedIn()->language()->addToStack( 'file_storage_move_in_progress' );
}
}
$form->add( new \IPS\Helpers\Form\YesNo( 'filestorage_move', TRUE, FALSE, array(), NULL, NULL, NULL, 'filestorage_move' ) );
if ( $values = $form->values() )
{
$rebuild = FALSE;
/* Queue theme first */
if( isset( $values['filestorage__core_Theme'] ) and $settings['filestorage__core_Theme'] != $values['filestorage__core_Theme'] )
{
$rebuild = TRUE;
$extension = new \IPS\core\extensions\core\FileStorage\Theme;
\IPS\Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => 'filestorage__core_Theme', 'oldConfiguration' => $settings[ 'filestorage__core_Theme' ], 'newConfiguration' => $values[ 'filestorage__core_Theme' ], 'count' => $extension->count() ), 1 );
/* Add to allowed storage methods so when moving files, we can accept old config or new config if move is in progress. Important: order is array(x, y) x is the new location (pos 0), y is the old location (pos 1)*/
$values['filestorage__core_Theme'] = array( $values['filestorage__core_Theme'], $settings['filestorage__core_Theme'] );
}
foreach ( $values as $k => $v )
if( isset( $values['filestorage_move'] ) AND $values['filestorage_move'] )
{
if ( isset( $settings[$k] ) AND !is_array( $settings[$k] ) )
{
if ( $settings[ $k ] != $v and $k != 'filestorage__core_Theme' )
{
/* Do we need to move files at all? */
$configurations = \IPS\File::getConfigurations();
$exploded = explode( '_', $k );
$classname = "IPS\\{$exploded[2]}\\extensions\\core\\FileStorage\\{$exploded[3]}";
$extension = new $classname;
$currentClass = \IPS\File::getClass( intval( $settings[ $k ] ) );
$newClass = \IPS\File::getClass( intval( $v ) );
if ( ( isset( $configurations[ $v ] ) and isset( $configurations[ $settings[ $k ] ] ) ) and ( get_class( $currentClass ) == get_class( $newClass ) ) and ! $newClass::moveCheck( $newClass->configuration, $currentClass->configuration ) )
{
$rebuild = FALSE;
}
else
{
$rebuild = TRUE;
}
$rebuild = FALSE;
if ( $rebuild )
/* Queue theme first */
if( isset( $values['filestorage__core_Theme'] ) and $settings['filestorage__core_Theme'] != $values['filestorage__core_Theme'] )
{
$rebuild = TRUE;
$extension = new \IPS\core\extensions\core\FileStorage\Theme;
\IPS\Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => 'filestorage__core_Theme', 'oldConfiguration' => $settings[ 'filestorage__core_Theme' ], 'newConfiguration' => $values[ 'filestorage__core_Theme' ], 'count' => $extension->count() ), 1 );
/* Add to allowed storage methods so when moving files, we can accept old config or new config if move is in progress. Important: order is array(x, y) x is the new location (pos 0), y is the old location (pos 1)*/
$values['filestorage__core_Theme'] = array( $values['filestorage__core_Theme'], $settings['filestorage__core_Theme'] );
}
$totalCount = 0;
foreach ( $values as $k => $v )
{
if ( isset( $settings[$k] ) AND !\is_array( $settings[$k] ) )
{
if ( $settings[ $k ] != $v and $k != 'filestorage__core_Theme' AND $k != 'filestorage_move' )
{
$count = $extension->count();
/* Do we need to move files at all? */
$configurations = \IPS\File::getConfigurations();
$exploded = explode( '_', $k );
$classname = "IPS\\{$exploded[2]}\\extensions\\core\\FileStorage\\{$exploded[3]}";
$extension = new $classname;
$currentClass = \IPS\File::getClass( \intval( $settings[ $k ] ) );
$newClass = \IPS\File::getClass( \intval( $v ) );
if ( $count )
if ( ( isset( $configurations[ $v ] ) and isset( $configurations[ $settings[ $k ] ] ) ) and ( \get_class( $currentClass ) == \get_class( $newClass ) ) and ! $newClass::moveCheck( $newClass->configuration, $currentClass->configuration ) )
{
\IPS\Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => $k, 'oldConfiguration' => $settings[ $k ], 'newConfiguration' => $values[ $k ], 'count' => $count ), 2 );
$rebuild = FALSE;
}
else
{
$rebuild = TRUE;
}
if ( $rebuild )
{
$count = $extension->count();
/* Add to allowed storage methods so when moving files, we can accept old config or new config if move is in progress. Important: order is array(x, y) x is the new location (pos 0), y is the old location (pos 1)*/
$values[ $k ] = array( $v, $settings[ $k ] );
if ( $count )
{
$totalCount += $count;
\IPS\Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => $k, 'oldConfiguration' => $settings[ $k ], 'newConfiguration' => $values[ $k ], 'count' => $count ), 2 );
/* Add to allowed storage methods so when moving files, we can accept old config or new config if move is in progress. Important: order is array(x, y) x is the new location (pos 0), y is the old location (pos 1)*/
$values[ $k ] = array( $v, $settings[ $k ] );
}
}
}
}
}
if( $rebuild )
{
\IPS\Task::queue( 'core', 'DeleteMovedFiles', array( 'delete' => true, 'count' => $totalCount ), 5, array( 'delete' ) ); /* We use a key in the data array just to trigger the code that deletes duplicate tasks */
}
}
if( $rebuild )
{
\IPS\Task::queue( 'core', 'DeleteMovedFiles', array( 'delete' => true ), 5, array( 'delete' ) ); /* We use a key in the data array just to trigger the code that deletes duplicate tasks */
}
/* Update the settings */
\IPS\Settings::i()->changeValues( array( 'upload_settings' => json_encode( $values ) ) );
/* Clear guest page caches */
@@ -422,7 +436,8 @@ class _files extends \IPS\Dispatcher\Controller
$table->noSort = array( 'filestorage_method' );
$table->parsers = array( 'filestorage_method' => function( $val, $row )
{
$classname = 'IPS\File\\' . $row['method'];
$handlers = \IPS\File::storageHandlers( $row );
$classname = $handlers[ $row['method'] ];
return $classname::displayName( json_decode( $row['configuration'], TRUE ) );
} );
@@ -448,7 +463,7 @@ class _files extends \IPS\Dispatcher\Controller
'delete' => array(
'icon' => 'times-circle',
'title' => 'delete',
'link' => \IPS\Http\Url::internal( "app=core&module=overview&controller=files&do=configurationForm&id={$row['id']}&delete=1" )
'link' => \IPS\Http\Url::internal( "app=core&module=overview&controller=files&do=configurationForm&id={$row['id']}&delete=1" )->csrf()
),
);
};
@@ -487,7 +502,7 @@ class _files extends \IPS\Dispatcher\Controller
protected function fileLogSettings()
{
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\Number( 'file_log_pruning', \IPS\Settings::i()->file_log_pruning, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), \IPS\Member::loggedIn()->language()->addToStack('days'), 'file_log_pruning' ) );
$form->add( new \IPS\Helpers\Form\Interval( 'file_log_pruning', \IPS\Settings::i()->file_log_pruning, FALSE, array( 'valueAs' => \IPS\Helpers\Form\Interval::DAYS, 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), NULL, 'file_log_pruning' ) );
if ( $values = $form->values() )
{
@@ -515,10 +530,10 @@ class _files extends \IPS\Dispatcher\Controller
{
try
{
$current = \IPS\Db::i()->select( '*', 'core_file_storage', array( 'id=?', intval( \IPS\Request::i()->id ) ) )->first();
$current = \IPS\Db::i()->select( '*', 'core_file_storage', array( 'id=?', \intval( \IPS\Request::i()->id ) ) )->first();
$currentHandlerSettings = json_decode( $current['configuration'], TRUE );
if ( in_array( intval( \IPS\Request::i()->id ), json_decode( \IPS\Settings::i()->upload_settings, TRUE ) ) )
if ( \in_array( \intval( \IPS\Request::i()->id ), array_filter( json_decode( \IPS\Settings::i()->upload_settings, TRUE ), function( $key ){ return $key != 'filestorage_move'; }, ARRAY_FILTER_USE_KEY ) ) )
{
if ( isset( \IPS\Request::i()->delete ) )
{
@@ -546,7 +561,9 @@ class _files extends \IPS\Dispatcher\Controller
if ( isset( \IPS\Request::i()->delete ) )
{
\IPS\Db::i()->delete( 'core_file_storage', array( 'id=?', intval( \IPS\Request::i()->id ) ) );
\IPS\Session::i()->csrfCheck();
\IPS\Db::i()->delete( 'core_file_storage', array( 'id=?', \intval( \IPS\Request::i()->id ) ) );
unset( \IPS\Data\Store::i()->storageConfigurations );
\IPS\Session::i()->log( 'acplogs__files_config_removed', array() );
@@ -564,54 +581,36 @@ class _files extends \IPS\Dispatcher\Controller
$handlers = array();
$handlerSettings = array();
$toggles = array();
foreach ( new \DirectoryIterator( \IPS\ROOT_PATH . '/system/File' ) as $f )
foreach ( \IPS\File::storageHandlers( $current ) as $key => $class )
{
if ( !$f->isDot() and mb_substr( $f, -4 ) === '.php' and $f != 'File.php' and $f != 'Iterator.php' and $f != 'Exception.php' )
{
$key = mb_substr( $f, 0, -4 );
if ( \IPS\CIC and $key === 'FileSystem' )
$handlers[ $key ] = 'filehandler__' . $key;
foreach ( $class::settings( $currentHandlerSettings ) as $k => $v )
{
if ( \is_array( $v ) )
{
continue;
}
/* Hide FTP option from form unless it's already in use */
if ( ( $key === 'Ftp' AND isset( $current['method'] ) AND $current['method'] !== 'Ftp' ) OR ( $key === 'Ftp' AND !isset( $current['method'] ) ) )
{
continue;
}
$handlers[ $key ] = 'filehandler__' . $key;
$class = 'IPS\File\\' . $key;
foreach ( $class::settings( $currentHandlerSettings ) as $k => $v )
{
if ( is_array( $v ) )
$settingClass = '\IPS\Helpers\Form\\' . $v['type'];
$default = isset( $currentHandlerSettings[ $k ] ) ? str_replace( '{root}', \IPS\ROOT_PATH, $currentHandlerSettings[ $k ] ) : NULL;
if ( isset( $v['default'] ) and !$default )
{
$settingClass = '\IPS\Helpers\Form\\' . $v['type'];
$default = isset( $currentHandlerSettings[ $k ] ) ? str_replace( '{root}', \IPS\ROOT_PATH, $currentHandlerSettings[ $k ] ) : NULL;
if ( isset( $v['default'] ) and !$default )
{
$default = str_replace( '{root}', \IPS\ROOT_PATH, $v['default'] );
}
$handlerSettings[ $key ][ $k ] = new $settingClass( "filehandler__{$key}_{$k}", $default, FALSE, isset( $v['options'] ) ? $v['options'] : array(), isset( $v['validate'] ) ? $v['validate'] : NULL, isset( $v['prefix'] ) ? $v['prefix'] : NULL, isset( $v['suffix'] ) ? $v['suffix'] : NULL, "{$key}_{$k}" );
$default = str_replace( '{root}', \IPS\ROOT_PATH, $v['default'] );
}
else
{
$settingClass = '\IPS\Helpers\Form\\' . $v;
$handlerSettings[ $key ][ $k ] = new $settingClass( "filehandler__{$key}_{$k}", isset( $currentHandlerSettings[ $k ] ) ? $currentHandlerSettings[ $k ] : NULL, FALSE, array(), NULL, NULL, NULL, "{$key}_{$k}" );
}
$toggles[ $key ][ $k ] = "{$key}_{$k}";
$handlerSettings[ $key ][ $k ] = new $settingClass( "filehandler__{$key}_{$k}", $default, FALSE, isset( $v['options'] ) ? $v['options'] : array(), isset( $v['validate'] ) ? $v['validate'] : NULL, isset( $v['prefix'] ) ? $v['prefix'] : NULL, isset( $v['suffix'] ) ? $v['suffix'] : NULL, "{$key}_{$k}" );
}
else
{
$settingClass = '\IPS\Helpers\Form\\' . $v;
$handlerSettings[ $key ][ $k ] = new $settingClass( "filehandler__{$key}_{$k}", isset( $currentHandlerSettings[ $k ] ) ? $currentHandlerSettings[ $k ] : NULL, FALSE, array(), NULL, NULL, NULL, "{$key}_{$k}" );
}
$toggles[ $key ][ $k ] = "{$key}_{$k}";
}
}
/* Build form */
$form = new \IPS\Helpers\Form;
$form->hiddenValues['configurationId'] = isset( \IPS\Request::i()->id ) ? \IPS\Request::i()->id : 0;
if ( isset( \IPS\Request::i()->id ) AND in_array( intval( \IPS\Request::i()->id ), json_decode( \IPS\Settings::i()->upload_settings, TRUE ) ) and $current['method'] !== 'FileSystem')
if ( isset( \IPS\Request::i()->id ) AND \in_array( \intval( \IPS\Request::i()->id ), json_decode( \IPS\Settings::i()->upload_settings, TRUE ) ) and $current['method'] !== 'FileSystem')
{
$form->addMessage( 'files_edit_existing_and_used', 'ipsMessage ipsMessage_info' );
}
@@ -643,7 +642,7 @@ class _files extends \IPS\Dispatcher\Controller
}
}
$classname = 'IPS\File\\' . $values['filestorage_method'];
$classname = \IPS\File::storageHandlers( $current )[ $values['filestorage_method'] ];
if ( method_exists( $classname, 'testSettings' ) )
{
$classname::testSettings( $currentHandlerSettings );
@@ -695,9 +694,13 @@ class _files extends \IPS\Dispatcher\Controller
) );
unset( \IPS\Data\Store::i()->storageConfigurations );
/* Log the storage addition */
\IPS\Session::i()->log( 'acplogs__files_config_added' );
if ( $createNewAndMove )
{
$settings = json_decode( \IPS\Settings::i()->upload_settings, TRUE );
$totalCount = 0;
foreach ( $settings as $k => $v )
{
if ( $v == $current['id'] )
@@ -712,8 +715,9 @@ class _files extends \IPS\Dispatcher\Controller
if( \IPS\Application::appIsEnabled( $exploded[2] ) AND class_exists( $classname ) )
{
$extension = new $classname;
\IPS\Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => $k, 'oldConfiguration' => $v, 'newConfiguration' => $insertId, 'count' => $extension->count() ), 2 );
$count = $extension->count();
$totalCount += $count;
\IPS\Task::queue( 'core', 'MoveFiles', array( 'storageExtension' => $k, 'oldConfiguration' => $v, 'newConfiguration' => $insertId, 'count' => $count ), 2 );
}
$settings[ $k ] = $insertId;
@@ -731,7 +735,7 @@ class _files extends \IPS\Dispatcher\Controller
if ( $values['filestorage_move'] )
{
\IPS\Task::queue( 'core', 'DeleteMovedFiles', array( 'delete' => true ), 5, array( 'delete' ) ); /* We use a key in the data array just to trigger the code that deletes duplicate tasks */
\IPS\Task::queue( 'core', 'DeleteMovedFiles', array( 'delete' => true, 'count' => $totalCount ), 5, array( 'delete' ) ); /* We use a key in the data array just to trigger the code that deletes duplicate tasks */
}
}
}
@@ -743,6 +747,9 @@ class _files extends \IPS\Dispatcher\Controller
if ( $current !== NULL and ! $createNewAndMove )
{
/* Log the storage change */
\IPS\Session::i()->log( 'acplogs__files_config_changed' );
$classname::getClass( $current['id'] )->settingsUpdated();
}
@@ -772,7 +779,7 @@ class _files extends \IPS\Dispatcher\Controller
{
try
{
$current = \IPS\Db::i()->select( '*', 'core_file_storage', array( 'id=?', intval( \IPS\Request::i()->id ) ) )->first();
$current = \IPS\Db::i()->select( '*', 'core_file_storage', array( 'id=?', \intval( \IPS\Request::i()->id ) ) )->first();
}
catch( \UnderflowException $e )
{
@@ -782,7 +789,7 @@ class _files extends \IPS\Dispatcher\Controller
$currentConf = json_decode( $current['configuration'], TRUE );
$needsMoving = FALSE;
if ( in_array( intval( \IPS\Request::i()->id ), json_decode( \IPS\Settings::i()->upload_settings, TRUE ) ) )
if ( \in_array( \intval( \IPS\Request::i()->id ), json_decode( \IPS\Settings::i()->upload_settings, TRUE ) ) )
{
foreach ( $currentConf as $k => $v )
{
@@ -794,7 +801,8 @@ class _files extends \IPS\Dispatcher\Controller
}
}
$classname = 'IPS\File\\' . $current['method'];
$handlers = \IPS\File::storageHandlers( $current );
$classname = $handlers[ $current['method'] ];
/* Do we really need to create and move? */
$needsMoving = $classname::moveCheck( $currentHandlerSettings, $currentConf );
@@ -810,7 +818,7 @@ class _files extends \IPS\Dispatcher\Controller
*/
protected function configurationLog()
{
$method = \IPS\Db::i()->select( '*', 'core_file_storage', array( 'id=?', intval( \IPS\Request::i()->id ) ) )->first();
$method = \IPS\Db::i()->select( '*', 'core_file_storage', array( 'id=?', \intval( \IPS\Request::i()->id ) ) )->first();
$title = \IPS\Member::loggedIn()->language()->addToStack( 'file_config_log', NULL, array( 'sprintf' => array( $method['method'] ) ) );
/* Create the table */
@@ -859,6 +867,8 @@ class _files extends \IPS\Dispatcher\Controller
*/
protected function orphaned()
{
\IPS\Session::i()->csrfCheck();
foreach( \IPS\Db::i()->select( '*', 'core_file_storage', NULL, 'id' ) as $row )
{
\IPS\Task::queue( 'core', 'FindOrphanedFiles', array( 'configurationId' => $row['id'] ), 4, array( 'configurationId' ) );
@@ -878,7 +888,7 @@ class _files extends \IPS\Dispatcher\Controller
\IPS\Session::i()->csrfCheck();
if( !isset( \IPS\Request::i()->multimod ) OR !is_array( \IPS\Request::i()->multimod ) OR !count( \IPS\Request::i()->multimod ) )
if( !isset( \IPS\Request::i()->multimod ) OR !\is_array( \IPS\Request::i()->multimod ) OR !\count( \IPS\Request::i()->multimod ) )
{
\IPS\Output::i()->error( 'nothing_mm_selected', '2C158/6', 403, '' );
}
@@ -897,6 +907,12 @@ class _files extends \IPS\Dispatcher\Controller
\IPS\Db::i()->delete( 'core_attachments', \IPS\Db::i()->in( 'attach_id', array_keys( \IPS\Request::i()->multimod ) ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=overview&controller=files" ), 'deleted' );
$url = \IPS\Http\Url::internal( "app=core&module=overview&controller=files" );
if( \IPS\Request::i()->listResort )
{
$url = $url->setQueryString( array( 'listResort' => 1, 'sortby' => \IPS\Request::i()->sortby, 'sortdirection' => \IPS\Request::i()->sortdirection ) )->csrf();
}
\IPS\Output::i()->redirect( $url, 'deleted' );
}
}