Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Returns the unique groupId of an EDMgroup identified by its group name.
Related functions: edmiRemoteCreateGroup, edmiRemoteDeleteGroup,
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteGetGroup(SdaiServerContext serverContextId,
                              SdaiString        groupName,
                              SdaiGroup         *groupId,,
                              SdaiInvocationId  *edmiInvocationId);
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

groupName

The name of the EDMgroup of interrest. Group names are case insensitive.

groupId

A variable that will receive a numeric groupID that uniquely identifies the EDMgroup within the _EDMdatabase._

edmiInvocationId

Currently not used.

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
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);
. . .

  • No labels