]>
Commit | Line | Data |
---|---|---|
fb67047b | 1 | /** |
2 | * auth.h | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU General Public License | |
6 | * as published by the Free Software Foundation; either version 2 | |
7 | * of the License, or (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program; if not, write to the Free Software | |
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
17 | * USA. | |
18 | * | |
19 | * $Id$ | |
20 | */ | |
21 | ||
22 | #ifndef __auth_H | |
23 | #define __auth_H "$Id$" | |
24 | ||
25 | #include <string> | |
26 | ||
27 | #include "client.h" | |
f83871e7 | 28 | #include "Network.h" |
fb67047b | 29 | |
30 | namespace gnuworld | |
31 | { | |
32 | ||
33 | /** | |
34 | * A dummy xClient. This is just a skeleton from which developers | |
35 | * may create new services clients. | |
36 | */ | |
37 | class auth : public xClient | |
38 | { | |
39 | ||
40 | public: | |
41 | /** | |
42 | * Constructor receives a configuration file name. | |
43 | */ | |
f83871e7 | 44 | auth( const std::string& configFileName ) ; |
fb67047b | 45 | |
46 | /** | |
47 | * Destructor does normal stuff. | |
48 | */ | |
49 | virtual ~auth() ; | |
50 | ||
51 | /** | |
52 | * This method is called when a network client sends | |
53 | * a private message (PRIVMSG or NOTICE) to this xClient. | |
54 | * The first argument is a pointer to the source client, | |
55 | * and the second argument is the actual message (minus | |
56 | * all of the server command stuff). | |
57 | */ | |
58 | virtual void OnPrivateMessage( iClient*, const std::string&, | |
59 | bool secure = false ) ; | |
60 | ||
61 | /** | |
62 | * This method is called by the server when a server connection | |
63 | * is established. The purpose of this method is to inform | |
64 | * the xServer of the channels this client wishes to burst. | |
65 | */ | |
e2268b47 | 66 | virtual void BurstChannels(); |
fb67047b | 67 | |
68 | protected: | |
69 | ||
e2268b47 | 70 | /** |
71 | * Return true if the given string represents a valid | |
72 | * account. This is rather trivial, and probably not | |
73 | * entirely correct, but hopefully it will avoid some | |
74 | * simple typos and types of abuse. | |
75 | */ | |
76 | bool validAccount( const std::string& ) const ; | |
77 | ||
78 | /** | |
79 | * The maximum account length for the network on which this | |
80 | * client runs. This is used in determining if an account | |
81 | * is valid. | |
82 | */ | |
83 | size_t maxAccountLen ; | |
84 | ||
85 | /** | |
86 | * Whether or not to restrict the service to opers only. | |
87 | */ | |
f83871e7 | 88 | bool operOnly ; |
e2268b47 | 89 | |
90 | /** | |
91 | * Whether or not to require the use of the secure message type. | |
92 | */ | |
93 | bool secureOnly ; | |
94 | ||
fb67047b | 95 | } ; |
96 | ||
97 | } // namespace gnuworld | |
98 | ||
99 | #endif // __auth_H |