Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -22,6 +22,13 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
*/
|
||||
class _settings extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief These properties are used to specify datalayer context properties.
|
||||
*
|
||||
*/
|
||||
public static $dataLayerContext = array(
|
||||
'community_area' => [ 'value' => 'settings', 'odkUpdate' => true]
|
||||
);
|
||||
|
||||
/**
|
||||
* Execute
|
||||
@@ -384,7 +391,10 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->class = 'ipsForm_collapseTablet';
|
||||
$form->add( new \IPS\Helpers\Form\Password( 'current_password', '', TRUE, array( 'protect' => TRUE, 'validateFor' => \IPS\Member::loggedIn(), 'bypassProfanity' => \IPS\Helpers\Form\Text::BYPASS_PROFANITY_ALL, 'htmlAutocomplete' => "current-password" ) ) );
|
||||
if ( !\IPS\Member::loggedIn()->members_bitoptions['password_reset_forced'] )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Password( 'current_password', '', TRUE, array( 'protect' => TRUE, 'validateFor' => \IPS\Member::loggedIn(), 'bypassProfanity' => \IPS\Helpers\Form\Text::BYPASS_PROFANITY_ALL, 'htmlAutocomplete' => "current-password" ) ) );
|
||||
}
|
||||
$form->add( new \IPS\Helpers\Form\Password( 'new_password', '', TRUE, array( 'protect' => TRUE, 'showMeter' => \IPS\Settings::i()->password_strength_meter, 'checkStrength' => TRUE, 'strengthMember' => \IPS\Member::loggedIn(), 'bypassProfanity' => \IPS\Helpers\Form\Text::BYPASS_PROFANITY_ALL, 'htmlAutocomplete' => "new-password" ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Password( 'confirm_new_password', '', TRUE, array( 'protect' => TRUE, 'confirm' => 'new_password', 'bypassProfanity' => \IPS\Helpers\Form\Text::BYPASS_PROFANITY_ALL, 'htmlAutocomplete' => "new-password" ) ) );
|
||||
|
||||
@@ -597,6 +607,8 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function _mfa()
|
||||
{
|
||||
\IPS\Output::i()->bypassCsrfKeyCheck = true;
|
||||
|
||||
/* Validate password */
|
||||
if ( !isset( $_SESSION['passwordValidatedForMfa'] ) )
|
||||
{
|
||||
@@ -646,11 +658,11 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
return $output . $mfaOutput;
|
||||
}
|
||||
|
||||
/* Do any enabling/diabling */
|
||||
/* Do any enabling/disabling */
|
||||
if ( isset( \IPS\Request::i()->act ) )
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
|
||||
/* Get the handler */
|
||||
$key = \IPS\Request::i()->type;
|
||||
if ( !isset( $handlers[ $key ] ) or \IPS\MFA\MFAHandler::accessToArea( 'core', 'SecurityQuestions', \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=mfa', 'front', 'settings_mfa' ) ) )
|
||||
@@ -671,11 +683,11 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
|
||||
\IPS\Member::loggedIn()->members_bitoptions['security_questions_opt_out'] = FALSE;
|
||||
\IPS\Member::loggedIn()->save();
|
||||
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=mfa', 'front', 'settings_mfa' ) );
|
||||
}
|
||||
|
||||
/* Show the configruation modal */
|
||||
|
||||
/* Show the configuration modal */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('settings');
|
||||
return $output . \IPS\Theme::i()->getTemplate( 'system' )->settingsMfaSetup( $handlers[ $key ]->configurationScreen( \IPS\Member::loggedIn(), FALSE, \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=mfa&act=enable&type=' . $key, 'front', 'settings_mfa' ) ), \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=mfa&act=enable&type=' . $key, 'front', 'settings_mfa' ) );
|
||||
}
|
||||
@@ -1708,7 +1720,7 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
|
||||
$this->_performRedirect( \IPS\Http\Url::internal( "app=core&module=system&controller=settings", 'front', 'settings' ), 'block_newsletter_subscribed' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Toggle Anonymously Online
|
||||
*
|
||||
@@ -1717,26 +1729,57 @@ class _settings extends \IPS\Dispatcher\Controller
|
||||
protected function updateAnon()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
|
||||
/* Check this value can be toggled */
|
||||
if( \IPS\Member::loggedIn()->group['g_hide_online_list'] >= 1 )
|
||||
{
|
||||
\IPS\Output::i()->error( 'online_status_cannot_change', '2C122/X', 403, '' );
|
||||
}
|
||||
|
||||
/* Update the bitwise flag */
|
||||
\IPS\Member::loggedIn()->members_bitoptions['is_anon'] = (bool) \IPS\Request::i()->value;
|
||||
\IPS\Member::loggedIn()->save();
|
||||
|
||||
|
||||
/* Update users devices */
|
||||
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members_known_devices', array( "member_id=?", \IPS\Member::loggedIn()->member_id ) ), 'IPS\Member\Device' ) AS $device )
|
||||
{
|
||||
$device->anonymous = ( (bool) \IPS\Request::i()->value ) ? 1 : 0;
|
||||
$device->save();
|
||||
}
|
||||
|
||||
|
||||
/* Update the session */
|
||||
\IPS\Session::i()->setType( ( (bool) \IPS\Request::i()->value ) ? \IPS\Session\Front::LOGIN_TYPE_ANONYMOUS : \IPS\Session\Front::LOGIN_TYPE_MEMBER );
|
||||
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( 'OK' );
|
||||
}
|
||||
|
||||
|
||||
$this->_performRedirect( \IPS\Http\Url::internal( "app=core&module=system&controller=settings&area=mfa", 'front', 'settings_mfa' ), 'saved' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle Whether PII is included in the data layer
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function togglePii()
|
||||
{
|
||||
if ( ! \IPS\Settings::i()->core_datalayer_member_pii_choice )
|
||||
{
|
||||
\IPS\Output::i()->error( 'page_not_found', '3T251/7', 404 );
|
||||
}
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Update the bitwise flag */
|
||||
\IPS\Member::loggedIn()->datalayer_collect_pii = (bool) ! \IPS\Member::loggedIn()->datalayer_collect_pii;
|
||||
\IPS\Member::loggedIn()->save();
|
||||
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->json( 'OK' );
|
||||
}
|
||||
|
||||
$this->_performRedirect( \IPS\Http\Url::internal( "app=core&module=system&controller=settings&area=mfa", 'front', 'settings_mfa' ), 'saved' );
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user