Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,38 +11,47 @@
|
||||
namespace IPS\core\modules\front\system;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Dispatcher\Controller;
|
||||
use IPS\Output;
|
||||
use IPS\Poll as PollClass;
|
||||
use IPS\Request;
|
||||
use IPS\Theme;
|
||||
use OutOfRangeException;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Poll View Voters Controller
|
||||
*/
|
||||
class _poll extends \IPS\Dispatcher\Controller
|
||||
class poll extends Controller
|
||||
{
|
||||
/**
|
||||
* View log
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function voters()
|
||||
protected function voters() : void
|
||||
{
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex';
|
||||
Output::i()->metaTags['robots'] = 'noindex';
|
||||
try
|
||||
{
|
||||
$poll = \IPS\Poll::load( \IPS\Request::i()->id );
|
||||
$poll = PollClass::load( Request::i()->id );
|
||||
if ( !$poll->canSeeVoters() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2C174/2', 403, '' );
|
||||
Output::i()->error( 'node_error', '2C174/2', 403, '' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pollVoters( $poll->getVotes( \IPS\Request::i()->question, \IPS\Request::i()->option ) );
|
||||
Output::i()->output = Theme::i()->getTemplate( 'global', 'core', 'global' )->pollVoters( $poll->getVotes( Request::i()->question, Request::i()->option ) );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
catch ( OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2C174/1', 404, '' );
|
||||
Output::i()->error( 'node_error', '2C174/1', 404, '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user