More code for add correct ACE index to Sharing Folder dialog.

References #397.
Fix for preventing user to share to a LDAP user having a username
without the domain part in it.

References #421.