oroinc / platform

Main OroPlatform package with core functionality.
Other
627 stars 351 forks source link

Allow to generate the password instead of providing it in plain text #1041

Closed sadortun closed 5 months ago

sadortun commented 3 years ago

Hello Oro !!!

Small quality of life patch that allow to create users and generating a random password.

Avoiding having to provide password in plain text through command line is a security improvement, since there is no option currently to "Force user to change password on next login"

Have a good day, Samuel

sadortun commented 3 years ago

Also, Not sure if its wanted or not, but i think this is missing from the command, without that, the user is not added to oro_user_organization table

See #1044

 src/Oro/Bundle/UserBundle/Command/CreateUserCommand.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/Oro/Bundle/UserBundle/Command/CreateUserCommand.php b/src/Oro/Bundle/UserBundle/Command/CreateUserCommand.php
index 92097c1ec3..2a8548dcd3 100644
--- a/src/Oro/Bundle/UserBundle/Command/CreateUserCommand.php
+++ b/src/Oro/Bundle/UserBundle/Command/CreateUserCommand.php
@@ -187,6 +187,7 @@ class CreateUserCommand extends Command
             $user
                 ->setOwner($businessUnit)
                 ->setOrganization($businessUnit->getOrganization())
+                ->addOrganization($businessUnit->getOrganization())
                 ->addBusinessUnit($businessUnit);
         }