Version 4.3.6
This commit is contained in:
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 );
|
||||
|
||||
@@ -209,6 +209,7 @@ class _email extends \IPS\Dispatcher\Controller
|
||||
/* Columns we need */
|
||||
$table->include = array( 'mlog_to', 'mlog_subject', 'mlog_date', 'mlog_msg' );
|
||||
$table->widths = array( 'mlog_date' => '15', 'mlog_to' => '20', 'mlog_subject' => '20', 'mlog_msg' => '35' );
|
||||
$table->rowClasses = array( 'mlog_subject' => array( 'ipsTable_wrap' ), 'mlog_msg' => array( 'ipsTable_wrap' ) );
|
||||
|
||||
$table->sortBy = $table->sortBy ?: 'mlog_date';
|
||||
$table->sortDirection = $table->sortDirection ?: 'DESC';
|
||||
@@ -236,6 +237,19 @@ class _email extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$val = \IPS\Member::loggedIn()->language()->get('phpmail_not_sent');
|
||||
}
|
||||
else
|
||||
{
|
||||
if( $data = json_decode( $val, true ) )
|
||||
{
|
||||
/* We may not have a 'message' key if this is an older SendGrid log entry */
|
||||
if( isset( $data['message'] ) )
|
||||
{
|
||||
$val = \is_string( $data['message'] ) ?
|
||||
( ( isset( $data['details'] ) AND $data['details'] ) ? \IPS\Member::loggedIn()->language()->addToStack( $data['message'], FALSE, array( 'sprintf' => $data['details'] ) ) : \IPS\Member::loggedIn()->language()->addToStack( $data['message'] ) ) :
|
||||
$val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'logs' )->emailErrorLog( nl2br( htmlspecialchars( $val, ENT_DISALLOWED, 'UTF-8', FALSE ) ), $row );
|
||||
},
|
||||
|
||||
@@ -61,16 +61,20 @@ class _general extends \IPS\Dispatcher\Controller
|
||||
\IPS\Lang::saveCustom( 'core', "copyright_line_value", $values['copyright_line'] );
|
||||
unset( $values['copyright_line'] );
|
||||
|
||||
array_walk( $values['site_social_profiles'], function( &$value ){
|
||||
$value['key'] = (string) $value['key'];
|
||||
});
|
||||
$values['site_social_profiles'] = json_encode( array_filter( $values['site_social_profiles'], function( $value ) {
|
||||
return (bool) $value['key'];
|
||||
} ) );
|
||||
|
||||
$values['site_address'] = json_encode( $values['site_address'] );
|
||||
|
||||
$values['upgrade_email'] = implode( ',', $values['upgrade_email'] );
|
||||
|
||||
$values['usage_reporting'] = in_array( 'usage', $values['diagnostics_reporting'] );
|
||||
$values['diagnostics_reporting'] = in_array( 'diagnostics', $values['diagnostics_reporting'] );
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => intval( $values['usage_reporting'] ) ), array( '`key`=?', 'usagereporting' ) );
|
||||
// $values['usage_reporting'] = in_array( 'usage', $values['diagnostics_reporting'] );
|
||||
// $values['diagnostics_reporting'] = in_array( 'diagnostics', $values['diagnostics_reporting'] );
|
||||
// \IPS\Db::i()->update( 'core_tasks', array( 'enabled' => intval( $values['usage_reporting'] ) ), array( '`key`=?', 'usagereporting' ) );
|
||||
|
||||
$form->saveAsSettings( $values );
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class _licensekey extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function settings()
|
||||
{
|
||||
$$form = new \IPS\Helpers\Form;
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->addHeader('ipb_license_edit_main');
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'ipb_reg_number', \IPS\Settings::i()->ipb_reg_number, TRUE ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'ipb_license_active', \IPS\Settings::i()->ipb_license_active ) );
|
||||
|
||||
@@ -170,7 +170,10 @@ class _login extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form( 'login_handler_1', 'continue' );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'login_handler', TRUE, NULL, array( 'options' => $options ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'login_handler', TRUE, NULL, array( 'options' => $options ), function( $val )
|
||||
{
|
||||
$val::testCompatibility();
|
||||
} ) );
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
return array( 'handler' => $values['login_handler'] );
|
||||
@@ -366,11 +369,19 @@ class _login extends \IPS\Node\Controller
|
||||
'disabled' => 'allow_reg_disabled'
|
||||
),
|
||||
'toggles' => array(
|
||||
'normal' => array( 'allow_reg_normal_warning' ),
|
||||
'full' => array( 'minimum_age', 'use_coppa' ),
|
||||
'redirect' => array( 'allow_reg_target' )
|
||||
),
|
||||
'disabled' => \IPS\Login\Handler::findMethod( 'IPS\Login\Handler\Standard' ) ? array() : array( 'normal', 'full' )
|
||||
) ) );
|
||||
|
||||
/* Do we have required custom fields? */
|
||||
if ( \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_data', array( 'pf_not_null != 0 and pf_show_on_reg=1' ) )->first() )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words['allow_reg_normal_warning'] = \IPS\Member::loggedIn()->language()->addToStack( 'allow_reg_normal_desc_required_warning' );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Url( 'allow_reg_target', \IPS\Settings::i()->allow_reg_target, NULL, array(), function( $val )
|
||||
{
|
||||
if ( !$val and \IPS\Request::i()->allow_red === 'redirect' )
|
||||
|
||||
@@ -172,6 +172,8 @@ class _posting extends \IPS\Dispatcher\Controller
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'dellog_retention_period', \IPS\Settings::i()->dellog_retention_period, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'immediately', 'max' => PHP_INT_MAX ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('dellog_days_after_deleted') ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'ip_address_prune', \IPS\Settings::i()->ip_address_prune, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'never', 'max' => PHP_INT_MAX ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('days') ) );
|
||||
|
||||
/* Save values */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -361,6 +363,7 @@ class _posting extends \IPS\Dispatcher\Controller
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_acronyms', \IPS\Http\Url::internal( 'app=core&module=settings&controller=posting&tab=acronymExpansion' ) );
|
||||
$table->langPrefix = 'acronym_';
|
||||
$table->mainColumn = 'a_short';
|
||||
$table->rowClasses = array( 'a_long' => array( 'ipsTable_wrap' ) );
|
||||
|
||||
/* Columns we need */
|
||||
$table->include = array( 'a_short', 'a_long', 'a_casesensitive' );
|
||||
|
||||
@@ -63,13 +63,17 @@ class _terms extends \IPS\Dispatcher\Controller
|
||||
'external' => 'privacy_external',
|
||||
'none' => "privacy_none" ),
|
||||
'toggles' => array(
|
||||
'internal' => array( 'privacy_text_id' ),
|
||||
'internal' => array( 'privacy_text_id', 'privacy_show_processors' ),
|
||||
'external' => array( 'privacy_link' ),
|
||||
'none' => array(),
|
||||
)
|
||||
) ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'privacy_text', NULL, FALSE, array( 'app' => 'core', 'key' => 'privacy_text_value', 'editor' => array( 'app' => 'core', 'key' => 'Admin', 'autoSaveKey' => 'Privacy', 'attachIds' => array( NULL, NULL, 'privacy_text' ) ) ), NULL, NULL, NULL, 'privacy_text_id' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'privacy_show_processors', \IPS\Settings::i()->privacy_show_processors, FALSE, array(), NULL, NULL, NULL, 'privacy_show_processors' ) );
|
||||
|
||||
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Url( 'privacy_link', \IPS\Settings::i()->privacy_link, FALSE, array(), NULL, NULL, NULL, 'privacy_link' ) );
|
||||
|
||||
$form->addHeader( 'terms_registration' );
|
||||
|
||||
Reference in new issue
Block a user