Commit bd26d3e2 authored by claes's avatar claes

User functions moved to co_api_user

parent 8ecdf4d8
/**
* Proview $Id: co_api.cpp,v 1.11 2007-02-07 15:46:22 claes Exp $
* Proview $Id: co_api.cpp,v 1.12 2008-06-24 07:01:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -45,75 +45,8 @@ extern "C" {
#include "co_dcli.h"
}
#include "co_user.h"
#include "co_lng.h"
//
// c-api to co_user
//
int user_CheckUser( char *systemgroup, char *user, char *password,
unsigned int *priv)
{
GeUser *gu;
int sts;
char filename[120];
gu = new GeUser();
sts = dcli_get_defaultfilename( user_cFilename, filename, "");
sts = gu->load( filename);
if ( ODD(sts))
sts = gu->get_user( systemgroup, user, password, priv);
delete gu;
return sts;
}
int user_CheckSystemGroup( char *systemgroup)
{
GeUser *gu;
int sts;
unsigned int attributes;
char filename[120];
gu = new GeUser();
sts = dcli_get_defaultfilename( user_cFilename, filename, "");
sts = gu->load( filename);
if ( ODD(sts))
sts = gu->get_system_data( systemgroup, &attributes);
delete gu;
return sts;
}
int user_GetUserPriv( char *systemgroup, char *user, unsigned int *priv)
{
GeUser *gu;
int sts;
char filename[120];
gu = new GeUser();
sts = dcli_get_defaultfilename( user_cFilename, filename, "");
sts = gu->load( filename);
if ( ODD(sts))
sts = gu->get_user_priv( systemgroup, user, priv);
delete gu;
return sts;
}
void user_PrivToString( unsigned int priv, char *str, int size)
{
GeUser::priv_to_string( priv, str, size);
}
void user_RtPrivToString( unsigned int priv, char *str, int size)
{
GeUser::rt_priv_to_string( priv, str, size);
}
void user_DevPrivToString( unsigned int priv, char *str, int size)
{
GeUser::dev_priv_to_string( priv, str, size);
}
//
// c api to co_lng
//
......@@ -217,7 +150,3 @@ int crr_object( void *parent_ctx, char *objectname,
delete navcrr;
return sts;
}
/**
* Proview $Id: co_api.h,v 1.7 2005-09-01 14:57:52 claes Exp $
* Proview $Id: co_api.h,v 1.8 2008-06-24 07:01:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -49,14 +49,6 @@ typedef enum {
} navh_eHelpFile;
#endif
int user_CheckUser( char *systemgroup, char *user, char *password,
unsigned int *priv);
int user_CheckSystemGroup( char *systemgroup);
int user_GetUserPriv( char *systemgroup, char *user, unsigned int *priv);
void user_PrivToString( unsigned int priv, char *str, int size);
void user_RtPrivToString( unsigned int priv, char *str, int size);
void user_DevPrivToString( unsigned int priv, char *str, int size);
void lng_get_uid( char *in, char *out);
char *lng_translate( char *str);
void lng_set( char *str);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment