Robert Vogel has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356531 )
Change subject: BSAvatars: Fixed missing initial avatars for new users ...................................................................... BSAvatars: Fixed missing initial avatars for new users => #5787 => Needs cherry-pick to REL1_27 Change-Id: Iaef178a2eba774b99361e715cdb939bafe89f68a --- M Avatars/Avatars.class.php M Avatars/extension.json 2 files changed, 43 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/31/356531/1 diff --git a/Avatars/Avatars.class.php b/Avatars/Avatars.class.php index 2f3b34d..1fc7c2c 100644 --- a/Avatars/Avatars.class.php +++ b/Avatars/Avatars.class.php @@ -263,4 +263,44 @@ return $sNewUserImageSrc; } + /** + * Create an initial Avatar + * @param User $user + * @param boolean $autocreated + * @return boolean + */ + public static function onLocalUserCreated( $user, $autocreated ) { + $oAvatars = BsExtensionManager::getExtension( 'Avatars' ); + try{ + $sNewPath = $oAvatars->generateAvatar( $user, array(), true ); + } catch( Exception $e ) { + wfDebugLog( + 'BS::Avatars', + 'onLocalUserCreated: Error: '.$e->getMessage() + ); + } + return true; + } + + /** + * Create an initial Avatar + * @param UserManager $oUserManager + * @param User $oUser + * @param array $aMetaData + * @param Status $oStatus + * @param User $oPerformer + * @return boolean + */ + public static function onBSUserManagerAfterAddUser( $oUserManager, $oUser, $aMetaData, &$oStatus, $oPerformer ) { + $oAvatars = BsExtensionManager::getExtension( 'Avatars' ); + try{ + $sNewPath = $oAvatars->generateAvatar( $oUser, array(), true ); + } catch( Exception $e ) { + wfDebugLog( + 'BS::Avatars', + 'onBSUserManagerAfterAddUser: Error: '.$e->getMessage() + ); + } + return true; + } } diff --git a/Avatars/extension.json b/Avatars/extension.json index 593caff..5140c5f 100644 --- a/Avatars/extension.json +++ b/Avatars/extension.json @@ -50,7 +50,9 @@ "remoteExtPath": "BlueSpiceExtensions/Avatars/resources" }, "Hooks": { - "BeforePageDisplay": "Avatars::onBeforePageDisplay" + "BeforePageDisplay": "Avatars::onBeforePageDisplay", + "BSUserManagerAfterAddUser": "Avatars::onBSUserManagerAfterAddUser", + "LocalUserCreated": "Avatars::onLocalUserCreated" }, "manifest_version": 1 } -- To view, visit https://gerrit.wikimedia.org/r/356531 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaef178a2eba774b99361e715cdb939bafe89f68a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: REL1_27 Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz> Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits