Skip to content

Commit f6f09b4

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-92720: E-mail admin users when a new administrator is created.
1 parent e3763e9 commit f6f09b4

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed

app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Magento\User\Model\Spi\NotificatorInterface;
2020

2121
/**
22+
* Initiate forgot-password process.
23+
*
2224
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2325
*/
2426
class Forgotpassword extends Auth

app/code/Magento/User/Controller/Adminhtml/User/Save.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use Magento\User\Model\Spi\NotificationExceptionInterface;
1313

1414
/**
15+
* Save admin user.
16+
*
1517
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1618
*/
1719
class Save extends \Magento\User\Controller\Adminhtml\User
@@ -37,7 +39,7 @@ private function getSecurityCookie()
3739
}
3840

3941
/**
40-
* @return void
42+
* @inheritDoc
4143
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
4244
* @SuppressWarnings(PHPMD.NPathComplexity)
4345
*/
@@ -119,6 +121,8 @@ public function execute()
119121
}
120122

121123
/**
124+
* Redirect to Edit form.
125+
*
122126
* @param \Magento\User\Model\User $model
123127
* @param array $data
124128
* @return void

app/code/Magento/User/Model/Spi/NotificatorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function sendCreated(UserInterface $user): void;
3939
* Send a notification when a user is updated.
4040
*
4141
* @param UserInterface $user The user updated.
42-
* @param string[] List of changed properties.
42+
* @param string[] $changed List of changed properties.
4343
* @throws NotificationExceptionInterface
4444
*
4545
* @return void

app/code/Magento/User/Model/User.php

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ protected function _construct()
199199
}
200200

201201
/**
202+
* Removing dependencies and leaving only entity's properties.
203+
*
202204
* @return string[]
203205
*/
204206
public function __sleep()
@@ -221,6 +223,8 @@ public function __sleep()
221223
}
222224

223225
/**
226+
* Restoring required objects after serialization.
227+
*
224228
* @return void
225229
*/
226230
public function __wakeup()
@@ -407,7 +411,7 @@ public function deleteFromRole()
407411
}
408412

409413
/**
410-
* Check if such combination role/user exists
414+
* Check if such combination role/user exists.
411415
*
412416
* @return bool
413417
*/
@@ -419,6 +423,7 @@ public function roleUserExists()
419423

420424
/**
421425
* Send email with reset password confirmation link.
426+
*
422427
* @deprecated
423428
* @see NotificatorInterface::sendForgotPassword()
424429
*
@@ -738,143 +743,143 @@ public function setHasAvailableResources($hasResources)
738743
}
739744

740745
/**
741-
* {@inheritdoc}
746+
* @inheritDoc
742747
*/
743748
public function getFirstName()
744749
{
745750
return $this->_getData('firstname');
746751
}
747752

748753
/**
749-
* {@inheritdoc}
754+
* @inheritDoc
750755
*/
751756
public function setFirstName($firstName)
752757
{
753758
return $this->setData('firstname', $firstName);
754759
}
755760

756761
/**
757-
* {@inheritdoc}
762+
* @inheritDoc
758763
*/
759764
public function getLastName()
760765
{
761766
return $this->_getData('lastname');
762767
}
763768

764769
/**
765-
* {@inheritdoc}
770+
* @inheritDoc
766771
*/
767772
public function setLastName($lastName)
768773
{
769774
return $this->setData('lastname', $lastName);
770775
}
771776

772777
/**
773-
* {@inheritdoc}
778+
* @inheritDoc
774779
*/
775780
public function getEmail()
776781
{
777782
return $this->_getData('email');
778783
}
779784

780785
/**
781-
* {@inheritdoc}
786+
* @inheritDoc
782787
*/
783788
public function setEmail($email)
784789
{
785790
return $this->setData('email', $email);
786791
}
787792

788793
/**
789-
* {@inheritdoc}
794+
* @inheritDoc
790795
*/
791796
public function getUserName()
792797
{
793798
return $this->_getData('username');
794799
}
795800

796801
/**
797-
* {@inheritdoc}
802+
* @inheritDoc
798803
*/
799804
public function setUserName($userName)
800805
{
801806
return $this->setData('username', $userName);
802807
}
803808

804809
/**
805-
* {@inheritdoc}
810+
* @inheritDoc
806811
*/
807812
public function getPassword()
808813
{
809814
return $this->_getData('password');
810815
}
811816

812817
/**
813-
* {@inheritdoc}
818+
* @inheritDoc
814819
*/
815820
public function setPassword($password)
816821
{
817822
return $this->setData('password', $password);
818823
}
819824

820825
/**
821-
* {@inheritdoc}
826+
* @inheritDoc
822827
*/
823828
public function getCreated()
824829
{
825830
return $this->_getData('created');
826831
}
827832

828833
/**
829-
* {@inheritdoc}
834+
* @inheritDoc
830835
*/
831836
public function setCreated($created)
832837
{
833838
return $this->setData('created', $created);
834839
}
835840

836841
/**
837-
* {@inheritdoc}
842+
* @inheritDoc
838843
*/
839844
public function getModified()
840845
{
841846
return $this->_getData('modified');
842847
}
843848

844849
/**
845-
* {@inheritdoc}
850+
* @inheritDoc
846851
*/
847852
public function setModified($modified)
848853
{
849854
return $this->setData('modified', $modified);
850855
}
851856

852857
/**
853-
* {@inheritdoc}
858+
* @inheritDoc
854859
*/
855860
public function getIsActive()
856861
{
857862
return $this->_getData('is_active');
858863
}
859864

860865
/**
861-
* {@inheritdoc}
866+
* @inheritDoc
862867
*/
863868
public function setIsActive($isActive)
864869
{
865870
return $this->setData('is_active', $isActive);
866871
}
867872

868873
/**
869-
* {@inheritdoc}
874+
* @inheritDoc
870875
*/
871876
public function getInterfaceLocale()
872877
{
873878
return $this->_getData('interface_locale');
874879
}
875880

876881
/**
877-
* {@inheritdoc}
882+
* @inheritDoc
878883
*/
879884
public function setInterfaceLocale($interfaceLocale)
880885
{

0 commit comments

Comments
 (0)