1515use Joomla \CMS \Association \AssociationServiceInterface ;
1616use Joomla \CMS \Component \ComponentHelper ;
1717use Joomla \CMS \Event \Router \AfterInitialiseRouterEvent ;
18+ use Joomla \CMS \Event \User \AfterSaveEvent ;
19+ use Joomla \CMS \Event \User \BeforeSaveEvent ;
20+ use Joomla \CMS \Event \User \LoginEvent ;
1821use Joomla \CMS \Factory ;
1922use Joomla \CMS \Filesystem \Folder ;
2023use Joomla \CMS \Language \Associations ;
@@ -559,8 +562,10 @@ public function onPrivacyCollectAdminCapabilities()
559562 *
560563 * @since 1.6
561564 */
562- public function onUserBeforeSave ($ user , $ isnew , $ new )
565+ public function onUserBeforeSave (BeforeSaveEvent $ event )
563566 {
567+ $ user = $ event ->getUser ();
568+
564569 if (\array_key_exists ('params ' , $ user ) && $ this ->params ->get ('automatic_change ' , 1 ) == 1 ) {
565570 $ registry = new Registry ($ user ['params ' ]);
566571 $ this ->user_lang_code = $ registry ->get ('language ' );
@@ -585,8 +590,11 @@ public function onUserBeforeSave($user, $isnew, $new)
585590 *
586591 * @since 1.6
587592 */
588- public function onUserAfterSave ($ user , $ isnew , $ success , $ msg ): void
593+ public function onUserAfterSave (AfterSaveEvent $ event ): void
589594 {
595+ $ user = $ event ->getUser ();
596+ $ success = $ event ->getSavingResult ();
597+
590598 if ($ success && \array_key_exists ('params ' , $ user ) && $ this ->params ->get ('automatic_change ' , 1 ) == 1 ) {
591599 $ registry = new Registry ($ user ['params ' ]);
592600 $ lang_code = $ registry ->get ('language ' );
@@ -621,8 +629,10 @@ public function onUserAfterSave($user, $isnew, $success, $msg): void
621629 *
622630 * @since 1.5
623631 */
624- public function onUserLogin ($ user , $ options = [] )
632+ public function onUserLogin (LoginEvent $ event )
625633 {
634+ $ user = $ event ->getArgument ('subject ' );
635+
626636 if ($ this ->getApplication ()->isClient ('site ' )) {
627637 $ menu = $ this ->getApplication ()->getMenu ();
628638
0 commit comments