Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

@@ -65,14 +65,19 @@ class _page extends \IPS\Dispatcher\Controller
\IPS\Output::i()->sidebar['contextual'] .= \IPS\Theme::i()->getTemplate( 'clubs', 'core' )->clubLocationBox( $this->page->club, $location );
}
if( $this->page->club->type != \IPS\Member\Club::TYPE_PUBLIC )
if( $this->page->club->type != \IPS\Member\Club::TYPE_PUBLIC AND $this->page->club->canViewMembers() )
{
\IPS\Output::i()->sidebar['contextual'] .= \IPS\Theme::i()->getTemplate( 'clubs', 'core' )->clubMemberBox( $this->page->club );
}
\IPS\Output::i()->breadcrumb[] = array( $this->page->club->url(), $this->page->club->name );
\IPS\Output::i()->breadcrumb[] = array( NULL, $this->page->title );
if( !$this->page->meta_index )
{
\IPS\Output::i()->metaTags['robots'] = 'noindex';
}
parent::execute();
}
@@ -1496,8 +1496,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
{
$this->club->approved = TRUE;
$this->club->save();
$this->club->owner->achievementAction( 'core', 'NewClub', $this->club );
$this->club->onApprove();
\IPS\Output::i()->redirect( $this->club->url() );
}
@@ -1143,7 +1143,8 @@ class _profile extends \IPS\Helpers\CoverPhoto\Controller
/* Moderator stuff */
if ( ( \IPS\Member::loggedIn()->modPermission('can_modify_profiles') OR \IPS\Member::loggedIn()->modPermission('can_unban') ) AND \IPS\Member::loggedIn()->member_id != $this->member->member_id )
{
if( \IPS\Settings::i()->signatures_enabled )
$sigLimits = explode( ":", $this->member->group['g_signature_limits'] );
if( \IPS\Settings::i()->signatures_enabled AND !$sigLimits[0] AND $sigLimits[5] != 0 )
{
$form->add( new \IPS\Helpers\Form\Editor( 'signature', $this->member->signature, FALSE, array( 'app' => 'core', 'key' => 'Signatures', 'autoSaveKey' => "frontsig-" . $this->member->member_id, 'attachIds' => array( $this->member->member_id ) ) ) );
}
@@ -974,9 +974,15 @@ class _search extends \IPS\Dispatcher\Controller
/* Dates */
$form->add( new \IPS\Helpers\Form\Select( 'startDate', ( isset( \IPS\Request::i()->start_before ) or ( isset( \IPS\Request::i()->start_after ) and \is_numeric( \IPS\Request::i()->start_after ) ) ) ? 'custom' : \IPS\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 \IPS\Helpers\Form\DateRange( 'startDateCustom', array( 'start' => ( isset( \IPS\Request::i()->start_after ) and \is_numeric( \IPS\Request::i()->start_after ) ) ? \IPS\DateTime::ts( \IPS\Request::i()->start_after ) : NULL, 'end' => isset( \IPS\Request::i()->start_before ) ? \IPS\DateTime::ts( \IPS\Request::i()->start_before ) : NULL ) ), NULL, 'search_tab_content' );
$form->add( new \IPS\Helpers\Form\DateRange( 'startDateCustom', array( 'start' => ( isset( \IPS\Request::i()->start_after ) and \is_numeric( \IPS\Request::i()->start_after ) ) ? \IPS\DateTime::ts( \IPS\Request::i()->start_after, TRUE ) : NULL, 'end' => isset( \IPS\Request::i()->start_before ) ? \IPS\DateTime::ts( \IPS\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 \IPS\Helpers\Form\Select( 'updatedDate', ( isset( \IPS\Request::i()->updated_before ) or ( isset( \IPS\Request::i()->updated_after ) and \is_numeric( \IPS\Request::i()->updated_after ) ) ) ? 'custom' : \IPS\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 \IPS\Helpers\Form\DateRange( 'updatedDateCustom', array( 'start' => ( isset( \IPS\Request::i()->updated_after ) and \is_numeric( \IPS\Request::i()->updated_after ) ) ? \IPS\DateTime::ts( \IPS\Request::i()->updated_after ) : NULL, 'end' => isset( \IPS\Request::i()->updated_before ) ? \IPS\DateTime::ts( \IPS\Request::i()->updated_before ) : NULL ) ), NULL, 'search_tab_content' );
$form->add( new \IPS\Helpers\Form\DateRange( 'updatedDateCustom', array( 'start' => ( isset( \IPS\Request::i()->updated_after ) and \is_numeric( \IPS\Request::i()->updated_after ) ) ? \IPS\DateTime::ts( \IPS\Request::i()->updated_after, TRUE ) : NULL, 'end' => isset( \IPS\Request::i()->updated_before ) ? \IPS\DateTime::ts( \IPS\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' );
/* Other filters */
$form->add( new \IPS\Helpers\Form\Radio( 'search_in', \IPS\Request::i()->search_in, FALSE, array( 'options' => array( 'all' => 'titles_and_body', 'titles' => 'titles_only' ) ), NULL, NULL, NULL, 'searchIn' ), NULL, 'search_tab_content' );
@@ -1035,7 +1041,7 @@ class _search extends \IPS\Dispatcher\Controller
$form->add(new \IPS\Helpers\Form\CheckboxSet('group', ( isset( \IPS\Request::i()->group ) ) ? \is_array( \IPS\Request::i()->group) ? array_keys( \IPS\Request::i()->group) : array( \IPS\Request::i()->group ) : array_keys( $groups ), FALSE, array('options' => $groups, 'parse' => 'normal'), NULL, NULL, NULL, 'core_members_group'), NULL, 'search_tab_member' );
$form->add(new \IPS\Helpers\Form\Select('joinedDate', (isset(\IPS\Request::i()->start_before) or (isset(\IPS\Request::i()->start_after) and \is_numeric(\IPS\Request::i()->start_after))) ? 'custom' : \IPS\Request::i()->start_after, FALSE, array('options' => $dateOptions, 'toggles' => array('custom' => array('elCustomDate_joinedDate'))), NULL, NULL, NULL, 'joinedDate'), NULL, 'search_tab_member' );
$form->add(new \IPS\Helpers\Form\DateRange('joinedDateCustom', array('start' => (isset(\IPS\Request::i()->start_after) and \is_numeric(\IPS\Request::i()->start_after)) ? \IPS\DateTime::ts(\IPS\Request::i()->start_after) : NULL, 'end' => isset(\IPS\Request::i()->start_before) ? \IPS\DateTime::ts(\IPS\Request::i()->start_before) : NULL)), NULL, 'search_tab_member' );
$form->add(new \IPS\Helpers\Form\DateRange('joinedDateCustom', array('start' => (isset(\IPS\Request::i()->start_after) and \is_numeric(\IPS\Request::i()->start_after)) ? \IPS\DateTime::ts(\IPS\Request::i()->start_after, TRUE) : NULL, 'end' => isset(\IPS\Request::i()->start_before) ? \IPS\DateTime::ts(\IPS\Request::i()->start_before, TRUE) : NULL)), NULL, 'search_tab_member' );
/* Profile fields for member searches */
$memberFields = array();
@@ -211,10 +211,19 @@ class _ajax extends \IPS\Dispatcher\Controller
/* Permission check */
if ( $permission )
{
$toReturn[ $attachment['attach_id'] ] = array(
'size' => \IPS\Output\Plugin\Filesize::humanReadableFilesize( $attachment['attach_filesize'], FALSE, TRUE ),
'downloads' => \IPS\Member::loggedIn()->language()->formatNumber( $attachment['attach_hits'] )
);
if( $attachment['attach_is_image'] )
{
$toReturn[ $attachment['attach_id'] ] = array(
'rotate' => $attachment['attach_img_rotate'] <> 0 ? (int)$attachment['attach_img_rotate'] : null
);
}
else
{
$toReturn[ $attachment['attach_id'] ] = array(
'size' => \IPS\Output\Plugin\Filesize::humanReadableFilesize( $attachment['attach_filesize'], FALSE, TRUE ),
'downloads' => \IPS\Member::loggedIn()->language()->formatNumber( $attachment['attach_hits'] )
);
}
}
}
}
@@ -62,4 +62,86 @@ class _attachments extends \IPS\Dispatcher\Controller
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack('my_attachments') );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('myAttachments')->template( (string) $table, \IPS\Db::i()->select( 'SUM(attach_filesize)', 'core_attachments', array( 'attach_member_id=?', \IPS\Member::loggedIn()->member_id ) )->first(), \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments', array( 'attach_member_id=?', \IPS\Member::loggedIn()->member_id ) )->first() );
}
/**
* Rotate imate
*
* @return void
*/
protected function rotate()
{
\IPS\Session::i()->csrfCheck();
/* Get attachment to make sure it's valid */
try
{
$attachment = \IPS\Db::i()->select( '*', 'core_attachments', [ 'attach_id=? and attach_is_image=?', \IPS\Request::i()->id, 1 ] )
->join( 'core_attachments_map', 'core_attachments.attach_id=core_attachments_map.attachment_id' )
->first();
}
catch( \UnderflowException $e )
{
\IPS\Output::i()->json( array( 'error' => 'node_error' ) );
}
/* Check Permission */
$exploded = explode( '_', $attachment['location_key'] );
try
{
$extensions = \IPS\Application::load( $exploded[0] )->extensions( 'core', 'EditorLocations' );
if ( isset( $extensions[ $exploded[1] ] ) )
{
$attachmentItem = $extensions[ $exploded[1] ]->attachmentLookup( $attachment[ 'id1' ], $attachment[ 'id2' ], $attachment[ 'id3' ] );
}
}
catch ( \OutOfRangeException $e )
{
\IPS\Output::i()->json( array( 'error' => 'no_permission' ) );
}
/* If we have permission to edit the post, we're going to save the rotation angle */
if( $attachmentItem->author()->member_id == \IPS\Member::loggedIn()->member_id OR $attachmentItem->canEdit() )
{
$baseRotation = $attachment['attach_img_rotate'];
$temp = false;
}
else
{
$baseRotation = \IPS\Request::i()->current ?? 0;
$temp = true;
}
$angle = \IPS\Request::i()->direction == 'right' ? 90 : -90;
$rotation = $baseRotation + $angle;
/* Make sure we don't rotate to some stupid number */
if( $rotation >= 360 )
{
$rotation -= 360;
}
elseif( $rotation <= -360 )
{
$rotation += 360;
}
/* Store the angle for the future */
if( !$temp )
{
\IPS\Db::i()->update( 'core_attachments', [ 'attach_img_rotate' => $rotation ], [ 'attach_id=?', $attachment[ 'attach_id' ] ] );
}
if( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->json( [
'rotate' => $rotation,
'message' => \IPS\Member::loggedIn()->language()->addToStack('gallery_image_rotated'),
'fileId' => \IPS\Request::i()->id,
'saved' => $temp ? 0 : 1
] );
}
else
{
\IPS\Output::i()->redirect( $attachmentItem->url() );
}
}
}
@@ -271,7 +271,10 @@ class _notifications extends \IPS\Dispatcher\Controller
{
\IPS\Member::loggedIn()->clearPwaAuths();
}
/* Digests */
\IPS\Db::i()->update( 'core_follow', array( 'follow_notify_freq' => 'none'), array( 'follow_member_id=? AND follow_notify_freq IN(?,?)', \IPS\Member::loggedIn()->member_id, "daily", "weekly" ) );
if ( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->json( 'ok' );
@@ -29,6 +29,7 @@ class _poll extends \IPS\Dispatcher\Controller
*/
protected function voters()
{
\IPS\Output::i()->metaTags['robots'] = 'noindex';
try
{
$poll = \IPS\Poll::load( \IPS\Request::i()->id );
@@ -131,8 +131,7 @@ class _settings extends \IPS\Dispatcher\Controller
$canConfigureMfa = TRUE;
}
$sigLimits = explode( ":", \IPS\Member::loggedIn()->group['g_signature_limits'] );
$canChangeSignature = (bool) ( \IPS\Settings::i()->signatures_enabled && !$sigLimits[0] );
$canChangeSignature = (bool) \IPS\Member::loggedIn()->canEditSignature();
/* Add login handlers */
$loginMethods = \IPS\Login::methods();
@@ -413,7 +412,7 @@ class _settings extends \IPS\Dispatcher\Controller
/* Delete any pending validation emails */
\IPS\Db::i()->delete( 'core_validating', array( 'member_id=? AND lost_pass=1', \IPS\Member::loggedIn()->member_id ) );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=password', 'front', 'settings' ), 'password_changed' );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=password&success=1', 'front', 'settings' ) );
}
return \IPS\Theme::i()->getTemplate( 'system' )->settingsPassword( $form );
@@ -1101,7 +1100,7 @@ class _settings extends \IPS\Dispatcher\Controller
/* Check they have permission to change their signature */
$sigLimits = explode( ":", \IPS\Member::loggedIn()->group['g_signature_limits']);
if( !\IPS\Settings::i()->signatures_enabled OR $sigLimits[0] )
if( !\IPS\Member::loggedIn()->canEditSignature() )
{
\IPS\Output::i()->error( 'signatures_disabled', '2C122/C', 403, '' );
}
@@ -1772,7 +1771,7 @@ class _settings extends \IPS\Dispatcher\Controller
\IPS\Session::i()->csrfCheck();
/* Update the bitwise flag */
\IPS\Member::loggedIn()->datalayer_collect_pii = (bool) ! \IPS\Member::loggedIn()->datalayer_collect_pii;
\IPS\Member::loggedIn()->members_bitoptions['datalayer_pii_optout'] = (bool) ! \IPS\Member::loggedIn()->members_bitoptions['datalayer_pii_optout'];
\IPS\Member::loggedIn()->save();
if ( \IPS\Request::i()->isAjax() )
@@ -275,6 +275,10 @@ class _widgets extends \IPS\Dispatcher\Controller
{
$currentConfig = \IPS\Db::i()->select( '*', 'core_widget_areas', array( 'app=? AND module=? AND controller=? AND area=?', \IPS\Request::i()->pageApp, \IPS\Request::i()->pageModule, \IPS\Request::i()->pageController, \IPS\Request::i()->area ) )->first();
$widgets = json_decode( $currentConfig['widgets'], TRUE );
if( !is_countable( $widgets ) )
{
throw new \UnderflowException;
}
}
catch ( \UnderflowException $e )
{