+++ /dev/null
-# The software in this package is distributed under the GNU General
-# Public License version 2 (with a special exception described below).
-#
-# A copy of GNU General Public License (GPL) is included in this distribution,
-# in the file COPYING.GPL.
-#
-# As a special exception, if other files instantiate templates or use macros
-# or inline functions from this file, or you compile this file and link it
-# with other works to produce a work based on this file, this file
-# does not by itself cause the resulting work to be covered
-# by the GNU General Public License.
-#
-# However the source code for this file must still be made available
-# in accordance with section (3) of the GNU General Public License.
-#
-# This exception does not invalidate any other reasons why a work based
-# on this file might be covered by the GNU General Public License.
-#
-# Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
-
-from .build_cnfvar import BuildCnfVar
-"""Class to create group objects on the fly"""
-
-
-class BuildGroup(BuildCnfVar):
-
- def __init__(self, data='', instance=0, line_no=1):
- BuildCnfVar.__init__(self, 'GROUP', instance, data, line_no)
-
- # the bare defaults the UI adds upon
- # creation of new groups
- defaults = {
- 'GROUP_COMMENT': '',
- }
-
- self.add_defaults(defaults)
-
- def comment(self, comment):
- self.update_cnf('GROUP_COMMENT', 0, comment)
- return self
-
- def enable_activesync(self):
- self.update_cnf('GROUP_ACTIVESYNC_ENABLE', 0, '1')
- return self
-
- def enable_xauth(self):
- self.update_cnf('GROUP_XAUTH_ENABLE', 0, '1')
- return self
-
- def enable_go_online(self):
- self.update_cnf('GROUP_ACCESS_GO_ONLINE_ALLOWED', 0, '1')
- return self
-
- def enable_remote_administration(self):
- self.update_cnf('GROUP_ACCESS_REMOTE_ADMINISTRATION_ALLOWED', 0, '1')
- return self
-
- def email_quota(self, quota):
- self.update_cnf('GROUP_EMAIL_QUOTA', 0, quota)
- return self
-
- def email_relay_rights_block_relay(self):
- self.update_cnf('GROUP_EMAIL_RELAY_RIGHTS', 0, 'BLOCK_RELAY')
- return self
-
- def email_relay_rights_from_intranet(self):
- self.update_cnf('GROUP_EMAIL_RELAY_RIGHTS', 0, 'RELAY_FROM_INTRANET')
- return self
-
- def email_relay_rights_from_everywhere(self):
- self.update_cnf('GROUP_EMAIL_RELAY_RIGHTS', 0, 'RELAY_FROM_EVERYWHERE')
- return self
-
- def emailfilter_ban_filterlist_ref(self, filterlist_ref):
- self.update_cnf('GROUP_EMAILFILTER_BAN_FILTERLIST_REF', 0,
- filterlist_ref)
- return self
-
- def proxy_profile_ref(self, profile_ref):
- self.update_cnf('GROUP_PROXY_PROFILE_REF', 0, profile_ref)
- return self