blob: 858e936767478476776412a74011cea0edd06aba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/*
* authentication_model.h
* SecondLife
*
* Created by RMS on 7/17/08.
*
*/
#ifndef PL_authentication_model_H
#define PL_authentication_model_H
#include <string>
#include <set>
#include <list>
#include <boost/signal.hpp>
#include <boost/bind.hpp>
#include "lluuid.h"
#include "llmemory.h"
#include "llsd.h"
class AuthenticationModel : public LLSingleton<AuthenticationModel>
{
public:
typedef boost::signal<void ()> event_t;
typedef boost::signals::connection connection_t;
AuthenticationModel();
virtual ~AuthenticationModel();
void loadPersistentData();
void savePersistentData();
void revert();
/* generic update, pull model: */
connection_t subscribeToModelUpdates(event_t::slot_function_type subscriber);
void unsubscribe(connection_t subscriber);
/* setters */
void addAccount(const std::string &grid, const std::string &accountName, const std::string &accountPassword);
void removeAccount(const std::string &grid, const std::string &accountName);
void changePassword(const std::string &grid, const std::string &accountName, const std::string &newPassword);
/* getters */
void getAllAccountNames(std::list<std::string> &names);
void getAccountNames(const std::string &grid, std::set<std::string> &names);
void getPassword(const std::string &grid, const std::string &accountName, std::string &password);
void requestUpdate();
protected:
LLSD mAuthLLSD;
private:
event_t mEventUpdate;
};
#endif // PL_authentication_model_H
|