Version 4.7.23

This commit is contained in:
Neo committed 2025-12-19 16:21:27 -08:00
1 parent 7124a02564
commit 25ddeb65d6
1791 files changed
+76990 -44452

No files matched your search

+8 -3
View File
@@ -169,7 +169,8 @@ abstract class _Handler extends \IPS\Node\Model
if ( !isset( $this->_cachedLinks[ $member->member_id ] ) )
{
try
{
{
/* @note SELECT_FROM_WRITE_SERVER Added in 2e3846f8e6e50b0fc89f18ada73539e7034c5290 "Read/Write Separation issue with OAuth logins" */
$this->_cachedLinks[ $member->member_id ] = \IPS\Db::i()->select( '*', 'core_login_links', array( 'token_login_method=? AND token_member=? AND token_linked=1', $this->id, $member->member_id ), NULL, NULL, NULL, NULL, \IPS\Db::SELECT_FROM_WRITE_SERVER )->first();
}
catch ( \UnderflowException $e )
@@ -458,7 +459,11 @@ abstract class _Handler extends \IPS\Node\Model
* @return bool
*/
public function showInUcp( \IPS\Member $member = NULL )
{
{
if( !$this->enabled )
{
return FALSE ;
}
if ( isset( $this->settings['show_in_ucp'] ) )
{
switch ( $this->settings['show_in_ucp'] )
@@ -966,7 +971,7 @@ abstract class _Handler extends \IPS\Node\Model
public function save()
{
parent::save();
unset( \IPS\Data\Store::i()->loginMethods );
unset( \IPS\Data\Store::i()->loginMethods, \IPS\Data\Store::i()->essentialCookieNames );
\IPS\Data\Cache::i()->clearAll();
}
+4 -2
View File
@@ -481,11 +481,13 @@ abstract class _OAuth1 extends \IPS\Login\Handler
*/
public function showInUcp( \IPS\Member $member = NULL )
{
if ( !isset( $this->settings['show_in_ucp'] ) )
$return = parent::showInUcp( $member );
if ( $return AND !isset( $this->settings['show_in_ucp'] ) )
{
return TRUE; // Default to showing
}
return parent::showInUcp( $member );
return $return;
}
/**
+4 -9
View File
@@ -21,12 +21,7 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
* Twitter Login Handler
*/
class _Twitter extends \IPS\Login\Handler\OAuth1
{
/**
* @brief Share Service
*/
public static $shareService = 'Twitter';
{
/**
* Get title
*
@@ -78,7 +73,7 @@ class _Twitter extends \IPS\Login\Handler\OAuth1
*/
public function buttonColor()
{
return '#00abf0';
return '#000000';
}
/**
@@ -119,7 +114,7 @@ class _Twitter extends \IPS\Login\Handler\OAuth1
*/
public function logoForDeviceInformation()
{
return \IPS\Theme::i()->resource( 'logos/login/Twitter.png', 'core', 'interface' );
return \IPS\Theme::i()->resource( 'logos/login/X.png', 'core', 'interface' );
}
/**
@@ -290,7 +285,7 @@ class _Twitter extends \IPS\Login\Handler\OAuth1
return NULL;
}
/**
* Get user's statuses since a particular date
*
+9 -6
View File
@@ -188,8 +188,9 @@ abstract class _OAuth2 extends \IPS\Login\Handler
if ( $this->grantType() === 'authorization_code' AND $this->pkceSupported === TRUE )
{
$_SESSION['codeVerifier'] = \IPS\Login::generateRandomString( 128 );
$data['code_challenge'] = rtrim( strtr( base64_encode( pack( 'H*', hash( 'sha256', $_SESSION['codeVerifier'] ) ) ), '+/', '-_' ), '=' );
$codeChallenge = \IPS\Login::generateRandomString( 128 );
\IPS\Request::i()->setCookie('codeVerifier', $codeChallenge, ( new \IPS\DateTime )->add( new \DateInterval( 'PT10M' ) ) );
$data['code_challenge'] = rtrim( strtr( base64_encode( pack( 'H*', hash( 'sha256', $codeChallenge ) ) ), '+/', '-_' ), '=' );
$data['code_challenge_method'] = 'S256';
}
@@ -588,13 +589,13 @@ abstract class _OAuth2 extends \IPS\Login\Handler
if( $this->pkceSupported === TRUE )
{
$post['code_verifier'] = $_SESSION['codeVerifier'];
$post['code_verifier'] = \IPS\Request::i()->cookie['codeVerifier'] ?: NULL;
}
$data = $this->_authenticatedRequest( $this->tokenEndpoint(), $post );
$response = $data->decodeJson();
unset( $_SESSION['codeVerifier'] );
\IPS\Request::i()->setCookie('codeVerifier', NULL );
}
catch( \RuntimeException $e )
{
@@ -845,11 +846,13 @@ abstract class _OAuth2 extends \IPS\Login\Handler
*/
public function showInUcp( \IPS\Member $member = NULL )
{
if ( !isset( $this->settings['show_in_ucp'] ) ) // Default to showing
$return = parent::showInUcp( $member );
if ( $return and !isset( $this->settings['show_in_ucp'] ) ) // Default to showing
{
return TRUE;
}
return parent::showInUcp( $member );
return $return;
}