+++ /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>
-
-"""
-.. note:: DEPRECATED! Please do not extend this or add new uses of this module,
- use :py:mod:`pyi2ncommon.arnied_api` or :py:mod:`pyi2ncommon.cnfvar`
- instead!
-"""
-
-from .build_cnfvar import BuildCnfVar
-"""Class to create user cnfvar objects on the fly"""
-
-
-class BuildUser(BuildCnfVar):
-
- def __init__(self, data='', instance=0, line_no=1):
- BuildCnfVar.__init__(self, 'USER', instance, data, line_no)
-
- # the bare defaults the UI adds upon
- # creation of new groups
- defaults = {
- 'USER_DISABLED': '0',
- 'USER_FULLNAME': '',
- 'USER_GROUPWARE_FOLDER_CALENDAR': 'INBOX/Calendar',
- 'USER_GROUPWARE_FOLDER_CONTACTS': 'INBOX/Contacts',
- 'USER_GROUPWARE_FOLDER_DRAFTS': 'INBOX/Drafts',
- 'USER_GROUPWARE_FOLDER_NOTES': 'INBOX/Notes',
- 'USER_GROUPWARE_FOLDER_OUTBOX': 'INBOX/Sent Items',
- 'USER_GROUPWARE_FOLDER_TASKS': 'INBOX/Tasks',
- 'USER_GROUPWARE_FOLDER_TRASH': 'INBOX/Deleted Items',
- # always a member of the 'Alle' group
- 'USER_GROUP_MEMBER_REF': '2',
- 'USER_LOCALE': '',
- 'USER_PASSWORD': 'test1234',
- 'USER_TRASH_DELETEDAYS': '30',
- 'USER_WEBMAIL_MESSAGES_PER_PAGE': '25',
- 'USER_WEBMAIL_SIGNATURE': '',
- }
-
- self.add_defaults(defaults)
-
- def disabled(self, disabled='1'):
- self.update_cnf('USER_DISABLED', 0, disabled)
- return self
-
- def fullname(self, fullname):
- self.update_cnf('USER_FULLNAME', 0, fullname)
- return self
-
- def password(self, password):
- self.update_cnf('USER_PASSWORD', 0, password)
- return self
-
- def normal_email(self):
- self.update_cnf('USER_EMAIL_FORWARD_ENABLE', 0, 'NONE')
- return self
-
- def forward_email(self, email):
- self.update_cnf('USER_EMAIL_FORWARD_ENABLE', 0, 'FORWARD')
-
- addr = self.update_cnf('USER_EMAIL_FORWARD_ADDRESS', 0, '')
- self.update_cnf('USER_EMAIL_FORWARD_ADDRESS_ADDR', 0, email, addr)
- return self
-
- def copy_email(self, email):
- self.update_cnf('USER_EMAIL_FORWARD_ENABLE', 0, 'COPY')
-
- addr = self.update_cnf('USER_EMAIL_FORWARD_ADDRESS', 0, '')
- self.update_cnf('USER_EMAIL_FORWARD_ADDRESS_ADDR', 0, email, addr)
- return self
-
- def add_group_member_ref(self, group_ref):
- self.add_cnf('USER_GROUP_MEMBER_REF', -1, group_ref)
- return self