Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_security_user.hpp
1/*
2##############################################################################
3# file: ms_security_user.hpp #
4# 'msparser' toolkit #
5# Encapsulates a mascot user as used in authentication #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2004 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Archive:: /MowseBranches/ms_mascotresfile_1.2/include/ms_mascotresfi $ #
12# $Author: villek@matrixscience.com $ #
13# $Date: 2018-07-30 16:23:53 +0100 $ #
14# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
15# $NoKeywords:: $ #
16##############################################################################
17*/
18
19
20
21#if !defined(ms_security_user_INCLUDED_)
22#define ms_security_user_INCLUDED_
23
24
25// Includes from the standard template library
26#include <string>
27#include <set>
28#include <vector>
29#include <map>
30#include <time.h>
31
32
33namespace matrix_science {
39
48 class MS_MASCOTRESFILE_API ms_user
49 {
50
51 public:
53
57 {
58 USER_SECURITY_DISABLED = 0x0000,
59 USER_NORMAL = 0x0001,
60 USER_INTEGRA = 0x0002,
61 USER_COMPUTER_NAME = 0x0003,
62 USER_IP_ADDRESS = 0x0004,
63 USER_AGENT_STRING = 0x0005,
64 USER_WEBAUTH = 0x0006
65 };
66
68
72 {
73 USERID_SECURITY_DISABLED= 0x0000,
74 USERID_GUEST = 0x0001,
75 USERID_ADMINISTRATOR = 0x0002,
76 USERID_CMDLINE = 0x0003,
77 USERID_DAEMON = 0x0004,
78 USERID_PUBLIC_SEARCHES = 0x0005,
79 USERID_INTEGRA_SYSTEM = 0x0006,
80 USERID_LAST = 0x0007
81 };
82
84 ms_user(const int userID,
85 const std::string userName,
86 const std::string password,
87 const long passwordExpiry,
88 const std::string fullName,
89 const std::string emailAddress,
90 const usertype userType,
91 const bool enabled);
92
94 ms_user();
95
96 // Copying constructor for c++ programs - don't document
97 ms_user(const ms_user &src);
98
99#ifndef SWIG
100 // Assignment operator for c++ programs - don't document
101 ms_user & operator=(const ms_user & right);
102#endif
103 ~ms_user();
104
106 usertype getUserType() const;
107
109 void setUserType(usertype newVal);
110
112 std::string getFullName() const;
113
115 void setFullName(std::string newVal);
116
118 std::string getEncryptedPassword() const;
119
121 void setEncryptedPassword(std::string newVal);
122
124 void setPassword(std::string barePassword);
125
127 bool validatePassword(const std::string pwd, int & errorFlag) const;
128
130 time_t getPasswordExpiry() const;
131
133 void setPasswordExpiry(time_t newVal);
134
136 int getID() const;
137
139 void setID(int newVal);
140
142 std::string getName() const;
143
145 void setName(std::string newVal);
146
148 bool isAccountEnabled() const;
149
151 void setAccountEnabled(bool newVal);
152
154 std::string getEmailAddress() const;
155
157 void setEmailAddress(std::string newVal);
158
160 bool hasPasswordExpired() const;
161
163 bool saveStringParam(const std::string name, const std::string param);
164
165#ifndef SWIG
167 bool getStringParam(const std::string name, std::string & param) const;
168#endif
169
171 std::string getStringParam(const std::string name) const;
172
174 bool clearParam(const std::string name);
175
176#ifndef SWIG
177#ifndef DOXYGEN_SHOULD_SKIP_THIS
178 typedef std::map<std::string, std::string> customParams_t;
179 customParams_t getAllCustomParams() const { return params_; }
180#endif
181#endif
182
183 private:
184 int userID_;
185 std::string userName_;
186 std::string fullName_;
187 std::string encryptedPassword_;
188 time_t passwordExpiry_;
189 std::string emailAddress_;
190 bool accountEnabled_;
191 usertype userType_;
192 customParams_t params_;
193
194 void copyFrom(const ms_user * src);
195 }; // end of security_group
197}
198#endif // !defined(ms_security_user_INCLUDED_)
This class will normally only be used by Mascot Security Administration applications.
Definition: ms_security_user.hpp:49
usertype
Definitions for types of user.
Definition: ms_security_user.hpp:57
systemids
Definitions for predefined users.
Definition: ms_security_user.hpp:72