/***************************************************************************
xqluser.h - description
-------------------
begin : Tue Jan 15 2002
copyright : (C) 2002 by Raoul Markus
email : raoul.markus@arcormail.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef XQLUSER_H
#define XQLUSER_H
#include "xqlobject.h"
#include "xqltypes.h"
#include "xqlsqlstmt.h"
#include "crypt.h"
/**holds the XQL-users. Provides functions for the management of XQL users.
*@author Raoul Markus
*/
class xqlUser : public xqlObject {
public:
xqlUser(xqlOdbc * pConnection);
~xqlUser();
/**
returns the classname of this type
*/
char * className() const;
/**
changes the password of the user. The user object has
to be authorized to perform this procedure.
*/
void chPasswd(const char * pPasswd);
/** tries to authorize a user by password.
If the user is authorized, the user object
becomes valid */
void authByPasswd(const char * pPasswd);
/**
sets the username. Attention! it is possible
to change the username for a given user id!.
*/
void setUsername(const char * pName);
void authBySuperUser(const xqlUser * pUser);
/**
get the User id for a given name, returns XQL_NO_USER
if not found.
*/
xqlUserId getIdByName(const char * pName);
/**
returns the authorization status of this user object.
*/
bool isAuthorized();
/**
Loads the user given by Userid as pInstId into the current
user object.
*/
bool loadInstance(const int pInstId);
bool createInstance();
/**
saves the current user, i. e. name and password.
*/
bool saveInstance();
/**
creates a new user using name and password
*/
void createUser(const char * pName, const char * pPasswd);
/**
returns the userid of this User.
*/
xqlUserId getUserId();
//bool deleteInstance();
private:
void setAuthorized(bool pAuthValue);
/** encrypts the passwd using the unix crypt function */
char * xqlPwCrypt(const char *);
char * mName;
char * mPasswd;
bool mIsAuthorized;
};
#endif
| Generated by: markus on hobbes on Fri Mar 29 16:15:24 2002, using kdoc 2.0a53. |