1 # The software in this package is distributed under the GNU General
2 # Public License version 2 (with a special exception described below).
4 # A copy of GNU General Public License (GPL) is included in this distribution,
5 # in the file COPYING.GPL.
7 # As a special exception, if other files instantiate templates or use macros
8 # or inline functions from this file, or you compile this file and link it
9 # with other works to produce a work based on this file, this file
10 # does not by itself cause the resulting work to be covered
11 # by the GNU General Public License.
13 # However the source code for this file must still be made available
14 # in accordance with section (3) of the GNU General Public License.
16 # This exception does not invalidate any other reasons why a work based
17 # on this file might be covered by the GNU General Public License.
19 # Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
21 from .build_cnfvar import BuildCnfVar
22 """Class to create group objects on the fly"""
25 class BuildGroup(BuildCnfVar):
27 def __init__(self, data='', instance=0, line_no=1):
28 BuildCnfVar.__init__(self, 'GROUP', instance, data, line_no)
30 # the bare defaults the UI adds upon
31 # creation of new groups
36 self.add_defaults(defaults)
38 def comment(self, comment):
39 self.update_cnf('GROUP_COMMENT', 0, comment)
42 def enable_activesync(self):
43 self.update_cnf('GROUP_ACTIVESYNC_ENABLE', 0, '1')
46 def enable_xauth(self):
47 self.update_cnf('GROUP_XAUTH_ENABLE', 0, '1')
50 def enable_go_online(self):
51 self.update_cnf('GROUP_ACCESS_GO_ONLINE_ALLOWED', 0, '1')
54 def enable_remote_administration(self):
55 self.update_cnf('GROUP_ACCESS_REMOTE_ADMINISTRATION_ALLOWED', 0, '1')
58 def email_quota(self, quota):
59 self.update_cnf('GROUP_EMAIL_QUOTA', 0, quota)
62 def email_relay_rights_block_relay(self):
63 self.update_cnf('GROUP_EMAIL_RELAY_RIGHTS', 0, 'BLOCK_RELAY')
66 def email_relay_rights_from_intranet(self):
67 self.update_cnf('GROUP_EMAIL_RELAY_RIGHTS', 0, 'RELAY_FROM_INTRANET')
70 def email_relay_rights_from_everywhere(self):
71 self.update_cnf('GROUP_EMAIL_RELAY_RIGHTS', 0, 'RELAY_FROM_EVERYWHERE')
74 def emailfitler_ban_filterlist_ref(self, filterlist_ref):
75 self.update_cnf('GROUP_EMAILFILTER_BAN_FILTERLIST_REF', 0,
79 def proxy_profile_ref(self, profile_ref):
80 self.update_cnf('GROUP_PROXY_PROFILE_REF', 0, profile_ref)