]> git.stg.codes - stg.git/blob - tests/testusers.h
Merge remote-tracking branch 'origin/master' into ticket
[stg.git] / tests / testusers.h
1 #ifndef __TEST_USERS_H__
2 #define __TEST_USERS_H__
3
4 #include "stg/users.h"
5
6 class TEST_USERS : public USERS {
7     public:
8         TEST_USERS() {}
9
10         int  FindByName(const std::string & /*login*/, USER_PTR * /*user*/)
11         { return -1; }
12         int  FindByName(const std::string & /*login*/, CONST_USER_PTR * /*user*/) const
13         { return -1; }
14
15         bool TariffInUse(const std::string & /*tariffName*/) const
16         { return -1; }
17
18         void AddNotifierUserAdd(NOTIFIER_BASE<USER_PTR> * /*notifier*/) {}
19         void DelNotifierUserAdd(NOTIFIER_BASE<USER_PTR> * /*notifier*/) {}
20
21         void AddNotifierUserDel(NOTIFIER_BASE<USER_PTR> * /*notifier*/) {}
22         void DelNotifierUserDel(NOTIFIER_BASE<USER_PTR> * /*notifier*/) {}
23
24         int  Add(const std::string & /*login*/, const ADMIN * /*admin*/)
25         { return 0; }
26         void Del(const std::string & /*login*/, const ADMIN * /*admin*/) {}
27
28         bool Authorize(const std::string &, uint32_t, uint32_t, const AUTH *)
29         { return false; }
30         bool Unauthorize(const std::string &, const AUTH *, const std::string &)
31         { return false; }
32
33         int  ReadUsers() { return 0; }
34         virtual size_t Count() const { return 0; };
35
36         int  FindByIPIdx(uint32_t /*ip*/, USER_PTR * /*user*/) const
37         { return -1; }
38         bool IsIPInIndex(uint32_t /*ip*/) const { return false; }
39         bool IsIPInUse(uint32_t, const std::string &, CONST_USER_PTR *) const { return false; }
40         bool Exists(const std::string &) const { return false; }
41
42         int  OpenSearch() { return 0; }
43         int  SearchNext(int /*handle*/, USER_PTR * /*u*/) { return -1; }
44         int  CloseSearch(int /*handle*/) { return 0; }
45
46         int  Start() { return 0; }
47         int  Stop() { return 0; }
48
49     private:
50 };
51
52 #endif