-
-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only pass user's ID into Users::addRole() #7092
Conversation
src/Users.php
Outdated
@@ -152,7 +152,7 @@ public function deleteUser($id) | |||
{ | |||
$user = $this->getRepository()->find($id); | |||
|
|||
if (!$user) { | |||
if ( ! $user) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 0 spaces after opening bracket; 1 found
src/Users.php
Outdated
@@ -187,18 +187,18 @@ public function getEmptyUser() | |||
*/ | |||
public function getUsers() | |||
{ | |||
if (!empty($this->users)) { | |||
if ( ! empty($this->users)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 0 spaces after opening bracket; 1 found
src/Users.php
Outdated
return $this->users; | ||
} | ||
|
||
try { | ||
if (!$tempusers = $this->getRepository()->getUsers()) { | ||
if ( ! $tempusers = $this->getRepository()->getUsers()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 0 spaces after opening bracket; 1 found
src/Users.php
Outdated
* @param boolean|integer $enabled | ||
* | ||
* @return integer | ||
*/ | ||
public function setEnabled($id, $enabled = true) | ||
{ | ||
if (!$user = $this->getUser($id)) { | ||
if ( ! $user = $this->getUser($id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 0 spaces after opening bracket; 1 found
src/Users.php
Outdated
* | ||
* @return boolean | ||
*/ | ||
public function hasRole($id, $role) | ||
{ | ||
if (!$user = $this->getUser($id)) { | ||
if ( ! $user = $this->getUser($id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 0 spaces after opening bracket; 1 found
I've rebased this to 3.3 as it is a valid bug fix 👍 … I also stripped out the IDE changes 😉 |
Sorry for the messy request :( |
Resolved small bug that occurs when first user is created via app/nut command without Root permissions.
At line 458,
addRole()
is aimed to accept a user id (int or string), the whole user object as array was passed instead causing a crash at line 234 when userId is used inarray_key_exists
.Sorry for IDE autoindent