-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
occ: Add --all
support to user:lastseen
#39669
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
a7b8933
to
e26ecb4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Ooop, I spoke too soon. I see something has come up in the old code. I didn't change that. And I see that function in the rest of the user Should I add |
--all
support to user:lastseen
core/Command/User/LastSeen.php
Outdated
} else { | ||
$date = new \DateTime(); | ||
$date->setTimestamp($lastLogin); | ||
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i')); |
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.
I think the next feature request will be to be able to sort by last login, so maybe we should either sort, or do something like that so that it can be piped into sort:
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i')); | |
$output->writeln($date->format('Y-m-d H:i').' is the last login from '.$user->getUID()); |
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.
Okay, sure, if that change will align with future changes elsewhere. But for now, I didn't want to introduce breaking format change here. But happy for others to decide on how this should move forward.
You also need to run |
Sorry, could you please provide more info? I ran the code through the suggested linter in the development docs. Is that not correct? |
What linter are you talking about, can you share a link to this documentation? In the server repository there are helper scripts in the composer.json so that you can use You branch is failing the code style check in the CI: https://github.com/nextcloud/server/actions/runs/5746991359/job/15580158407 |
Thanks for getting back. I'm sorry, it's so long ago now, I can't find what linter I ran in my history. It was most likely But I've now followed the instructions here and ran the composer line and fixed, and will push with those last commits as discussed above. Thanks for your help. I hope that's better! |
Could you try to see if you manage to run the test locally with:
And then fix either the code or the test? |
26331cb
to
792c11a
Compare
Running that returned this:
|
@nooblag Are you missing php-sqlite3 maybe? |
Hi @come-nc Yes, I was missing I suspect the code needs to be changed in the test too, but I'm not really sure where to start. |
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.
Looks good otherwise
Signed-off-by: Jordan Brown <code@jore.cc>
b5034c0
to
f2d4d9b
Compare
Now with fixes, thank you @nickvergessen @come-nc, it'd be great if this makes it in time for NC 29. 😉 |
Signed-off-by: Joas Schilling <coding@schilljs.com>
f2d4d9b
to
8134063
Compare
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
Great! :) I note the |
On https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#user-commands-label if could be added (search for |
Nice work. While we're in the space, just want to query if the times returned here will always be in UTC? And if so, whether we should be more explicit about that?
Or, what do people think about ensuring the time is the same timezone as PHP set? For example, my locale set is Australia/Sydney, so times expected would be UTC+11 at the moment (and UTC+10 once daylight-saving is over). i.e. My CLI php.in setting:
So either:
Or:
I also notice, if we do work to improve here, that changes for consistency should also apply to
Should I open a new issue to tackle the |
Yes, please create a new issue |
Okay, thank you. Here it is for discussion: #44641. |
occ
#39048Summary
Adds
--all
argument touser:lastseen
forocc
.Checklist