Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -235,6 +235,8 @@ class _badges extends \IPS\Node\Controller
|
||||
}
|
||||
catch( \Exception $e ) { }
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__exported_badges' );
|
||||
|
||||
\IPS\Output::i()->sendOutput( $xml->asXML(), 200, 'application/xml', array( 'Content-Disposition' => \IPS\Output::getContentDisposition( 'attachment', "Achievement_Badges.xml" ) ) );
|
||||
}
|
||||
@@ -261,6 +263,8 @@ class _badges extends \IPS\Node\Controller
|
||||
{
|
||||
\IPS\Output::i()->error( $e->getMessage(), '2C422/1', 403, '' );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__imported_badges' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=achievements&controller=badges' ), 'completed' );
|
||||
}
|
||||
|
||||
@@ -159,6 +159,8 @@ class _ranks extends \IPS\Node\Controller
|
||||
\IPS\Output::i()->error( $e->getMessage(), '2C423/1', 403, '' );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__imported_ranks' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=achievements&controller=ranks' ), 'completed' );
|
||||
}
|
||||
|
||||
@@ -199,6 +201,8 @@ class _ranks extends \IPS\Node\Controller
|
||||
|
||||
$xml->addChild( 'rank', $forXml );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__exported_ranks' );
|
||||
|
||||
\IPS\Output::i()->sendOutput( $xml->asXML(), 200, 'application/xml', array( 'Content-Disposition' => \IPS\Output::getContentDisposition( 'attachment', "Achievement_Ranks.xml" ) ) );
|
||||
}
|
||||
|
||||
@@ -141,6 +141,15 @@ class _rules extends \IPS\Node\Controller
|
||||
$rule = \IPS\core\Achievements\Rule::load( \IPS\Request::i()->id );
|
||||
$rule->enabled = (int) \IPS\Request::i()->enable;
|
||||
$rule->save();
|
||||
|
||||
if ( \IPS\Request::i()->enable )
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplogs__rule_enabled', array( $rule->id => FALSE ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplogs__rule_disabled', array( $rule->id => FALSE ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=achievements&controller=rules' ), 'updated' );
|
||||
}
|
||||
@@ -230,6 +239,8 @@ class _rules extends \IPS\Node\Controller
|
||||
catch( \Exception $e ) { }
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__rules_exported' );
|
||||
|
||||
\IPS\Output::i()->sendOutput( $xml->asXML(), 200, 'application/xml', array( 'Content-Disposition' => \IPS\Output::getContentDisposition( 'attachment', "Achievement_Rules.xml" ) ) );
|
||||
}
|
||||
@@ -285,6 +296,8 @@ class _rules extends \IPS\Node\Controller
|
||||
{
|
||||
\IPS\Output::i()->error( $e->getMessage(), '2C424/1', 403, '' );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__rules_imported' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=achievements&controller=rules' ), 'completed' );
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class _apiKeys extends \IPS\Node\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'forms', 'core' )->blurb( 'api_keys_blurb', TRUE, TRUE );
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'forms', 'core' )->blurb( 'api_keys_blurb', TRUE, TRUE );
|
||||
return parent::manage();
|
||||
}
|
||||
}
|
||||
@@ -429,7 +429,7 @@ class _applications extends \IPS\Node\Controller
|
||||
{
|
||||
$buttons['edit']['link'] = $buttons['edit']['link']->setQueryString( 'searchResult', \IPS\Request::i()->searchResult );
|
||||
}
|
||||
|
||||
|
||||
/* Return */
|
||||
return \IPS\Theme::i()->getTemplate( 'trees', 'core' )->row(
|
||||
$this->url,
|
||||
@@ -448,7 +448,8 @@ class _applications extends \IPS\Node\Controller
|
||||
$this->_descriptionHtml,
|
||||
$node->canAdd(),
|
||||
TRUE,
|
||||
\IPS\Theme::i()->getTemplate('applications')->appRowAdditional( $node )
|
||||
\IPS\Theme::i()->getTemplate('applications')->appRowAdditional( $node ),
|
||||
$node->_lockedLang
|
||||
);
|
||||
}
|
||||
|
||||
@@ -682,11 +683,10 @@ class _applications extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Export an application from ipbmafia.ru
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function downloadMafia()
|
||||
public function customDownload()
|
||||
{
|
||||
$application = \IPS\Application::load( \IPS\Request::i()->appKey );
|
||||
|
||||
@@ -731,7 +731,7 @@ class _applications extends \IPS\Node\Controller
|
||||
/* Don't allow downloads of Marketplace resources */
|
||||
if( $application->marketplace_id )
|
||||
{
|
||||
// \IPS\Output::i()->error( 'application_cannot_build_marketplace', '2C133/Y', 403, '' );
|
||||
// \IPS\Output::i()->error( 'application_cannot_build_marketplace', '2C133/Y', 403, '' );
|
||||
}
|
||||
|
||||
$form = $this->_buildForm( $application->directory, TRUE );
|
||||
@@ -1060,6 +1060,13 @@ class _applications extends \IPS\Node\Controller
|
||||
/* IPS Cloud Sync */
|
||||
\IPS\IPS::resyncIPSCloud('Upgraded application in ACP');
|
||||
$application = \IPS\Application::load( \IPS\Request::i()->appKey );
|
||||
|
||||
/* Unlock the app for PHP8 Usage */
|
||||
if ( $application->requires_manual_intervention )
|
||||
{
|
||||
$application->requires_manual_intervention = 0;
|
||||
$application->save();
|
||||
}
|
||||
|
||||
/* Invalidate disk templates */
|
||||
\IPS\Theme::resetAllCacheKeys();
|
||||
|
||||
@@ -121,10 +121,6 @@ class _developer extends \IPS\Dispatcher\Controller
|
||||
$tabs['versions'] = 'dev_versions';
|
||||
$tabs['widgets'] = 'dev_widgets';
|
||||
|
||||
if ( \in_array( $this->application->directory, \IPS\IPS::$ipsApps ) )
|
||||
{
|
||||
$tabs['features'] = 'dev_features';
|
||||
}
|
||||
if( \IPS\Application::appIsEnabled('cms') )
|
||||
{
|
||||
$tabs['cmstemplates'] = 'dev_cms_templates';
|
||||
@@ -554,23 +550,20 @@ class _developer extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ( $order as $parent => $items )
|
||||
foreach( $_menu as $root => $items )
|
||||
{
|
||||
if ( $parent === NULL OR array_key_exists( $parent, $_menu ) )
|
||||
/* If we were sorting one level of the menu, and this is not it, then leave it as is */
|
||||
if( isset( \IPS\Request::i()->root ) and \IPS\Request::i()->root != $root )
|
||||
{
|
||||
$menu[ $parent ] = array();
|
||||
foreach ( $items as $key => $position )
|
||||
$menu[ $root ] = $items;
|
||||
}
|
||||
elseif( isset( $order[ $root ] ) )
|
||||
{
|
||||
$menu[ $root ] = array();
|
||||
foreach( $order[ $root ] as $key => $position )
|
||||
{
|
||||
foreach ( $_menu as $_parent => $_items )
|
||||
{
|
||||
if ( array_key_exists( $key, $_items ) )
|
||||
{
|
||||
$menu[ $parent ][ $key ] = $_menu[ $_parent ][ $key ];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$menu[ $root ][ $key ] = $_menu[ $root ][ $key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3541,24 +3534,6 @@ class _developer extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Features
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _manageFeatures()
|
||||
{
|
||||
if ( !\in_array( $this->application->directory, \IPS\IPS::$ipsApps ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'app_ips_only', '2C103/R', 403, '' );
|
||||
}
|
||||
|
||||
return \IPS\Application\Feature::devTable(
|
||||
\IPS\Http\Url::internal( "app=core&module=applications&controller=developer&appKey={$this->application->directory}&tab=features" ),
|
||||
$this->application->directory
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Hooks
|
||||
*
|
||||
|
||||
@@ -105,6 +105,7 @@ class _oauth extends \IPS\Node\Controller
|
||||
$client->save();
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__oauth_new_secret', array( 'core_oauth_client_' . $client->client_id => TRUE ) );
|
||||
\IPS\Output::i()->bypassCsrfKeyCheck = TRUE;
|
||||
}
|
||||
|
||||
\IPS\Output::i()->sidebar['actions'] = $client->getButtons( \IPS\Http\Url::internal( "app=core&module=applications&controller=oauth&do=view&client_id={$client->client_id}" ) );
|
||||
@@ -508,7 +509,12 @@ class _oauth extends \IPS\Node\Controller
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=applications&controller=oauth&do=tokens" )->setQueryString( 'client_id', \IPS\Request::i()->client_id ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function form()
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'system/api.css', 'core', 'admin' ) );
|
||||
return parent::form();
|
||||
}
|
||||
/**
|
||||
* Redirect after save
|
||||
*
|
||||
|
||||
@@ -111,6 +111,8 @@ class _plugins extends \IPS\Node\Controller
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'disable_all_plugins' => implode( ',', $disabledPlugins ) ) );
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__all_plugins_disabled' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=applications&controller=plugins' ) );
|
||||
}
|
||||
|
||||
@@ -137,6 +139,8 @@ class _plugins extends \IPS\Node\Controller
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'disable_all_plugins' => '' ) );
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__all_plugins_reenabled' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=applications&controller=plugins' ) );
|
||||
}
|
||||
|
||||
@@ -367,7 +371,6 @@ class _plugins extends \IPS\Node\Controller
|
||||
}
|
||||
}
|
||||
|
||||
// nulled by ipbmafia.ru
|
||||
\file_put_contents( \IPS\ROOT_PATH . "/plugins/{$plugin->location}/{$plugin->name}_{$plugin->version_human}.xml", \file_get_contents( \IPS\Request::i()->file ) );
|
||||
@chmod( \IPS\ROOT_PATH . "/plugins/{$plugin->location}/{$plugin->name}_{$plugin->version_human}.xml", \IPS\IPS_FILE_PERMISSION );
|
||||
|
||||
@@ -1210,6 +1213,18 @@ class _plugins extends \IPS\Node\Controller
|
||||
{
|
||||
@unlink( \IPS\Request::i()->file );
|
||||
|
||||
/* Make sure the plugin is not php8 locked now */
|
||||
try
|
||||
{
|
||||
$plugin = \IPS\Plugin::load( \IPS\Request::i()->id );
|
||||
if ( $plugin->requires_manual_intervention )
|
||||
{
|
||||
$plugin->requires_manual_intervention = 0;
|
||||
$plugin->save();
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e ) {}
|
||||
|
||||
/* If CMS Template install had conflicts, solve those now */
|
||||
if( !empty( $_SESSION['cmsConflictKey'] ) )
|
||||
{
|
||||
|
||||
@@ -313,6 +313,7 @@ class _clubs extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$target = $target->setQueryString( 'filter', 'pending_approval' );
|
||||
}
|
||||
\IPS\Session::i()->modLog( 'acplog__club_approved', array( $club->name => FALSE ) );
|
||||
\IPS\Output::i()->redirect( $target, "approved" );
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,16 @@ class _ajax extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$cssFiles[ $app ][ $location ][ $path ] = $items;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $items as $item )
|
||||
{
|
||||
if ( $item['css_added_to'] == $theme->_id or $item['css_user_edited'] )
|
||||
{
|
||||
$cssFiles[ $app ][ $location ][ $path ][ $item['css_name'] ] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,8 +137,8 @@ class _ajax extends \IPS\Dispatcher\Controller
|
||||
else
|
||||
{
|
||||
$templateNames = $skinSet->getRawCss( '', '', '', \IPS\Theme::RETURN_ALL_NO_CONTENT );
|
||||
$templateBits = $skinSet->getRawCss( $t_app, 'front', 'custom', \IPS\Theme::RETURN_ALL );
|
||||
$templateBit = ( ! empty( $t_name ) ) ? $templateBits[ $t_app ]['front']['custom'][ $t_name ] : null;
|
||||
$templateBits = $skinSet->getRawCss( $t_app, 'front', NULL, \IPS\Theme::RETURN_ALL );
|
||||
$templateBit = ( ! empty( $t_name ) ) ? $templateBits[ $t_app ]['front'][ $t_group ][ $t_name ] : null;
|
||||
$templateBit['css_content'] = htmlentities( $templateBit['css_content'], ENT_DISALLOWED, 'UTF-8', TRUE );
|
||||
}
|
||||
|
||||
|
||||
@@ -215,12 +215,12 @@ class _icons extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public static function processApplicationIcon( $values, $homeScreen = array(), $homeScreenMaskable = array() )
|
||||
{
|
||||
if( $values['icons_homescreen'] or $values['icons_homescreen_maskable'] )
|
||||
if( ( isset( $values['icons_homescreen'] ) AND $values['icons_homescreen'] ) or ( isset( $values['icons_homescreen_maskable' ] ) AND $values['icons_homescreen_maskable'] ) )
|
||||
{
|
||||
foreach( [ 'icons_homescreen', 'icons_homescreen_maskable' ] as $type )
|
||||
{
|
||||
$setting = [];
|
||||
if( $values[ $type ] )
|
||||
if( isset( $values[ $type ] ) AND $values[ $type ] )
|
||||
{
|
||||
$sizes = array(
|
||||
'android-chrome-36x36' => array(36, 36),
|
||||
|
||||
@@ -160,6 +160,8 @@ class _themes extends \IPS\Node\Controller
|
||||
/* Just use the default */
|
||||
$value = $themeSetting['sc_default'];
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__theme_setting_deleted', array( $themeSetting['sc_key'] => FALSE ) );
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
@@ -780,6 +782,8 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__theme_resource_deleted', array( $current['resource_filename'] => FALSE ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=resources&set_id=' . $set->_id ), 'deleted' );
|
||||
}
|
||||
@@ -889,6 +893,7 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
if ( $id )
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__theme_resource_edited', array( $save['resource_filename'] => FALSE ) );
|
||||
\IPS\Db::i()->update( 'core_theme_resources', $save, array( 'resource_id=?', $id ) );
|
||||
}
|
||||
else
|
||||
@@ -904,7 +909,8 @@ class _themes extends \IPS\Node\Controller
|
||||
$save['resource_name'] = mb_substr( $save['resource_name'], 0, ( mb_strrpos( $save['resource_name'], '.' ) ) ) . '_' . mt_rand() . '.' . $ext;
|
||||
}
|
||||
catch( \UnderflowException $ex ) { }
|
||||
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__theme_resource_added', array( $save['resource_filename'] => FALSE ) );
|
||||
\IPS\Db::i()->insert( 'core_theme_resources', $save );
|
||||
}
|
||||
|
||||
@@ -984,6 +990,8 @@ class _themes extends \IPS\Node\Controller
|
||||
$theme->by_skin_gen = 0;
|
||||
$theme->save();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__theme_converted_custom', array( "core_theme_set_title_{$theme->id}" => TRUE ) );
|
||||
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( array() );
|
||||
@@ -2302,6 +2310,8 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
/* Finish */
|
||||
$xml->endDocument();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__theme_exported', array( "core_theme_set_title_{$themeSet->_id}" => TRUE ) );
|
||||
|
||||
\IPS\Output::i()->sendOutput( $xml->outputMemory(), 200, 'application/xml', array( 'Content-Disposition' => \IPS\Output::getContentDisposition( 'attachment', \IPS\Member::loggedIn()->language()->get('core_theme_set_title_' . $themeSet->_id ) . " {$version}.xml" ), FALSE, FALSE ) );
|
||||
}
|
||||
@@ -2945,17 +2955,22 @@ class _themes extends \IPS\Node\Controller
|
||||
{
|
||||
foreach ( $customCss[ $app ]['front']['custom'] as $name => $data )
|
||||
{
|
||||
$cssFiles++;
|
||||
|
||||
if ( $name == 'custom.css' )
|
||||
{
|
||||
$itemId = $data['css_id'];
|
||||
$cssData .= "\n" . $data['css_content'];
|
||||
}
|
||||
/* Any CSS files in the 'custom' folder that are prefixed with an underscore are 'hidden' to the simple theme editor */
|
||||
else if ( mb_substr( $name, 0, 1 ) != '_' )
|
||||
{
|
||||
$cssData .= "\n\n/* ===[Filename:" . $app . '/custom/' . $name . "]=== */\n\n" . $data['css_content'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$cssData .= "\n\n/* ===[Filename:" . $app . '/custom/' . $name . "]=== /*\n\n" . $data['css_content'];
|
||||
continue;
|
||||
}
|
||||
|
||||
$cssFiles++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3003,6 +3018,11 @@ class _themes extends \IPS\Node\Controller
|
||||
$themeSet->custom_footer = $values['theme_simple_footer'];
|
||||
$themeSet->save();
|
||||
|
||||
$headerKey = 'custom_header_' . $themeSet->id;
|
||||
$footerKey = 'custom_footer_' . $themeSet->id;
|
||||
unset( \IPS\Data\Store::i()->$headerKey);
|
||||
unset( \IPS\Data\Store::i()->$footerKey);
|
||||
|
||||
/* Now remove any additional CSS files */
|
||||
if ( $cssFiles > 1 )
|
||||
{
|
||||
@@ -3012,9 +3032,13 @@ class _themes extends \IPS\Node\Controller
|
||||
{
|
||||
foreach ( $customCss[ $app ]['front']['custom'] as $name => $data )
|
||||
{
|
||||
if ( ! ( $app == 'core' and $name == 'custom.css' ) )
|
||||
/* Any CSS files in the 'custom' folder that are prefixed with an underscore are 'hidden' to the simple theme editor */
|
||||
if ( mb_substr( $name, 0, 1 ) != '_' )
|
||||
{
|
||||
\IPS\Theme::removeCss( $app, 'front', 'custom', NULL, TRUE, $name );
|
||||
if ( !( $app == 'core' and $name == 'custom.css' ) )
|
||||
{
|
||||
\IPS\Theme::removeCss( $app, 'front', 'custom', NULL, TRUE, $name );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3128,6 +3152,16 @@ class _themes extends \IPS\Node\Controller
|
||||
{
|
||||
$cssFiles[ $app ][ $location ][ $path ] = $items;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $items as $item )
|
||||
{
|
||||
if ( $item['css_added_to'] == $themeSet->_id or $item['css_user_edited'] )
|
||||
{
|
||||
$cssFiles[ $app ][ $location ][ $path ][ $item['css_name'] ] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3188,6 +3222,8 @@ class _themes extends \IPS\Node\Controller
|
||||
\IPS\Member::updateAllMembers( array( 'skin' => \IPS\Request::i()->id ) );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__theme_member_reset' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes' ), 'member_theme_reset' );
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class _search extends \IPS\Dispatcher\Controller
|
||||
/* Open search is compatible up to at least version 2 */
|
||||
if( isset( $response['version']['distribution'] ) and $response['version']['distribution'] == 'opensearch' )
|
||||
{
|
||||
if ( version_compare( $response['version']['number'], '2.0', '>' ) )
|
||||
if ( version_compare( $response['version']['number'], '2.2', '>=' ) )
|
||||
{
|
||||
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack('search_opensearch_server_unsupported_version', FALSE, array( 'sprintf' => array( $response['version']['number'] ) ) ) );
|
||||
}
|
||||
|
||||
@@ -113,6 +113,8 @@ class _streams extends \IPS\Node\Controller
|
||||
{}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__streams_restored' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=discovery&controller=streams' ), 'restore_default_streams_restored' );
|
||||
}
|
||||
|
||||
@@ -177,6 +179,8 @@ class _streams extends \IPS\Node\Controller
|
||||
$toSave[ 'activity_stream_rss' ] = $values['activity_stream_rss'];
|
||||
$toSave[ 'activity_stream_subscriptions' ] = $values['activity_stream_subscriptions'];
|
||||
$toSave[ 'activity_stream_subscriptions_max' ] = $values['activity_stream_subscriptions_max'];
|
||||
|
||||
\IPS\Session::i()->Log( 'acplog__all_activity_settings' );
|
||||
|
||||
$form->saveAsSettings( $toSave );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=discovery&controller=streams' ), 'saved' );
|
||||
|
||||
@@ -282,6 +282,8 @@ class _emoticons extends \IPS\Dispatcher\Controller
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'emoji_cache' => time() ) );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__emoticons_edited' );
|
||||
|
||||
\IPS\Output::i()->json( 'OK' );
|
||||
return;
|
||||
}
|
||||
@@ -413,6 +415,8 @@ class _emoticons extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__emoticon_set_deleted' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=editor&controller=emoticons&tab=custom' ), 'saved' );
|
||||
}
|
||||
|
||||
@@ -93,4 +93,27 @@ class _storedreplies extends \IPS\Node\Controller
|
||||
|
||||
parent::manage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Search
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function search()
|
||||
{
|
||||
$rows = array();
|
||||
|
||||
/* Get results */
|
||||
$nodeClass = $this->nodeClass;
|
||||
$results = [];
|
||||
|
||||
/* Convert to HTML */
|
||||
foreach ( $nodeClass::search( 'reply_title', \IPS\Request::i()->input, 'reply_title' ) as $result )
|
||||
{
|
||||
$id = ( $result instanceof $this->nodeClass ? '' : 's.' ) . $result->_id;
|
||||
$rows[ $id ] = $this->_getRow( $result, FALSE, TRUE );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'trees', 'core' )->rows( $rows, '' );
|
||||
}
|
||||
}
|
||||
@@ -131,6 +131,8 @@ class _languages extends \IPS\Node\Controller
|
||||
/* Save */
|
||||
\IPS\Lang::saveCustom( 'core', $values['word_key'], $values['word_custom'] ?? NULL, FALSE, $values['word_default'] );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__custom_word_added', array( $values['word_key'] => FALSE ) );
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( 'OK' );
|
||||
@@ -171,6 +173,8 @@ class _languages extends \IPS\Node\Controller
|
||||
|
||||
\IPS\Db::i()->delete( 'core_sys_lang_words', array( "word_key=?", \IPS\Request::i()->key ) );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__custom_word_deleted', array( \IPS\Request::i()->key => FALSE ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=languages&controller=languages&do=translate&id=" . \IPS\Request::i()->langId ), 'deleted' );
|
||||
}
|
||||
|
||||
@@ -446,6 +450,7 @@ class _languages extends \IPS\Node\Controller
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$form->saveAsSettings( $values );
|
||||
\IPS\Session::i()->log( 'acplog__language_settings_edited' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=languages&controller=languages' ) );
|
||||
}
|
||||
|
||||
@@ -812,7 +817,7 @@ class _languages extends \IPS\Node\Controller
|
||||
|
||||
/* Set version */
|
||||
$xml->startAttribute( 'version' );
|
||||
$xml->text( $app->version_long );
|
||||
$xml->text( $app->long_version );
|
||||
$xml->endAttribute();
|
||||
|
||||
/* Add words */
|
||||
@@ -999,7 +1004,11 @@ class _languages extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
/* Only import language strings from applications we have installed */
|
||||
$applications = array_keys( \IPS\Application::applications() );
|
||||
$applications = array();
|
||||
foreach( \IPS\Application::applications() as $app )
|
||||
{
|
||||
$applications[$app->directory] = $app->long_version;
|
||||
}
|
||||
|
||||
/* Move to correct app */
|
||||
$appKey = NULL;
|
||||
@@ -1008,10 +1017,10 @@ class _languages extends \IPS\Node\Controller
|
||||
while ( $xml->read() )
|
||||
{
|
||||
$appKey = $xml->getAttribute('key');
|
||||
if ( !array_key_exists( $appKey, $data['apps'] ) AND \in_array( $appKey, $applications ) )
|
||||
if ( !array_key_exists( $appKey, $data['apps'] ) AND array_key_exists( $appKey, $applications ) )
|
||||
{
|
||||
/* Get version */
|
||||
$version = $xml->getAttribute('version');
|
||||
$version = $xml->getAttribute('version') ?: $applications[$appKey];
|
||||
|
||||
/* Import */
|
||||
$xml->read();
|
||||
|
||||
@@ -645,15 +645,17 @@ class _marketplace extends \IPS\Dispatcher\Controller
|
||||
* @param array|null $data POST/PUT Data
|
||||
* @param int $timeout Custom timeout value for request
|
||||
* @param bool $retry Retried request after token expire
|
||||
* @param int $ipsVersion Version of Invision to use for version check
|
||||
* @return array JSON decoded response
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
final protected function _api( string $endpoint, array $queryString = NULL, bool $authenticate = FALSE, array $data = NULL, int $timeout = \IPS\DEFAULT_REQUEST_TIMEOUT, bool $retry = FALSE ): array
|
||||
final protected function _api( string $endpoint, array $queryString = NULL, bool $authenticate = FALSE, array $data = NULL, int $timeout = \IPS\DEFAULT_REQUEST_TIMEOUT, bool $retry = FALSE, ?int $ipsVersion = NULL ): array
|
||||
{
|
||||
$token = $authenticate ? ( $this->_token() ?? \IPS\MARKETPLACE_GUEST_TOKEN ) : \IPS\MARKETPLACE_GUEST_TOKEN;
|
||||
$url = \IPS\Http\Url::external( \IPS\MARKETPLACE_URL . '/api/' . $endpoint )->setQueryString( 'ips_version', \IPS\Application::load('core')->long_version );
|
||||
$url = \IPS\Http\Url::external( \IPS\MARKETPLACE_URL . '/api/' . $endpoint )->setQueryString( 'ips_version', $ipsVersion ?? \IPS\Application::load('core')->long_version );
|
||||
|
||||
if ( $queryString )
|
||||
{
|
||||
$url = $url->setQueryString( $queryString );
|
||||
@@ -1235,9 +1237,9 @@ class _marketplace extends \IPS\Dispatcher\Controller
|
||||
* @param array $files Array of files, key is Marketplace ID, value is current version
|
||||
* @return array
|
||||
*/
|
||||
final public function _updateCheck( array $files ):? array
|
||||
final public function _updateCheck( array $files, ?int $version = NULL ):? array
|
||||
{
|
||||
return $this->_api("marketplace/files/versions", [ 'files' => $files ] );
|
||||
return $this->_api("marketplace/files/versions", [ 'files' => $files ], FALSE, NULL, \IPS\DEFAULT_REQUEST_TIMEOUT, FALSE, $version );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -414,7 +414,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['approve'] = array(
|
||||
'icon' => 'check-circle',
|
||||
'title' => 'approve',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=approve&id=' . $member->member_id . $this->getSafeUrlFromFilters() )->csrf(),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=approve&id=' . $member->member_id )->getSafeUrlFromFilters()->csrf(),
|
||||
'id' => "{$member->member_id}-approve",
|
||||
'data' => array(
|
||||
'bubble' => '',
|
||||
@@ -423,7 +423,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['ban'] = array(
|
||||
'icon' => 'times',
|
||||
'title' => 'ban',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=ban&id=' . $member->member_id . '&permban=1' . $this->getSafeUrlFromFilters() )->csrf(),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=ban&id=' . $member->member_id . '&permban=1' )->csrf()->getSafeUrlFromFilters(),
|
||||
'id' => "{$member->member_id}-ban",
|
||||
'data' => array(
|
||||
'bubble' => '',
|
||||
@@ -435,7 +435,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['resend_email'] = array(
|
||||
'icon' => 'envelope-o',
|
||||
'title' => 'resend_validation_email',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=resendEmail&id=' . $member->member_id . $this->getSafeUrlFromFilters() )->csrf(),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=resendEmail&id=' . $member->member_id )->csrf()->getSafeUrlFromFilters(),
|
||||
'data' => array( 'doajax' => '' ),
|
||||
'id' => "{$member->member_id}-resend",
|
||||
);
|
||||
@@ -453,7 +453,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['unlock'] = array(
|
||||
'icon' => 'unlock',
|
||||
'title' => 'unlock',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=unlock&id=' . $member->member_id . $this->getSafeUrlFromFilters() )->csrf(),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=unlock&id=' . $member->member_id )->csrf()->getSafeUrlFromFilters(),
|
||||
'data' => array( 'bubble' => '' )
|
||||
);
|
||||
}
|
||||
@@ -461,7 +461,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['view'] = array(
|
||||
'icon' => 'search',
|
||||
'title' => 'view',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=view&id=' . $member->member_id . $this->getSafeUrlFromFilters() ),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=view&id=' . $member->member_id )->getSafeUrlFromFilters(),
|
||||
);
|
||||
|
||||
if ( !\IPS\Request::i()->_groupFilter )
|
||||
@@ -473,7 +473,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['flag'] = array(
|
||||
'icon' => 'flag',
|
||||
'title' => 'spam_flag',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=spam&id=' . $member->member_id . '&status=1' . $this->getSafeUrlFromFilters() )->csrf(),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=spam&id=' . $member->member_id . '&status=1')->csrf()->getSafeUrlFromFilters(),
|
||||
'hidden' => $member->members_bitoptions['bw_is_spammer'],
|
||||
'id' => "{$member->member_id}-flag",
|
||||
'data' => array(
|
||||
@@ -483,7 +483,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['unflag'] = array(
|
||||
'icon' => 'flag ipsType_spammer',
|
||||
'title' => 'spam_unflag',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=spam&id=' . $member->member_id . '&status=0' . $this->getSafeUrlFromFilters() )->csrf(),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=spam&id=' . $member->member_id . '&status=0' )->csrf()->getSafeUrlFromFilters(),
|
||||
'hidden' => !$member->members_bitoptions['bw_is_spammer'],
|
||||
'id' => "{$member->member_id}-unflag",
|
||||
'data' => array(
|
||||
@@ -498,7 +498,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$return['delete'] = array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=delete&id=' . $member->member_id . $this->getSafeUrlFromFilters() ),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=delete&id=' . $member->member_id )->getSafeUrlFromFilters(),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack( 'delete_member', FALSE, array( 'sprintf' => $member->name ) ) ),
|
||||
);
|
||||
}
|
||||
@@ -1544,6 +1544,9 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
/* Still here? We've already confirmed and we only have the internal login handler, so go ahead. */
|
||||
$member->forcePasswordReset();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__reset_password_member', array( $member->name => FALSE ) );
|
||||
|
||||
\IPS\Output::i()->redirect( $member->acpUrl() );
|
||||
}
|
||||
}
|
||||
@@ -1633,7 +1636,9 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
|
||||
\IPS\Task::queue( 'core', 'ForcePasswordReset', $options, 1, \array_keys( $options ) );
|
||||
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__reset_password_all' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=members&controller=members" ), 'saved' );
|
||||
}
|
||||
|
||||
@@ -2989,32 +2994,14 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__deleted_guest_content', array( $values['guest_name_to_delete'] => FALSE ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=moderation&controller=spam&searchResult=guest_captcha" ), 'deleted' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output = $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a partial query string based on any filters or sort options
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getSafeUrlFromFilters(): string
|
||||
{
|
||||
$extraUrlParams = [];
|
||||
|
||||
foreach( [ 'filter', 'sortby', 'sortdirection' ] as $param )
|
||||
{
|
||||
if ( isset( \IPS\Request::i()->$param ) )
|
||||
{
|
||||
$extraUrlParams[ $param ] = \IPS\Request::i()->$param;
|
||||
}
|
||||
}
|
||||
|
||||
return \count( $extraUrlParams ) ? '&' . http_build_query( $extraUrlParams ) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Member
|
||||
*
|
||||
@@ -3082,7 +3069,7 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
break;
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal("app=core&module=members&controller=members" . $this->getSafeUrlFromFilters() ), 'deleted' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal("app=core&module=members&controller=members" )->getSafeUrlFromFilters(), 'deleted' );
|
||||
}
|
||||
|
||||
/* Display Form */
|
||||
@@ -3267,6 +3254,8 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
/* Rebuild */
|
||||
$member->removeReputation( \IPS\Request::i()->type );
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__member_reaction_removed_' . \IPS\Request::i()->type , array( $member->name => FALSE ) );
|
||||
|
||||
/* redirect */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=members&controller=members&do=view&id={$member->member_id}" ), 'saved' );
|
||||
@@ -4400,6 +4389,8 @@ class _members extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__member_pii_exported', array( $member->name => FALSE ) );
|
||||
|
||||
/* Build */
|
||||
\IPS\Output::i()->sendOutput( $xml->asXML(), 200, 'application/xml', array( "Content-Disposition" => \IPS\Output::getContentDisposition( 'attachment', $member->name . '_personal_information.xml' ) ), FALSE, FALSE, FALSE );
|
||||
|
||||
@@ -47,6 +47,7 @@ class _reset extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
\IPS\Task::queue( 'core', 'RecountMemberContent', array(), 4 );
|
||||
\IPS\Session::i()->log( 'acplog__recount_member_content' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=members' ), \IPS\Member::loggedIn()->language()->addToStack( 'member_recount_content_process' ) );
|
||||
}
|
||||
|
||||
@@ -59,6 +60,7 @@ class _reset extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
\IPS\Task::queue( 'core', 'RecountMemberReputation', array(), 4 );
|
||||
\IPS\Session::i()->log( 'acplog__recount_member_rep' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=members' ), \IPS\Member::loggedIn()->language()->addToStack( 'member_recount_rep_process' ) );
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,8 @@ class _profilecompletion extends \IPS\Node\Controller
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'quick_register' => 1 ) );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__quick_register_enabled' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=profiles&tab=profilecompletion' ), 'profile_complete_quick_register_off_enabled' );
|
||||
}
|
||||
|
||||
@@ -140,6 +142,8 @@ class _profilecompletion extends \IPS\Node\Controller
|
||||
|
||||
\IPS\Member::updateAllMembers( array( "members_bitoptions2 = members_bitoptions2 & ~" . \IPS\Member::$bitOptions['members_bitoptions']['members_bitoptions2']['profile_completed'] ) );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__profile_step_added', array( "profile_step_title_{$step->id}" => TRUE ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=membersettings&controller=profiles&tab=profilecompletion" ), 'saved' );
|
||||
}
|
||||
|
||||
|
||||
@@ -155,6 +155,9 @@ class _profilesettings extends \IPS\Dispatcher\Controller
|
||||
}, \IPS\Member::loggedIn()->language()->addToStack('after'), NULL, 'prune_item_markers' ) );
|
||||
}
|
||||
|
||||
$form->addHeader( 'profile_settings_pms' );
|
||||
$form->add( new \IPS\Helpers\Form\Interval( 'prune_pms', \IPS\Settings::i()->prune_pms, FALSE, array( 'valueAs' => \IPS\Helpers\Form\Interval::DAYS, 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), NULL, 'prune_pms' ) );
|
||||
|
||||
$form->addHeader( 'profile_settings_ignore' );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'ignore_system_on', \IPS\Settings::i()->ignore_system_on, FALSE, array(), NULL, NULL, NULL, 'ignore_system_on' ) );
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class _referralbanners extends \IPS\Node\Controller
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'core', 'membersettings', 'referrals_manage' );
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'referrals_manage', 'core', 'membersettings' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ class _referralcommission extends \IPS\Node\Controller
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__referral_commission_settings_edited' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=customers&controller=referrals'), 'saved' );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,15 @@ class _refersettings extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
if ( $values['ref_on'] )
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__referrals_enabled' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Session::i()->log( 'acplog__referrals_disabled' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=core&module=membersettings&controller=referrals') );
|
||||
}
|
||||
|
||||
@@ -388,6 +388,7 @@ class _reputation extends \IPS\Node\Controller
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
\IPS\Task::queue( 'core', 'RebuildReputationLeaderboard', array(), 4 );
|
||||
\IPS\Db::i()->delete('core_reputation_leaderboard_history');
|
||||
\IPS\Session::i()->log( 'acplog__rebuilt_leaderboard' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation&tab=leaderboard' ), 'reputation_leaderboard_rebuilding' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,11 +212,11 @@ class _spam extends \IPS\Dispatcher\Controller
|
||||
$disabled = TRUE;
|
||||
if( !\IPS\Settings::i()->ipb_reg_number )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words['spam_service_enabled_desc'] = \IPS\Member::loggedIn()->language()->addToStack( '__ipbmafia__nulling_null_alert' ); //Changing error message to custom
|
||||
\IPS\Member::loggedIn()->language()->words['spam_service_enabled_desc'] = \IPS\Member::loggedIn()->language()->addToStack( '__nulling_null_alert' ); //Changing error message to custom
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words['spam_service_enabled_desc'] = \IPS\Member::loggedIn()->language()->addToStack( '__ipbmafia__nulling_null_alert' ); //Changing error message to custom
|
||||
\IPS\Member::loggedIn()->language()->words['spam_service_enabled_desc'] = \IPS\Member::loggedIn()->language()->addToStack( '__nulling_null_alert' ); //Changing error message to custom
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,30 +75,6 @@ class _dashboard extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'dashboard' )->dashboard( $toShow, $blocks, $info );
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the latest features we've seen so that we can see them again
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function whatsNew()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
\IPS\Member::loggedIn()->members_bitoptions['has_new_acp_features'] = TRUE;
|
||||
\IPS\Member::loggedIn()->save();
|
||||
|
||||
\IPS\Db::i()->delete( 'core_members_feature_seen', array( 'member_id=?', \IPS\Member::loggedIn()->member_id ) );
|
||||
|
||||
if( \IPS\Member::loggedIn()->hasAcpRestriction( \IPS\Application::load( 'core' ), \IPS\Application\Module::get( 'core', 'overview' ), 'view_dashboard' ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=overview&controller=dashboard" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "" ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a json-encoded array of the current blocks to show
|
||||
*
|
||||
|
||||
@@ -42,7 +42,7 @@ class _promote extends \IPS\Dispatcher\Controller
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'promote_manage' );
|
||||
|
||||
/* Get tab content */
|
||||
$this->activeTab = \IPS\Request::i()->tab ?: 'facebook';
|
||||
$this->activeTab = \IPS\Request::i()->tab ?: 'internal';
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
@@ -67,13 +67,12 @@ class _promote extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Build tab list */
|
||||
$tabs = array();
|
||||
|
||||
$tabs['facebook'] = 'promote_tab_facebook';
|
||||
|
||||
$tabs['internal'] = 'promote_tab_internal';
|
||||
$tabs['permissions'] = 'promote_tab_permissions';
|
||||
$tabs['twitter'] = 'promote_tab_twitter';
|
||||
$tabs['links'] = 'promote_tab_links';
|
||||
$tabs['schedule'] = 'promote_tab_schedule';
|
||||
$tabs['permissions'] = 'promote_tab_permissions';
|
||||
$tabs['internal'] = 'promote_tab_internal';
|
||||
|
||||
/* Buttons for logs */
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'promotion', 'promote_logs' ) )
|
||||
@@ -347,244 +346,6 @@ class _promote extends \IPS\Dispatcher\Controller
|
||||
return $output . $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Facebook
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _manageFacebook()
|
||||
{
|
||||
$facebook = \IPS\Login\Handler::findMethod('IPS\Login\Handler\Oauth2\Facebook');
|
||||
$account = \IPS\core\Promote::getPromoter('Facebook')->setMember( \IPS\Member::loggedIn() );
|
||||
|
||||
if ( isset( \IPS\Request::i()->clear ) and \IPS\Request::i()->clear === 'true' )
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* We want to clear settings */
|
||||
$account->enabled = FALSE;
|
||||
$account->saveSettings( array(
|
||||
'token' => NULL,
|
||||
'owner' => NULL,
|
||||
'page_name' => NULL,
|
||||
'enabled' => NULL,
|
||||
'page' => NULL,
|
||||
'group' => NULL,
|
||||
'member_token' => NULL,
|
||||
'shareable' => NULL
|
||||
) );
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'promote_facebook_auth' => '' ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=promotion&controller=promote&tab=facebook" ) );
|
||||
}
|
||||
|
||||
/* We are using the default app here */
|
||||
if ( \is_numeric( \IPS\Settings::i()->promote_facebook_auth ) )
|
||||
{
|
||||
/* Have we set up Facebook yet? */
|
||||
if ( !$facebook OR ! $facebook->settings['client_id'] )
|
||||
{
|
||||
/* Nope, so lets do that first... */
|
||||
return \IPS\Theme::i()->getTemplate( 'promote' )->warningNoFacebookApp();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We are using our custom app here */
|
||||
$facebook->settings = json_decode( \IPS\Settings::i()->promote_facebook_auth, TRUE );
|
||||
}
|
||||
|
||||
/* promote_facebook_auth: value 0 means not set up, value 1 means using default, JSON means using custom */
|
||||
if ( ! \IPS\Settings::i()->promote_facebook_auth )
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$json = array();
|
||||
|
||||
if ( ! \is_int( \IPS\Settings::i()->promote_facebook_auth ) )
|
||||
{
|
||||
$json = json_decode( \IPS\Settings::i()->promote_facebook_auth, TRUE );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'promote_facebook_auth_choose', ( \IPS\Settings::i()->promote_facebook_auth === 0 or \IPS\Settings::i()->promote_facebook_auth === 1 ) ? 1 : 0, FALSE, array( 'options' => array(
|
||||
0 => 'promote_facebook_auth_choose_default',
|
||||
1 => 'promote_facebook_auth_choose_custom'
|
||||
),
|
||||
'toggles' => array(
|
||||
1 => array( 'promote_facebook_auth_id', 'promote_facebook_auth_secret' )
|
||||
) ), NULL, NULL, NULL, 'promote_facebook_auth_choose' ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'promote_facebook_auth_id', ( isset( $json['client_id'] ) ? $json['client_id'] : NULL ), TRUE, array(), NULL, NULL, NULL, 'promote_facebook_auth_id' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'promote_facebook_auth_secret', ( isset( $json['client_secret'] ) ? $json['client_secret'] : NULL ), TRUE, array(), NULL, NULL, NULL, 'promote_facebook_auth_secret' ) );
|
||||
|
||||
\IPS\Member::loggedIn()->language()->words['promote_facebook_auth_id_desc'] = \IPS\Member::loggedIn()->language()->addToStack( 'login_handler_Facebook_info', FALSE, array( 'sprintf' => array( (string) \IPS\Http\Url::internal( 'oauth/callback/', 'none' ) ) ) );
|
||||
|
||||
/* Are we saving? */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
/* Default to .. default */
|
||||
$auth = 1;
|
||||
|
||||
if ( $values['promote_facebook_auth_choose'] == 1 )
|
||||
{
|
||||
$auth = array(
|
||||
'client_id' => $values['promote_facebook_auth_id'],
|
||||
'client_secret' => $values['promote_facebook_auth_secret']
|
||||
);
|
||||
}
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'promote_facebook_auth' => json_encode( $auth ) ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=promotion&controller=promote&tab=" . \IPS\Request::i()->tab ), 'saved' );
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/* Have we synchronized our user account with Facebook? */
|
||||
if ( ! $account->isConnected( \IPS\Member::loggedIn() ) )
|
||||
{
|
||||
/* Nope, so lets do that now... */
|
||||
return \IPS\Theme::i()->getTemplate( 'promote' )->warningNoFacebookUser( $facebook, \is_numeric( \IPS\Settings::i()->promote_facebook_auth ) );
|
||||
}
|
||||
|
||||
/* Do we have post to page permissions? */
|
||||
$response = $account->canPostToPage();
|
||||
if ( $response !== TRUE )
|
||||
{
|
||||
/* Nope, so lets do that now... */
|
||||
return \IPS\Theme::i()->getTemplate( 'promote' )->warningNoFacebookPostToPagePermission( $response, $facebook );
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form;
|
||||
|
||||
/* We're all set, so show the form! */
|
||||
$pages = $facebook->getPages( \IPS\Member::loggedIn() );
|
||||
$options = array();
|
||||
$shareable = array();
|
||||
|
||||
foreach( $pages as $id => $data )
|
||||
{
|
||||
$options[ 'p_' . $id ] = \IPS\Member::loggedIn()->language()->addToStack( 'promote_facebook_page_prefix', FALSE, array( 'sprintf' => array( $data[0] ) ) );
|
||||
}
|
||||
|
||||
$groups = $facebook->getGroups( \IPS\Member::loggedIn() );
|
||||
foreach( $groups as $id => $data )
|
||||
{
|
||||
$options[ 'g_' . $id ] = \IPS\Member::loggedIn()->language()->addToStack( 'promote_facebook_group_prefix', FALSE, array( 'sprintf' => array( $data[0] ) ) );
|
||||
}
|
||||
|
||||
$output = '';
|
||||
$owner = \IPS\Member::load( $account->settings['owner'] );
|
||||
|
||||
if ( isset( $account->settings['shareable'] ) )
|
||||
{
|
||||
if( isset( $account->settings['shareable']['pages'] ) )
|
||||
{
|
||||
foreach( $account->settings['shareable']['pages'] as $id => $data )
|
||||
{
|
||||
$shareable[] = 'p_' . $id;
|
||||
}
|
||||
}
|
||||
|
||||
if( isset( $account->settings['shareable']['groups'] ) )
|
||||
{
|
||||
foreach( $account->settings['shareable']['groups'] as $id => $data )
|
||||
{
|
||||
$shareable[] = 'g_' . $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $account->settings['owner'] )
|
||||
{
|
||||
try
|
||||
{
|
||||
$output = \IPS\Theme::i()->getTemplate( 'promote' )->facebookOwnedBy( $owner, $account->settings['page'], $account->settings['page_name'] );
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
/* Member no longer exists, so clear settings */
|
||||
$account->enabled = FALSE;
|
||||
$account->saveSettings( array(
|
||||
'token' => NULL,
|
||||
'owner' => NULL,
|
||||
'page_name' => NULL
|
||||
) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=promotion&controller=promote&tab=facebook" ) );
|
||||
}
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'promote_facebook_enabled', $account->enabled, FALSE, array( 'togglesOn' => array( 'promote_facebook_shareable', 'promote_facebook_members', 'promote_facebook_tags' ) ), NULL, NULL, NULL, 'promote_facebook_enabled' ) );
|
||||
|
||||
if ( ! $account->settings['owner'] or ( \IPS\Member::loggedIn()->member_id == $account->settings['owner'] ) )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'promote_facebook_shareable', $shareable, FALSE, array( 'options' => $options ), NULL, NULL, NULL, 'promote_facebook_shareable' ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Stack( 'promote_facebook_tags', $account->settings['tags'], FALSE, array( 'stackFieldType' => 'Text' ), NULL, NULL, NULL, 'promote_facebook_tags' ) );
|
||||
|
||||
/* Are we saving? */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
if ( \is_array( $values['promote_facebook_tags'] ) )
|
||||
{
|
||||
array_walk( $values['promote_facebook_tags'], function( &$value )
|
||||
{
|
||||
$value = str_replace( '#', '', $value );
|
||||
} );
|
||||
}
|
||||
|
||||
$account->enabled = $values['promote_facebook_enabled'];
|
||||
|
||||
/* If we have page data, then we are the page owner and can have extra special things */
|
||||
if ( isset( $values['promote_facebook_shareable'] ) )
|
||||
{
|
||||
$shareable = array( 'pages' => array(), 'groups' => array() );
|
||||
foreach( $values['promote_facebook_shareable'] as $id )
|
||||
{
|
||||
$realId = mb_substr( $id, 2 );
|
||||
|
||||
/* Page or group? */
|
||||
if ( mb_substr( $id, 0, 2 ) == 'p_' )
|
||||
{
|
||||
$shareable['pages'][ $realId ] = array(
|
||||
'token' => $facebook->exchangeToken( $pages[ $realId ][1] ),
|
||||
'name' => $pages[ $realId ][0]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$shareable['groups'][ $realId ] = array(
|
||||
'name' => $groups[ $realId ][0]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$save['shareable'] = $shareable;
|
||||
$save['owner'] = \IPS\Member::loggedIn()->member_id;
|
||||
try
|
||||
{
|
||||
$save['token'] = \IPS\Db::i()->select( 'token_access_token', 'core_login_links', array( 'token_login_method=? and token_member=?', $facebook->id, \IPS\Member::loggedIn()->member_id ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
$save['token'] = NULL;
|
||||
}
|
||||
|
||||
$save['tags'] = $values['promote_facebook_tags'];
|
||||
}
|
||||
|
||||
$account->saveSettings( $save );
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__promote_save', array( "acplogs__promote_changed_facebook" => true ) );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=promotion&controller=promote&tab=" . \IPS\Request::i()->tab ), 'saved' );
|
||||
}
|
||||
|
||||
return $output . $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Response Logs
|
||||
*
|
||||
|
||||
@@ -200,6 +200,8 @@ class _seo extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
$form->saveAsSettings( [ 'robots_txt' => $value ] );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__robotstxt_edited' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=promotion&controller=seo&tab=robotstxt&_saved=1" ) );
|
||||
}
|
||||
|
||||
@@ -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" ) );
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief cloud
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
|
||||
* @since 07 Oct 2022
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\admin\smartcommunity;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* cloud
|
||||
*/
|
||||
class _cloud extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* Cloud
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'system/enhancements.css', 'core', 'admin' ) );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'menu__core_smartcommunity' );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'smartcommunity' )->cloud();
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ class _overview extends \IPS\Dispatcher\Controller
|
||||
|
||||
$dateFilters = array(
|
||||
'start' => new \IPS\DateTime( \IPS\Helpers\Form\Date::_convertDateFormat( \IPS\Request::i()->start ), $timezone ),
|
||||
'end' => new \IPS\DateTime( \IPS\Helpers\Form\Date::_convertDateFormat( \IPS\Request::i()->end ), $timezone )
|
||||
'end' => ( new \IPS\DateTime( \IPS\Helpers\Form\Date::_convertDateFormat( \IPS\Request::i()->end ), $timezone ) )->setTime( 23, 59, 59 )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief rankprogression
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
|
||||
* @since 27 Jun 2022
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\admin\stats;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* rankprogression
|
||||
*/
|
||||
class _rankprogression extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Allow MySQL RW separation for efficiency
|
||||
*/
|
||||
public static $allowRWSeparation = TRUE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'overview_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Points earned activity chart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$chart = new \IPS\Helpers\Chart;
|
||||
$chart->addHeader( "Rank", 'string' );
|
||||
$chart->addHeader( "Days", 'number' );
|
||||
|
||||
$data = \IPS\Db::i()->select( 'new_rank, AVG(time_to_new_rank) as time_to_rank', 'core_points_log', array('time_to_new_rank IS NOT NULL'), 'core_member_ranks.points ASC', NULL, ['new_rank'] );
|
||||
$data->join( 'core_member_ranks', 'core_member_ranks.id = core_points_log.new_rank' );
|
||||
|
||||
foreach ( $data as $row )
|
||||
{
|
||||
try
|
||||
{
|
||||
$rank = \IPS\core\Achievements\Rank::load( $row['new_rank'] );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$chart->addRow( array( $rank->_title, floor( $row['time_to_rank'] / 86400 ) ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__core_stats_rankprogression');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'stats' )->rankprogressionmessage();
|
||||
\IPS\Output::i()->output .= $chart->render( 'ScatterChart', array(
|
||||
'is3D' => TRUE,
|
||||
'vAxis' => array( 'title' => \IPS\Member::loggedIn()->language()->addToStack("core_stats_rank_progression_v") ),
|
||||
'legend' => 'none'
|
||||
) );
|
||||
}
|
||||
}
|
||||
@@ -46,19 +46,23 @@ class _hookedFiles extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_hooks', \IPS\Http\Url::internal( 'app=core&module=support&controller=hookedFiles' ), array( \IPS\Db::i()->in( 'app', \IPS\IPS::$ipsApps, TRUE ) . " OR app IS NULL" ) );
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_hooks', \IPS\Http\Url::internal( 'app=core&module=support&controller=hookedFiles' ), array( array( "( app NOT IN( '" . implode( "','", \IPS\IPS::$ipsApps ) . "' ) OR app IS NULL )" ) ) );
|
||||
$table->langPrefix = 'hooks_';
|
||||
$table->quickSearch = array( 'class', 'hook_class' );
|
||||
$table->include = array( 'hooks_app', 'hooks_plugin', 'hooks_type', 'hooks_class', 'hooks_file' );
|
||||
$table->include = array( 'hooks_id', 'hooks_app', 'hooks_plugin', 'hooks_type', 'hooks_class', 'hooks_file' );
|
||||
|
||||
$table->parsers = array(
|
||||
'hooks_id' => function( $val, $row )
|
||||
{
|
||||
return $row['id'];
|
||||
},
|
||||
'hooks_app' => function( $val, $row )
|
||||
{
|
||||
try
|
||||
{
|
||||
return \IPS\Application::load($row['app'])->_title;
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
catch ( \OutOfRangeException | \UnexpectedValueException $e )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack('hook_class_none');
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ class _recovery extends \IPS\Dispatcher\Controller
|
||||
}, function()
|
||||
{
|
||||
\IPS\IPS::resyncIPSCloud('Enabled recovery mode');
|
||||
\IPS\Session::i()->log( 'acplog__enabled_recovery' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=support&controller=recovery&do=done' ) );
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
'critical' => TRUE,
|
||||
'advice' => FALSE,
|
||||
'success' => FALSE,
|
||||
'link' =>\IPS\Http\Url::internal( "app=core&module=support&controller=support&do=getBlock&block=version&fix=1" ),
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=support&controller=support&do=getBlock&block=version&fix=1" ),
|
||||
'detail' => \IPS\Member::loggedIn()->language()->addToStack('md5_check_fail')
|
||||
);
|
||||
}
|
||||
@@ -555,6 +555,175 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get block: Hook Scanner
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
final protected function _showBlockHookscanner()
|
||||
{
|
||||
$requirements = array( 'advice' => 0, 'failures' => 0, 'list' => array() );
|
||||
/* Do custom class's overloaded method signatures work on php8? */
|
||||
try
|
||||
{
|
||||
$scannerResult = \IPS\Application\Scanner::scanCustomizationIssues( false, true, 500, array( 'shallowCheckEnabledOnly' => true, 'enabledOnly' => false ) );
|
||||
if ( $scannerResult OR $scannerResult === false )
|
||||
{
|
||||
\IPS\core\AdminNotification::send( 'core', 'ManualInterventionMessage' );
|
||||
if( (bool) $scannerResult )
|
||||
{
|
||||
$requirements['failures']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$requirements['advice']++;
|
||||
}
|
||||
|
||||
$requirements['list'][] = array(
|
||||
'critical' => (bool) $scannerResult,
|
||||
'advice' => !$scannerResult,
|
||||
'success' => FALSE,
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=support&controller=support&do=getBlock&block=methodcheck&fix=1" ),
|
||||
'detail' => \IPS\Member::loggedIn()->language()->addToStack( 'method_check_fail' ),
|
||||
'dialogTitle' => \IPS\Member::loggedIn()->language()->addToStack( 'method_check_fix' ),
|
||||
'dialogSize' => 'large'
|
||||
);
|
||||
}
|
||||
} catch ( \Exception $e ) {}
|
||||
|
||||
return array(
|
||||
'html' => \IPS\Theme::i()->getTemplate( 'support' )->supportBlockList( $requirements['list'] ),
|
||||
'criticalIssues' => $requirements['failures'],
|
||||
'recommendedIssues' => $requirements['advice']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get block: Hook Check. Only returns when "fixing" in the dialog
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function _showBlockMethodcheck()
|
||||
{
|
||||
if ( !\IPS\Request::i()->fix AND !\IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=support&controller=support" ) );
|
||||
}
|
||||
|
||||
$foundIssues = \IPS\Application\Scanner::scanCustomizationIssues( false, false, 500, array( 'enabledOnly' => false ) )[0];
|
||||
$issues = array();
|
||||
foreach ( $foundIssues as $appOrPlugin => $classes )
|
||||
{
|
||||
$components = explode( "-", $appOrPlugin );
|
||||
$isApp = \mb_strtolower( trim( $components[0] ) ) === 'app';
|
||||
$appDir = trim( $components[1] );
|
||||
$appOrPluginId = $appDir;
|
||||
/* Plugins are loaded by the ID not directory */
|
||||
if ( !$isApp )
|
||||
{
|
||||
try
|
||||
{
|
||||
$appOrPluginId = (int) \IPS\Db::i()->select( 'plugin_id', 'core_plugins', [ 'plugin_location=?', $appDir ], null, 1 )->first();
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $classes as $classFile => $classIssues )
|
||||
{
|
||||
foreach( $classIssues as $classIssue )
|
||||
{
|
||||
$issues[] = array(
|
||||
'type' => $isApp ? 'app' : 'plugin',
|
||||
'app' => $appOrPluginId,
|
||||
'reason' => $classIssue['reason'],
|
||||
'scanner_method' => $classIssue['class'] . '::' . $classIssue['method'] . '()',
|
||||
'parameter' => $classIssue['parameter'],
|
||||
'subclassFile' => $classIssue['subclassFile'] . ':' . $classIssue['subclassMethod']['lineNumber'],
|
||||
'baseFile' => $classIssue['baseFile'] . ':' . $classIssue['baseMethod']['lineNumber'],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $issues ) )
|
||||
{
|
||||
$table = \IPS\Member::loggedIn()->language()->addToStack( 'methodscanner_no_issues' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$table = new \IPS\Helpers\Table\Custom( $issues, \IPS\Http\Url::internal( 'app=core&module=support&controller=support&do=getBlock&block=methodcheck' ) );
|
||||
$table->langPrefix = 'method_';
|
||||
$table->simplePagination = true;
|
||||
|
||||
$table->parsers = array(
|
||||
'app' => function ( $val, $row ) {
|
||||
try
|
||||
{
|
||||
return $row['type'] === 'app' ?
|
||||
\IPS\Application::load( $row['app'] )->_title :
|
||||
htmlspecialchars( \is_integer( $row['app'] ? \IPS\Plugin::load( $row['app'] )->name : $row['app'] ), ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'method_class_none' );
|
||||
}
|
||||
},
|
||||
'type' => function ( $val, $row ) {
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'hooks_hooks_' . $row['type'] );
|
||||
},
|
||||
'reason' => function ( $val, $row ) {
|
||||
$reason = \IPS\Member::loggedIn()->language()->addToStack( $row['reason'] );
|
||||
$reasonDesc = \IPS\Member::loggedIn()->language()->addToStack( $row['reason'] . '_desc' );
|
||||
return "<span data-ipstooltip style='cursor:pointer' title=\"$reasonDesc\">$reason <i class=\"fa fa-info-circle\"></i></span>";
|
||||
},
|
||||
'parameter' => function ( $val, $row ) {
|
||||
if ( $row['parameter'] ?? 0 )
|
||||
{
|
||||
return '$' . $row['parameter'];
|
||||
}
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'method_na' );
|
||||
},
|
||||
'priority' => function ( $val, $row ) {
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( $val ? 'yes' : 'no' );
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ( !\IPS\Request::i()->fix AND \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
return (string) $table;
|
||||
}
|
||||
return \IPS\Theme::i()->getTemplate( 'support' )->methodIssues( $table );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Endpoint to get just the chart
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function methodCheck()
|
||||
{
|
||||
/* Trick the method into giving its chart */
|
||||
$fix = \IPS\Request::i()->fix ?? null;
|
||||
\IPS\Request::i()->fix = 1;
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'method_check_fix' );
|
||||
\IPS\Output::i()->output = $this->_showBlockMethodcheck();
|
||||
if ( $fix === null )
|
||||
{
|
||||
unset( \IPS\Request::i()->fix );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Request::i()->fix = $fix;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get block: Third Party
|
||||
*
|
||||
@@ -700,11 +869,12 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
|
||||
if( \in_array( 'cf-cache-status', $headerKeys ) )
|
||||
{
|
||||
$requirements['advice']++;
|
||||
$requirements['list'][] = array(
|
||||
'critical' => FALSE,
|
||||
'advice' => TRUE,
|
||||
'advice' => FALSE,
|
||||
'success' => FALSE,
|
||||
'learnmore' => TRUE,
|
||||
'dialogTitle' => \IPS\Member::loggedIn()->language()->addToStack( 'health_learn_more'),
|
||||
'element' => 'cloudflare',
|
||||
'body' => \IPS\Member::loggedIn()->language()->addToStack('health__cache_cloudflare_details'),
|
||||
'detail' => \IPS\Member::loggedIn()->language()->addToStack('health__cache_cloudflare')
|
||||
@@ -1381,6 +1551,10 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
$blocks['hookscanner'] = array(
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack('health__scanner_title'),
|
||||
);
|
||||
|
||||
$blocks['mysql'] = array(
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( \IPS\CIC ? 'health__mysql_title' : 'health__mysql_title_cic' ),
|
||||
'details' => !\IPS\CIC ? \IPS\Member::loggedIn()->language()->addToStack( 'acp_version_number_raw', FALSE, array( 'sprintf' => array( \IPS\Db::i()->server_info ) ) ) : NULL
|
||||
@@ -1618,6 +1792,9 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
$errors[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__support_tool_db_check' );
|
||||
|
||||
if ( \count( $erroredQueries ) )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->fixDatabase( $erroredQueries, $errors, \IPS\Request::i()->_upgradeVersion );
|
||||
@@ -1921,6 +2098,8 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
$supportAccount->save();
|
||||
\IPS\core\AdminNotification::send( 'core', 'ConfigurationError', "supportAdmin-{$supportAccount->member_id}", TRUE, NULL, TRUE );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__support_tool_admin' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack( 'administrator_account' );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'support' )->admin( $supportAccount->name, $supportAccount->email, $password );
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Requires MySQL 5.5.3 */
|
||||
if ( version_compare( \IPS\Db::i()->server_info, '5.5.3', '<' ) )
|
||||
if ( !\IPS\CIC AND version_compare( \IPS\Db::i()->server_info, '5.5.3', '<' ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'utf8mb4_converter_requires_553', '1C325/1', 403, '' );
|
||||
}
|
||||
|
||||
@@ -132,6 +132,8 @@ class _background extends \IPS\Dispatcher\Controller
|
||||
$task->next_run = time() + 60;
|
||||
$task->save();
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__background_tasks_ran' );
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=core&module=overview&controller=dashboard'), 'completed' );
|
||||
}
|
||||
);
|
||||
|
||||
@@ -52,6 +52,10 @@ class _login extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if( \IPS\Application::load('core')->long_version < \IPS\Application::getAvailableVersion('core') and \IPS\Application::load('core')->version != \IPS\Application::getAvailableVersion( 'core', TRUE ) )
|
||||
{
|
||||
/* Force no caching */
|
||||
@header( "Cache-control: no-cache, no-store, must-revalidate, max-age=0, s-maxage=0" );
|
||||
@header( "Expires: 0" );
|
||||
|
||||
if ( \IPS\CIC )
|
||||
{
|
||||
include( \IPS\ROOT_PATH . '/' . \IPS\CP_DIRECTORY . '/upgrade/upgradeAvailableCic.php' );
|
||||
@@ -296,8 +300,11 @@ class _login extends \IPS\Dispatcher\Controller
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCsrfKey(): ?string
|
||||
public function getCsrfKey()
|
||||
{
|
||||
/* Don't cache the CSRF key */
|
||||
\IPS\Output::i()->pageCaching = FALSE;
|
||||
|
||||
\IPS\Output::i()->json( [ 'key' => \IPS\Session::i()->csrfKey ] );
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'upgrade_manage', 'core', 'overview' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('ips_suite_upgrade');
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::external( "https://ipbmafia.ru/files/file/2342-invision-community-nulled/" ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::external( "https://nullcave.club/resources/invision-community.979/" ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,36 +160,39 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
if ( $values )
|
||||
{
|
||||
/* Check requirements */
|
||||
try
|
||||
if( !\IPS\CIC )
|
||||
{
|
||||
$requirements = \IPS\Http\Url::ips('requirements')->setQueryString( 'version', $values['version'] )->request()->get()->decodeJson();
|
||||
$phpVersion = PHP_VERSION;
|
||||
$mysqlVersion = \IPS\Db::i()->server_info;
|
||||
if ( !( version_compare( $phpVersion, $requirements['php']['required'] ) >= 0 ) )
|
||||
try
|
||||
{
|
||||
if ( $requirements['php']['required'] == $requirements['php']['recommended'] )
|
||||
$requirements = \IPS\Http\Url::ips('requirements')->setQueryString( 'version', $values['version'] )->request()->get()->decodeJson();
|
||||
$phpVersion = PHP_VERSION;
|
||||
$mysqlVersion = \IPS\Db::i()->server_info;
|
||||
if ( !( version_compare( $phpVersion, $requirements['php']['required'] ) >= 0 ) )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail_no_recommended', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'] ) ) );
|
||||
if ( $requirements['php']['required'] == $requirements['php']['recommended'] )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail_no_recommended', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'] ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'], $requirements['php']['recommended'] ) ) );
|
||||
}
|
||||
\IPS\Output::i()->error( $message, '1C287/2' );
|
||||
}
|
||||
else
|
||||
if ( !( version_compare( $mysqlVersion, $requirements['mysql']['required'] ) >= 0 ) )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'], $requirements['php']['recommended'] ) ) );
|
||||
\IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_version_fail', FALSE, array( 'sprintf' => array( $mysqlVersion, $requirements['mysql']['required'], $requirements['mysql']['recommended'] ) ) ), '1C287/3', 403, '' );
|
||||
}
|
||||
\IPS\Output::i()->error( $message, '1C287/2' );
|
||||
}
|
||||
if ( !( version_compare( $mysqlVersion, $requirements['mysql']['required'] ) >= 0 ) )
|
||||
{
|
||||
\IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_version_fail', FALSE, array( 'sprintf' => array( $mysqlVersion, $requirements['mysql']['required'], $requirements['mysql']['recommended'] ) ) ), '1C287/3', 403, '' );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
/* Do a database check */
|
||||
if( !\IPS\IPS_ALPHA_BUILD )
|
||||
{
|
||||
$md5CheckVersion = NULL;
|
||||
/* If the files on disk are already newer, set version for MD5 check (i.e. if the files were already applied, but the upgrade hasn't happened) */
|
||||
if( (int) \IPS\Application::getAvailableVersion('core') > \IPS\Application::load('core')->long_version )
|
||||
if( (int) \IPS\Application::getAvailableVersion('core') > \IPS\Application::load('core')->long_version AND \IPS\Application::load('core')->version != \IPS\Application::getAvailableVersion( 'core', TRUE ) )
|
||||
{
|
||||
$md5CheckVersion = (int) \IPS\Application::getAvailableVersion('core');
|
||||
}
|
||||
@@ -226,7 +229,99 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Check Resources for new versions */
|
||||
if ( !isset( \IPS\Request::i()->skip_resource_check ) )
|
||||
{
|
||||
/* Check apps and plugins */
|
||||
$row = \IPS\Db::i()->union(
|
||||
array(
|
||||
\IPS\Db::i()->select( "'applications' AS `table`, app_directory AS `id`, app_version AS `current`, app_long_version AS `long`, app_marketplace_id as `marketplace_id`", 'core_applications', [ \IPS\Db::i()->in( 'app_directory', \IPS\IPS::$ipsApps, TRUE ) ] ),
|
||||
\IPS\Db::i()->select( "'plugins' AS `table`, plugin_id AS id, plugin_version_human AS `current`, plugin_version_long AS `long`, plugin_marketplace_id as `marketplace_id`", 'core_plugins' ),
|
||||
\IPS\Db::i()->select( "'themes' AS `table`, set_id AS `id`, set_version AS `current`, set_long_version AS `long`, set_marketplace_id as `marketplace_id`", 'core_themes', [ 'set_customized=?', 1 ] ),
|
||||
\IPS\Db::i()->select( "'languages' AS `table`, lang_id AS `id`, `lang_version` AS `current`, `lang_version_long` AS `long`, `lang_marketplace_id` as `marketplace_id`", "core_sys_lang" )
|
||||
),
|
||||
NULL,
|
||||
200
|
||||
);
|
||||
|
||||
$marketplaceCheck = [];
|
||||
$output = [ 'updates' => [], 'noupdate' => [], 'compatible' => [], 'custom' => [] ];
|
||||
foreach ( $row as $r )
|
||||
{
|
||||
/* Load title */
|
||||
try
|
||||
{
|
||||
switch( $r['table'] )
|
||||
{
|
||||
case 'applications':
|
||||
$r['title'] = \IPS\Application::load( $r['id'] )->_title;
|
||||
break;
|
||||
case 'plugins':
|
||||
$r['title'] = \IPS\Plugin::load( $r['id'] )->_title;
|
||||
break;
|
||||
case 'themes':
|
||||
$r['title'] = \IPS\Theme::load( $r['id'] )->_title;
|
||||
break;
|
||||
case 'languages':
|
||||
\IPS\Db::i()->select( 'word_id', 'core_sys_lang_words', array( 'lang_id=? AND word_export=1 AND word_custom IS NOT NULL', $r['id'], 1 ) )->first();
|
||||
$r['title'] = \IPS\Lang::load( $r['id'] )->_title;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch( \RuntimeException | \OutOfRangeException $e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$output[ ( $r['marketplace_id'] ? 'updates' : 'custom' )][ $r['table'] . $r['id'] ] = $r;
|
||||
if ( $r['marketplace_id'] )
|
||||
{
|
||||
$marketplaceCheck[] = $r;
|
||||
}
|
||||
}
|
||||
|
||||
/* Actually Check */
|
||||
if( \count( $marketplaceCheck ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$marketplaceController = new \IPS\core\modules\admin\marketplace\marketplace;
|
||||
$response = $marketplaceController->_updateCheck( array_column( $marketplaceCheck, 'long', 'marketplace_id' ), (int) $values['version'] );
|
||||
|
||||
foreach ( $marketplaceCheck as $mp )
|
||||
{
|
||||
if( !empty( $response[ $mp['marketplace_id'] ] ) )
|
||||
{
|
||||
$mp['update'] = $response[ $mp['marketplace_id'] ];
|
||||
|
||||
if( $response[ $mp['marketplace_id'] ]['longversion'] == $mp['long'] )
|
||||
{
|
||||
$output['compatible'][ $mp['table'] . $mp['id'] ] = $mp;
|
||||
unset( $output['updates'][ $mp['table'] . $mp['id'] ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output['updates'][ $mp['table'] . $mp['id'] ] = $mp;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
unset( $output['updates'][ $mp['table'] . $mp['id'] ] );
|
||||
$output['noupdate'][ $mp['table'] . $mp['id'] ] = $mp;
|
||||
}
|
||||
}
|
||||
catch( \RuntimeException | \UnexpectedValueException $e )
|
||||
{
|
||||
$output['nocheck'] = $marketplaceCheck;
|
||||
$output['updates'] = [];
|
||||
}
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate('system')->upgradeDeltaResourceIssues( $values['version'], $output );
|
||||
}
|
||||
|
||||
/* Get details */
|
||||
$data = array( 'version' => $values['version'], 'oldVersion' => \IPS\Application::load('core')->long_version, 'changes' => array() );
|
||||
$data['info'] = $this->_changeDetails( $data['oldVersion'], $values['version'] );
|
||||
@@ -409,6 +504,9 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* Deliberately no try/catch because if it does fail, the site will never know and it will always be an issue cloud-side. */
|
||||
\IPS\IPS::applyLatestFilesIPSCloud();
|
||||
|
||||
/* Log who started the upgrade */
|
||||
\IPS\Session::i()->log( 'acplog__upgrade_started' );
|
||||
|
||||
if ( isset( \IPS\Request::i()->check ) )
|
||||
{
|
||||
@@ -994,6 +1092,8 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
unset( \IPS\Data\Store::i()->applications, \IPS\Data\Store::i()->updatecount_applications );
|
||||
|
||||
\IPS\core\extensions\core\CommunityEnhancements\Zapier::rebuildRESTApiPermissions();
|
||||
|
||||
\IPS\core\AdminNotification::remove( 'core', 'NewVersion' );
|
||||
|
||||
return array( \IPS\Theme::i()->getTemplate('system')->upgradeFinished( $databaseErrors ) );
|
||||
|
||||
Reference in new issue
Block a user