Vault API Question

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
Balthazor
Posts: 81
Joined: Fri Mar 11, 2005 4:10 pm
Location: Hartford, Wisconsin

Vault API Question

Post by Balthazor » Thu Feb 01, 2007 3:36 pm

I'm retrieving a list of users with the GetUserList function, but every user in the list is shown as having an isActive value of false and a Status of 0. Is there a reason for this? I want to see if the users are currently Active or Inactive, but this doesn't seem to be working for me.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Feb 01, 2007 3:53 pm

The active status is a three value state:

A) -1 - the user is inactive
B) 0 - the user is active and not logged in.
C) 1 - the user is active and logged in.
Jeff Clausius
SourceGear

Balthazor
Posts: 81
Joined: Fri Mar 11, 2005 4:10 pm
Location: Hartford, Wisconsin

Post by Balthazor » Thu Feb 01, 2007 3:59 pm

That's good to know, but the trouble is that I get a status of 0 for every user, regardless of their actual status.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Feb 01, 2007 4:25 pm

Ahh. I see.

There are two calls for GetUserList().

Are you calling the one from the AdminService Web Service? If not, then that is the one you will want to call, as it will have the additional info.
Jeff Clausius
SourceGear

Balthazor
Posts: 81
Joined: Fri Mar 11, 2005 4:10 pm
Location: Hartford, Wisconsin

Post by Balthazor » Fri Feb 02, 2007 8:42 am

Actually, I got it working using Connection.ListUsers. The Connection.GetUserList is what I was using before, and that returned a list, but the isActive was always false and the Status was always 0.

The one thing I noticed about the Connection.ListUsers is that it only works if you're logged in as an Admin. If you log in as a Client, the ListUsers errors out with an "object reference not set to an instance of an object" error.

So, I have it working now, it just took a little experimenting. But hey, that's what makes it fun.

Locked