Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -101,10 +101,10 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* If we've changed anything, explain to the admin they have to update */
|
||||
if ( \IPS\Request::i()->store_method !== \IPS\STORE_METHOD or \IPS\Request::i()->store_config !== \IPS\STORE_CONFIG or \IPS\Request::i()->cache_method !== \IPS\CACHE_METHOD or \IPS\Request::i()->cache_config !== $cacheConfig or \IPS\Request::i()->cache_guest_page != \IPS\CACHE_PAGE_TIMEOUT )
|
||||
if ( \IPS\Request::i()->store_method !== \IPS\STORE_METHOD or \IPS\Request::i()->store_config !== \IPS\STORE_CONFIG or \IPS\Request::i()->cache_method !== \IPS\CACHE_METHOD or \IPS\Request::i()->cache_config !== $cacheConfig )
|
||||
{
|
||||
$downloadUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&do=downloadDatastoreConstants' )->setQueryString( array( 'store_method' => \IPS\Request::i()->store_method, 'store_config' => \IPS\Request::i()->store_config, 'cache_method' => \IPS\Request::i()->cache_method, 'cache_config' => \IPS\Request::i()->cache_config, 'cache_guest_page' => \IPS\Request::i()->cache_guest_page ) );
|
||||
$checkUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&tab=datastore&checkConstants=1' )->setQueryString( array( 'store_method' => \IPS\Request::i()->store_method, 'store_config' => \IPS\Request::i()->store_config, 'cache_method' => \IPS\Request::i()->cache_method, 'cache_config' => \IPS\Request::i()->cache_config, 'cache_guest_page' => \IPS\Request::i()->cache_guest_page ) )->csrf();
|
||||
$downloadUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&do=downloadDatastoreConstants' )->setQueryString( array( 'store_method' => \IPS\Request::i()->store_method, 'store_config' => \IPS\Request::i()->store_config, 'cache_method' => \IPS\Request::i()->cache_method, 'cache_config' => \IPS\Request::i()->cache_config ) );
|
||||
$checkUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&tab=datastore&checkConstants=1' )->setQueryString( array( 'store_method' => \IPS\Request::i()->store_method, 'store_config' => \IPS\Request::i()->store_config, 'cache_method' => \IPS\Request::i()->cache_method, 'cache_config' => \IPS\Request::i()->cache_config ) )->csrf();
|
||||
return \IPS\Theme::i()->getTemplate( 'settings' )->dataStoreChange( $downloadUrl, $checkUrl, TRUE );
|
||||
}
|
||||
/* Otherwise just log and redirect */
|
||||
@@ -241,9 +241,7 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'redis_enabled', \IPS\REDIS_ENABLED, FALSE, array(), NULL, NULL, NULL, 'redis_enabled' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Interval( 'cache_guest_page', \IPS\CACHE_PAGE_TIMEOUT, FALSE, array( 'valueAs' => \IPS\Helpers\Form\Interval::SECONDS, 'unlimited' => 0, 'unlimitedLang' => 'disable' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('for'), NULL, 'cache_guest_page' ) );
|
||||
|
||||
|
||||
/* Handle submissions */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -266,7 +264,7 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* If we've changed anything, explain to the admin they have to update */
|
||||
if ( $values['datastore_method'] !== \IPS\STORE_METHOD or str_replace( '\\/', '/', json_encode( $storeConfiguration ) ) !== \IPS\STORE_CONFIG or $values['cache_method'] !== \IPS\CACHE_METHOD or json_encode( $cacheConfiguration ) !== \IPS\CACHE_CONFIG or $values['cache_guest_page'] !== \IPS\CACHE_PAGE_TIMEOUT or \IPS\REDIS_ENABLED != (boolean) $values['redis_enabled'] )
|
||||
if ( $values['datastore_method'] !== \IPS\STORE_METHOD or str_replace( '\\/', '/', json_encode( $storeConfiguration ) ) !== \IPS\STORE_CONFIG or $values['cache_method'] !== \IPS\CACHE_METHOD or json_encode( $cacheConfiguration ) !== \IPS\CACHE_CONFIG or \IPS\REDIS_ENABLED != (boolean) $values['redis_enabled'] )
|
||||
{
|
||||
/* Connect to cache engine if we can and invalidate any existing caches */
|
||||
try
|
||||
@@ -295,8 +293,8 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
\IPS\core\AdminNotification::remove( 'core', 'ConfigurationError', 'dataStorageBroken' );
|
||||
|
||||
/* Display */
|
||||
$downloadUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&do=downloadDatastoreConstants' )->setQueryString( array( 'store_method' => $values['datastore_method'], 'store_config' => str_replace( '\\/', '/', json_encode( $storeConfiguration ) ), 'cache_method' => $values['cache_method'], 'cache_config' => json_encode( $cacheConfiguration ), 'cache_guest_page' => $values['cache_guest_page'], 'redis_enabled' => $values['redis_enabled'] ) );
|
||||
$checkUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&tab=datastore&checkConstants=1' )->setQueryString( array( 'store_method' => $values['datastore_method'], 'store_config' => str_replace( '\\/', '/', json_encode( $storeConfiguration ) ), 'cache_method' => $values['cache_method'], 'cache_config' => json_encode( $cacheConfiguration ), 'cache_guest_page' => $values['cache_guest_page'], 'redis_enabled' => $values['redis_enabled'] ) )->csrf();
|
||||
$downloadUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&do=downloadDatastoreConstants' )->setQueryString( array( 'store_method' => $values['datastore_method'], 'store_config' => str_replace( '\\/', '/', json_encode( $storeConfiguration ) ), 'cache_method' => $values['cache_method'], 'cache_config' => json_encode( $cacheConfiguration ), 'redis_enabled' => $values['redis_enabled'] ) );
|
||||
$checkUrl = \IPS\Http\Url::internal( 'app=core&module=settings&controller=advanced&tab=datastore&checkConstants=1' )->setQueryString( array( 'store_method' => $values['datastore_method'], 'store_config' => str_replace( '\\/', '/', json_encode( $storeConfiguration ) ), 'cache_method' => $values['cache_method'], 'cache_config' => json_encode( $cacheConfiguration ), 'redis_enabled' => $values['redis_enabled'] ) )->csrf();
|
||||
return \IPS\Theme::i()->getTemplate( 'settings' )->dataStoreChange( $downloadUrl, $checkUrl );
|
||||
}
|
||||
/* Otherwise just log and redirect */
|
||||
@@ -364,7 +362,6 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
$output .= "\\define( 'CACHE_CONFIG', " . var_export( \IPS\Request::i()->cache_config, TRUE ) . " );\n";
|
||||
}
|
||||
|
||||
$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";
|
||||
|
||||
@@ -1061,7 +1058,7 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
ksort( $furl, SORT_NATURAL );
|
||||
$keys = array_keys( $furl );
|
||||
$lastKey = str_replace( 'key', '', end( $keys ) );
|
||||
$key = 'key' . ( $lastKey + 1 );
|
||||
$key = 'key' . ( (int)$lastKey + 1 );
|
||||
$furl[ $key ] = $save;
|
||||
}
|
||||
|
||||
|
||||
@@ -253,6 +253,8 @@ class _dataLayer extends \IPS\Dispatcher\Controller
|
||||
\IPS\core\DataLayer::i()->clearCachedConfiguration([ '_jsConfig', '_eventProperties', '_propertyEvents' ]);
|
||||
|
||||
\IPS\Settings::i()->changeValues( $values );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__datalayer_settings_edited' );
|
||||
|
||||
/* Redirect to avoid csrfKey errors */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=settings&controller=dataLayer&tab=main' ) );
|
||||
@@ -403,6 +405,8 @@ class _dataLayer extends \IPS\Dispatcher\Controller
|
||||
\IPS\core\DataLayer::i()->savePropertyConfiguration( $property_key, $_values );
|
||||
}
|
||||
catch ( \InvalidArgumentException $e ) {}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__data_layer_property_edited', array( $property_key => FALSE ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=settings&controller=dataLayer&tab=properties&property_key=' . $property_key ) );
|
||||
@@ -508,6 +512,8 @@ class _dataLayer extends \IPS\Dispatcher\Controller
|
||||
$key = $values['formatted_name'];
|
||||
|
||||
\IPS\core\DataLayer::i()->savePropertyConfiguration( $key, $values, true );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__data_layer_property_added', array( $key => FALSE ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=settings&controller=dataLayer&tab=properties&property_key=' . $key ) );
|
||||
}
|
||||
@@ -538,6 +544,7 @@ class _dataLayer extends \IPS\Dispatcher\Controller
|
||||
unset( $setting[$key] );
|
||||
\IPS\Settings::i()->changeValues([ 'core_datalayer_properties' => json_encode( $setting ) ]);
|
||||
\IPS\core\DataLayer::i()->clearCachedConfiguration();
|
||||
\IPS\Session::i()->log( 'acplog__data_layer_property_deleted', array( $key => FALSE ) );
|
||||
$_SESSION['deleted_datalayer_property'] = 1;
|
||||
}
|
||||
else
|
||||
@@ -613,6 +620,8 @@ class _dataLayer extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch ( \InvalidArgumentException $e ) {}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__data_layer_event_edited', array( $event_key => FALSE ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=settings&controller=dataLayer&tab=events&event_key=' . $event_key ) );
|
||||
}
|
||||
|
||||
@@ -63,8 +63,7 @@ class _general extends \IPS\Dispatcher\Controller
|
||||
/* $form->add( new \IPS\Helpers\Form\CheckboxSet( 'diagnostics_reporting', array( 'usage' => ( (bool) \IPS\Settings::i()->usage_reporting ), 'diagnostics' => ( (bool) \IPS\Settings::i()->diagnostics_reporting ) ), FALSE, array( 'options' => array(
|
||||
'usage' => 'diagnostics_reporting_usage',
|
||||
'diagnostics' => 'diagnostics_reporting_diagnostics',
|
||||
) ) ) );
|
||||
*/
|
||||
) ) ) ); */
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -80,9 +79,9 @@ class _general extends \IPS\Dispatcher\Controller
|
||||
|
||||
$values['site_address'] = json_encode( $values['site_address'] );
|
||||
|
||||
//$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 );
|
||||
|
||||
|
||||
@@ -97,11 +97,12 @@ class _licensekey extends \IPS\Dispatcher\Controller
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Fetch the license key data and update our local storage */
|
||||
unset( \IPS\Data\Store::i()->license_data );
|
||||
\IPS\IPS::licenseKey( TRUE );
|
||||
|
||||
/* Return the overview screen afterwards */
|
||||
if ( isset( \IPS\Request::i()->return ) and \IPS\Request::i()->return === 'cloud' and \IPS\Application::appIsEnabled('cloud') )
|
||||
{
|
||||
\IPS\cloud\Application::toggleDisabledApps();
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=cloud&module=smartcommunity&controller=smartcommunity' ), 'cloud_license_refreshed' );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -192,8 +192,8 @@ class _posting extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Save values */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => (int) $values['post_before_registering'] ), array( '`key`=?', 'postBeforeRegisterFollowup' ) );
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => ( isset( $values['post_before_registering'] ) ) ? (int) $values['post_before_registering'] : 0 ), array( '`key`=?', 'postBeforeRegisterFollowup' ) );
|
||||
|
||||
$clearCss = ( $values['max_video_width'] !== \IPS\Settings::i()->max_video_width );
|
||||
|
||||
@@ -565,6 +565,15 @@ class _posting extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
|
||||
\IPS\core\Profanity::createFromForm( $save, $current );
|
||||
|
||||
if ( $current )
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__profanity_edited' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__profanity_added' );
|
||||
}
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
@@ -736,6 +745,15 @@ class _posting extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
if ( $current )
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__acronym_edited' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__acronym_added' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=settings&controller=posting&tab=acronymExpansion' ), 'saved' );
|
||||
}
|
||||
@@ -760,6 +778,8 @@ class _posting extends \IPS\Dispatcher\Controller
|
||||
|
||||
\IPS\core\Profanity::load( \IPS\Request::i()->id )->delete();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__profanity_deleted' );
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
@@ -783,6 +803,8 @@ class _posting extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__acronym_deleted' );
|
||||
|
||||
/* And redirect */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=settings&controller=posting&tab=acronymExpansion" ) );
|
||||
|
||||
Reference in new issue
Block a user