I'm working on a PHP script that will retrieve the last_login value for an admin user. Here is the endpoint that I am using:
The problem is that when we execute this, we sometimes get TWO user objects. For example:
returns two admin accounts, one with the email@example.com login id, and one with a totally different login id, and the value of last_login is entirely different for each of them. Why could this be happening?
Entirely different. Let's say that the first person is named Joe Smith; then the second person is Kathy O'NoName, with the email address firstname.lastname@example.org.
Edit: I just realized that person 1 and person 2 have the same email domain.
I just managed to reproduce this - and the users have different email domains.
Its the same if I search in the GUI as an admin in People.
I get back three, two would be expected, one has no current details that match the search. But the odd one out is a test account that I use, and the other two are also accounts I use. Spooky!
I wonder if the odd one out used to have something matching the others and Canvas is finding these details. Eg., a deleted login. Deleted things are often really still there.
My co-worker figured it out. I don't know how, but we've used it for a couple of things.
I wonder what's going on with this behavior. I haven't found anything online to suggest a way around it.
Oh well, for now, just have to allow for multiple results and grab the one that actually matches. Should probably be doing this anyway as you don't know what will come back.
Here's a strange nuance... I tried searching by id, but when include is specified, then the search parameter will only accept string input. So I tried searching by id, but without the include=last_login parameter. However, it still returned two results for the user in question, which is really starting to irk me.