...
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiRemoteCreateUser(SdaiServerContext serverContextId,
SdaiString userName,
SdaiUser *userId,
SdaiInvocationId *edmiInvocationId);
|
Creates a new EDMuser in a remote EDMdatabase
...
.
...
EDMuser names must be unique within an EDMdatabase
...
. It may consist of letters, digits and hyphens. The first character must be a letter. EDMuser names are case insensitive.
...
The edmiRemoteCreateDatabase function will
...
implicitly create the EDMgroup named 'sdai-group' and the EDMusers 'superuser' and 'sdai-user'. The two users will be members of 'sdai-group'.
...
Only the superuser may use this function.
Related functions: edmiRemoteDeleteUser, edmiRemoteUserToGroup, edmiRemoteGetUser, edmiRemoteChangePassword, edmiRemoteDefinePassword.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteCreateUser(SdaiServerContext serverContextId, SdaiString userName, SdaiUser *userId, SdaiInvocationId *edmiInvocationId);
Arguments:
Arguments
...
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiString | userName | The name of the EDMuser to create in the remote _EDMdatabase{_}remote EDMdatabase . EDMuser names are case insensitive. see EDMuserName |
SdaiUser | userId | A variable that will receive the numeric userId that uniquely identifies the EDMuser in the EDMdatabase. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Example
...
Code Block | ||
---|---|---|
| ||
EdmiError rstat; SdaiServerContext suContext; SdaiUser userId; SdaiGroup groupId; /* Define Remote Server Context for the superuser */ rstat = edmiDefineServerContext("SuperUserContext", |
...
"superuser", NULL, "dbName", |
...
"TCP", "9090", "MyServerHost", |
...
NULL, NULL, NULL, NULL, NULL, &suContext); |
...
/* First, change the superuser password |
...
from the factory |
...
setting <databaseName> to the somewhat more complicated 'xfx56kl9' */ |
...
rstat = edmiRemoteDefinePassword(suContext, "xfx56kl9", NULL); |
...
/* The new password makes the current context obsolete. */ |
...
rstat = edmiDeleteServerContext(suContext); |
...
/* A new context must be created |
...
to reflect the change in password */ |
...
rstat = edmiDefineServerContext("SuperUserContext", |
...
"superuser", NULL, "xfx56kl9", |
...
"TCP", "9090", "MyServerHost", |
...
NULL, NULL, NULL, NULL, NULL, &suContext); |
...
/* Check if 'Lucy' exists as user */ |
...
rstat = edmiRemoteGetUser(suContext, "Lucy", &userId, NULL); |
...
if (rstat = edmiENOUSER) { |
...
rstat = edmiRemoteCreateUser(suContext, "Lucy", &userId, NULL); |
...
} /* Check if 'Guest' exists as user */ |
...
rstat = edmiRemoteGetGroup(suContext, "Guest", &groupId, NULL); |
...
if (rstat = edmiENOGROUP) { |
...
rstat = edmiRemoteCreateGroup(suContext, "Guest", &groupId, NULL); |
...
} /* Put 'Lucy' in the 'Guest' group */ |
...
rstat = edmiRemoteUserToGroup(suContext, groupId, userId, NULL); |
...
/* Change Lucys password from the |
...
default 'Lucy' to 'ddf54y' */ |
...
rstat = edmiRemoteChangePassword(suContext, userId, "ddf54y", NULL); |
...
. . . |
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|