HI,I am using REGNewPerson C API to create a new user. If I do not supply policy then user gets created but after supplying Explicit policy in REG_PERSON_INFO, the following error comes -
Error: unable to register a new user. Error:20e5
Registration failed: A policy could not be retrieved from the Domino directory.
Though the policy exists in Domino server. I have also supplied the appropriate flag. Also the following server setting is enabled -
Server->Security->Check Passwords on Note IDs: Enabled
I am not sure why it is not picking up. I am able to reproduce this problem 7.03 adn 8.5 servers.
Pease help…
Subject: Giving a user an explicit policy or registering a user with explicit policy
When registering a user via the API, there are two things that can be done:
Register a user using the parameters supplied in the REG API structures and put the ExplicitPolicy paraementer into the Person document as the Policy field
Register a user by evaluation the effective registration policy supplied and using the policy settings as the parameters in the REG API structures. The effective registration policy is created by evaluation the organizational policy (including the certifier passed to the REG API) and the ExplicitPolicy passed to the REG API via the structures. In order to use this registration method pass the fREGExtRegUsingPolicy flag. In order for this method to work there must be an effective registration policy.
which method are you trying to do? do you simply want to assign an Explicit Policy in the person document but are supply the REG API structure values yourself? Or do you want the API to do the work for you?
Dave
Subject: Giving a policy in user document
I want to supply the explicit policy in a user document using REG API and want domino to take care of it.
Now I ma able to do that, it seems there was some problem with my installation. Though the policy is is shown in the user document but I am not able to see any change in user document due to policy.
For example, it is not showing DB file size limit in admin console for newly created user, but it is defined in explicit policy.
I am also not able to assign groups using API REGNewPerson, though it creates a user and do not show any error but do not apply gorup.
Can you suggest the possible cause of the problem.
Subject: REGNewPerson
It still isn’t clear to me what you want the API to do. Are you supplying the REG API parameters or do you want the API to pull the parameters out of a registration policy. If you can supply parts of the code that call REGNewPerson it might make it clearer to me.
“DB file size limit” are you referring to quota’s or file size limit? They are different things.
“Groups” are you passing the group list to the REGNewPerson API or do you have groups assigned in the registration settings?
Subject: REGNewPerson
I Apologize that the information I have provided is confusing, let me try to explain…
Issue 1: I want to specify the Explicit Policy name in REGNewPerson and then create a user with the specified API.
Error: Unable to find the policy. Even though the policy exists.
Current Status: I have resolved the issue. The problem was, there was no registration settings defined in the policy. Once I did that, it resolved the error.
Issue 2: Not able to specify DB Quota using REGNewPerson API(Not using Policy). Though it does not throw any error at the time of user and mail file creation but the quota does not reflect.
Current Status: After creating the user with the specified API, I again called API NSFDbQuotaSetExt to set the quota. Now it is woring fine
Issue 3: Not able to create mail replica on cluster at the time of user creation usign specified API(Not using Policy). Though it do not throw any error but does not create replica.
Current Status: After creating a user, I have called another API to set replica NSFDbReplicaInfoGet/Set. Now it is working fine.
Issue 4: Not able to apply groups at the time of user creation using REGNewPerson API(Not using Policy). Though it does not throw any error but does not reflect the changes once I see the member of the group in admin console.
Current Status: Did not find any solution till yet. It would be great if you can help.
Subject: REGNewPerson
Without seeing the code it is hard to determine what is wrong.
Verify that the quotas you are specifying are in KB not Bytes or MB.
Verify that the pGroupList your are passing was created via ListAlloc (without data type) and locked via OSLockObject or similar.
Subject: REGNewPerson
Here is the code which I use to create a list -
STATUS createList(HANDLE *hlist, char *privList)
{
VOID *plist;
WORD list_size; /* total size of list */
STATUS Error = NOERROR;
char *p;
WORD i;
printf("\nSupplied List (in method):%s\n", privList);
/* Create an empty text list data structure. */
if (Error = ListAllocate(0, 0, FALSE, hlist, &plist, &list_size)) {
printf("Can't ListAllocate\n");
return 1;
}
OSUnlock(*hlist);
plist = NULL;
if (privList != NULL) {
//need to break the tokens and add it to priviledge list
for (i = 0, p = strtok(privList, "|"); p != NULL;
i++, p = strtok(NULL, "|")) {
printf("\nList token :%s\n", p);
//trimWhiteSpace(p);
//add it to the list
if (Error = ListAddEntry(*hlist, FALSE, &list_size, i, p,
(WORD) strlen(p))) {
printf("Can't ListAddEntry!\n");
OSMemFree(*hlist);
return 1;
}
}
}
plist = OSLockObject(*hlist);
return 0;
}