1/*
2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef AUTHENTICATION_MANAGER_H
6#define AUTHENTICATION_MANAGER_H
7
8
9#include <OS.h>
10
11
12namespace BPrivate {
13	class KMessage;
14}
15
16
17class AuthenticationManager {
18public:
19								AuthenticationManager();
20								~AuthenticationManager();
21
22			status_t			Init();
23
24private:
25	class FlatStore;
26	class User;
27	class Group;
28	class UserDB;
29	class GroupDB;
30
31	static	status_t			_RequestThreadEntry(void* data);
32			status_t			_RequestThread();
33
34			status_t			_InitPasswdDB();
35			status_t			_InitGroupDB();
36			status_t			_InitShadowPwdDB();
37
38			void				_InvalidatePasswdDBReply();
39			void				_InvalidateGroupDBReply();
40			void				_InvalidateShadowPwdDBReply();
41
42private:
43			port_id				fRequestPort;
44			thread_id			fRequestThread;
45			UserDB*				fUserDB;
46			GroupDB*			fGroupDB;
47			BPrivate::KMessage*	fPasswdDBReply;
48			BPrivate::KMessage*	fGroupDBReply;
49			BPrivate::KMessage*	fShadowPwdDBReply;
50};
51
52
53#endif	// AUTHENTICATION_MANAGER_H
54