Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -527,8 +527,10 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
/* Fetch them */
|
||||
$members = $this->club->members( $statuses, array( $offset, $perPage ), $orderByClause, $this->club->isLeader() ? 5 : 1 );
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $baseUrl, ceil( $members->count(TRUE) / $perPage ), $activePage, $perPage );
|
||||
|
||||
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $baseUrl, ceil( $this->club->members( $statuses, NULL, $orderByClause, 4 ) / $perPage ), $activePage, $perPage );
|
||||
|
||||
|
||||
/* Display */
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
@@ -1112,9 +1114,17 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
/* If we're not a member of this club yet, send us back to the join form */
|
||||
if( $this->club->memberStatus( \IPS\Member::loggedIn() ) === NULL AND $referrer = \IPS\Request::i()->referrer() )
|
||||
if( $this->club->memberStatus( \IPS\Member::loggedIn() ) === NULL )
|
||||
{
|
||||
\IPS\Output::i()->redirect( $referrer->setQueryString( 'rulesAcknowledged', 1 ), 'accepted' );
|
||||
if( $referrer = \IPS\Request::i()->referrer() )
|
||||
{
|
||||
\IPS\Output::i()->redirect( $referrer->setQueryString( 'rulesAcknowledged', 1 ), 'accepted' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->redirect( $this->club->url()->setQueryString( 'rulesAcknowledged', 1 ), 'accepted' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->club->acknowledgeRules( \IPS\Member::loggedIn() );
|
||||
@@ -1150,10 +1160,16 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
}
|
||||
|
||||
/* Are there rules that need to be acknowledged which we haven't acknowledged yet? */
|
||||
if( $this->club->rules_required AND !\IPS\Request::i()->rulesAcknowledged )
|
||||
if( $this->club->rules_required AND !$this->club->rulesAcknowledged() AND !\IPS\Request::i()->rulesAcknowledged )
|
||||
{
|
||||
$ref = \IPS\Request::i()->url()->addRef( \IPS\Request::i()->referrer() );
|
||||
\IPS\Output::i()->redirect( $this->club->url()->setQueryString( 'do', 'rules' )->addRef( $ref ) );
|
||||
$rulesUrl = $this->club->url()->setQueryString( 'do', 'rules' );
|
||||
|
||||
if( $referrer = \IPS\Request::i()->referrer() )
|
||||
{
|
||||
$rulesUrl = $rulesUrl->addRef( \IPS\Request::i()->url()->addRef( $referrer ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( $rulesUrl );
|
||||
}
|
||||
|
||||
/* CSRF Check */
|
||||
@@ -1484,6 +1500,8 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
$this->club->approved = TRUE;
|
||||
$this->club->save();
|
||||
|
||||
$this->club->owner->achievementAction( 'core', 'NewClub', $this->club );
|
||||
|
||||
\IPS\Output::i()->redirect( $this->club->url() );
|
||||
}
|
||||
|
||||
@@ -1515,7 +1533,7 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
{
|
||||
try
|
||||
{
|
||||
$node = $class::load( \IPS\Request::i()->node );
|
||||
$node = $class::load( (int) \IPS\Request::i()->node );
|
||||
$club = $node->club();
|
||||
if ( !$club or $club->id !== $this->club->id )
|
||||
{
|
||||
@@ -1566,9 +1584,14 @@ class _view extends \IPS\Helpers\CoverPhoto\Controller
|
||||
|
||||
/* Load */
|
||||
$class = \IPS\Request::i()->type;
|
||||
|
||||
if( !$class instanceof \IPS\Node\Model )
|
||||
{
|
||||
throw new \Exception;
|
||||
}
|
||||
try
|
||||
{
|
||||
$node = $class::load( \IPS\Request::i()->node );
|
||||
$node = $class::load( (int) \IPS\Request::i()->node );
|
||||
$club = $node->club();
|
||||
if ( !$club or $club->id !== $this->club->id )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user