Skip to content

Introduce user session commands#3307

Merged
danielbachhuber merged 12 commits into
masterfrom
wp-user-session
Oct 15, 2016
Merged

Introduce user session commands#3307
danielbachhuber merged 12 commits into
masterfrom
wp-user-session

Conversation

@johnbillion
Copy link
Copy Markdown
Contributor

@johnbillion johnbillion commented Aug 17, 2016

Fixes #3306.

This is a work in progress. The commands mostly map to the available user session API functions.

TODO:

  • wp user session list <user> - List all sessions of a user.
  • wp user session destroy-all <user> - Destroy all sessions of a user.
  • wp user session destroy <user> <token> - Destroy the given session of a user.
  • [ ] wp user session drop - Destroy all sessions of all users.
  • Tests for all of the above.
  • Inline doc explaining the reflection in list_().

Comment thread php/commands/user.php Outdated
* ## EXAMPLES
*
*/
class User_Session_Command extends WP_CLI_Command {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we move this to its own file? user-session.php

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #3296

@danielbachhuber
Copy link
Copy Markdown
Member

@johnbillion FYI - the scope:command label is deprecated, in favor of labels for each specific command.

@danielbachhuber
Copy link
Copy Markdown
Member

@johnbillion Do you have time committed to working on this, or should I finish it up?

@johnbillion
Copy link
Copy Markdown
Contributor Author

Yeah I have some other changes that I made. I'll implement your feedback and push it up.

@danielbachhuber
Copy link
Copy Markdown
Member

@johnbillion I'd like to get this landed. Last chance to push your changes, otherwise I'm going to take this forward.

@johnbillion
Copy link
Copy Markdown
Contributor Author

@danielbachhuber Just pushed my latest code. Feel free to carry on, otherwise I'll continue when I get some more time!

@ernilambar
Copy link
Copy Markdown
Member

Test for user session destroy. It may be helpful. :) https://gist.github.com/ernilambar/63a7e985f328d2171a799b182088fbdd

@danielbachhuber
Copy link
Copy Markdown
Member

Test for user session destroy. It may be helpful. :)

@ernilambar Thanks! Really helpful :)

wp user session drop - Destroy all sessions of all users.

Given this is doable with xargs, I don't think we need a command for it. See 1ba3ba7

@danielbachhuber danielbachhuber merged commit 26a26f3 into master Oct 15, 2016
@danielbachhuber danielbachhuber deleted the wp-user-session branch October 15, 2016 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants