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

+36 -2
View File
@@ -131,10 +131,24 @@ class _OAuthClient extends \IPS\Node\Model
'toggles' => array(
'invision' => array( 'oauth_grant_types_invision', 'oauth_invision_endpoint' ),
'wordpress' => array( 'oauth_wordpress_endpoint' ),
'confidential' => array( 'oauth_grant_types_confidential', 'oauth_redirect_uris', 'oauth_choose_scopes', 'oauth_header_oauth_access_tokens', 'oauth_access_token_length', 'oauth_tab_oauth_scopes' ),
'public' => array( 'oauth_grant_types_public', 'oauth_redirect_uris', 'oauth_choose_scopes', 'oauth_header_oauth_access_tokens', 'oauth_access_token_length', 'oauth_tab_oauth_scopes' ),
'confidential' => array( 'oauth_grant_types_confidential', 'oauth_redirect_uris', 'oauth_choose_scopes', 'oauth_header_oauth_access_tokens', 'oauth_access_token_length', 'oauth_tab_oauth_scopes','oauth_api_access', ),
'public' => array( 'oauth_grant_types_public', 'oauth_redirect_uris', 'oauth_choose_scopes', 'oauth_header_oauth_access_tokens', 'oauth_access_token_length', 'oauth_tab_oauth_scopes', 'oauth_api_access' ),
)
) ) );
$form->add( new \IPS\Helpers\Form\Radio( 'oauth_api_access', $this->api_access ? $this->api_access : 'rest', TRUE, array(
'options' => array(
'rest' => 'oauth_api_type_rest',
'graphql' => 'oauth_api_type_graphql',
'both' => 'oauth_api_type_both',
),
'toggles' => array(
'rest' => array( 'oauth_tab_oauth_scopes', 'oauth_choose_scopes' ),
'both' => array( 'oauth_tab_oauth_scopes', 'oauth_choose_scopes' ),
'graphql' => array( '' ),
)
), NULL, NULL, NULL, 'oauth_api_access' ) );
$form->add( new \IPS\Helpers\Form\Radio( 'oauth_invision_grant_type', $this->client_id ? $this->grant_types : 'authorization_code', NULL, array(
'options' => array(
'authorization_code' => 'invision_grant_type_server_authorization_code',
@@ -304,6 +318,7 @@ class _OAuthClient extends \IPS\Node\Model
$values['oauth_access_token_length'] = 168;
$values['oauth_use_refresh_tokens'] = TRUE;
$values['oauth_refresh_token_length'] = 28;
$values['oauth_api_access'] = 'rest';
$values['scopes'] = array(
array(
'name' => array( 'key' => 'profile', 'desc' => \IPS\Member::loggedIn()->language()->get('oauth_default_scope_profile') ),
@@ -330,6 +345,7 @@ class _OAuthClient extends \IPS\Node\Model
$values['oauth_access_token_length'] = 168;
$values['oauth_use_refresh_tokens'] = TRUE;
$values['oauth_refresh_token_length'] = 28;
$values['oauth_api_access'] = 'rest';
$values['scopes'] = array(
array(
'name' => array( 'key' => 'email', 'desc' => \IPS\Member::loggedIn()->language()->get('oauth_default_scope_email') ),
@@ -342,6 +358,11 @@ class _OAuthClient extends \IPS\Node\Model
$values['oauth_type'] = 'wordpress';
$values['oauth_pkce'] = 'none';
}
elseif ( $values['oauth_api_access'] === 'graphql' )
{
$values['oauth_choose_scopes'] = FALSE;
$values['scopes'] = array();
}
else
{
$values['oauth_type'] = NULL;
@@ -412,6 +433,19 @@ class _OAuthClient extends \IPS\Node\Model
/* Return */
return $values;
}
/**
* Return the custom badge for each row
*
* @return NULL|array Null for no badge, or an array of badge data (0 => CSS class type, 1 => language string, 2 => optional raw HTML to show instead of language string)
*/
public function get__badge()
{
return array(
0 => 'ipsBadge ipsBadge_neutral ipsPos_right ipsMargin_right:half',
1 => 'api_access_' . $this->api_access,
);
}
/**
* [Node] Get Description