Version 5.0.14
This commit is contained in:
1 parent
5efe744c5f
commit
dbd774b30c
364 files changed
+7048
-1377
No files matched your search
@@ -55,8 +55,10 @@ class themeeditor extends Controller
|
||||
|
||||
/**
|
||||
* @brief Tabs array
|
||||
*
|
||||
* @var array <string,string>
|
||||
*/
|
||||
protected array $tabs = array();
|
||||
protected array $tabs = [];
|
||||
|
||||
/**
|
||||
* @brief Active tab
|
||||
@@ -79,10 +81,10 @@ class themeeditor extends Controller
|
||||
$this->url = $this->url->setQueryString( 'set_id', $this->theme->id );
|
||||
}
|
||||
|
||||
$this->tabs = array(
|
||||
$this->tabs = [
|
||||
'settings' => 'dev_themeeditor_settings',
|
||||
'categories' => 'dev_themeeditor_categories'
|
||||
);
|
||||
];
|
||||
|
||||
/* Choose active tab */
|
||||
if ( isset( Request::i()->tab ) and array_key_exists( Request::i()->tab, $this->tabs ) )
|
||||
@@ -96,19 +98,19 @@ class themeeditor extends Controller
|
||||
}
|
||||
|
||||
/* Yummy free food */
|
||||
Output::i()->breadcrumb = array(
|
||||
array(
|
||||
Output::i()->breadcrumb = [
|
||||
[
|
||||
Url::internal('app=core&module=customization&controller=themes'),
|
||||
'menu__' . Dispatcher::i()->application->directory . '_' . Dispatcher::i()->module->key
|
||||
)
|
||||
);
|
||||
]
|
||||
];
|
||||
|
||||
Output::i()->breadcrumb[] = array(
|
||||
Output::i()->breadcrumb[] = [
|
||||
Url::internal('app=core&module=customization&controller=themeeditor&set_id=' . $this->theme->_id ),
|
||||
'themeeditor_settings'
|
||||
);
|
||||
];
|
||||
|
||||
Output::i()->breadcrumb[] = array( null, $this->theme->_title );
|
||||
Output::i()->breadcrumb[] = [ null, $this->theme->_title ];
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
@@ -136,14 +138,14 @@ class themeeditor extends Controller
|
||||
*/
|
||||
protected function _manageSettings() : string
|
||||
{
|
||||
$table = new TableDb( 'core_theme_editor_settings', $this->url, array( array( 'setting_set_id=?', $this->theme->id ) ) );
|
||||
$table = new TableDb( 'core_theme_editor_settings', $this->url, [ [ 'setting_set_id=?', $this->theme->id ] ] );
|
||||
$table->include = [ 'setting_name', 'setting_type', 'setting_category_id' ];
|
||||
$table->noSort = $table->include;
|
||||
$table->rootButtons = [
|
||||
'add' => [
|
||||
'icon' => 'plus',
|
||||
'title' => 'add',
|
||||
'link' => $this->url->setQueryString( array( 'do' => 'form', 'subnode' => 1 ) )
|
||||
'link' => $this->url->setQueryString( [ 'do' => 'form', 'subnode' => 1 ] )
|
||||
]
|
||||
];
|
||||
|
||||
@@ -172,7 +174,7 @@ class themeeditor extends Controller
|
||||
*/
|
||||
protected function _manageCategories() : string
|
||||
{
|
||||
$table = new TableDb( 'core_theme_editor_categories', $this->url, array( array( 'cat_set_id=?', $this->theme->id ) ) );
|
||||
$table = new TableDb( 'core_theme_editor_categories', $this->url->setQueryString(['tab' => 'categories']), [ [ 'cat_set_id=?', $this->theme->id ] ] );
|
||||
$table->include = [ 'cat_name' ];
|
||||
$table->noSort = [ 'cat_name' ];
|
||||
$table->langPrefix = 'themeeditor_';
|
||||
@@ -180,7 +182,7 @@ class themeeditor extends Controller
|
||||
'add' => [
|
||||
'icon' => 'plus',
|
||||
'title' => 'add',
|
||||
'link' => $this->url->setQueryString( array( 'do' => 'form' ) )
|
||||
'link' => $this->url->setQueryString( [ 'do' => 'form' ] )
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ use function method_exists;
|
||||
use function str_replace;
|
||||
use function strlen;
|
||||
use function strtotime;
|
||||
use const IPS\CIC;
|
||||
use const IPS\Helpers\Table\HEADER;
|
||||
use const IPS\Helpers\Table\SEARCH_CONTAINS_TEXT;
|
||||
use const IPS\Helpers\Table\SEARCH_DATE_RANGE;
|
||||
@@ -2180,7 +2181,7 @@ class members extends Controller
|
||||
Dispatcher::i()->checkAcpPermission( 'member_edit' );
|
||||
|
||||
/* Managed Only */
|
||||
if( !\IPS\CIC OR ( \IPS\CIC AND !isManaged() ) )
|
||||
if( !CIC OR !isManaged() )
|
||||
{
|
||||
Output::i()->error( 'node_error', '2C114/17', 403, '' );
|
||||
}
|
||||
@@ -2230,7 +2231,7 @@ class members extends Controller
|
||||
$form->add( new Text( 'add_login_link_identifier', NULL, TRUE, customValidationCode: function( $value ) {
|
||||
try
|
||||
{
|
||||
Db::i()->select( '*', 'core_login_links', [ 'token_login_method=? AND token_identifier=?', (int) \IPS\Request::i()->add_login_link_handler, $value ] )->first();
|
||||
Db::i()->select( '*', 'core_login_links', [ 'token_login_method=? AND token_identifier=?', (int) Request::i()->add_login_link_handler, $value ] )->first();
|
||||
throw new DomainException( 'login_identifier_exists' );
|
||||
}
|
||||
catch( UnderflowException ) {}
|
||||
@@ -4379,7 +4380,7 @@ class members extends Controller
|
||||
{
|
||||
if( $method::class != 'IPS\Login\Handler\Standard' AND $method::class != 'IPS\convert\extensions\core\LoginHandler\Converter' )
|
||||
{
|
||||
$columns[ 'core_login_' . $method->_id ] = \IPS\Member::loggedIn()->language()->addToStack( 'import_login_links_suffix', FALSE, [ 'sprintf' => [ $method->_title ] ] );
|
||||
$columns[ 'core_login_' . $method->_id ] = Member::loggedIn()->language()->addToStack( 'import_login_links_suffix', FALSE, [ 'sprintf' => [ $method->_title ] ] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4685,7 +4686,7 @@ class members extends Controller
|
||||
|
||||
$valueToWrite = match( $field->type ) {
|
||||
'YesNo', 'Checkbox' => $member[ 'field_' . $fieldId ] ? Member::loggedIn()->language()->get('yes') : Member::loggedIn()->language()->get('no'),
|
||||
default => $member[ 'field_' . $fieldId ] ? Field::load( $fieldId )->displayValue( $member[ 'field_' . $fieldId ], FALSE, NULL, 0, NULL, TRUE, ',' ) : ''
|
||||
default => $member[ 'field_' . $fieldId ] ? Field::load( $fieldId )->displayValue( $member[ 'field_' . $fieldId ], FALSE, NULL, 0, NULL, TRUE ) : ''
|
||||
};
|
||||
}
|
||||
else if ( mb_substr( $column, 0, 11 ) == 'core_login_' )
|
||||
@@ -5097,7 +5098,7 @@ class members extends Controller
|
||||
return [ 'delete' => [
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => $row['rule'] ? NULL : $member->acpUrl()->setQueryString( ['do' => 'deleteBadge', 'id' => $row['badge_id'], 'member_id' => $member->member_id ] ),
|
||||
'link' => $row['rule'] ? NULL : $member->acpUrl()->setQueryString( ['do' => 'deleteBadge', 'id' => $row['badge_id'], 'member_id' => $member->member_id ] )->csrf(),
|
||||
'class' => $row['rule'] ? 'ipsControlStrip_disabled' : '',
|
||||
'data' => $row['rule'] ? [] : [ 'delete' => '' ],
|
||||
'tooltip' => Member::loggedIn()->language()->addToStack( $row['rule'] ? 'acp_badge_cannot_delete' : 'delete' )
|
||||
@@ -5174,6 +5175,8 @@ class members extends Controller
|
||||
*/
|
||||
protected function deleteBadge() : void
|
||||
{
|
||||
Request::i()->confirmedDelete();
|
||||
|
||||
/* Load Member */
|
||||
try
|
||||
{
|
||||
@@ -5206,16 +5209,6 @@ class members extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request that a member's email is unblocked (via ajax)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function requestEmailUnblock(): void
|
||||
{
|
||||
Bridge::i()->bounceMemberViewRequestEmailUnblock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the functionality to manually add members is enabled
|
||||
*
|
||||
|
||||
@@ -44,6 +44,7 @@ use UnderflowException;
|
||||
use function defined;
|
||||
use function in_array;
|
||||
use function intval;
|
||||
use const IPS\CIC;
|
||||
use const IPS\Helpers\Table\SEARCH_CONTAINS_TEXT;
|
||||
use const IPS\Helpers\Table\SEARCH_DATE_RANGE;
|
||||
use const IPS\Helpers\Table\SEARCH_NUMERIC;
|
||||
@@ -226,8 +227,19 @@ class spam extends Controller
|
||||
'options' => static::getCaptchaOptions( 'options' ),
|
||||
'toggles' => static::getCaptchaOptions( 'toggles' ),
|
||||
), NULL, NULL, NULL, 'bot_antispam_type' ) );
|
||||
$form->add( new Text( 'turnstile_site_key', Settings::i()->turnstile_site_key, id: 'turnstile_site_key' ) );
|
||||
$form->add( new Text( 'turnstile_secret_key', Settings::i()->turnstile_secret_key, id: 'turnstile_secret_key' ) );
|
||||
$form->add( new Text( 'turnstile_site_key', Settings::i()->turnstile_site_key, ( CIC ? false : null ), [], function( $val )
|
||||
{
|
||||
if( empty( $val ) and Request::i()->bot_antispam_type == 'turnstile' and !CIC )
|
||||
{
|
||||
throw new DomainException( 'field_required' );
|
||||
}
|
||||
}, id: 'turnstile_site_key' ) );
|
||||
$form->add( new Text( 'turnstile_secret_key', Settings::i()->turnstile_secret_key, ( CIC ? false : null ), [], function( $val ) {
|
||||
if( empty( $val ) and Request::i()->bot_antispam_type == 'turnstile' and !CIC )
|
||||
{
|
||||
throw new DomainException( 'field_required' );
|
||||
}
|
||||
}, id: 'turnstile_secret_key' ) );
|
||||
|
||||
if( \IPS\CIC )
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ class general extends Controller
|
||||
} ) );
|
||||
|
||||
$values['site_address'] = json_encode( $values['site_address'] );
|
||||
|
||||
|
||||
$form->saveAsSettings( $values );
|
||||
|
||||
if ( $values['site_online'] )
|
||||
|
||||
@@ -43,6 +43,7 @@ use IPS\Request;
|
||||
use IPS\Session;
|
||||
use IPS\Settings;
|
||||
use IPS\Task;
|
||||
use IPS\Text\Parser;
|
||||
use IPS\Theme;
|
||||
use IPS\Xml\XMLReader;
|
||||
use OutOfRangeException;
|
||||
@@ -50,6 +51,7 @@ use UnderflowException;
|
||||
use XMLWriter;
|
||||
use function count;
|
||||
use function defined;
|
||||
use function implode;
|
||||
use function intval;
|
||||
use function is_array;
|
||||
use function preg_match;
|
||||
@@ -465,13 +467,31 @@ class posting extends Controller
|
||||
)
|
||||
), NULL, NULL, NULL, 'embed_url_filter_any_action' ) );
|
||||
|
||||
$form->addHeader('fb_ig_oembed_header');
|
||||
$form->add( new Text( 'fb_ig_oembed_appid', Settings::i()->fb_ig_oembed_appid, FALSE ) );
|
||||
$form->add( new Text( 'fb_ig_oembed_appsecret', Settings::i()->fb_ig_oembed_appsecret, FALSE ) );
|
||||
/* Facebook/IG oembeds are deprecated. Only show this message if the site currently has them setup or they have added the manual override constant */
|
||||
$fbEnabled =false;
|
||||
if ( ( defined( "FB_DEPRECATION_BYPASS" ) and constant( "FB_DEPRECATION_BYPASS" ) ) or ( Settings::i()->fb_ig_oembed_appid and Settings::i()->fb_ig_oembed_appsecret ) )
|
||||
{
|
||||
$fbEnabled = true;
|
||||
$form->addHeader( 'fb_ig_oembed_header' );
|
||||
$form->addMessage( "fb_ig_oembed_deprecate_warning", "ipsMessage--error" );
|
||||
$form->add( new Text( 'fb_ig_oembed_appid', Settings::i()->fb_ig_oembed_appid, FALSE ) );
|
||||
$form->add( new Text( 'fb_ig_oembed_appsecret', Settings::i()->fb_ig_oembed_appsecret, FALSE ) );
|
||||
}
|
||||
|
||||
/* Iframely link */
|
||||
if ( Dispatcher::i()->checkAcpPermission( "enhancements_manage", return: true ) )
|
||||
{
|
||||
$form->addMessage( 'iframely_manage_link' );
|
||||
}
|
||||
|
||||
/* Save values */
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
/* Changed the embed app or secret? We need to clear the cached token */
|
||||
if ( $fbEnabled and ( !$values['fb_ig_oembed_appid'] or !$values['fb_ig_oembed_appsecret'] or $values['fb_ig_oembed_appid'] !== Settings::i()->fb_ig_oembed_appid or $values['fb_ig_oembed_appsecret'] !== Settings::i()->fb_ig_oembed_appsecret ) )
|
||||
{
|
||||
Settings::i()->changeValues( array( 'fb_ig_oembed_token' => '' ) );
|
||||
}
|
||||
$values['ipb_embed_url_whitelist'] = implode( ",", $values['ipb_embed_url_whitelist'] );
|
||||
$form->saveAsSettings( $values );
|
||||
|
||||
@@ -921,6 +941,21 @@ class posting extends Controller
|
||||
$form->addHtml( Theme::i()->getTemplate( 'forms' )->blurb( 'editor_simplified_mode_desc', true, true ) );
|
||||
|
||||
$dependencies = Form\Editor::getRestrictionDependencies();
|
||||
|
||||
/* Add note about iframely config */
|
||||
if ( Dispatcher::i()->checkAcpPermission( 'enhancements_manage', return: true ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$baseExternalDesc = Member::loggedIn()->language()->get( "editor_r__external_embed__desc" ) . "\n";
|
||||
}
|
||||
catch ( UnderflowException )
|
||||
{
|
||||
$baseExternalDesc = "";
|
||||
}
|
||||
Member::loggedIn()->language()->words['editor_r__external_embed__desc'] = $baseExternalDesc . Member::loggedIn()->language()->addToStack( "iframely_manage_link" );
|
||||
}
|
||||
|
||||
foreach ( Form\Editor::getAllRestrictions() as $restriction )
|
||||
{
|
||||
if ( $restriction === 'giphy' && !Settings::i()->giphy_enabled )
|
||||
|
||||
@@ -151,7 +151,7 @@ class badges extends Controller
|
||||
|
||||
if( isset( Request::i()->badgeDateStart ) AND isset( Request::i()->badgeDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->badgeDateStart ), 'end' => DateTime::ts( Request::i()->badgeDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->badgeDateStart ), 'end' => DateTime::ts( (int) Request::i()->badgeDateEnd ) );
|
||||
}
|
||||
|
||||
$form = new Form( $activeTab, 'continue' );
|
||||
@@ -216,7 +216,7 @@ class badges extends Controller
|
||||
|
||||
if( isset( Request::i()->badgeDateStart ) AND isset( Request::i()->badgeDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->badgeDateStart ), 'end' => DateTime::ts( Request::i()->badgeDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->badgeDateStart ), 'end' => DateTime::ts( (int) Request::i()->badgeDateEnd ) );
|
||||
}
|
||||
|
||||
$form = new Form( $activeTab, 'continue' );
|
||||
|
||||
@@ -109,8 +109,8 @@ class helpful extends Controller
|
||||
$form = new Form( 'form', 'go' );
|
||||
|
||||
$default = array(
|
||||
'start' => Request::i()->start ? DateTime::ts( Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( Request::i()->end ) : NULL
|
||||
'start' => Request::i()->start ? DateTime::ts( (int) Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( (int) Request::i()->end ) : NULL
|
||||
);
|
||||
|
||||
$form->add( new DateRange( 'stats_date_range', $default, FALSE, array( 'start' => array( 'max' => DateTime::ts( time() )->setTime( 0, 0, 0 ), 'time' => FALSE ), 'end' => array( 'max' => DateTime::ts( time() )->setTime( 23, 59, 59 ), 'time' => FALSE ) ) ) );
|
||||
|
||||
@@ -85,7 +85,7 @@ class membersactivity extends Controller
|
||||
|
||||
if( isset( Request::i()->postDateStart ) AND isset( Request::i()->postDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->postDateStart ), 'end' => DateTime::ts( Request::i()->postDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->postDateStart ), 'end' => DateTime::ts( (int) Request::i()->postDateEnd ) );
|
||||
}
|
||||
|
||||
$groupOptions = array_combine( array_keys( Group::groups( TRUE, FALSE ) ), array_map( function( $_group ) { return (string) $_group; }, Group::groups( TRUE, FALSE ) ) );
|
||||
|
||||
@@ -77,7 +77,7 @@ class membervisits extends Controller
|
||||
|
||||
if( isset( Request::i()->visitDateStart ) AND isset( Request::i()->visitDateEnd ) )
|
||||
{
|
||||
$defaults = array( 'start' => DateTime::ts( Request::i()->visitDateStart ), 'end' => DateTime::ts( Request::i()->visitDateEnd ) );
|
||||
$defaults = array( 'start' => DateTime::ts( (int) Request::i()->visitDateStart ), 'end' => DateTime::ts( (int) Request::i()->visitDateEnd ) );
|
||||
}
|
||||
|
||||
$groupOptions = array_combine( array_keys( Group::groups( TRUE, FALSE ) ), array_map( function( $_group ) { return (string) $_group; }, Group::groups( TRUE, FALSE ) ) );
|
||||
|
||||
@@ -75,8 +75,8 @@ class referrals extends Controller
|
||||
$form = new Form( 'form', 'go' );
|
||||
|
||||
$default = array(
|
||||
'start' => Request::i()->start ? DateTime::ts( Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( Request::i()->end ) : NULL
|
||||
'start' => Request::i()->start ? DateTime::ts( (int) Request::i()->start ) : NULL,
|
||||
'end' => Request::i()->end ? DateTime::ts( (int) Request::i()->end ) : NULL
|
||||
);
|
||||
|
||||
$form->add( new DateRange( 'stats_date_range', $default, FALSE, array( 'start' => array( 'max' => DateTime::ts( time() )->setTime( 0, 0, 0 ), 'time' => FALSE ), 'end' => array( 'max' => DateTime::ts( time() )->setTime( 23, 59, 59 ), 'time' => FALSE ) ) ) );
|
||||
|
||||
@@ -75,7 +75,7 @@ class recovery extends Controller
|
||||
switch( $step )
|
||||
{
|
||||
case 0: # Applications
|
||||
$appsDisabled = array();
|
||||
$appsDisabled = [];
|
||||
|
||||
/* Disable All non-IPS Applications */
|
||||
foreach( Application::applications() AS $app )
|
||||
@@ -83,7 +83,7 @@ class recovery extends Controller
|
||||
if ( !in_array( $app->directory, IPS::$ipsApps ) )
|
||||
{
|
||||
$app->_enabled = FALSE;
|
||||
$appDisabled[] = $app->_id;
|
||||
$appsDisabled[] = $app->_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ class streams extends Controller
|
||||
}
|
||||
if ( !empty( $extra ) )
|
||||
{
|
||||
$results = $results->addExtraItems( $extra, NULL, ( Request::i()->isAjax() and isset( Request::i()->after ) ) ? DateTime::ts( Request::i()->after ) : NULL, ( Request::i()->isAjax() and isset( Request::i()->before ) ) ? DateTime::ts( Request::i()->before ) : NULL );
|
||||
$results = $results->addExtraItems( $extra, NULL, ( Request::i()->isAjax() and isset( Request::i()->after ) ) ? DateTime::ts( (int) Request::i()->after ) : NULL, ( Request::i()->isAjax() and isset( Request::i()->before ) ) ? DateTime::ts( (int) Request::i()->before ) : NULL );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,7 +682,7 @@ class streams extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
foreach( Content\Search\SearchContent::searchableClasses() as $class )
|
||||
foreach( Content\Search\SearchContent::searchableClasses( Member::loggedIn() ) as $class )
|
||||
{
|
||||
$classes[ $class ] = $class::$title . '_pl';
|
||||
if ( isset( $class::$containerNodeClass ) and $class == Request::i()->className )
|
||||
@@ -699,7 +699,7 @@ class streams extends Controller
|
||||
), NULL, NULL, NULL, 'stream_containers_' . $class::$title );
|
||||
$field->label = Member::loggedIn()->language()->addToStack( 'stream_narrow_by_container_label', FALSE, array( 'sprintf' => array( Member::loggedIn()->language()->addToStack( $containerClass::$nodeTitle ) ) ) );
|
||||
|
||||
return Output::i()->json( array( 'node' => Theme::i()->getTemplate('streams')->filterFormContentTypeContent( $field, $class, Request::i()->key ) ) );
|
||||
Output::i()->json( array( 'node' => Theme::i()->getTemplate('streams')->filterFormContentTypeContent( $field, $class, Request::i()->key ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ use IPS\Notification;
|
||||
use IPS\Output;
|
||||
use IPS\Request;
|
||||
use IPS\Session;
|
||||
use IPS\Settings;
|
||||
use IPS\Theme;
|
||||
use LogicException;
|
||||
use OutOfRangeException;
|
||||
@@ -60,11 +59,6 @@ class messenger extends Controller
|
||||
*/
|
||||
protected static string $contentModel = 'IPS\core\Messenger\Conversation';
|
||||
|
||||
/**
|
||||
* [Content\Controller] FURL Base
|
||||
*/
|
||||
protected static string $furlBase = 'messenger';
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
@@ -586,9 +580,9 @@ class messenger extends Controller
|
||||
try
|
||||
{
|
||||
$conversation = Conversation::loadAndCheckPerms( $id );
|
||||
$conversation->moveConversation( Request::i()->move_message_to );
|
||||
$conversation->moveConversation( $values['move_message_to'] );
|
||||
}
|
||||
catch ( OutOfRangeException $e )
|
||||
catch ( OutOfRangeException )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -762,7 +756,7 @@ class messenger extends Controller
|
||||
try
|
||||
{
|
||||
$conversation = Conversation::loadAndCheckPerms( Request::i()->id );
|
||||
if ( $conversation->starter_id != Member::loggedIn()->member_id )
|
||||
if ( $conversation->starter_id != Member::loggedIn()->member_id or Request::i()->member == $conversation->starter_id )
|
||||
{
|
||||
throw new BadMethodCallException;
|
||||
}
|
||||
@@ -787,7 +781,7 @@ class messenger extends Controller
|
||||
Output::i()->redirect( $conversation->url() );
|
||||
}
|
||||
}
|
||||
catch ( LogicException $e )
|
||||
catch ( LogicException )
|
||||
{
|
||||
Output::i()->error( 'no_module_permission', '2C137/4', 403, '' );
|
||||
}
|
||||
@@ -1071,6 +1065,8 @@ class messenger extends Controller
|
||||
*/
|
||||
protected function removeAlertFilter() : void
|
||||
{
|
||||
Session::i()->csrfCheck();
|
||||
|
||||
Alert::clearMessengerFilters();
|
||||
|
||||
Output::i()->redirect( Url::internal('app=core&module=messaging&controller=messenger&overview=1') );
|
||||
|
||||
@@ -279,7 +279,7 @@ class search extends Controller
|
||||
break;
|
||||
|
||||
default:
|
||||
$$l = DateTime::ts( Request::i()->$key );
|
||||
$$l = DateTime::ts( (int) Request::i()->$key );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -646,8 +646,8 @@ class search extends Controller
|
||||
if ( isset( Request::i()->$beforeKey ) and Request::i()->$beforeKey != 'any' and isset( Request::i()->$afterKey ) and Request::i()->$afterKey != 'any' )
|
||||
{
|
||||
/* Javascript takes a date and turns it into a timestamp but does not apply any timezone offsetting, so we don't want to do so here or else the date we create may not be the same one the user chose. */
|
||||
$after = DateTime::ts( Request::i()->$afterKey, TRUE );
|
||||
$before = DateTime::ts( Request::i()->$beforeKey, TRUE );
|
||||
$after = DateTime::ts( (int) Request::i()->$afterKey, TRUE );
|
||||
$before = DateTime::ts( (int) Request::i()->$beforeKey, TRUE );
|
||||
$titleConditions[] = Member::loggedIn()->language()->addToStack( "search_blurb_date_$k", FALSE, array( 'sprintf' => array( Member::loggedIn()->language()->addToStack( "search_blurb_date_between", FALSE, array( 'sprintf' => array( $after->localeDate(), $before->localeDate() ) ) ) ) ) );
|
||||
|
||||
$query->$method( $after, $before );
|
||||
@@ -693,7 +693,7 @@ class search extends Controller
|
||||
break;
|
||||
|
||||
default:
|
||||
$$l = DateTime::ts( Request::i()->$$key );
|
||||
$$l = DateTime::ts( (int) Request::i()->$$key );
|
||||
$dateCondition = Member::loggedIn()->language()->addToStack( "search_blurb_date_{$l}", FALSE, array( 'sprintf' => array( $$l->localeDate() ) ) );
|
||||
break;
|
||||
}
|
||||
@@ -1043,12 +1043,12 @@ class search extends Controller
|
||||
|
||||
/* Dates */
|
||||
$form->add( new Select( 'startDate', ( isset( Request::i()->start_before ) or ( isset( Request::i()->start_after ) and is_numeric( Request::i()->start_after ) ) ) ? 'custom' : Request::i()->start_after, FALSE, array( 'options' => $dateOptions, 'toggles' => array( 'custom' => array( 'elCustomDate_startDate' ) ) ), NULL, NULL, NULL, 'startDate' ), NULL, 'search_tab_content' );
|
||||
$form->add( new DateRange( 'startDateCustom', array( 'start' => ( isset( Request::i()->start_after ) and is_numeric( Request::i()->start_after ) ) ? DateTime::ts( Request::i()->start_after, TRUE ) : NULL, 'end' => isset( Request::i()->start_before ) ? DateTime::ts( Request::i()->start_before, TRUE ) : NULL ), false, array(
|
||||
$form->add( new DateRange( 'startDateCustom', array( 'start' => ( isset( Request::i()->start_after ) and is_numeric( Request::i()->start_after ) ) ? DateTime::ts( (int) Request::i()->start_after, TRUE ) : NULL, 'end' => isset( Request::i()->start_before ) ? DateTime::ts( (int) Request::i()->start_before, TRUE ) : NULL ), false, array(
|
||||
'start' => array( 'timezone' => new DateTimeZone( 'UTC' ), 'time' => FALSE ),
|
||||
'end' => array( 'timezone' => new DateTimeZone( 'UTC' ), 'time' => FALSE )
|
||||
) ), NULL, 'search_tab_content' );
|
||||
$form->add( new Select( 'updatedDate', ( isset( Request::i()->updated_before ) or ( isset( Request::i()->updated_after ) and is_numeric( Request::i()->updated_after ) ) ) ? 'custom' : Request::i()->updated_after, FALSE, array( 'options' => $dateOptions, 'toggles' => array( 'custom' => array( 'elCustomDate_updatedDate' ) ) ), NULL, NULL, NULL, 'updatedDate' ), NULL, 'search_tab_content' );
|
||||
$form->add( new DateRange( 'updatedDateCustom', array( 'start' => ( isset( Request::i()->updated_after ) and is_numeric( Request::i()->updated_after ) ) ? DateTime::ts( Request::i()->updated_after, TRUE ) : NULL, 'end' => isset( Request::i()->updated_before ) ? DateTime::ts( Request::i()->updated_before, TRUE ) : NULL ), false, array(
|
||||
$form->add( new DateRange( 'updatedDateCustom', array( 'start' => ( isset( Request::i()->updated_after ) and is_numeric( Request::i()->updated_after ) ) ? DateTime::ts( (int) Request::i()->updated_after, TRUE ) : NULL, 'end' => isset( Request::i()->updated_before ) ? DateTime::ts( (int) Request::i()->updated_before, TRUE ) : NULL ), false, array(
|
||||
'start' => array( 'timezone' => new DateTimeZone( 'UTC' ), 'time' => FALSE ),
|
||||
'end' => array( 'timezone' => new DateTimeZone( 'UTC' ), 'time' => FALSE )
|
||||
) ), NULL, 'search_tab_content' );
|
||||
@@ -1366,7 +1366,7 @@ class search extends Controller
|
||||
public static function contentTypes( Member|bool $member = TRUE ) : array
|
||||
{
|
||||
$types = array();
|
||||
foreach( Content\Search\SearchContent::searchableClasses() as $class )
|
||||
foreach( Content\Search\SearchContent::searchableClasses( $member instanceof Member ? $member : Member::loggedIn() ) as $class )
|
||||
{
|
||||
if( in_array( 'IPS\Content\Item', class_parents( $class ) ) )
|
||||
{
|
||||
@@ -1374,6 +1374,7 @@ class search extends Controller
|
||||
$types[ $key ] = $class;
|
||||
}
|
||||
}
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,8 @@ class announcement extends Controller
|
||||
|
||||
/**
|
||||
* Check permissions for linked content item
|
||||
*
|
||||
* called from js/front/controllers/modcp/ips.modcp.announcementForm.js
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -128,6 +130,7 @@ class announcement extends Controller
|
||||
}
|
||||
|
||||
$class = $furlDefinition[ $url->seoTemplate ]['verify'];
|
||||
/** @var Item $item */
|
||||
$item = $class::loadFromUrl( $url );
|
||||
|
||||
/* If the class does not have our method, return a not_verified status */
|
||||
|
||||
@@ -136,6 +136,7 @@ class editor extends Controller
|
||||
$externalEmbedAllowed,
|
||||
$externalImageAllowed,
|
||||
$internalEmbedAllowed,
|
||||
Settings::i()->iframely_enabled ? Settings::i()->iframely_api_key : false, // we need to consider this when creating the cache key because it can change the results
|
||||
]));
|
||||
|
||||
try
|
||||
|
||||
@@ -127,6 +127,12 @@ class register extends Controller
|
||||
Output::i()->showOffline();
|
||||
}
|
||||
|
||||
/* Are we already logged in? */
|
||||
if( Member::loggedIn()->member_id )
|
||||
{
|
||||
Output::i()->redirect( Url::internal( "" ) );
|
||||
}
|
||||
|
||||
if( Application::appIsEnabled( 'nexus' ) )
|
||||
{
|
||||
if ( Member::loggedIn()->canAccessModule( Module::get( 'nexus', 'store' ) ) and ( Settings::i()->nexus_reg_force or !isset( Request::i()->noPurchase ) ) and Package::haveRegistrationProducts() )
|
||||
@@ -245,27 +251,30 @@ class register extends Controller
|
||||
};
|
||||
|
||||
/* Do we have any profile completion steps marked for registration? */
|
||||
foreach( ProfileStep::loadAll() as $step )
|
||||
if( Login::registrationType() == 'full' )
|
||||
{
|
||||
if( $step->registration )
|
||||
foreach( ProfileStep::loadAll() as $step )
|
||||
{
|
||||
$extension = $step->extension;
|
||||
foreach( $extension::wizard() as $key => $form )
|
||||
if( $step->registration )
|
||||
{
|
||||
if( $key == $step->key )
|
||||
$extension = $step->extension;
|
||||
foreach( $extension::wizard() as $key => $form )
|
||||
{
|
||||
$steps[ $key ] = $form;
|
||||
if( $key == $step->key )
|
||||
{
|
||||
$steps[ $key ] = $form;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* This happens when the user has already completed the step.
|
||||
We need to use a dummy function, or the wizard gets thrown out of whack. */
|
||||
if( !array_key_exists( $step->key, $steps ) )
|
||||
{
|
||||
$steps[ $step->key ] = function( $data )
|
||||
/* This happens when the user has already completed the step.
|
||||
We need to use a dummy function, or the wizard gets thrown out of whack. */
|
||||
if( !array_key_exists( $step->key, $steps ) )
|
||||
{
|
||||
return $data;
|
||||
};
|
||||
$steps[ $step->key ] = function( $data )
|
||||
{
|
||||
return $data;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,12 +366,16 @@ class register extends Controller
|
||||
Session::i()->setMember( $member );
|
||||
Device::loadOrCreate( $member, FALSE )->updateAfterAuthentication( TRUE );
|
||||
|
||||
/* If we have profile steps on registration, return instead of redirect */
|
||||
foreach( ProfileStep::loadAll() as $step )
|
||||
/* If we have profile steps on registration, return instead of redirect
|
||||
but ONLY if we are using full registration */
|
||||
if( Login::registrationType() == 'full' )
|
||||
{
|
||||
if( $step->registration )
|
||||
foreach( ProfileStep::loadAll() as $step )
|
||||
{
|
||||
return [ 'member' => $member->member_id ];
|
||||
if( $step->registration )
|
||||
{
|
||||
return [ 'member' => $member->member_id ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class license extends Controller
|
||||
public function manage() : void
|
||||
{
|
||||
$form = new Form( 'license', 'continue', Url::external( ( Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '?controller=license' ) );
|
||||
$form->add( new Text( 'lkey', 'Nulled by IPBMafia.ru | 5.11.2025', TRUE, array( 'size' => 50 ), function( $val )
|
||||
$form->add( new Text( 'lkey', 'Nulled by IPBMafia.ru | 9.12.2025', TRUE, array( 'size' => 50 ), function( $val )
|
||||
{
|
||||
IPS::checkLicenseKey( $val, ( Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . mb_substr( $_SERVER['SCRIPT_NAME'], 0, -mb_strlen( 'admin/install/index.php' ) ) );
|
||||
}, NULL, '<a href="' . Url::ips( 'docs/find_lkey' ) . '" target="_blank" rel="noopener">' . Member::loggedIn()->language()->addToStack('lkey_help') . ' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"/></svg></a>' ) );
|
||||
|
||||
Reference in new issue
Block a user