Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+134 -53
View File
@@ -173,11 +173,6 @@ class _Application extends \IPS\Application
\IPS\core\Achievements\Rule::importXml( $this->getApplicationPath() . "/data/achievements/rules.xml" );
\IPS\core\Achievements\Rank::importXml( $this->getApplicationPath() . "/data/achievements/ranks.xml" );
\IPS\core\Achievements\Badge::importXml( $this->getApplicationPath() . "/data/achievements/badges.xml" );
if ( \IPS\CIC2 )
{
\IPS\Cicloud\postInstall();
}
}
/**
@@ -199,7 +194,11 @@ class _Application extends \IPS\Application
or
(
$module->key == 'contact' and $controller == 'contact'
);
)
or
(
$module->key == 'discover' and \in_array( $controller, array( 'rss', 'streams' ) )
);
}
/**
@@ -375,7 +374,7 @@ class _Application extends \IPS\Application
$subprocessors = array();
/* Analytics */
if ( \IPS\Settings::i()->ipbseo_ga_provider == 'ga' )
if ( \IPS\Settings::i()->ga_enabled )
{
$subprocessors[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack('enhancements__core_GoogleAnalytics'),
@@ -383,11 +382,11 @@ class _Application extends \IPS\Application
'privacyUrl' => 'https://www.google.com/intl/en/policies/privacy/'
);
}
else if ( \IPS\Settings::i()->ipbseo_ga_provider == 'piwik' )
if ( \IPS\Settings::i()->matomo_enabled )
{
$subprocessors[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack('analytics_provider_piwik'),
'description' => \IPS\Member::loggedIn()->language()->addToStack('pp_desc_Piwik'),
'title' => \IPS\Member::loggedIn()->language()->addToStack('analytics_provider_matomo'),
'description' => \IPS\Member::loggedIn()->language()->addToStack('pp_desc_Matomo'),
'privacyUrl' => 'https://matomo.org/privacy-policy/'
);
}
@@ -450,6 +449,12 @@ class _Application extends \IPS\Application
'privacyUrl' => 'https://www.keycaptcha.com'
);
break;
case 'hcaptcha':
$subprocessors[] = array(
'title' => \IPS\Member::loggedIn()->language()->addToStack('captcha_type_hcaptcha'),
'description' => \IPS\Member::loggedIn()->language()->addToStack('hcaptcha_privacy'),
'privacyUrl' => 'https://www.hcaptcha.com/privacy'
);
}
}
@@ -489,49 +494,6 @@ class _Application extends \IPS\Application
return $return;
}
/**
* Return an array of specific links to add to the sitemap
*
* @return array
*/
public function sitemapLinks()
{
$return = array(
\IPS\Http\Url::internal( 'app=core&module=system&controller=cookies', 'front', 'cookies' ),
\IPS\Http\Url::internal( 'app=core&module=system&controller=terms', 'front', 'terms' ),
);
if( \IPS\Settings::i()->gl_type != 'none' )
{
$return[] = \IPS\Http\Url::internal( 'app=core&module=system&controller=guidelines', 'front', 'guidelines' );
}
if( \IPS\Settings::i()->privacy_type != 'none' )
{
$return[] = \IPS\Http\Url::internal( 'app=core&module=system&controller=privacy', 'front', 'privacy' );
}
$guest = new \IPS\Member;
if( $guest->canAccessModule( \IPS\Application\Module::get( 'core', 'staffdirectory', 'front' ) ) )
{
$return[] = \IPS\Http\Url::internal( 'app=core&module=staffdirectory&controller=directory', 'front', 'staffdirectory' );
}
if ( \IPS\Settings::i()->reputation_enabled and \IPS\Settings::i()->reputation_leaderboard_on )
{
$return[] = \IPS\Http\Url::internal( 'app=core&module=discover&controller=popular&tab=leaderboard', 'front', 'leaderboard_leaderboard' );
$return[] = \IPS\Http\Url::internal( 'app=core&module=discover&controller=popular&tab=history', 'front', 'leaderboard_history' );
$return[] = \IPS\Http\Url::internal( 'app=core&module=discover&controller=popular&tab=members', 'front', 'leaderboard_members' );
}
if ( \IPS\Settings::i()->clubs )
{
$return[] = \IPS\Http\Url::internal( 'app=core&module=clubs&controller=directory', 'front', 'clubs_list' );
}
return $return;
}
/**
* Get AdminCP Menu Count for resource updates
*
@@ -552,6 +514,11 @@ class _Application extends \IPS\Application
case 'applications':
foreach( \IPS\Application::applications() as $app )
{
if ( \IPS\CIC AND \IPS\IPS::isManaged() AND \in_array( $app->directory, \IPS\IPS::$ipsApps ) )
{
continue;
}
if( \count( $app->availableUpgrade( TRUE ) ) )
{
$count++;
@@ -602,4 +569,118 @@ class _Application extends \IPS\Application
\IPS\Data\Store::i()->$key = $count;
return (int) \IPS\Data\Store::i()->$key;
}
/**
* Returns a list of all existing webhooks and their payload in this app.
*
* @return array
*/
public function getWebhooks() : array
{
return array_merge( [
'club_created' => \IPS\Member\Club::class,
'club_deleted' => \IPS\Member\Club::class,
'club_member_added' => ['club' => \IPS\Member\Club::class, 'member' => \IPS\Member::class, 'status' => "string" ],
'club_member_removed' => ['club' => \IPS\Member\Club::class, 'member' => \IPS\Member::class ],
'member_create' => \IPS\Member::class,
'member_edited' => [ 'member' => \IPS\Member::class, 'changes' => "array" ],
'member_delete' => \IPS\Member::class,
], parent::getWebhooks() );
}
/**
* Do Member Check
*
* @return \IPS\Http\Url|NULL
*/
public function doMemberCheck(): ?\IPS\Http\Url
{
/* Need their name or email... */
if( ( \IPS\Member::loggedIn()->real_name === '' or !\IPS\Member::loggedIn()->email ) and \IPS\Dispatcher::i()->controller !== 'register' and \IPS\Dispatcher::i()->controller !== 'login' )
{
return \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=complete' )->setQueryString( 'ref', base64_encode( \IPS\Request::i()->url() ) );
}
/* Need them to validate... */
elseif(
\IPS\Member::loggedIn()->members_bitoptions['validating'] and
\IPS\Dispatcher::i()->controller !== 'register' and
\IPS\Dispatcher::i()->controller !== 'login' and
\IPS\Dispatcher::i()->controller != 'redirect' and
\IPS\Dispatcher::i()->controller !== 'store' and
\IPS\Dispatcher::i()->controller !== 'checkout'
)
{
return \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=validating', 'front', 'register' );
}
/* Need them to reconfirm terms/privacy policy... */
elseif ( ( \IPS\Member::loggedIn()->members_bitoptions['must_reaccept_privacy'] or \IPS\Member::loggedIn()->members_bitoptions['must_reaccept_terms'] ) and \IPS\Dispatcher::i()->controller !== 'register' and \IPS\Dispatcher::i()->controller !== 'ajax' )
{
return \IPS\Http\Url::internal( 'app=core&module=system&controller=register&do=reconfirm', 'front', 'register' )->setQueryString( 'ref', base64_encode( \IPS\Request::i()->url() ) );
}
/* Have required profile actions that need completing */
else if (
\IPS\Settings::i()->quick_register AND
!\IPS\Member::loggedIn()->members_bitoptions['profile_completed'] AND
!\in_array( \IPS\Dispatcher::i()->controller, array( 'register', 'login', 'redirect', 'ajax', 'settings', 'checkout', 'pixabay', 'editor' ) ) AND
$completion = \IPS\Member::loggedIn()->profileCompletion() AND
\count( $completion['required'] )
)
{
foreach( $completion['required'] AS $id => $completed )
{
if ( $completed === FALSE )
{
return \IPS\Http\Url::internal( "app=core&module=system&controller=register&do=finish&_new=1", 'front', 'register' )->setQueryString( 'ref', base64_encode( \IPS\Request::i()->url() ) );
}
}
}
/* Need to set up MFA... */
if ( !\in_array( \IPS\Dispatcher::i()->controller, array( 'register', 'login', 'redirect', 'ajax', 'settings', 'embed' ) ) )
{
$haveAcceptableHandlers = FALSE;
$haveConfiguredHandler = FALSE;
foreach ( \IPS\MFA\MFAHandler::handlers() as $key => $handler )
{
if ( $handler->isEnabled() and $handler->memberCanUseHandler( \IPS\Member::loggedIn() ) )
{
$haveAcceptableHandlers = TRUE;
if ( $handler->memberHasConfiguredHandler( \IPS\Member::loggedIn() ) )
{
$haveConfiguredHandler = TRUE;
break;
}
}
}
if ( !$haveConfiguredHandler and $haveAcceptableHandlers )
{
if ( \IPS\Settings::i()->mfa_required_groups == '*' or \IPS\Member::loggedIn()->inGroup( explode( ',', \IPS\Settings::i()->mfa_required_groups ) ) )
{
if ( \IPS\Settings::i()->mfa_required_prompt === 'immediate' )
{
return \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&do=initialMfa', 'front', 'settings' )->setQueryString( 'ref', base64_encode( \IPS\Request::i()->url() ) );
}
}
elseif ( \IPS\Settings::i()->mfa_optional_prompt === 'immediate' and !\IPS\Member::loggedIn()->members_bitoptions['security_questions_opt_out'] )
{
return \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&do=initialMfa', 'front', 'settings' )->setQueryString( 'ref', base64_encode( \IPS\Request::i()->url() ) );
}
}
}
/* Need to reset password */
if ( \IPS\Dispatcher::i()->controller !== 'settings' AND ( !isset( \IPS\Request::i()->area ) OR \IPS\Request::i()->area !== 'password' ) )
{
foreach( \IPS\Login::methods() AS $method )
{
if ( $url = $method->forcePasswordResetUrl( \IPS\Member::loggedIn(), \IPS\Request::i()->url() ) )
{
return $url;
}
}
}
return NULL;
}
}