b2abc909349e46489f88ccecb9d206989598e77b
[NeonServV5.git] / src / DBHelper.h
1 /* DBHelper.h - NeonServ v5.1
2  * Copyright (C) 2011  Philipp Kreil (pk910)
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (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, see <http://www.gnu.org/licenses/>. 
16  */
17 #ifndef _DBHelper_h
18 #define _DBHelper_h
19
20 #include "main.h"
21 struct UserNode;
22 struct ChanNode;
23
24 #define DB_CHANUSER_SUSPENDED 0x01
25 #define DB_CHANUSER_AUTOINVITE 0x02
26 #define DB_CHANUSER_NOAUTOOP 0x04
27
28 void _loadUserSettings(struct UserNode* user);
29 #define loadUserSettings(USER) if((USER->flags & USERFLAG_ISAUTHED) && !(USER->flags & USERFLAG_LOADED_SETTINGS)) _loadUserSettings(USER)
30 int isGodMode(struct UserNode *user);
31 char *getChanDefault(char *channel_setting);
32 int getChannelAccess(struct UserNode *user, struct ChanNode *chan, int override);
33 int checkChannelAccess(struct UserNode *user, struct ChanNode *chan, char *channel_setting, int allow_override, int allow_501);
34 void _loadChannelSettings(struct ChanNode *chan);
35 #define loadChannelSettings(CHAN) if(!(CHAN->flags & CHANFLAG_REQUESTED_CHANINFO)) _loadChannelSettings(CHAN)
36 int isUserProtected(struct ChanNode *chan, struct UserNode *victim, struct UserNode *issuer);
37
38 char *getBanAffectingMask(struct ChanNode *chan, char *mask); //returns bans that match a given mask   eg. *!*@ab*  if you pass  *!*@abcdefg.*
39
40 int renameAccount(char *oldauth, char *newauth);
41 #endif