Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Disabling users in WebUI #413

Closed
wants to merge 10 commits into from
Closed

Conversation

Faldon
Copy link
Contributor

@Faldon Faldon commented Jul 15, 2016

Ability to disable users in Web UI

Base for implementing #283

  • Implemented an action menu for each user like in the files section
  • Added the menu items delete and disable/enable (based on the current state of the user)
  • Added a Disabled Group in the sidebar and a disbaled users count

TODO:

  • When enabling a user, site needs a reload because the groups won't be filled with users anymore.
    The other way around seems to work fine.
    (Edit: I just fired ab my local test server after the weekend and this strange behaviour was gone. Maybe a cache problem?)

Thomas Pulzer added 5 commits July 8, 2016 15:06
Added the controller functions for enabling/disabling a user.
… an additional route handler in the user controller.

 Finished the visuals to reflect current user status and changed user status respectively.
…re deletion and state toggling of a user is selectable.
Improved style of user action menu.
@mention-bot
Copy link

@Faldon, thanks for your PR! By analyzing the annotation information on this pull request, we identified @jancborchardt, @schiessle and @ringmaster to be potential reviewers

Removed visual indicator for disabled users.
@Faldon Faldon changed the title [WIP] Disabling users in WebUI Disabling users in WebUI Jul 18, 2016
@Faldon Faldon added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 18, 2016
@MorrisJobke
Copy link
Member

MorrisJobke commented Jul 18, 2016

  • PNGs are not needed anymore on master
  • optimize the SVGs (use either svgo or scour to do so)

} else {
return new DataResponse(
array(
'status' => 'error',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use HTTP status codes for the response instead of a status flag.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. You just used the same style as in the code above. Okay. Then we could keep this, but should clean this up once we touch all the code here again.

@MorrisJobke
Copy link
Member

We already have the menu CSS in place. This is for now only implemented in the sidebar, but should be reusable: https://docs.nextcloud.org/server/9/developer_manual/app/css.html#menus

bildschirmfoto 2016-07-18 um 09 31 21

Could you check this out? And also we usually use px instead of em. Maybe this already helps to make this work.

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 18, 2016
@MorrisJobke
Copy link
Member

But nevertheless: Thanks for your contribution :)

@Faldon
Copy link
Contributor Author

Faldon commented Jul 18, 2016

@MorrisJobke I changed my additions to the css from em to px. There are already some declarations in em, but I would rather look into it as separate task (redesigning settings maybe, than we also can change the code for the http status codes as you mentioned above.)

The last mentioned problem (not displaying user) was a bug that seems to be present already. In the template resides a single tr for the javascript, that should be kept on reloading the user list but wasn't.

…controller.

Changed units for newly introduced css values from em to px.
Removed unnecessary png and optimized svg with scour.
Changed the userlist template to display the user action menu with correct width.
@Faldon Faldon added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 22, 2016
$batch = $this->getUsersForUID($this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset));
} else {
$batch = $this->userManager->search($pattern, $limit, $offset);
}

foreach ($batch as $user) {
$users[] = $this->formatUserForIndex($user);
if( ($gid!=='disabledUsers' && $user->isEnabled()) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing spaces around !==

@MorrisJobke
Copy link
Member

Beside that it already looks quite good :)

@MorrisJobke
Copy link
Member

For better user experience we should make the loginException extend from HintException:

use OC\HintException;

class LoginException extends HintException {
}

@Faldon Could you add this?

@LukasReschke I don't see a risk for leaking info here. Every time the login exception is thrown it also uses a translated message.

@Faldon Beside that it works really nice 👍

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 28, 2016
@Faldon
Copy link
Contributor Author

Faldon commented Jul 29, 2016

I'm still struggling with the code style. -.- Fixes are on their way.
@MorrisJobke Currently, the LoginController seems to not throw any Exception. Or am I looking at the wrong place?

@MorrisJobke
Copy link
Member

@MorrisJobke Currently, the LoginController seems to not throw any Exception. Or am I looking at the wrong place?

Correct. Then all is fine. This is the old way to implement it but it is consistent in that class. So leave it as it is :)

@MorrisJobke
Copy link
Member

@Faldon There are conflicts that doesn't allow merging. Could you try to resolve those conflicts?

@Faldon
Copy link
Contributor Author

Faldon commented Jul 29, 2016

Hmpf...
Merging the master branch back appearantly was not a good idea... ;-( Sorry for that. But hopefully, the merge conflicts are resolved now...

@jancborchardt
Copy link
Member

@Faldon I just noticed the added icons. Instead please use the classes .icon-add and .icon-delete with the respective text: »Add user« or »Delete user« (or »Disable«)

@Faldon
Copy link
Contributor Author

Faldon commented Jul 30, 2016

@jancborchardt Should I extend the icons style sheet for the disabling user icon then?

@jancborchardt
Copy link
Member

@Faldon we can use .icon-close for that. It’s similar to »Delete« but not a trash can. And it’s important there’s text next to it. :)

@Faldon
Copy link
Contributor Author

Faldon commented Aug 1, 2016

@jancborchardt Ok, I did the changes for the action menu. However, I left the code style for the "more" icon to comply with the other icons in the tr that are visible on hover.

@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 1, 2016
@MorrisJobke MorrisJobke self-assigned this Sep 1, 2016
@MorrisJobke
Copy link
Member

The conflicts doesn't seem to be trivial. I will try to sort this out. Sorry for having this laying around that long 😢

@MorrisJobke
Copy link
Member

Rebase on master is in #1234

@Faldon Is this okay for you? (that I take over this PR)

@MorrisJobke
Copy link
Member

@Faldon Is this okay for you? (that I take over this PR)

I will close this here for now.

@MorrisJobke MorrisJobke closed this Sep 1, 2016
@MorrisJobke MorrisJobke removed their assignment Sep 1, 2016
@MorrisJobke
Copy link
Member

Superseeded by #1234

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants