Allow admin to create users without password by sending mail automatic…#8856
Allow admin to create users without password by sending mail automatic…#8856MorrisJobke merged 1 commit intomasterfrom
Conversation
| throw new OCSException('To send a password link to the user an email address is required.', 108); | ||
| } | ||
|
|
||
| $password = $this->secureRandom->generate(30); |
There was a problem hiding this comment.
30?!? Don't overcomplicate things 😅
There was a problem hiding this comment.
But... that is only 1532495540865888858358347027150309183618739122183602176 possibilities!
There was a problem hiding this comment.
X)
Do we want to be secure or not!!?? :D
7559c7d to
73682c2
Compare
Codecov Report
|
73682c2 to
3bba48d
Compare
47bae0c to
c3f9c7e
Compare
|
|
||
| $password = $this->secureRandom->generate(10); | ||
| // Make sure we pass the password_policy | ||
| $password .= $this->secureRandom->generate(2, '$!.,;:-~+*[]{}()'); |
There was a problem hiding this comment.
well this is only 'kind of' true. We don't know if this will pass the password policy test because we don't know what it is set to.
There was a problem hiding this comment.
Nothing you can fix here. But still
There was a problem hiding this comment.
I used old code, so I'm to blame here :D
To be fair, the goal is to create a secure password that no one will know about since the user will receive a mail to reset it. I suggest we remove the special char part and only use a 15 length generation.
There was a problem hiding this comment.
Then this might fail hard when using the password_policy app ;) But like I said fine by me. Lets do this for now.
| * @throws OCSException | ||
| */ | ||
| public function addUser(string $userid, string $password, array $groups = []): DataResponse { | ||
| public function addUser(string $userid, string $password = '', $email='', array $groups = []): DataResponse { |
02f1087 to
bcca3e0
Compare
…ally Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
bcca3e0 to
41b690e
Compare
|
I think the failure is unrelated! |
…ally
Required by #8824