Nextcloud/Collabora: Set Nickname automatically - nextcloud

When editing a document anonymously in Nextcloud/Collabora, you are asked:
Please choose your nickname to continue as guest user.
Can I add something to the URL, which will skip this step?
Maybe something like: https://cloud/s/documentid?nickname=undef

Related

How to clone a UserPrincipal object in VB.NET

I'm trying to create a new User in Active Directory from a VB.NET application. Most fields will be identical to an already existing "template" user, except things like Name, SurName, Email, SamAccountName, etc.
So I want to copy or clone this template User, assign the few fields with a new/different value and then save this new user in Active Directory. I'd like to avoid having to manually assign who-knows how many properties from my template to the new User and maybe forget something along the way..
Is there not a way to do that? I found something about using DirectoryEntry.CopyTo(), but I simply get a "Not implemented" error, and anyway I doubt this is the right direction (Unsure how to use this class together with a UserPrincipal object)
Should I be using a different class than System.DirectoryServices.AccountManagement.UserPrincipal to save my new user in the AD? Do I have the wrong approach?
Any help will be appreciated :)
If you look at the source code for DirectoryEntry.CopyTo, it calls:
newParent.ContainerObject.CopyHere(Path, newName)
And ContainerObject is of the type IADsContainer. If you look at the documentation for IADsContainer.CopyHere, it says (under Remarks):
The providers supplied with ADSI return the E_NOTIMPL error message.
ADSI is "Active Directory Service Interfaces". So the short answer is that it just won't work with AD objects.
There is no way to do what you want. You will have to manually assign each attribute you want to copy.

Basecamp 3 API : How to get comments created by the authorized user?

I am in the process of integrating my webapp with Basecamp 2 (solved, see edit) and 3, and I want to get all of the comments for a todo item for the authorized user.
First I make a call to https://launchpad.37signals.com/authorization.json which returns json that includes the user's identity, something like {"identity":{"id":99999999, ..... }}.
Then I make a call to the URL to get the comments for the item in question and go through them one by one matching the identity.id from above (99999999) with the creator.id for the comment.
The problem is, they don't match! I am working with one Basecamp2 project and one Basecamp3 project. When testing, using comments I wrote, Basecamp2 and Basecamp3 each have different values for creator.id (even though I wrote both comments!), and neither of them match the identity.id from authorization.json.
How do I link them to find which comments were made by the authorized user
Thanks
EDIT: I figured it out for Basecamp2 - I need to get /people.json which has a mapping from the identity_id of each user to the id for that user in that project. Still not sure how to do it for Basecamp3, which does not include identity_id in people.json!
The correct way to do this for Basecamp2 is to get:
https://basecamp.com/{project_id}/api/v1/people/me.json - the id node contains the id of the authorized user for project {project_id}.
for Basecamp3:
https://3.basecampapi.com/{project_id}/my/profile.json - the id node contains the id of the authorized user for project {project_id}.

How to get user information from hippo via HST

I'm evaluating the hippo cms,
after add hst-security as a dependence ,so public site need login, but how can I fetch the login user's detail information like email and something else.
I used HstRequest.getUserPrincipal ,but only get the username.
and tried to write a query "SELECT_USER_QUERY = "SELECT * FROM hipposys:user"
but only get a user 'liveuser', after login with admin.
so , Anyone can help me ,how can I get the detail info?
You can do this:
final User user = JcrSessionUtils.getHippoSession(request.getRequestContext().getSession()).getUser();
user.getEmail();
user.getLastLogin()

Get Country code from VBA and LDAP

I have email id of the members and I am executing following quesy
The command text is
UserDomain = VBA.Environ("UserDomain")
cmd.CommandText = "SELECT cn, mail, c FROM 'LDAP://" & UserDomain & "' WHERE mail = 'r.khenat#abc.com'"
Above code works well on my machine for me and my teammates, however if I use the same code to get the details of the team mates who are in different domain, I get no information.
Instead of UserDomain, what root value I need to put so that I can get the required information.
Any idea?
I managed to get it done by hard coding the domain names and adding it in an Array. I iterated through array to fetch the required details.
You can only ask a domain for users that belong to that domain, so the current domain you are querying will know nothing about e.g. my email, just as my domain will know nothing about your email.
You can try asking my domain about my email if you want, but you won't have any access to it. In the same way I can try asking your domain about its members but if I have access them your domain has been set up very very badly. Only a properly authorised member of a domain should be able to ask that domain such questions, and them only when logged onto a machine which is also a member of that same domain, and is also connected to it.
So no, the query you want to run will not work, by design.

MVC user's full name in Url, how to handle duplicates

I want to setup the following url in my MVC4 website, using the user's full name in the url:
http://www.myapp.com/profile/steve-jones
I have setup the following route in Global.asax:
routeCollection.MapRoute(
"profile", "profile/{userName}",
new { controller = "myController", action = "profile", userName = string.Empty
});
And I can take the parameter 'steve-jones' and match it to a user with matching name. My only problem though is, what if there is more than one 'Steve Jones', how can I handle this?
Does anyone know of a workaround/solution to this so that I can use a user's full name as part of the url and still be able to retrieve the correct user in the controller method?
Am I forced into including the user's id with the url (something that I do not want to appear)?
The usual way of handling this is by appending a number when creating the profiles. So if "steve-jones" is already a name in the database, then make the user's display name "steve-jones2". You basically have to insist that all profile urls are unique, which includes updating any existing database and account creation code.
Alternatively (and/or additionally), if two same names are found then have the script reroute to a disambiguation page where the user is presented with links and snippet of profile info of the many existing Steve Joneseses so they can go to the full correct profile.
Another way of handling it is by giving all user profiles an additional numeric code on the end. At my university all logins are based on name, so they give everyone pseudo-random 3-digit extensions so that they are safe as long as they don't get 1000 people with the exact same names :)
Some people might be happier being steve-jones-342 if there is no steve-jones or steve-jones1, if you're concerned.