When working with a repository hosted on laserfiche.com, we have found that there are two different user names being used, and we need to know how to link them together.
A user can login with their email or username. Regardless of which one, the following code will always return the email address:
RepositoryRegistration rep = new RepositoryRegistration(myServer, myRep); Session session = new Session(); session.LogIn("user1", "***", rep); return session.UserName; // always returns email address (e.g. user1@company.com)
Also regardless of which on, this code will show documents are checked out to the username:
RepositoryRegistration rep = new RepositoryRegistration(myServer, myRep); Session session = new Session(); session.LogIn("user1", "***", rep); EntryInfo lfEntry = Entry.GetEntryInfo(entryId, session); AccountReference acctRef = new AccountReference(lfEntry.PersistentLock.Owner, session); return acctRef.AccountName; // Always returns username (e.g. user1) instead of email address
When we access a locked document from different processes, we need to know whether the logged in user has previously locked the document or not. How can we either get the username of the logged in user, or how can we get the email address for the account that has locked a document? The former would probably be more useful, thanks.