Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

@@ -130,6 +130,7 @@ class _advanced extends \IPS\Dispatcher\Controller
$options = array(
'FileSystem' => 'datastore_method_FileSystem',
'Database' => 'datastore_method_Database',
'Redis' => 'datastore_method_Redis',
);
$existingConfiguration = json_decode( \IPS\STORE_CONFIG, TRUE );
foreach ( $options as $k => $v )
@@ -159,7 +160,12 @@ class _advanced extends \IPS\Dispatcher\Controller
'options' => $options,
'toggles' => $toggles,
'disabled' => $disabled,
) ) );
), function( $val ){
if( $val === 'Redis' AND \IPS\Request::i()->cache_method !== 'Redis' )
{
throw new \DomainException( 'datastore_redis_cache' );
}
} ) );
foreach ( $extra as $input )
{
$form->add( $input );
@@ -299,7 +305,7 @@ class _advanced extends \IPS\Dispatcher\Controller
{
$val = constant( 'IPS\\' . $k );
if ( $val !== $v and !in_array( $k, array( 'STORE_METHOD', 'STORE_CONFIG', 'CACHE_METHOD', 'CACHE_CONFIG', 'CACHE_PAGE_TIMEOUT', 'SUITE_UNIQUE_KEY', 'READ_WRITE_SEPARATION', 'REDIS_ENABLED' ) ) )
if ( $val !== $v and !in_array( $k, array( 'STORE_METHOD', 'STORE_CONFIG', 'CACHE_METHOD', 'CACHE_CONFIG', 'CACHE_PAGE_TIMEOUT', 'SUITE_UNIQUE_KEY', 'READ_WRITE_SEPARATION', 'REDIS_ENABLED', 'REPORT_EXCEPTIONS' ) ) )
{
$output .= "define( '{$k}', " . var_export( $val, TRUE ) . " );\n";
}
@@ -331,7 +337,7 @@ class _advanced extends \IPS\Dispatcher\Controller
$output .= "define( 'CACHE_PAGE_TIMEOUT', " . var_export( (int) \IPS\Request::i()->cache_guest_page, TRUE ) . " );\n";
$output .= "define( 'SUITE_UNIQUE_KEY', " . var_export( mb_substr( md5( mt_rand() ), 10, 10 ), TRUE ) . " );\n"; // Regenerate the unique key so there's no conflicts
$output .= "\n\n\n";
\IPS\Output::i()->sendOutput( $output, 200, 'text/x-php', array( 'Content-Disposition' => 'attachment; filename=constants.php' ) );
}
@@ -451,9 +457,10 @@ class _advanced extends \IPS\Dispatcher\Controller
{
\IPS\Dispatcher::i()->checkAcpPermission( 'advanced_manage_tasks' );
$table = new \IPS\Helpers\Table\Db( 'core_tasks', \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&do=tasks' ), array( array( 'a.app_enabled=1' ) ) );
$table = new \IPS\Helpers\Table\Db( 'core_tasks', \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&do=tasks' ), array( array( '(p.plugin_enabled=1 OR a.app_enabled=1)' ) ) );
$table->joins = array(
array( 'select' => 'a.app_enabled', 'from' => array( 'core_applications', 'a' ), 'where' => "a.app_directory=app" )
array( 'select' => 'a.app_enabled', 'from' => array( 'core_applications', 'a' ), 'where' => "a.app_directory=app" ),
array( 'select' => 'p.plugin_enabled', 'from' => array( 'core_plugins', 'p' ), 'where' => "p.plugin_id=plugin" )
);
$table->langPrefix = 'task_manager_';
$table->include = array( 'app', 'key', 'frequency', 'next_run', 'last_run' );
@@ -644,18 +651,19 @@ class _advanced extends \IPS\Dispatcher\Controller
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'advancedsettings' )->taskResult( TRUE, $output, $task->id );
}
}
catch( \RuntimeException $e )
{
\IPS\Output::i()->error( 'task_class_not_found', '4C124/6', 404, '' );
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->error( 'node_error', '2C124/1', 404, '' );
}
catch ( \IPS\Task\Exception $e )
{
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'advancedsettings' )->taskResult( FALSE, \IPS\Member::loggedIn()->language()->addToStack( $e->getMessage(), FALSE ), $task->id );
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->error( 'task_class_not_found', '2C124/1', 404, '' );
}
catch( \Exception $e )
{
\IPS\Log::log( $e, 'uncaught_exception' );
\IPS\Output::i()->error( $e->getMessage(), '4C124/6', 404, '' );
}
}
/**
@@ -718,7 +726,14 @@ class _advanced extends \IPS\Dispatcher\Controller
}
else
{
$val = \IPS\Member::loggedIn()->language()->addToStack( $val, FALSE );
if( $decoded = json_decode( $val ) )
{
$val = \IPS\Member::loggedIn()->language()->addToStack( array_shift( $decoded ), FALSE, array( 'sprintf' => $decoded ) );
}
else
{
$val = \IPS\Member::loggedIn()->language()->addToStack( $val, FALSE );
}
}
return $row['error'] ? \IPS\Theme::i()->getTemplate( 'global' )->message( $val, 'error' ) : $val;
}
@@ -905,7 +920,7 @@ class _advanced extends \IPS\Dispatcher\Controller
}
else
{
ksort( $furl );
ksort( $furl, SORT_NATURAL );
$keys = array_keys( $furl );
$lastKey = str_replace( 'key', '', end( $keys ) );
$key = 'key' . ( $lastKey + 1 );