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