1
2 """
3
4 @author: Fabio Erculiani <lxnay@sabayonlinux.org>
5 @contact: lxnay@sabayonlinux.org
6 @copyright: Fabio Erculiani
7 @license: GPL-2
8
9 B{Entropy Services Command Interfaces}.
10
11 """
12 from entropy.services.skel import SocketCommands
13
15
16 import entropy.dump as dumpTools
17 import entropy.tools as entropyTools
19
20 SocketCommands.__init__(self, HostInterface, inst_name = "phpbb3-commands")
21
22 self.valid_commands = {
23 'is_user': {
24 'auth': True,
25 'built_in': False,
26 'cb': self.docmd_is_user,
27 'args': ["authenticator"],
28 'as_user': False,
29 'desc': "returns whether the username linked with the session belongs to a simple user",
30 'syntax': "<SESSION_ID> is_user",
31 'from': unicode(self),
32 },
33 'is_developer': {
34 'auth': True,
35 'built_in': False,
36 'cb': self.docmd_is_developer,
37 'args': ["authenticator"],
38 'as_user': False,
39 'desc': "returns whether the username linked with the session belongs to a developer",
40 'syntax': "<SESSION_ID> is_developer",
41 'from': unicode(self),
42 },
43 'is_moderator': {
44 'auth': True,
45 'built_in': False,
46 'cb': self.docmd_is_moderator,
47 'args': ["authenticator"],
48 'as_user': False,
49 'desc': "returns whether the username linked with the session belongs to a moderator",
50 'syntax': "<SESSION_ID> is_moderator",
51 'from': unicode(self),
52 },
53 'is_administrator': {
54 'auth': True,
55 'built_in': False,
56 'cb': self.docmd_is_administrator,
57 'args': ["authenticator"],
58 'as_user': False,
59 'desc': "returns whether the username linked with the session belongs to an administrator",
60 'syntax': "<SESSION_ID> is_administrator",
61 'from': unicode(self),
62 },
63 }
64
66 return authenticator.is_user(),'ok'
67
70
73
76