]>
jfr.im git - irc/rizon/acid.git/blob - pyva/src/main/python/erepublik/sys_auth.py
1 from pseudoclient
.sys_auth
import AuthManager
3 class ErepublikAuthManager(AuthManager
):
4 def __init__(self
, module
):
5 AuthManager
.__init
__(self
, module
)
7 def onAccept(self
, user
, request
, action
, channel
):
9 if self
.module
.channels
.is_valid(channel
):
10 self
.module
.channels
.set(channel
, 'news', True)
11 self
.module
.msg(user
, 'Enabled news in @b%s@b.' % channel
)
12 elif action
== 'nonews':
13 if self
.module
.channels
.is_valid(channel
):
14 self
.module
.channels
.set(channel
, 'news', False)
15 self
.module
.msg(user
, 'Disabled news in @b%s@b.' % channel
)
16 elif action
== 'chanmass':
17 if self
.module
.channels
.is_valid(channel
):
18 self
.module
.channels
.set(channel
, 'mass', True)
19 self
.module
.msg(user
, 'Enabled mass in @b%s@b.' % channel
)
20 elif action
== 'nochanmass':
21 if self
.module
.channels
.is_valid(channel
):
22 self
.module
.channels
.set(channel
, 'mass', False)
23 self
.module
.msg(user
, 'Disabled mass in @b%s@b.' % channel
)
24 elif action
== 'usermass':
25 # if self.module.users.is_valid(channel):
26 self
.module
.users
.set(channel
, 'mass', True)
27 self
.module
.msg(user
, 'Enabled mass for @b%s@b.' % channel
)
28 elif action
== 'nousermass':
29 # if self.module.users.is_valid(channel):
30 self
.module
.users
.set(channel
, 'mass', False)
31 self
.module
.msg(user
, 'Disabled mass for @b%s@b. To re-enable type @b/msg eRepublik usermass@b' % channel
)