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
@@ -10,25 +10,28 @@
|
||||
*/
|
||||
|
||||
namespace IPS\core\api\GraphQL\Queries;
|
||||
use GraphQL\Type\Definition\ObjectType;
|
||||
use IPS\Api\GraphQL\TypeRegistry;
|
||||
use IPS\Application\Module;
|
||||
use IPS\core\api\GraphQL\TypeRegistry;
|
||||
use IPS\core\api\GraphQL\Types\ActiveUsersType;
|
||||
use IPS\Member;
|
||||
use function defined;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* OurPicks query for GraphQL API
|
||||
*/
|
||||
class _ActiveUsers
|
||||
class ActiveUsers
|
||||
{
|
||||
/*
|
||||
* @brief Query description
|
||||
*/
|
||||
public static $description = "Returns active user information";
|
||||
public static string $description = "Returns active user information";
|
||||
|
||||
/*
|
||||
* Query arguments
|
||||
@@ -41,20 +44,20 @@ class _ActiveUsers
|
||||
/**
|
||||
* Return the query return type
|
||||
*/
|
||||
public function type()
|
||||
public function type() : ActiveUsersType
|
||||
{
|
||||
return \IPS\core\api\GraphQL\TypeRegistry::activeUsers();
|
||||
return TypeRegistry::activeUsers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves this query
|
||||
*
|
||||
* @param mixed Value passed into this resolver
|
||||
* @return \IPS\core\Stream
|
||||
* @param mixed $val Value passed into this resolver
|
||||
* @return mixed
|
||||
*/
|
||||
public function resolve($val)
|
||||
public function resolve( mixed $val ) : mixed
|
||||
{
|
||||
if ( !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'online', 'front' ) ) )
|
||||
if ( !Member::loggedIn()->canAccessModule( Module::get( 'core', 'online', 'front' ) ) )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user