Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

+20 -3
View File
@@ -122,6 +122,23 @@ abstract class OAuth2 extends Handler
'optional' => 'login_update_changes_optional',
'disabled' => 'login_update_changes_no',
), 'disabled' => $emailChangesDisabled ), NULL, NULL, NULL, 'login_update_email_changes_inc_optional' );
/* If this handler supports profile photos, add options for that */
if( $this->canSyncProfilePhoto() )
{
$photoChangesDisabled = array();
if( $forcePhotoHandler = static::handlerHasForceSync( 'photo', $this ) )
{
$photoChangesDisabled[] = 'force';
Member::loggedIn()->language()->words['login_update_changes_yes_photo_desc'] = Member::loggedIn()->language()->addToStack( 'login_update_changes_yes_disabled', FALSE, array( 'sprintf' => $forcePhotoHandler->_title ) );
}
$return['update_photo_changes'] = new Radio( 'login_update_photo_changes', $this->settings['update_photo_changes'] ?? 'optional', FALSE, array( 'options' => array(
'force' => 'login_update_changes_yes_photo',
'optional' => 'login_update_changes_optional',
'disabled' => 'login_update_changes_no',
), 'disabled' => $photoChangesDisabled ), null, null, null, 'login_update_photo_changes_inc_optional' );
}
return array_merge( $return, parent::acpForm() );
}
@@ -538,7 +555,7 @@ abstract class OAuth2 extends Handler
{
try
{
$identifier = Db::i()->select( 'token_identifier', 'core_login_links', array( 'token_login_method=? AND token_member=?', $this->id, $exception->member->member_id ) )->first();
$identifier = Db::i()->select( 'token_identifier', 'core_login_links', [ 'token_login_method=? AND token_member=?', $this->id, $exception->member->member_id ], flags: Db::SELECT_FROM_WRITE_SERVER )->first();
if( $identifier != $userId )
{
@@ -786,7 +803,7 @@ abstract class OAuth2 extends Handler
*/
public function userId( Member $member ): ?string
{
if ( !( $link = $this->_link( $member ) ) or ( $link['token_expires'] and $link['token_expires'] < time() ) )
if ( !( $link = $this->_link( $member ) ) or ( $link['token_expires'] and $link['token_expires'] < time() ) OR empty( $link['token_access_token'] ) )
{
throw new Exception( 'generic_error', Exception::INTERNAL_ERROR );
}
@@ -806,7 +823,7 @@ abstract class OAuth2 extends Handler
*/
public function userProfileName( Member $member ): ?string
{
if ( !( $link = $this->_link( $member ) ) or ( $link['token_expires'] and $link['token_expires'] < time() ) )
if ( !( $link = $this->_link( $member ) ) or ( $link['token_expires'] and $link['token_expires'] < time() ) OR empty( $link['token_access_token'] ) )
{
throw new Exception( 'generic_error', Exception::INTERNAL_ERROR );
}