univention.admin package

Contents

univention.admin package#

UDM basic functionality

class univention.admin.extended_attribute(name: str, objClass: str, ldapMapping: Any, deleteObjClass: bool = False, syntax: str = 'string', hook: Any = None)[source]#

Bases: object

Extended attributes extend UDM and UMC with additional properties defined in LDAP.

class univention.admin.option(*, short_description: str = '', long_description: str = '', default: int = 0, editable: bool = False, disabled: bool = False, objectClasses: Iterable[str] | None = None, is_app_option: bool = False)[source]#

Bases: object

UDM option to make properties conditional.

matches(objectClasses: Container[str]) bool[source]#
univention.admin.pattern_replace(pattern: str, obj: dict | simpleLdap) str[source]#

Replaces patterns like <attribute:command,…>[range] with values of the specified UDM attribute.

class univention.admin.policiesGroup(id: Any, short_description: str | None = None, long_description: str = '', members: Any = [])[source]#

Bases: object

A policies group

class univention.admin.property(short_description: str = '', long_description: str = '', *, syntax: type | Any = None, module_search: None = None, multivalue: bool = False, one_only: bool = False, parent: None = None, options: list[str] = [], license: list[str] = [], required: bool = False, may_change: bool = True, identifies: bool = False, unique: bool = False, default: bool | int | str | list[str] | tuple[Any, list[str]] | tuple[Callable, list[str], Any] | None = None, prevent_umc_default_popup: bool = False, dontsearch: bool = False, show_in_lists: bool = True, cli_enabled: bool = True, editable: bool = True, configObjectPosition: None = None, configAttributeName: None = None, include_in_default_search: bool = False, nonempty_is_default: bool = False, readonly_when_synced: bool = False, size: str | None = None, copyable: bool = False, type_class: type[TypeHint] | None = None, lazy_loading_fn: str | None = None)[source]#

Bases: object

UDM property.

Parameters:
  • short_description – a short descriptive text - shown below the input filed in UMC by default.

  • long_description – a long descriptive text - shown only on demand in UMC.

  • syntax – a syntax class or instance to validate the value.

  • module_search – UNUSED?

  • multivalue – allow only a single value (False) or multiple values (True) .

  • one_only – UNUSED?

  • parent – UNUSED?

  • options – List of options, which enable this property.

  • license – List of license strings, which are required to use this property.

  • requiredTrue for a required property, False for an optional property.

  • may_changeTrue if the property can be changed after the object has been created, False when the property can only be specified when the object is created.

  • identifiesTrue if the property is part of the set of properties, which are required to uniquely identify the object. The properties are used by default to build RDN for a new object.

  • uniqueTrue if the property must be unique for all object instances.

  • default – The default value for the property when a new object is created.

  • prevent_umc_default_popupTrue to prevent a pop-up dialog in UMC when the default value is not set.

  • dontsearchTrue to prevent searches using the property.

  • show_in_listsFalse to prevent it from being shown in the CLI.

  • cli_enabledTrue to be able to set the attribute in the CLI.

  • editableFalse prevents the property from being modified by the user; it still can be modified by code.

  • configObjectPosition – UNUSED?

  • configAttributeName – UNUSED?

  • include_in_default_search – The default search searches this property when set to True.

  • nonempty_is_defaultTrue selects the first non-empty value as the default. False always selects the first default value, even if it is empty.

  • readonly_when_syncedTrue only shows the value as read-only when synchronized from some upstream database.

  • size – The UMC widget size; one of univention.admin.syntax.SIZES.

  • copyable – With True the property is copied when the object is cloned; with False the new object will use the default value.

  • type_class – An optional Typing class which overwrites the syntax class specific type.

  • lazy_loading_fn – An optional function name that implements loading additional expensive properties if requested.

UMLAUTS = {'Ä': 'Ae', 'Ö': 'Oe', 'Ü': 'Ue', 'Þ': 'P', 'ä': 'ae', 'ð': 'o', 'ö': 'oe', 'ü': 'ue', 'þ': 'p'}#
new() list[str] | None[source]#
default(obj: simpleLdap) Any[source]#
safe_default(obj: simpleLdap) Any[source]#
check_default(obj: simpleLdap) None[source]#
matches(options: Iterable[str]) bool[source]#
lazy_load(obj)[source]#
univention.admin.ucr_overwrite_layout(module: Any, ucr_property: str, tab: Tab) bool | None[source]#

Overwrite the advanced setting in the layout

univention.admin.ucr_overwrite_module_layout(module: Any) None[source]#

Overwrite the tab layout through UCR variables.

univention.admin.ucr_overwrite_properties(module: Any, lo: access) None[source]#

Overwrite properties in property_descriptions by UCR variables

Subpackages#

Submodules#

univention.admin.allocators module#

UDM allocators to allocate and lock resources for LDAP object creation.

univention.admin.allocators.requestUserSid(lo: access, position: position, uid_s: str) str[source]#
univention.admin.allocators.requestGroupSid(lo: access, position: position, gid_s: str, generateDomainLocalSid: bool = False) str[source]#
univention.admin.allocators.acquireRange(lo: univention.admin.uldap.access, position: univention.admin.uldap.position, atype: _Types, attr: str, ranges: Sequence[dict[str, int]], scope: _Scopes = 'base') str[source]#
univention.admin.allocators.acquireUnique(lo: access, position: position, type: Literal['uidNumber', 'gidNumber', 'uid', 'gid', 'sid', 'domainSid', 'mailPrimaryAddress', 'mailAlternativeAddress', 'aRecord', 'mac', 'groupName', 'cn-uid-position', 'univentionObjectIdentifier'], value: str, attr: str, scope: Literal['base', 'one', 'sub', 'domain'] = 'base') str[source]#
univention.admin.allocators.request(lo: access, position: position, type: Literal['uidNumber', 'gidNumber'], value: str | None = None) str[source]#
univention.admin.allocators.request(lo: access, position: position, type: Literal['uidNumber', 'gidNumber', 'uid', 'gid', 'sid', 'domainSid', 'mailPrimaryAddress', 'mailAlternativeAddress', 'aRecord', 'mac', 'groupName', 'cn-uid-position', 'univentionObjectIdentifier'], value: str) str
univention.admin.allocators.confirm(lo: access, position: position, type: Literal['uidNumber', 'gidNumber', 'uid', 'gid', 'sid', 'domainSid', 'mailPrimaryAddress', 'mailAlternativeAddress', 'aRecord', 'mac', 'groupName', 'cn-uid-position', 'univentionObjectIdentifier'], value: str, updateLastUsedValue: bool = True) None[source]#
univention.admin.allocators.release(lo: access, position: position, type: Literal['uidNumber', 'gidNumber', 'uid', 'gid', 'sid', 'domainSid', 'mailPrimaryAddress', 'mailAlternativeAddress', 'aRecord', 'mac', 'groupName', 'cn-uid-position', 'univentionObjectIdentifier'], value: str) None[source]#

univention.admin.appcenter module#

class univention.admin.appcenter.AppHost[source]#

Bases: object

app_host_ldap_post_remove()[source]#

univention.admin.blocklist module#

UDM functions to check and create blocklist entries

univention.admin.blocklist.hash_blocklist_value(value: bytes) str[source]#
univention.admin.blocklist.parse_timedelta(timedelta_string: str) relativedelta | None[source]#

Parse time delta.

>>> parse_timedelta("1y10m340d")
relativedelta(years=+1, months=+10, days=+340)
univention.admin.blocklist.get_blocking_udm_properties(udm_obj: simpleLdap) dict[source]#
univention.admin.blocklist.get_blockeduntil(dn: str, lo: access) str[source]#
univention.admin.blocklist.blocklist_enabled(udm_obj: simpleLdap) bool[source]#
univention.admin.blocklist.get_blocklist_values_from_udm_property(udm_property_value: Any, udm_property_name: str) list[Any][source]#
univention.admin.blocklist.create_blocklistentry(udm_obj: simpleLdap) list[source]#
univention.admin.blocklist.check_blocklistentry(udm_obj: simpleLdap) None[source]#
univention.admin.blocklist.cleanup_blocklistentry(blocklist_entries: Iterable, udm_obj: univention.admin.handlers.simpleLdap) None[source]#

univention.admin.certificate module#

UDM pki X.509 DER certificate handling

univention.admin.certificate.pki_option()[source]#
univention.admin.certificate.pki_properties()[source]#
univention.admin.certificate.register_pki_mapping(mapping)[source]#
univention.admin.certificate.pki_tab()[source]#
univention.admin.certificate.register_pki_integration(property_descriptions, mapping, options, layout)[source]#

Register the PKI integration for the given object type.

univention.admin.certificate.load_certificate(user_certificate)[source]#

Import a certificate in DER format

class univention.admin.certificate.PKIIntegration[source]#

Bases: object

pki_open()[source]#
reload_certificate()[source]#

Reload user certificate.

univention.admin.config module#

UDM configuration basics

Deprecated since version UCS: 4.4

class univention.admin.config.config(host: str = '')[source]#

Bases: object

UDM configuration object.

Deprecated since version UCS: 4.4 use None instead

items()[source]#
univention.admin.config.getDefaultContainer(lo: univention.admin.uldap.access, module: ModuleType | str) str | None[source]#

Return any random default container for a UDM module.

Deprecated since version UCS: 4.4

Parameters:
  • lo – A LDAP connection object.

  • module – The name of a UDM module.

Returns:

A distinguished name.

univention.admin.config.getDefaultValue(lo: access, name: str, position: position | None = None) str | None[source]#

Return the default value for a specific property of an UDM module. The default value is stored in a settings/default UDM object or in any of the parent container of the objects position.

Parameters:
Returns:

The default value.

univention.admin.cron module#

UDM functions for creating crontab entries.

univention.admin.cron.month_map(month: str) str | int | None[source]#

Map English month name to 1-based numeric month-in-year.

>>> month_map('*')
'*'
>>> month_map('January')
1
univention.admin.cron.weekday_map(weekday: str) str | int | None[source]#

Map English day-of-week name to numeric value 1-7.

>>> weekday_map('*')
'*'
>>> weekday_map('Monday')
1
univention.admin.cron.month_reverse_map(month: str | int) str | None[source]#

Map 1-based numeric month-in-year to English month name.

See also

month_map()

>>> month_reverse_map('*')
'*'
>>> month_reverse_map(1)
'January'
univention.admin.cron.weekday_reverse_map(weekday: str | int) str | None[source]#

Map numeric day-of-week value 1-7 to English name.

See also

weekday_map()

>>> weekday_reverse_map('*')
'*'
>>> weekday_reverse_map(1)
'Monday'
univention.admin.cron.cron_create(cronlist: Mapping[str, Sequence[str]]) str[source]#

Create a crontab time string.

Parameters:

cronlist – A mapping of strings to lists.

See also

cron_split()

>>> cron_create(dict(minute=[], hour=[], day=[], month=[], weekday=[]))
'* * * * * '
>>> cron_create(dict(minute=['0'], hour=['1'], day=['2'], month=['March'], weekday=['Thursday']))
'0 1 2 3 4 '
>>> cron_create(dict(minute=['all'], hour=['all'], day=['all'], month=['all'], weekday=['all']))
'0,5,10,15,20,25,30,35,40,45,50,55 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 1,2,3,4,5,6,7,8,9,10,11,12 1,2,3,4,5,6,7 '
univention.admin.cron.cron_split(cronlist)[source]#

Split a crontab time string into its parts.

Parameters:

cronlist – a crontab time string ‘minute hour day month weekday’.

See also

cron_create()

>>> cron_split('* * * * * ') == {'minute': ['*'], 'hour': ['*'], 'day': ['*'], 'month': ['*'], 'weekday': ['*']}
True
>>> cron_split('* * * 1 *')['month']
['January']
>>> cron_split('* * * * 1')['weekday']
['Monday']

univention.admin.filter module#

UDM functions to parse, modify and create LDAP style search filters

class univention.admin.filter.conjunction(type: str, expressions: list[conjunction | expression])[source]#

Bases: object

LDAP filter conjunction (&) or disjunction (|).

Create LDAP filter conjunction or disjunction.

>>> c = conjunction('&', ['(objectClass=*)'])
>>> c = conjunction('|', ['(objectClass=*)'])
OPS = frozenset({'!', '&', '|'})#
append_unmapped_filter_string(filter_s: str | None, rewrite_function: Callable[[expression, T | None], None], mapping: T) None[source]#
class univention.admin.filter.expression(variable: str = '', value: str = '', operator: str = '=', escape: bool = False)[source]#

Bases: object

LDAP filter expression.

Create LDAP filter expression.

>>> e = expression('objectClass', '*', escape=False)
>>> e = expression('objectClass', '*', '!=', escape=False)
>>> e = expression('uidNumber', '10', '<') # < <= > >=
OPS = frozenset({'!=', '<', '<=', '=', '=*', '>', '>=', '~='})#
RE_OP = re.compile('([<>]=?|[!~]=|=(?:[*]$)?)')#
escape(string: str, args: Sequence[str]) str[source]#
transform_to_conjunction(con: conjunction) None[source]#
univention.admin.filter.parse(filter_s: conjunction | expression | str, begin: int = 0, end: int = -1) conjunction | expression[source]#

Parse LDAP filter string.

>>> filter_s='(|(&(!(zone=univention.de))(soa=test))(nameserver=bar))'
>>> parse(filter_s)
conjunction('|', [conjunction('&', [conjunction('!', [expression('zone', 'univention.de', '=')]), expression('soa', 'test', '=')]), expression('nameserver', 'bar', '=')])
>>> parse('(!(key>=29))')
conjunction('!', [expression('key', '29', '>=')])
>>> parse('(&(key=va\\\\28!\\\\29ue))')
conjunction('&', [expression('key', 'va\\\\28!\\\\29ue', '=')])
>>> parse('(cn=Babs Jensen)')
expression('cn', 'Babs Jensen', '=')
>>> parse('(!(cn=Tim Howes))')
conjunction('!', [expression('cn', 'Tim Howes', '=')])
>>> parse('(&(objectClass=Person)(|(sn=Jensen)(cn=Babs J*)))')
conjunction('&', [expression('objectClass', 'Person', '='), conjunction('|', [expression('sn', 'Jensen', '='), expression('cn', 'Babs J*', '=')])])
>>> parse('(o=univ*of*mich*)')
expression('o', 'univ*of*mich*', '=')
>>> parse('(seeAlso=)')
expression('seeAlso', '', '=')
>>> parse('(cn:caseExactMatch:=Fred Flintstone)')
expression('cn:caseExactMatch:', 'Fred Flintstone', '=')
>>> parse('(cn:=Betty Rubble)')
expression('cn:', 'Betty Rubble', '=')
>>> parse('(sn:dn:2.4.6.8.10:=Barney Rubble)')
expression('sn:dn:2.4.6.8.10:', 'Barney Rubble', '=')
>>> parse('(o:dn:=Ace Industry)')
expression('o:dn:', 'Ace Industry', '=')
>>> parse('(:1.2.3:=Wilma Flintstone)')
expression(':1.2.3:', 'Wilma Flintstone', '=')
>>> parse('(:DN:2.4.6.8.10:=Dino)')
expression(':DN:2.4.6.8.10:', 'Dino', '=')
>>> parse(r'(o=Parens R Us \28for all your parenthetical needs\29)')
expression('o', 'Parens R Us \\28for all your parenthetical needs\\29', '=')
>>> parse(r'(cn=*\2A*)')
expression('cn', '*\\2A*', '=')
>>> parse(r'(cn=*)')
expression('cn', '', '=*')
>>> parse(r'(filename=C:\5cMyFile)')
expression('filename', 'C:\\5cMyFile', '=')
>>> parse(r'(bin=\00\00\00\04)')
expression('bin', '\\00\\00\\00\\04', '=')
>>> parse(r'(sn=Lu\c4\8di\c4\87)')
expression('sn', 'Lu\\c4\\8di\\c4\\87', '=')
>>> parse(r'(1.3.6.1.4.1.1466.0=\04\02\48\69)')
expression('1.3.6.1.4.1.1466.0', '\\04\\02\\48\\69', '=')
univention.admin.filter.walk(filter_p: conjunction | expression, expression_walk_function: Callable[[expression, T | None], None] | None = None, conjunction_walk_function: Callable[[conjunction, T | None], None] | None = None, arg: T | None = None) None[source]#

Walk LDAP filter expression tree.

Parameters:
  • filter_p – expression tree.

  • expression_walk_function – Callback for expressions.

  • conjunction_walk_function – Callback for conjunctions.

  • arg – Argument to the callback functions.

>>> filter_s = '(|(&(!(zone=univention.de))(soa=test))(nameserver=bar))'
>>> filter_p = parse(filter_s)
>>> def trace(e, a): print((a, str(e)))
>>> walk(filter_p, trace, None, 'e')
('e', '(zone=univention.de)')
('e', '(soa=test)')
('e', '(nameserver=bar)')
>>> walk(filter_p, None, trace, 'c')
('c', '(!(zone=univention.de))')
('c', '(&(!(zone=univention.de))(soa=test))')
('c', '(|(&(!(zone=univention.de))(soa=test))(nameserver=bar))')
univention.admin.filter.replace_fqdn_filter(filter_s: str) str[source]#

Replaces a filter expression for the read-only attribute fqdn. If no such expression can be found the unmodified filter is returned.

>>> replace_fqdn_filter('fqdn=host.domain.tld')
'(&(cn=host)(associatedDomain=domain.tld))'
>>> replace_fqdn_filter('(fqdn=host.domain.tld)')
'(&(cn=host)(associatedDomain=domain.tld))'
>>> replace_fqdn_filter('fqdn=domain')
'(|(cn=domain)(associatedDomain=domain))'
>>> replace_fqdn_filter('(|(fqdn=host.domain.tld)(fqdn=other.domain.tld2))')
'(|(&(cn=host)(associatedDomain=domain.tld))(&(cn=other)(associatedDomain=domain.tld2)))'

univention.admin.guardian_roles module#

UDM guardian roles handling

univention.admin.guardian_roles.member_role_properties()[source]#
univention.admin.guardian_roles.role_properties()[source]#
univention.admin.guardian_roles.register_member_role_mapping(mapping)[source]#
univention.admin.guardian_roles.register_role_mapping(mapping)[source]#
univention.admin.guardian_roles.member_role_layout()[source]#
univention.admin.guardian_roles.role_layout()[source]#
univention.admin.guardian_roles.load_roles(lo: access, groups: list[str]) list[str][source]#
univention.admin.guardian_roles.get_roles_from_ldap(lo: access, dn: str) list[str][source]#
class univention.admin.guardian_roles.GuardianBase[source]#

Bases: object

open_guardian() None[source]#

univention.admin.hook module#

UDM hook definitions for modifying LDAP calls when objects are created, modifier or deleted.

univention.admin.hook.import_hook_files() None[source]#

Load all additional hook files from .../univention/admin/hooks.d/*.py

class univention.admin.hook.simpleHook[source]#

Bases: object

Base class for a UDM hook performing logging.

type = 'simpleHook'#
hook_open(obj: univention.admin.handlers.simpleLdap) None[source]#

This method is called by the default open handler just before the current state of all properties is saved.

Parameters:

obj – The UDM object instance.

hook_ldap_pre_create(obj: univention.admin.handlers.simpleLdap) None[source]#

This method is called before an UDM object is created. It is called after the module validated all properties but before the add-list is created.

Parameters:

obj – The UDM object instance.

hook_ldap_addlist(obj: univention.admin.handlers.simpleLdap, al: AddList = []) AddList[source]#

This method is called before an UDM object is created.

Notice that hook_ldap_modlist() will also be called next.

Parameters:
  • obj – The UDM object instance.

  • al – A list of two-tuples (ldap-attribute-name, list-of-values) which will be used to create the LDAP object.

Returns:

The (modified) add-list.

hook_ldap_post_create(obj: univention.admin.handlers.simpleLdap) None[source]#

This method is called after the object was created in LDAP.

Parameters:

obj – The UDM object instance.

hook_ldap_pre_modify(obj: univention.admin.handlers.simpleLdap) None[source]#

This method is called before an UDM object is modified. It is called after the module validated all properties but before the modification-list is created.

Parameters:

obj – The UDM object instance.

hook_ldap_modlist(obj: univention.admin.handlers.simpleLdap, ml: ModList = []) ModList[source]#

This method is called before an UDM object is created or modified.

Parameters:
  • obj – The UDM object instance.

  • ml – A list of tuples, which are either two-tuples (ldap-attribute-name, list-of-new-values) or three-tuples (ldap-attribute-name, list-of-old-values, list-of-new-values). It will be used to create or modify the LDAP object.

Returns:

The (modified) modification-list.

hook_ldap_post_modify(obj: univention.admin.handlers.simpleLdap) None[source]#

This method is called after the object was modified in LDAP.

Parameters:

obj – The UDM object instance.

hook_ldap_pre_remove(obj: univention.admin.handlers.simpleLdap) None[source]#

This method is called before an UDM object is removed.

Parameters:

obj – The UDM object instance.

hook_ldap_post_remove(obj: univention.admin.handlers.simpleLdap) None[source]#

This method is called after the object was removed from LDAP.

Parameters:

obj – The UDM object instance.

class univention.admin.hook.AttributeHook[source]#

Bases: simpleHook

Convenience Hook that essentially implements a mapping between UDM and LDAP for your extended attributes. Derive from this class, set attribute_name to the name of the UDM attribute and implement map_attribute_value_to_udm() and map_attribute_value_to_ldap().

Warning

Only derive from this class when you are sure every system in your domain has the update installed that introduced this hook. (Nov 2018; UCS 4.3-2) Otherwise you will get errors when you are distributing your new hook via ucs_registerLDAPExtension –udm_hook

udm_attribute_name = None#
ldap_attribute_name = None#
version = 1#
hook_open(obj: univention.admin.handlers.simpleLdap) None[source]#

Open UDM object by loading value from LDAP.

Parameters:

obj – The UDM object instance.

hook_ldap_addlist(obj: univention.admin.handlers.simpleLdap, al: AddList) AddList[source]#

Extend LDAP add list.

Parameters:
  • obj – The UDM object instance.

  • al – The add list to extend.

Returns:

The extended add list.

hook_ldap_modlist(obj: univention.admin.handlers.simpleLdap, ml: ModList) ModList[source]#

Extend LDAP modification list.

Parameters:
  • obj – The UDM object instance.

  • ml – The modification list to extend.

Returns:

The extended modification list.

map_attribute_value_to_ldap(value: Any) list[bytes][source]#

Return value as it shall be saved in LDAP.

Parameters:

value – The UDM value.

Returns:

The LDAP value.

map_attribute_value_to_udm(value: list[bytes]) Any[source]#

Return value as it shall be used in UDM objects.

The mapped value needs to be syntax compliant.

Parameters:

value – The LDAP value.

Returns:

The UDM value.

univention.admin.layout module#

UDM classes to define layouts

class univention.admin.layout.ILayoutElement(label, description='', layout=[])[source]#

Bases: dict

Describes the layout information for a tab or a groupbox.

property label#
property description#
property layout#
replace(old, new, recursive=True)[source]#
remove(field, recursive=True)[source]#
exists(field)[source]#
insert(position, field)[source]#
class univention.admin.layout.Tab(label, description='', advanced=False, layout=[], is_app_tab=False, help_text=None)[source]#

Bases: ILayoutElement

property is_app_tab#
property advanced#
class univention.admin.layout.Group(label, description='', layout=[])[source]#

Bases: ILayoutElement

univention.admin.license module#

UDM wrapper around univention.license that translates error codes to exceptions

univention.admin.license.ldap_filter_not_objectflag(flag_string_list)[source]#
class univention.admin.license.License[source]#

Bases: object

ACCOUNT = 0#
CLIENT = 1#
DESKTOP = 2#
GROUPWARE = 3#
USERS = 0#
SERVERS = 1#
MANAGEDCLIENTS = 2#
CORPORATECLIENTS = 3#
VIRTUALDESKTOPUSERS = 4#
VIRTUALDESKTOPCLIENTS = 5#
SYSACCOUNTS = 5#
select(module, lo=None)[source]#
isValidFor(module)[source]#
modifyOptions(mod)[source]#
checkModules()[source]#
compare(val1, val2)[source]#
set_values(lo, module)[source]#
init_select(lo, module)[source]#
checkObjectCounts(lic, real)[source]#
univention.admin.license.select(module, lo=None)#
univention.admin.license.init_select(lo, module)#
univention.admin.license.is_valid_for(module)#

univention.admin.license_data module#

UDM licence data.

class univention.admin.license_data.Attributes(required_license=None, options={})[source]#

Bases: object

options(license_type)[source]#
valid(license_type)[source]#
univention.admin.license_data.moreGroupware(license)[source]#

univention.admin.localization module#

UDM localization.

usage:

translation = univention.admin.localization.translation()
_ = translation.translate
univention.admin.localization.translation#

alias of Translation

univention.admin.locking module#

LDAP locking methods for UDM.

univention.admin.locking.lockDn(lo, position, type, value, scope)[source]#

Build DN of lock object.

Parameters:
  • loLDAP connection.

  • positionUDM position specifying the LDAP base container.

  • type – A string describing the type of object, e.g. user.

  • value – A unique value for the object, e.g. uid.

  • scope – The scope for the lock, e.g. domain.

Returns:

A LDAP DN.

univention.admin.locking.lock(lo, position, type, value, scope='domain', timeout=300)[source]#

Lock an UDM object.

Parameters:
  • loLDAP connection.

  • positionUDM position specifying the LDAP base container.

  • type – A string describing the type of object, e.g. user.

  • value – A unique value for the object, e.g. uid.

  • scope – The scope for the lock, e.g. domain.

  • timeout – Number of seconds for the lock being valid.

Raises:
Returns:

Number of seconds since the UNIX epoch until which the lock is acquired.

univention.admin.locking.relock(lo, position, type, value, scope='domain', timeout=300)[source]#

Extend a lock of an UDM object.

Parameters:
  • loLDAP connection.

  • positionUDM position specifying the LDAP base container.

  • type – A string describing the type of object, e.g. user.

  • value – A unique value for the object, e.g. uid.

  • scope – The scope for the lock, e.g. domain.

  • timeout – Number of seconds for the lock being valid.

Raises:
Returns:

Number of seconds since the UNIX epoch until which the lock is acquired.

univention.admin.locking.unlock(lo, position, type, value, scope='domain')[source]#

Unlock an UDM object.

Parameters:
  • loLDAP connection.

  • positionUDM position specifying the LDAP base container.

  • type – A string describing the type of object, e.g. user.

  • value – A unique value for the object, e.g. uid.

  • scope – The scope for the lock, e.g. domain.

univention.admin.locking.getLock(lo, position, type, value, scope='domain')[source]#

Check if an UDM object is locked.

Parameters:
  • loLDAP connection.

  • positionUDM position specifying the LDAP base container.

  • type – A string describing the type of object, e.g. user.

  • value – A unique value for the object, e.g. uid.

  • scope – The scope for the lock, e.g. domain.

Returns:

Number of seconds since the UNIX epoch until which the lock is acquired or 0.

univention.admin.log module#

UDM log functionality

univention.admin.mapping module#

Functions to map between UDM properties and LDAP attributes.

univention.admin.mapping.MapToBytes(udm_value: list[str] | tuple[str, ...] | str, encoding: tuple[str, ...] = ()) list[bytes] | bytes[source]#
univention.admin.mapping.UnmapToUnicode(ldap_value: list[bytes] | tuple[bytes, ...] | bytes, encoding: tuple[str, ...] = ()) list[str] | str[source]#
univention.admin.mapping.DaysToSeconds(days: str) str[source]#

Convert number of days to seconds.

Parameters:

day – the number of days.

Returns:

the number of seconds.

>>> DaysToSeconds('1')
'86400'
univention.admin.mapping.SecondsToDays(seconds: str) str[source]#

Convert number of seconds to number of complete days.

Parameters:

seconds – 1-tuple with the number of seconds.

Returns:

the number of complete days.

>>> SecondsToDays(('86401',))
'1'
univention.admin.mapping.StringToLower(string: str) str[source]#

Convert string to lower-case.

Parameters:

string – a string.

Returns:

the lower-cased string.

>>> StringToLower("Aa")
'aa'
univention.admin.mapping.ListUniq(list: list[_E]) list[_E][source]#

Return list of unique items.

Parameters:

list – A list of elements.

Returns:

a list with duplicate elements removed.

>>> ListUniq(['1', '1', '2'])
['1', '2']
univention.admin.mapping.ListToString(value: list[bytes], encoding: tuple[str, ...] = ()) str[source]#

Return first element from list. This is right mapping for single-valued properties, as LDAP always returns lists of values.

Parameters:

list – A list of elements.

Returns:

the first element or the empty string.

>>> ListToString([])
''
>>> ListToString([b'value'])
'value'
univention.admin.mapping.ListToIntToString(list_: list[bytes]) str[source]#

Return first element from list if it is an integer.

Parameters:

list – A list of elements.

Returns:

the first element or the empty string.

>>> ListToIntToString([])
''
>>> ListToIntToString([b'x'])
''
>>> ListToIntToString([b'1'])
'1'
univention.admin.mapping.ListToLowerString(list: list[bytes]) str[source]#

Return first element from list lower-cased.

Parameters:

list – A list of elements.

Returns:

the first element lower-cased or the empty string.

>>> ListToLowerString([])
''
>>> ListToLowerString([b'Value'])
'value'
univention.admin.mapping.ListToLowerList(list: list[str]) list[str][source]#

Return the list with all elements converted to lower-case.

Parameters:

list – A list of elements.

Returns:

a list of the elemets converted to lower case.

>>> ListToLowerList(['A', 'a'])
['a', 'a']
univention.admin.mapping.ListToLowerListUniq(list: list[str]) list[str][source]#

Return the list with all elements converted to lower-case and duplicates removed.

Parameters:

list – A list of elements.

Returns:

a list of the elemets converted to lower case with duplicates removed.

>>> ListToLowerListUniq(['A', 'a'])
['a']
univention.admin.mapping.nothing(a: Any) None[source]#

‘Do nothing’ mapping returning None.

univention.admin.mapping.IgnoreNone(value: str, encoding: tuple[str, ...] = ()) bytes | None[source]#

Return the value if it is not the string None.

Parameters:

value – Some element(s).

Returns:

The element(s) if it is not None.

>>> IgnoreNone('1')
b'1'
>>> IgnoreNone('None')
univention.admin.mapping.unmapUNIX_TimeInterval(seconds: list[bytes] | tuple[bytes] | bytes) list[str][source]#

Map number of seconds to a human understandable time interval.

Parameters:

seconds – number of seconds

Returns:

a 2-tuple (value, unit)

>>> unmapUNIX_TimeInterval(['0'])
['0', 'days']
>>> unmapUNIX_TimeInterval(('1',))
['1', 'seconds']
>>> unmapUNIX_TimeInterval('60')
['1', 'minutes']
>>> unmapUNIX_TimeInterval('3600')
['1', 'hours']
>>> unmapUNIX_TimeInterval('86400')
['1', 'days']
univention.admin.mapping.mapUNIX_TimeInterval(value: list[str] | tuple[str] | tuple[str, str] | str) bytes[source]#

Unmap a human understandable time interval back to number of seconds.

Parameters:

value – a 2-tuple (value, unit)

Returns:

the number of seconds.

>>> mapUNIX_TimeInterval(0)
b'0'
>>> mapUNIX_TimeInterval([1, 'days'])
b'86400'
>>> mapUNIX_TimeInterval((1, 'hours'))
b'3600'
>>> mapUNIX_TimeInterval((1, 'minutes'))
b'60'
univention.admin.mapping.unmapBase64(value: list[bytes] | tuple[bytes, ...] | bytes) list[str] | str[source]#

Convert binary data (as found in LDAP) to Base64 encoded UDM property value(s).

Parameters:

value – some binary data.

Returns:

the base64 encoded data or the empty string on errors.

>>> unmapBase64([b'a'])
'YQ=='
>>> unmapBase64([b'a', b'b'])
['YQ==', 'Yg==']
>>> unmapBase64([None])
''
univention.admin.mapping.mapBase64(value: list[str] | str) list[bytes] | bytes[source]#

Convert Base64 encoded UDM property values to binary data (for storage in LDAP).

Parameters:

value – some base64 encoded value.

Returns:

the decoded binary data.

>>> mapBase64('*')
'*'
>>> mapBase64(['YQ=='])
[b'a']
>>> mapBase64('YQ==')
b'a'
univention.admin.mapping.BooleanListToString(list: list[bytes], encoding: tuple[str, ...] = ()) str[source]#

Convert LDAP boolean to UDM.

Parameters:

list – list of LDAP attribute values.

Returns:

the empty string for False or otherwise the first element.

>>> BooleanListToString([b'0'])
''
>>> BooleanListToString([b'1'])
'1'
univention.admin.mapping.BooleanUnMap(value: str, encoding: tuple[str, ...] = ()) bytes[source]#

Convert UDM boolean to LDAP.

Parameters:

list – One LDAP attribute values.

Returns:

the empty string for False or otherwise the first element.

>>> BooleanUnMap('0')
b''
>>> BooleanUnMap('1')
b'1'
class univention.admin.mapping.dontMap[source]#

Bases: object

‘Do nothing’ mapping.

class univention.admin.mapping.mapping[source]#

Bases: object

Map LDAP attribute names and values to UDM property names and values and back.

register(map_name: str, unmap_name: str, map_value: Callable[[Any], Any] | None = None, unmap_value: Callable[[Any], Any] | None = None, encoding: str = 'UTF-8', encoding_errors: str = 'strict') None[source]#

Register a new mapping.

Parameters:
  • map_nameUDM property name.

  • unmap_nameLDAP attribute name.

  • map_value – function to map UDM property values to LDAP attribute values.

  • unmap_value – function to map LDAP attribute values to UDM property values.

unregister(map_name: str, pop_unmap: bool = True) None[source]#

Remove a mapping UDM to LDAP (and also the reverse).

Parameters:
  • map_nameUDM property name.

  • pop_unmapFalse prevents the removal of the mapping from LDAP to UDM, which the default True also does.

registerUnmapping(unmap_name: str, unmap_value: Callable[[Any], Any], encoding: str = 'UTF-8', encoding_errors: str = 'strict') None[source]#

Register a new unmapping from LDAP to UDM.

Parameters:
  • unmap_nameLDAP attribute name.

  • unmap_value – function to map LDAP attribute values to UDM property values.

mapName(map_name: str) str[source]#

Map UDM property name to LDAP attribute name.

>>> map = mapping()
>>> map.mapName('unknown')
''
>>> map.register('udm', 'ldap')
>>> map.mapName('udm')
'ldap'
unmapName(unmap_name: str) str[source]#

Map LDAP attribute name to UDM property name.

>>> map = mapping()
>>> map.unmapName('unknown')
''
>>> map.register('udm', 'ldap')
>>> map.unmapName('ldap')
'udm'
mapValue(map_name: str, value: Any, encoding_errors=None) bytes[source]#

Map UDM property value to LDAP attribute value.

>>> map = mapping()
>>> map.mapValue('unknown', None)
Traceback (most recent call last):
...
KeyError:
>>> map.register('udm', 'ldap')
>>> map.mapValue('udm', 'value')
b'value'
>>> map.register('udm', 'ldap', lambda udm: udm.lower().encode('utf-8'), None)
>>> map.mapValue('udm', None)
b''
>>> map.mapValue('udm', [0])
b''
>>> map.mapValue('udm', 'UDM')
b'udm'
>>> map.register('sambaLogonHours', 'ldap')
>>> map.mapValue('sambaLogonHours', [0])
[b'0']
mapValueDecoded(map_name: str, value: Any, encoding_errors=None) Any[source]#
unmapValue(unmap_name: str, value: Any) Any[source]#

Map LDAP attribute value to UDM property value.

>>> map = mapping()
>>> map.unmapValue('unknown', None)
Traceback (most recent call last):
...
KeyError:
>>> map.register('udm', 'ldap')
>>> map.unmapValue('ldap', b'value')
'value'
>>> map.register('udm', 'ldap', None, lambda ldap: ldap.decode('utf-8').upper())
>>> map.unmapValue('ldap', b'ldap')
'LDAP'
unmapValues(oldattr: dict[str, Any]) dict[str, Any][source]#

Unmaps LDAP attribute values to UDM property values.

shouldMap(map_name: str) bool[source]#
shouldUnmap(unmap_name: str) bool[source]#
getEncoding(map_name: str) tuple[str, ...][source]#
univention.admin.mapping.mapCmp(mapping: mapping, key: str, old: Any, new: Any) bool[source]#

Compare old and new for equality (mapping back to LDAP value if possible).

>>> map = mapping()
>>> mapCmp(map, 'unknown', 'old', 'new')
False
>>> mapCmp(map, 'unknown', 'same', 'same')
True
>>> map.register('udm', 'ldap')
>>> mapCmp(map, 'udm', 'old', 'new')
False
>>> mapCmp(map, 'udm', 'same', 'same')
True
>>> map.register('udm', 'ldap', lambda udm: udm.lower(), None)
>>> mapCmp(map, 'udm', 'case', 'CASE')
True
univention.admin.mapping.mapDict(mapping: mapping, old: dict[str, Any]) dict[str, Any][source]#

Convert dictionary mapping LDAP_attriute_name to LDAP_value to a (partial) dictionary mapping UDM_property_name to UDM_value.

>>> map = mapping()
>>> map.register('udm', 'ldap', None, lambda ldap: ldap.decode('utf-8').upper())
>>> mapDict(map, {'ldap': b'ldap', 'unknown': None})
{'udm': 'LDAP'}
univention.admin.mapping.mapList(mapping: mapping, old: list[Any] | None) list[Any][source]#

Convert list of LDAP attribute names to list of UDM property names.

>>> map = mapping()
>>> mapList(map, None)
[]
>>> mapList(map, ['unknown'])
['']
>>> map.register('udm', 'ldap', None, None)
>>> mapList(map, ['ldap', 'unknown'])
['udm', '']
univention.admin.mapping.mapDiff(mapping: mapping, diff: Iterable[tuple[str, Any, Any]]) list[tuple[str, Any, Any]][source]#

Convert mod-list of UDM property names/values to mod-list of LDAP attribute names/values.

>>> map = mapping()
>>> mapDiff(map, None)
[]
>>> mapDiff(map, [('unknown', None, None)])
[]
>>> map.register('udm', 'ldap', lambda udm: udm.lower().encode('utf-8'), None)
>>> mapDiff(map, [('udm', 'OLD', 'NEW')])
[('ldap', b'old', b'new')]
>>> mapDiff(map, [('udm', 'case', 'CASE')])
[]
univention.admin.mapping.mapDiffAl(mapping: mapping, diff: Iterable[tuple[str, Any, Any]]) list[tuple[str, Any]][source]#

Convert mod-list of UDM property names/values to add-list of LDAP attribute names/values.

>>> map = mapping()
>>> mapDiffAl(map, None)
[]
>>> mapDiffAl(map, [('unknown', None, None)])
[]
>>> map.register('udm', 'ldap', lambda udm: udm.lower().encode('utf-8'), None)
>>> mapDiffAl(map, [('udm', 'OLD', 'NEW'), ('unknown', None, None)])
[('ldap', b'new')]
univention.admin.mapping.mapRewrite(filter: expression, mapping: mapping) None[source]#

Re-write UDM property name/value in UDM filter expression to LDAP attribute name/value.

>>> from argparse import Namespace
>>> map = mapping()
>>> f = Namespace(variable='unknown', value=None); mapRewrite(f, map); (f.variable, f.value)
('unknown', None)
>>> map.register('udm', 'ldap', lambda udm: udm.lower().encode('utf-8'), None)
>>> f = Namespace(variable='udm', value='UDM'); mapRewrite(f, map); (f.variable, f.value)
('ldap', b'udm')

univention.admin.modules module#

UDM access to handler modules.

class univention.admin.modules.UdmModule(*args, **kwargs)[source]#

Bases: Protocol

module: str = ''#
childs: bool = False#
childmodules: list[str] = []#
operations: list[str] = []#
short_description: str = ''#
object_name: str = ''#
object_name_plural: str = ''#
long_description: str = ''#
options: dict[str, option] = {}#
property_descriptions: dict[str, property] = {}#
default_property_descriptions: dict[str, property] = {}#
policy_apply_to: list[str] = []#
policy_position_dn_prefix: str = ''#
policy_oc: str = ''#
docleanup: bool = False#
layout: list[Tab] = []#
mapping: mapping = None#
initialized: bool = False#
extended_attribute_tabnames: list[str] = []#
extended_udm_attributes: list[extended_attribute] = []#
class object(co: None, lo: univention.admin.uldap.access, position: univention.admin.uldap.position, dn: str = '', superordinate: simpleLdap | None = None, attributes: _Attributes | None = None)[source]#

Bases: object

static identify(dn: str, attr: dict[str, list[Any]]) bool[source]#
static lookup(co: None, lo: access, filter: str = '', base: str = '', superordinate: Any = None, scope: str = 'base+one', unique: bool = False, required: bool = False, timeout: int = -1, sizelimit: int = 0, authz: bool = True) list[Any][source]#
static lookup_filter(filter_s: str | None = None, lo: access | None = None) conjunction[source]#
univention.admin.modules.modules: dict[str, UdmModule] = {'appcenter/app': <module 'univention.admin.handlers.appcenter.app' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/appcenter/app.py'>, 'blocklists/all': <module 'univention.admin.handlers.blocklists.all' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/blocklists/all.py'>, 'blocklists/entry': <module 'univention.admin.handlers.blocklists.entry' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/blocklists/entry.py'>, 'blocklists/list': <module 'univention.admin.handlers.blocklists.list' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/blocklists/list.py'>, 'computers/computer': <module 'univention.admin.handlers.computers.computer' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/computer.py'>, 'computers/domaincontroller_backup': <module 'univention.admin.handlers.computers.domaincontroller_backup' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/domaincontroller_backup.py'>, 'computers/domaincontroller_master': <module 'univention.admin.handlers.computers.domaincontroller_master' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/domaincontroller_master.py'>, 'computers/domaincontroller_slave': <module 'univention.admin.handlers.computers.domaincontroller_slave' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/domaincontroller_slave.py'>, 'computers/ipmanagedclient': <module 'univention.admin.handlers.computers.ipmanagedclient' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/ipmanagedclient.py'>, 'computers/linux': <module 'univention.admin.handlers.computers.linux' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/linux.py'>, 'computers/macos': <module 'univention.admin.handlers.computers.macos' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/macos.py'>, 'computers/memberserver': <module 'univention.admin.handlers.computers.memberserver' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/memberserver.py'>, 'computers/trustaccount': <module 'univention.admin.handlers.computers.trustaccount' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/trustaccount.py'>, 'computers/ubuntu': <module 'univention.admin.handlers.computers.ubuntu' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/ubuntu.py'>, 'computers/windows': <module 'univention.admin.handlers.computers.windows' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/windows.py'>, 'computers/windows_domaincontroller': <module 'univention.admin.handlers.computers.windows_domaincontroller' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/computers/windows_domaincontroller.py'>, 'container/cn': <module 'univention.admin.handlers.container.cn' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/container/cn.py'>, 'container/dc': <module 'univention.admin.handlers.container.dc' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/container/dc.py'>, 'container/msgpo': <module 'univention.admin.handlers.container.msgpo' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/container/msgpo.py'>, 'container/ou': <module 'univention.admin.handlers.container.ou' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/container/ou.py'>, 'dhcp/dhcp': <module 'univention.admin.handlers.dhcp.dhcp' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/dhcp.py'>, 'dhcp/host': <module 'univention.admin.handlers.dhcp.host' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/host.py'>, 'dhcp/pool': <module 'univention.admin.handlers.dhcp.pool' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/pool.py'>, 'dhcp/server': <module 'univention.admin.handlers.dhcp.server' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/server.py'>, 'dhcp/service': <module 'univention.admin.handlers.dhcp.service' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/service.py'>, 'dhcp/shared': <module 'univention.admin.handlers.dhcp.shared' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/shared.py'>, 'dhcp/sharedsubnet': <module 'univention.admin.handlers.dhcp.sharedsubnet' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/sharedsubnet.py'>, 'dhcp/subnet': <module 'univention.admin.handlers.dhcp.subnet' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dhcp/subnet.py'>, 'dns/alias': <module 'univention.admin.handlers.dns.alias' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/alias.py'>, 'dns/dns': <module 'univention.admin.handlers.dns.dns' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/dns.py'>, 'dns/forward_zone': <module 'univention.admin.handlers.dns.forward_zone' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/forward_zone.py'>, 'dns/host_record': <module 'univention.admin.handlers.dns.host_record' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/host_record.py'>, 'dns/ns_record': <module 'univention.admin.handlers.dns.ns_record' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/ns_record.py'>, 'dns/ptr_record': <module 'univention.admin.handlers.dns.ptr_record' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/ptr_record.py'>, 'dns/reverse_zone': <module 'univention.admin.handlers.dns.reverse_zone' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/reverse_zone.py'>, 'dns/srv_record': <module 'univention.admin.handlers.dns.srv_record' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/srv_record.py'>, 'dns/txt_record': <module 'univention.admin.handlers.dns.txt_record' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/dns/txt_record.py'>, 'groups/group': <module 'univention.admin.handlers.groups.group' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/groups/group.py'>, 'kerberos/kdcentry': <module 'univention.admin.handlers.kerberos.kdcentry' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/kerberos/kdcentry.py'>, 'mail/domain': <module 'univention.admin.handlers.mail.domain' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/mail/domain.py'>, 'mail/folder': <module 'univention.admin.handlers.mail.folder' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/mail/folder.py'>, 'mail/lists': <module 'univention.admin.handlers.mail.lists' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/mail/lists.py'>, 'mail/mail': <module 'univention.admin.handlers.mail.mail' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/mail/mail.py'>, 'ms/domainpolicy': <module 'univention.admin.handlers.ms.domainpolicy' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/ms/domainpolicy.py'>, 'nagios/nagios': <module 'univention.admin.handlers.nagios.nagios' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/nagios/nagios.py'>, 'nagios/service': <module 'univention.admin.handlers.nagios.service' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/nagios/service.py'>, 'networks/network': <module 'univention.admin.handlers.networks.network' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/networks/network.py'>, 'policies/admin_container': <module 'univention.admin.handlers.policies.admin_container' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/admin_container.py'>, 'policies/desktop': <module 'univention.admin.handlers.policies.desktop' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/desktop.py'>, 'policies/dhcp_boot': <module 'univention.admin.handlers.policies.dhcp_boot' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_boot.py'>, 'policies/dhcp_dns': <module 'univention.admin.handlers.policies.dhcp_dns' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_dns.py'>, 'policies/dhcp_dnsupdate': <module 'univention.admin.handlers.policies.dhcp_dnsupdate' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_dnsupdate.py'>, 'policies/dhcp_leasetime': <module 'univention.admin.handlers.policies.dhcp_leasetime' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_leasetime.py'>, 'policies/dhcp_netbios': <module 'univention.admin.handlers.policies.dhcp_netbios' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_netbios.py'>, 'policies/dhcp_routing': <module 'univention.admin.handlers.policies.dhcp_routing' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_routing.py'>, 'policies/dhcp_scope': <module 'univention.admin.handlers.policies.dhcp_scope' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_scope.py'>, 'policies/dhcp_statements': <module 'univention.admin.handlers.policies.dhcp_statements' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/dhcp_statements.py'>, 'policies/ldapserver': <module 'univention.admin.handlers.policies.ldapserver' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/ldapserver.py'>, 'policies/maintenance': <module 'univention.admin.handlers.policies.maintenance' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/maintenance.py'>, 'policies/masterpackages': <module 'univention.admin.handlers.policies.masterpackages' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/masterpackages.py'>, 'policies/memberpackages': <module 'univention.admin.handlers.policies.memberpackages' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/memberpackages.py'>, 'policies/nfsmounts': <module 'univention.admin.handlers.policies.nfsmounts' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/nfsmounts.py'>, 'policies/policy': <module 'univention.admin.handlers.policies.policy' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/policy.py'>, 'policies/printserver': <module 'univention.admin.handlers.policies.printserver' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/printserver.py'>, 'policies/pwhistory': <module 'univention.admin.handlers.policies.pwhistory' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/pwhistory.py'>, 'policies/recyclebin': <module 'univention.admin.handlers.policies.recyclebin' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/recyclebin.py'>, 'policies/registry': <module 'univention.admin.handlers.policies.registry' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/registry.py'>, 'policies/release': <module 'univention.admin.handlers.policies.release' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/release.py'>, 'policies/repositoryserver': <module 'univention.admin.handlers.policies.repositoryserver' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/repositoryserver.py'>, 'policies/repositorysync': <module 'univention.admin.handlers.policies.repositorysync' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/repositorysync.py'>, 'policies/share_userquota': <module 'univention.admin.handlers.policies.share_userquota' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/share_userquota.py'>, 'policies/slavepackages': <module 'univention.admin.handlers.policies.slavepackages' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/slavepackages.py'>, 'policies/umc': <module 'univention.admin.handlers.policies.umc' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/policies/umc.py'>, 'recyclebin/removedobject': <module 'univention.admin.handlers.recyclebin.removedobject' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/recyclebin/removedobject.py'>, 'settings/cn': <module 'univention.admin.handlers.settings.cn' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/cn.py'>, 'settings/console_helpdesk': <module 'univention.admin.handlers.settings.console_helpdesk' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/console_helpdesk.py'>, 'settings/data': <module 'univention.admin.handlers.settings.data' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/data.py'>, 'settings/default': <module 'univention.admin.handlers.settings.default' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/default.py'>, 'settings/directory': <module 'univention.admin.handlers.settings.directory' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/directory.py'>, 'settings/extended_attribute': <module 'univention.admin.handlers.settings.extended_attribute' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/extended_attribute.py'>, 'settings/extended_options': <module 'univention.admin.handlers.settings.extended_options' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/extended_options.py'>, 'settings/ldapacl': <module 'univention.admin.handlers.settings.ldapacl' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/ldapacl.py'>, 'settings/ldapschema': <module 'univention.admin.handlers.settings.ldapschema' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/ldapschema.py'>, 'settings/license': <module 'univention.admin.handlers.settings.license' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/license.py'>, 'settings/lock': <module 'univention.admin.handlers.settings.lock' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/lock.py'>, 'settings/msprintconnectionpolicy': <module 'univention.admin.handlers.settings.msprintconnectionpolicy' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/msprintconnectionpolicy.py'>, 'settings/mswmifilter': <module 'univention.admin.handlers.settings.mswmifilter' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/mswmifilter.py'>, 'settings/packages': <module 'univention.admin.handlers.settings.packages' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/packages.py'>, 'settings/printermodel': <module 'univention.admin.handlers.settings.printermodel' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/printermodel.py'>, 'settings/printeruri': <module 'univention.admin.handlers.settings.printeruri' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/printeruri.py'>, 'settings/prohibited_username': <module 'univention.admin.handlers.settings.prohibited_username' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/prohibited_username.py'>, 'settings/sambaconfig': <module 'univention.admin.handlers.settings.sambaconfig' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/sambaconfig.py'>, 'settings/sambadomain': <module 'univention.admin.handlers.settings.sambadomain' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/sambadomain.py'>, 'settings/service': <module 'univention.admin.handlers.settings.service' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/service.py'>, 'settings/settings': <module 'univention.admin.handlers.settings.settings' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/settings.py'>, 'settings/syntax': <module 'univention.admin.handlers.settings.syntax' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/syntax.py'>, 'settings/udm_hook': <module 'univention.admin.handlers.settings.udm_hook' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/udm_hook.py'>, 'settings/udm_module': <module 'univention.admin.handlers.settings.udm_module' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/udm_module.py'>, 'settings/udm_syntax': <module 'univention.admin.handlers.settings.udm_syntax' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/udm_syntax.py'>, 'settings/umc_operationset': <module 'univention.admin.handlers.settings.umc_operationset' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/umc_operationset.py'>, 'settings/usertemplate': <module 'univention.admin.handlers.settings.usertemplate' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/settings/usertemplate.py'>, 'shares/print': <module 'univention.admin.handlers.shares.print' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/shares/print.py'>, 'shares/printer': <module 'univention.admin.handlers.shares.printer' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/shares/printer.py'>, 'shares/printergroup': <module 'univention.admin.handlers.shares.printergroup' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/shares/printergroup.py'>, 'shares/share': <module 'univention.admin.handlers.shares.share' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/shares/share.py'>, 'test/ip_phone': <module 'univention.admin.handlers.test.ip_phone' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/test/ip_phone.py'>, 'users/contact': <module 'univention.admin.handlers.users.contact' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/users/contact.py'>, 'users/federated_account': <module 'univention.admin.handlers.users.federated_account' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/users/federated_account.py'>, 'users/ldap': <module 'univention.admin.handlers.users.ldap' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/users/ldap.py'>, 'users/passwd': <module 'univention.admin.handlers.users.passwd' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/users/passwd.py'>, 'users/self': <module 'univention.admin.handlers.users.self' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/users/self.py'>, 'users/user': <module 'univention.admin.handlers.users.user' from '/builds/univention/dev/docs/ucsapidoc/py/univention/admin/handlers/users/user.py'>}#

Mapping from module name to Python module.

univention.admin.modules.update() None[source]#

Scan file system and update internal list of UDM handler modules.

univention.admin.modules.get(module: UdmModule) UdmModule[source]#
univention.admin.modules.get(module: str) UdmModule | None

Get UDM module.

Parameters:

module – either the name (str) of a module or the module itself.

Returns:

the module or None if no module exists with the requested name.

univention.admin.modules.init(lo: univention.admin.uldap.access, position: univention.admin.uldap.position, module: UdmModule, template_object: simpleLdap | None = None, force_reload: bool = False) None[source]#

Initialize UDM handler module.

Parameters:
  • loLDAP connection.

  • positionUDM position instance.

  • moduleUDM handler module.

  • template_object – Reference to a instance, from which the default values are used.

  • force_reload – With True force Python to reload the module from the file system.

univention.admin.modules.update_extended_options(lo: access, module: UdmModule, position: position) None[source]#

Overwrite options defined via LDAP.

class univention.admin.modules.EA_Layout(**kwargs)[source]#

Bases: dict

Extended attribute layout.

property name: str#
property overwrite: str | None#
property tabName: str#
property groupName: str#
property position: int#
property groupPosition: int#
property advanced: bool#
property is_app_tab: bool#
univention.admin.modules.update_extended_attributes(lo: access, module: UdmModule, position: position) None[source]#

Load extended attribute from LDAP and modify UDM handler.

univention.admin.modules.identify(dn: str, attr: dict[str, list[Any]], module_name: str = '', canonical: int = 0, module_base: str | None = None) list[UdmModule][source]#

Return list of UDM handlers capable of handling the given LDAP object.

Parameters:
  • dnDN of the LDAP object.

  • attrLDAP attributes.

  • module_name – If given only the given module name is used if it is capable to handle the object.

  • canonical – UNUSED!

  • module_base – Optional string the module names must start with.

Returns:

the list of UDM modules.

univention.admin.modules.identifyOne(dn: str, attr: dict[str, list[Any]], type: str = '') UdmModule | None[source]#

Return the UDM handler capable of handling the given LDAP object.

Parameters:
  • dnDN of the LDAP object.

  • atrLDAP attributes.

  • type – If given only the given module name is used if it is capable to handle the object.

Returns:

the UDM modules or None.

univention.admin.modules.recognize(module_name: str, dn: str, attr: dict[str, list[Any]]) bool[source]#
univention.admin.modules.name(module: UdmModule | str) str[source]#

Return name of module.

univention.admin.modules.superordinate_names(module_name: UdmModule | str) list[str][source]#

Return name of superordinate module.

univention.admin.modules.superordinate_name(module_name: UdmModule | str) str | None[source]#

Return name of first superordinate module.

Deprecated since version UCS: 4.2 Use superordinate_names() instead.

univention.admin.modules.superordinate(module: UdmModule) UdmModule[source]#

Return instance of superordinate module.

Deprecated since version UCS: 4.2 Use superordinates() instead.

univention.admin.modules.superordinates(module: UdmModule | str) list[UdmModule | None][source]#

Return instance of superordinate module.

univention.admin.modules.subordinates(module: UdmModule | str) list[UdmModule][source]#

Return list of instances of subordinate modules.

Parameters:

module

???

Returns:

list of UDM handler modules.

univention.admin.modules.find_superordinate(dn: str, co: None, lo: access) UdmModule | None[source]#

For a given DN, search in the LDAP path whether this LDAP object is below an object that is a superordinate or is a superordinate itself.

Parameters:
  • dnDN.

  • coUDM configuation object.

  • loLDAP connection.

Returns:

the superordinate module or None.

univention.admin.modules.layout(module_name: UdmModule | str, object: Any = None) list[Tab][source]#

return layout of properties

univention.admin.modules.options(module_name: UdmModule | str) dict[str, Any][source]#

return options available for module

univention.admin.modules.attributes(module_name: UdmModule | str) list[dict[str, str]][source]#

Return attributes for module.

Parameters:

module_name – the name of the UDM module, e.g. users/user.

univention.admin.modules.short_description(module_name: UdmModule | str) str[source]#

Return short description for module.

Parameters:

module_name – the name of the UDM module, e.g. users/user.

Returns:

The short descriptive text.

univention.admin.modules.policy_short_description(module_name: UdmModule | str) str[source]#

Return short description for policy module primarily used for tab headers.

Parameters:

module_name – the name of the UDM policy module, e.g. policies/pwhistory.

Returns:

The short descriptive text.

univention.admin.modules.long_description(module_name: UdmModule | str) str[source]#

Return long description for module.

Parameters:

module_name – the name of the UDM module, e.g. users/user.

Returns:

The long descriptive text.

univention.admin.modules.childs(module_name: UdmModule | str) bool[source]#

Return whether module may have subordinate modules.

Parameters:

module_name – the name of the UDM module, e.g. users/user.

Returns:

True if the module has children, False otherwise.

univention.admin.modules.virtual(module_name: UdmModule | str) bool[source]#

Return whether the module is virtual (alias for other modules).

Parameters:

module_name – the name of the UDM module, e.g. computers/computer.

Returns:

True if the module is virtual, False otherwise.

univention.admin.modules.lookup(module_name: UdmModule | str, co: None, lo: access, filter: str = '', base: str = '', superordinate: Any = None, scope: str = 'base+one', unique: bool = False, required: bool = False, timeout: int = -1, sizelimit: int = 0, authz: bool = True) list[Any][source]#

Return objects of module that match the given criteria.

Parameters:

module_name – the name of the UDM module, e.g. users/user.

univention.admin.modules.isSuperordinate(module: UdmModule | str) bool[source]#

Check if the module is a UDM superordinate module.

Parameters:

module – A UDM handler class.

Returns:

True if the handler is a superordinate module, False otherwise.

univention.admin.modules.isContainer(module: UdmModule) bool[source]#

Check if the module is a UDM container module.

Parameters:

module – A UDM handler class.

Returns:

True if the handler is a container module, False otherwise.

univention.admin.modules.isPolicy(module: UdmModule) bool[source]#

Check if the module is a UDM policy module.

Parameters:

module – A UDM handler class.

Returns:

True if the handler is a policy module, False otherwise.

univention.admin.modules.defaultPosition(module: UdmModule, superordinate: Any = None) str[source]#

Returns default position for object of module.

Parameters:
  • module – A UDM handler class.

  • superordinate – A optional superordinate UDM object instance.

Returns:

The DN of the container for the object.

univention.admin.modules.supports(module_name: str, operation: str) bool[source]#

Check if module supports operation

Parameters:
  • module_name – the name of the UDM module, e.g. users/user.

  • operation – the name of the operation, e.g. ‘edit’.

Returns:

True if the operation is supported, False otherwise.

univention.admin.modules.objectType(co: None, lo: univention.admin.uldap.access, dn: str, attr: _Attributes | None = None, modules: list[UdmModule] = [], module_base: str | None = None) list[str][source]#
univention.admin.modules.objectShadowType(co: None, lo: univention.admin.uldap.access, dn: str, attr: _Attributes | None = None, modules: list[UdmModule] = []) list[Any][source]#
univention.admin.modules.findObject(co: None, lo: univention.admin.uldap.access, dn: str, type: UdmModule, attr: _Attributes | None = None, module_base: str | None = None) Any | None[source]#
univention.admin.modules.policyOc(module_name: UdmModule | str) str[source]#

Return the LDAP objectClass used to store the policy.

Parameters:

module_name – the name of the UDM policy module, e.g. policies/pwhistory.

Returns:

the objectClass.

univention.admin.modules.policiesGroup(module_name: UdmModule | str) str[source]#

Return the name of the group the UDM policy belongs to.

Parameters:

module_name – the name of the UDM policy module, e.g. policies/pwhistory.

Returns:

the group name.

univention.admin.modules.policies() list[policiesGroup][source]#
univention.admin.modules.policyTypes(module_name: str) list[str][source]#

Returns a list of policy types applying to the given module.

Parameters:

module_name – the name of the UDM module, e.g. users/user.

Returns:

a list of UDM policy modules, e.g. policies/pwhistory.

univention.admin.modules.policyPositionDnPrefix(module_name: UdmModule | str) str[source]#

Return the relative DN for a policy.

Parameters:

module_name – the name of the UDM policy module, e.g. policies/pwhistory.

Returns:

A DN string to append to the LDAP base to get the container for the policy.

univention.admin.modules.defaultContainers(module: simpleLdap) list[str][source]#

Checks for the attribute default_containers that should contain a list of RDNs of default containers.

Parameters:

moduleUDM

Returns:

a list of DNs.

univention.admin.modules.childModules(module_name: UdmModule | str) list[str][source]#

Return child modules if module is a super module.

Parameters:

module_name – the name of the UDM module, e.g. users/user.

Returns:

List of child module names.

univention.admin.nagios module#

UDM methods and defines for Nagios related attributes.

univention.admin.nagios.addPropertiesMappingOptionsAndLayout(new_property, new_mapping, new_options, new_layout)[source]#

Add Nagios properties.

class univention.admin.nagios.Support[source]#

Bases: object

Mixin base class indicating Nagios support for computers/* UDM modules

nagiosGetAssignedServices()[source]#
nagios_open()[source]#
nagios_ldap_modlist(ml)[source]#
nagios_ldap_pre_modify()[source]#
nagios_ldap_pre_create()[source]#
nagiosModifyServiceList()[source]#
nagiosRemoveHostFromServices()[source]#
nagiosRemoveHostFromParent()[source]#
nagios_ldap_post_modify()[source]#
nagios_ldap_post_create()[source]#
nagios_ldap_post_remove()[source]#
nagios_cleanup()[source]#

univention.admin.objects module#

UDM objects.

univention.admin.objects.module(object: simpleLdap) str | None[source]#

Return handler name for UDM object.

Parameters:

objectUDM object instance

Returns:

UDM handler name or None.

univention.admin.objects.get_superordinate(module: UdmModule, co: None, lo: access, dn: str) simpleLdap | None[source]#

Searches for the superordinate object for the given DN.

Parameters:
  • moduleUDM module name

  • coUDM configuation object.

  • loLDAP connection.

  • dnDN.

Returns:

the superoridnate or None if the object does not require a superordinate object or it is not found.

univention.admin.objects.get(module: UdmModule, co: None, lo: access, position: position, dn: str = '', attr: dict[str, list[Any]] | None = None, superordinate: Any | None = None, attributes: Any | None = None, authz: bool = True) simpleLdap | None[source]#

Return object of module while trying to identify objects of superordinate modules as well.

Parameters:
  • moduleUDM handler.

  • coUDM configuation object.

  • loLDAP connection.

  • positionUDM position instance.

univention.admin.objects.get_object(lo: access, dn: str) simpleLdap[source]#

Get a UDM object for the specified LDAP DN by automatically detecting the object type. Returns None if the object doesn’t exists or no UDM handler exists for it.

Parameters:
  • loLDAP connection.

  • dnDN of the object.

univention.admin.objects.open(object: simpleLdap) None[source]#

Initialization of properties not necessary for browsing etc.

Parameters:

objectUDM object.

univention.admin.objects.default(module: UdmModule, co: None, lo: access, position: position) simpleLdap[source]#

Create UDM object and initialize default values.

Parameters:
  • moduleUDM handler.

  • coUDM configuation object.

  • loLDAP connection.

  • positionUDM position instance.

Returns:

An initialized UDM object.

univention.admin.objects.description(object: simpleLdap) str[source]#

Return short description for object.

Parameters:

objectUDM object.

univention.admin.objects.shadow(lo: access, module: UdmModule, object: simpleLdap, position: position) tuple[simpleLdap, UdmModule] | tuple[None, None][source]#

If object is a container, return object and module the container shadows (that is usually the one that is subordinate in the LDAP tree).

Parameters:
  • loLDAP connection.

  • moduleUDM handler.

  • objectUDM object.

  • positionUDM position instance.

Returnd:

2-tuple (module, object) or (None, None)

univention.admin.objects.dn(object: simpleLdap) str | None[source]#

Return the DN of the object.

Parameters:

objectUDM object.

Returns:

the DN or None.

univention.admin.objects.ocToType(oc: str) str | None[source]#

Return the UDM module capabale of handling the given LDAP objectClass.

Parameters:

ocLDAP object class.

Returns:

name of the UDM module.

univention.admin.objects.fixedAttribute(object: simpleLdap, key: str) int[source]#

Check if the named property is a fixed attribute (not overwritten by more specific policies).

Parameters:
  • objectUDM object.

  • keyUDM property name

Returns:

True if the property is fixed, False otherwise.

univention.admin.objects.emptyAttribute(object: simpleLdap, key: str) int[source]#

Check if the named property is an empty attribute (reset to empty by a general policy).

Parameters:
  • objectUDM object.

  • keyUDM property name

Returns:

True if the property is empty, False otherwise.

univention.admin.objects.getPolicyReference(object: simpleLdap, policy_type: str) simplePolicy | None[source]#

Return the policy of the requested type.

Parameters:
  • objectUDM object.

  • policy_type – Name of the UDM policy to lookup.

Returns:

The policy applying to the object or None.

univention.admin.objects.removePolicyReference(object: simpleLdap, policy_type: str) None[source]#

Remove the policy of the requested type.

Parameters:
  • objectUDM object.

  • policy_type – Name of the UDM policy to lookup.

univention.admin.objects.replacePolicyReference(object: simpleLdap, policy_type: str, new_reference: str) None[source]#

Replace the policy of the requested type with a new instance.

Parameters:
  • objectUDM object.

  • policy_type – Name of the UDM policy to lookup.

univention.admin.objects.restorePolicyReference(object: simpleLdap, policy_type: str) None[source]#

Restore the policy of the requested type.

Parameters:
  • objectUDM object.

  • policy_type – Name of the UDM policy to lookup.

univention.admin.objects.wantsCleanup(object: simpleLdap) bool[source]#

Check if the given object wants to perform a cleanup (delete other objects, etc.) before it is deleted itself.

Parameters:

object – parent object.

Returns:

True´ if a cleanup is requested, `False otherwise.

univention.admin.objects.performCleanup(object: simpleLdap) None[source]#

some objects create other objects. remove those if necessary.

Parameters:

object – parent object.

univention.admin.password module#

UDM password encryption methods.

univention.admin.password.crypt(password: str, method_id: str | None = None, salt: str | None = None) str[source]#

Return crypt hash.

Parameters:
  • password – password string.

  • method_id – optional hash type, MD5, SHA256/SHA-256, SHA512/SHA-512.

  • salt – salt for randomize the hashing.

Returns:

the hashed password string.

univention.admin.password.bcrypt_hash(password: str) str[source]#

Return bcrypt hash.

Parameters:

password – password string.

Returns:

the hashed password string.

univention.admin.password.ntlm(password: str) tuple[str, str][source]#

Return tuple with NT and LanMan hash.

Parameters:

password – password string.

Returns:

2-tuple (NT, LanMan)

univention.admin.password.krb5_asn1(principal: str, password: str, krb5_context: heimdal.context | None = None) list[bytes][source]#

Generate Kerberos password hashes.

Parameters:
  • principal – Kerberos principal name.

  • password – password string.

  • krb5_context – optional Kerberos context.

Returns:

list of ASN1 encoded Kerberos hashes.

univention.admin.password.is_locked(password: str) bool[source]#

Check is the password (hash) is locked

Parameters:

password – password hash.

Returns:

True when locked, False otherwise.

>>> is_locked('foo')
False
>>> is_locked('{crypt}$1$foo')
False
>>> is_locked('{crypt}!$1$foo')
True
>>> is_locked('{KINIT}')
False
>>> is_locked('{LANMAN}!')
True
univention.admin.password.unlock_password(password: str) str[source]#

Remove prefix from password used for locking.

Parameters:

password – password hash.

Returns:

the unlocked password hash.

>>> unlock_password('{crypt}!$1$foo')
'{crypt}$1$foo'
>>> unlock_password('{LANMAN}!')
'{LANMAN}'
>>> unlock_password('{SASL}!')
'{SASL}'
>>> unlock_password('{KINIT}!')
'{KINIT}'
>>> unlock_password('{BCRYPT}!')
'{BCRYPT}'
univention.admin.password.lock_password(password: str) str[source]#

Add prefix to password used for locking.

Parameters:

password – password hash.

Returns:

the locked password hash.

>>> lock_password('{crypt}$1$foo')
'{crypt}!$1$foo'
>>> lock_password('{LANMAN}')
'{LANMAN}!'
>>> lock_password('{SASL}')
'{SASL}!'
>>> lock_password('{KINIT}')
'{KINIT}!'
>>> lock_password('{BCRYPT}')
'{BCRYPT}!'
>>> lock_password('foo').startswith('{crypt}!$')
True
univention.admin.password.password_is_auth_saslpassthrough(password: str) bool[source]#

Check if the password hash indicates the use of SASL.

Parameters:

apssword – password hash.

Returns:

True is SASL shall be used, False otherwise.

univention.admin.password.get_password_history(password: str, pwhistory: str, pwhlen: int) str[source]#

Append the given password as hash to the history of password hashes

Parameters:
  • password – the new password.

  • pwhistory – history of previous password hashes.

  • pwhlen – length of the password history.

Returns:

modified password hash history.

>>> get_password_history("a", "b", 0)
'b'
>>> len(get_password_history("a", "", 1).split(' '))
1
>>> len(get_password_history("a", "b", 1).split(' '))
1
>>> len(get_password_history("a", "b", 2).split(' '))
2
univention.admin.password.password_already_used(password: str, pwhistory: str) bool[source]#

Check if the password is already used in the password hash history.

Parameters:
  • password – new password hash.

  • pwhistory – history of previous password hashes.

Returns:

True when already used, False otherwise,

>>> password_already_used('a', '')
False
>>> password_already_used('a', 'b')
False
>>> password_already_used('a', 'b ' + crypt('a'))
True
class univention.admin.password.PasswortHistoryPolicy(pwhistoryPolicy)[source]#

Bases: object

Policy for handling history of password hashes.

univention.admin.policy module#

UDM policy utilities

univention.admin.policy.register_policy_mapping(mapping: mapping) None[source]#
univention.admin.policy.policy_object_tab() Tab[source]#
univention.admin.policy.requiredObjectClassesProperty(**kwargs: Any) tuple[str, property][source]#
univention.admin.policy.prohibitedObjectClassesProperty(**kwargs: Any) tuple[str, property][source]#
univention.admin.policy.fixedAttributesProperty(**kwargs: Any) tuple[str, property][source]#
univention.admin.policy.emptyAttributesProperty(**kwargs: Any) tuple[str, property][source]#
univention.admin.policy.ldapFilterProperty(**kwargs: Any) tuple[str, property][source]#

univention.admin.recyclebin module#

UDM functions to handle deleted objects in recyclebin

class univention.admin.recyclebin.Reference(source_attr, target_module, target_property, lookup_attribute, lookup_value)[source]#

Bases: Reference

Create new instance of Reference(source_attr, target_module, target_property, lookup_attribute, lookup_value)

SAFE_CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$&\'()*+,-./;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'#
classmethod parse(reference: str) Self | None[source]#

Parse a univentionRecycleBinReference value.

Format: source_attr:target_module:target_property:lookup_attribute:lookup_value Example: dn:groups/group:users:uuid:550e8400-e29b-41d4-a716-446655440000 which reads as: The LDAP attribute DN of the to-be-restored object should go into the users UDM property of the groups/group object identified by the LDAP attribute uuid $UUID. Some LDAP attributes have aliases: uuid = univentionObjectIdentifier, dn = 1.1.

Fields are URL-encoded to handle special characters like colons.

Returns dict with keys: source_attr, target_module, target_property, lookup_attribute, lookup_value Returns None if invalid format

resolve(lo: access, verify_exists: bool = True, include_recyclebin: bool = False) dict | None[source]#

Resolve a single reference string to its target DN.

Parameters:
  • lo – LDAP connection

  • verify_exists – Whether to verify the target object exists

  • include_recyclebin – Whether to also search in the recyclebin for deleted objects

Returns:

str target_dn, or None if not found

univention.admin.recyclebin.create_references(lo, object_type: str, original_dn: str | None, oldattr: dict[str, list[bytes]])[source]#

Create univentionRecycleBinReference for a given object.

univention.admin.recyclebin.to_uuid(dn: str, lo: access) tuple[str, str][source]#

Convert list of groups to list of univentionRecycleBinReference.

Tries to store references by UUID for stability. Search order: 1. Active LDAP - get UUID from current object 2. Recyclebin - get UUID from deleted object 3. Fallback - store DN

univention.admin.samba module#

UDM samba related code

class univention.admin.samba.acctFlags(flagstring=None, flags=None, fallbackflags=None)[source]#

Bases: object

Samba Account Flags

decode()[source]#
set(flag)[source]#
unset(flag)[source]#

univention.admin.syntax module#

Example for UDM syntax.

univention.admin.syntax.import_syntax_files() None[source]#

Load all additional syntax files from */univention/admin/syntax.d/*.py.

univention.admin.syntax.update_choices() None[source]#

Update choices which are defined in LDAP

>>> univention.admin.syntax.Country.choices = []
>>> update_choices()
>>> 'DE' in dict(univention.admin.syntax.Country.choices)
True
univention.admin.syntax.is_syntax(syntax_obj: Any, syntax_type: type) bool[source]#

Returns True if the syntax object/class matches the given type.

Parameters:
  • syntax_obj – The instance to check.

  • syntax_type – A syntax class type.

class univention.admin.syntax.ClassProperty(getter)[source]#

Bases: object

A decorator that can be used to define read-only class properties.

univention.admin.syntax.SIZES = ('OneThird', 'Half', 'TwoThirds', 'One', 'FourThirds', 'OneAndAHalf', 'FiveThirds')#

Widget sizes. UDM uses a two-column layout and by default any widget uses one column. Widgets can also be configured to span (partly) both columns.

class univention.admin.syntax.ISyntax[source]#

Bases: object

Base class for all syntax classes.

>>> ISyntax.name
'ISyntax'
>>> ISyntax.type
'ISyntax'
>>> ISyntax.tostring('Hallo')
'Hallo'
size: str | Sequence[str] = 'One'#

Widget size. See SIZES.

type_class: type[univention.admin.types.TypeHint] | None = None#
type_class_multivalue = None#
name = 'ISyntax'#
type = 'ISyntax'#
classmethod tostring(text: Any) str[source]#

Convert from internal representation to textual representation.

Parameters:

text – internal representation.

Returns:

textual representation.

parse_command_line(value)[source]#
classmethod new() str | list[str][source]#

Return the initial value.

classmethod any() str | list[str][source]#

Return the default search filter.

classmethod get_choices(lo, options)[source]#

Get all already sorted choices

classmethod sort_choices(choices)[source]#
widget: str | None = None#

The corresponding widget which is used in UMC

search_widget = 'TextBox'#

The corresponding widget which is used in UMC when searching for values of this property

widget_default_search_pattern: bool | str | None = '*'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod get_widget(prop)[source]#
get_widget_options(udm_property)[source]#
get_widget_choices_options(udm_property)[source]#
classmethod get_object_property_filter(object_property, object_property_value, allow_asterisks=True)[source]#

Get a LDAP filter for a certain property

>>> ISyntax.get_object_property_filter('foo', 'bar')
'foo=bar'
>>> ISyntax.get_object_property_filter('foo', 'bar*')
'(|(foo=bar*)(foo=bar))'
class univention.admin.syntax.simple[source]#

Bases: ISyntax

Base class for single value entries.

>>> simple.parse('A string')
'A string'
>>> simple().parse_command_line('A string')
'A string'
>>> simple.new()
''
>>> simple.any()
'*'
regex: Pattern | None = None#

Regular expression to validate the value.

error_message = 'Invalid value'#

Error message when an invalid item is selected.

type_class#

alias of StringType

widget: str | None = 'TextBox'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = '*'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text: Any) str[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

classmethod checkLdap(lo: access, value: Any, property: str | None = '') Any[source]#

Check the given value against the current LDAP state by reading directly from LDAP directory. The function returns nothing or raises an exception, if the value does not match with predefined constrains.

Parameters:
  • lo – LDAP connection.

  • value – The value to check.

  • property – The property name

Returns:

None on errors.

Raises:

Exception – on errors.

Deprecated since version 5.0-2: Univention internal use only!

class univention.admin.syntax.select[source]#

Bases: ISyntax

Select item from list of choices:

self.choices = [(id, _("Display text"), ...]
empty_value = False#

Allow the empty value.

type_class#

alias of StringType

widget: str | None = 'ComboBox'#

The corresponding widget which is used in UMC

search_widget = 'ComboBox'#

The corresponding widget which is used in UMC when searching for values of this property

depends: str | None = None#

The name of another UDM property this syntax depends on.

javascript_dependency: bool = False#

Whether dependencies should be resolved via Javascript (instead via a further request)

classmethod parse(text: Any) str | None[source]#
classmethod get_choices(lo, options)[source]#

Get the choices w.r.t. dependencies

get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.combobox[source]#

Bases: select

Select item from list of choices but accept all kind of values:

self.choices = [(id, _("Display text"), ...]
widget: str | None = 'SuggestionBox'#

The corresponding widget which is used in UMC

search_widget = 'SuggestionBox'#

The corresponding widget which is used in UMC when searching for values of this property

classmethod parse(text)[source]#
class univention.admin.syntax.MultiSelect[source]#

Bases: ISyntax

Select multiple items from a list of choices.

choices: Sequence[tuple[Any, str]] = []#

The list of choices.

empty_value = True#

Allow the empty value.

error_message = 'Invalid value'#

Error message when an invalid item is selected.

widget: str | None = 'MultiSelect'#

The corresponding widget which is used in UMC

search_widget = 'ComboBox'#

The corresponding widget which is used in UMC when searching for values of this property

classmethod parse(value: Any) list[str][source]#
class univention.admin.syntax.complex[source]#

Bases: ISyntax

Base class for complex syntax classes consisting of multiple sub-items.

delimiter: str = ' '#

Delimiter to separate the sub-items. Two possibilities:

  1. Either a single string like =, which is used to concatenate all subitems.

  2. A sequence of n+1 strings like [‘’, ‘: ‘, ‘=’, ‘’] to concatenate n sub-items. The first and last value is used as a prefix/suffix.

min_elements: int | None = None#

Minimum number of required values.

all_required = True#

All sub-values must contain a value.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = []#
subsyntax_names: tuple[str, ...] = ()#
subsyntax_key_value = False#
classmethod get_widget(prop)[source]#
widget: str | None = 'MultiInput'#

The corresponding widget which is used in UMC

widget_multivalue = 'ComplexInput'#
widget_default_search_pattern: bool | str | None = None#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(texts: Sequence[Any], minn: int | None = None) list[str][source]#
classmethod fromdict(value)[source]#
classmethod todict(value)[source]#
property type_class#
property type_class_multivalue#
classmethod tostring(texts: Any) str[source]#

Convert from internal representation to textual representation.

Parameters:

text – internal representation.

Returns:

textual representation.

classmethod new() str | list[str][source]#

Return the initial value.

classmethod any() str | list[str][source]#

Return the default search filter.

parse_command_line(value)[source]#
class univention.admin.syntax.UDM_Objects[source]#

Bases: ISyntax, _UDMObjectOrAttribute

Base class to lookup selectable items from LDAP entries using their DN.

See UDM_Attribute for an alternative to use values from one LDAP entry..

>>> UDM_Objects().type_class
<class 'univention.admin.types.DistinguishedNameType'>
>>> UDM_Objects.parse("uid=Administrator,cn=users,dc=intranet,dc=example,dc=com")
'uid=Administrator,cn=users,dc=intranet,dc=example,dc=com'
>>> UDM_Objects.parse("")
Traceback (most recent call last):
    ...
valueError:
>>> UDM_Objects.parse("no dn")
Traceback (most recent call last):
    ...
valueError:
udm_modules: Sequence[str] = ()#

Sequence of UDM module names to search for.

udm_filter = ''#

A LDAP filter string to further restrict the matching LDAP objects.

key = 'dn'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

label: str | None = None#

The UDM property name enclosed in %()s, which is used as the displayed value.

regex: Pattern | None = None#

Regular expression for validating the values.

static_values: Sequence[tuple[str, str]] | None = None#

Sequence of additional static items.

empty_value = False#

Allow to select no entry.

depends: str | None = None#

The name of another UDM property this syntax depends on.

error_message = 'Not a valid LDAP DN'#

Error message when an invalid item is selected.

simple = False#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

use_objects = True#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

widget: str | None = 'umc/modules/udm/ComboBox'#

The corresponding widget which is used in UMC

widget_advanced_multivalue = 'umc/modules/udm/MultiObjectSelect'#
classmethod get_widget(prop)[source]#
property type_class#
classmethod parse(text)[source]#
classmethod get_choices(lo, options)[source]#

Get all already sorted choices

get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.UDM_Attribute[source]#

Bases: ISyntax, _UDMObjectOrAttribute

Base class to lookup selectable items from LDAP entries using attribute values.

See UDM_Objects for an alternative to use multiple LDAP entries.

udm_module: str | None = None#

UDM module name to search for.

udm_filter = ''#

A LDAP filter string to further restrict the matching LDAP objects.

attribute: str | None = None#

The UDM property name to use as the value for this syntax class.

is_complex = False#

True for a complex item consisting of multiple sub-items.

key_index = 0#

When the UDM property is complex: The number of the sub-item, which is used as the value for this syntax class.

label_index = 0#

When the UDM property is complex: The number of the sub-item, which is used as the display value.

label_format: str | None = None#

Python format string used to convert the UDM properties to the displayed value.

regex: Pattern | None = None#

Regular expression for validating the values.

static_values: Sequence | None = None#

Sequence of additional static items.

empty_value = False#

Allow to select no entry.

depends: str | None = None#

The name of another UDM property this syntax depends on.

error_message = 'Invalid value'#

Error message when an invalid item is selected.

widget: str | None = 'ComboBox'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#
classmethod get_choices(lo, options)[source]#

Get all already sorted choices

get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.none[source]#

Bases: simple

class univention.admin.syntax.string[source]#

Bases: simple

Syntax for a string with unlimited length.

min_length = 0#
max_length = 0#
type_class#

alias of StringType

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.string64[source]#

Bases: simple

Syntax for a string with up to 64 characters.

>>> string64.parse('a' * 64) == 'a' * 64
True
>>> string64.parse('a' * 65)
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.UUID[source]#

Bases: string

Syntax for a string which represents a UUID1 or UUID4

entryUUID seems to be UUID1 objectGUID seems to be UUID4 UDM creates UUID4 for univentionObjectIdentifier

type_class#

alias of UUID

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.OneThirdString[source]#

Bases: string

Syntax for a string with an input field spanning 1/3 of the width.

size: str | Sequence[str] = 'OneThird'#

Widget size. See SIZES.

class univention.admin.syntax.string6[source]#

Bases: OneThirdString

Syntax for a string with up to 6 characters.

>>> string6.parse('123456')
'123456'
>>> string6.parse('1234567')
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.HalfString[source]#

Bases: string

Syntax for a string with an input field spanning 1/2 of the width.

size: str | Sequence[str] = 'Half'#

Widget size. See SIZES.

class univention.admin.syntax.TwoThirdsString[source]#

Bases: string

Syntax for a string with an input field spanning 2/3 of the width.

size: str | Sequence[str] = 'TwoThirds'#

Widget size. See SIZES.

class univention.admin.syntax.FourThirdsString[source]#

Bases: string

Syntax for a string with an input field spanning 4/3 of the width.

size: str | Sequence[str] = 'FourThirds'#

Widget size. See SIZES.

class univention.admin.syntax.OneAndAHalfString[source]#

Bases: string

Syntax for a string with an input field spanning 3/2 of the width.

size: str | Sequence[str] = 'OneAndAHalf'#

Widget size. See SIZES.

class univention.admin.syntax.FiveThirdsString[source]#

Bases: string

Syntax for a string with an input field spanning 5/3 of the width.

size: str | Sequence[str] = 'FiveThirds'#

Widget size. See SIZES.

class univention.admin.syntax.TwoString[source]#

Bases: string

Syntax for a string with an input field spanning 2/1 of the width.

size: str | Sequence[str] = 'Two'#

Widget size. See SIZES.

class univention.admin.syntax.TextArea[source]#

Bases: string

Syntax for a string with an input allowing multi-line input.

widget: str | None = 'TextArea'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

class univention.admin.syntax.Editor[source]#

Bases: string

widget: str | None = 'Editor'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

class univention.admin.syntax.TwoEditor[source]#

Bases: Editor

size: str | Sequence[str] = 'Two'#

Widget size. See SIZES.

class univention.admin.syntax.UCSVersion[source]#

Bases: string

Syntax for an UCS release version major.minor-patchlevel.

>>> UCSVersion.parse('4.3-2')
'4.3-2'
>>> UCSVersion.parse('4.3-2 errata200')
Traceback (most recent call last):
...
valueError:
>>> UCSVersion.parse('4.3-2.errata200')
Traceback (most recent call last):
...
valueError:
>>> UCSVersion.parse('4')
Traceback (most recent call last):
...
valueError:
classmethod parse(value)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.DebianPackageVersion[source]#

Bases: string

Syntax for a Debian package version.

>>> DebianPackageVersion.parse('9.1.1-2A~4.4.0.202005121353')
'9.1.1-2A~4.4.0.202005121353'
>>> DebianPackageVersion.parse('7.52.1-5+deb9u10')
'7.52.1-5+deb9u10'
>>> DebianPackageVersion.parse('2:7.52.1-5+deb9u10')
'2:7.52.1-5+deb9u10'
>>> DebianPackageVersion.parse('wheezy:7.52.1-5+deb9u10')
Traceback (most recent call last):
...
valueError:
>>> DebianPackageVersion.parse('1.0 with spaces...')
Traceback (most recent call last):
...
valueError:
invalid_chars_regex = re.compile('[^-+:.0-9a-zA-Z~]')#
classmethod parse(value)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.BaseFilename[source]#

Bases: string

Syntax for a file name. Sub- and parent directories are not allowed.

>>> BaseFilename.parse('example.txt')
'example.txt'
>>> BaseFilename.parse('my-folder/example.txt')
Traceback (most recent call last):
...
valueError:
classmethod parse(value)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Upload[source]#

Bases: ISyntax

Syntax to allow uploading a binary file.

>>> Upload.parse("hallo")
'hallo'
type_class#

alias of BinaryType

classmethod parse(value)[source]#
class univention.admin.syntax.Base64GzipText[source]#

Bases: TextArea

Syntax for some gzip-compressed and base64-encoded data.

>>> import base64
>>> import zlib
>>> content = b'txt'
>>> bz2string = zlib.compress(content)
>>> b64string = base64.b64encode(bz2string)
>>> Base64GzipText.parse(b64string) == b64string
True
>>> Base64GzipText.parse(content)
Traceback (most recent call last):
...
valueError: Value must be bzip2 compressed and Base64 encoded:
>>> b64string = base64.b64encode(content)
>>> Base64GzipText.parse('hallo')
Traceback (most recent call last):
...
valueError: Not a valid Base64 string: hallo
type_class#

alias of Base64Type

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Base64Bzip2Text[source]#

Bases: TextArea

Syntax for some bzip2-compressed and base64-encoded data.

>>> import base64
>>> import bz2
>>> content = b'txt'
>>> bz2string = bz2.compress(content)
>>> b64string = base64.b64encode(bz2string)
>>> Base64Bzip2Text.parse(b64string) == b64string
True
>>> Base64Bzip2Text.parse(content)
Traceback (most recent call last):
...
valueError: Value must be bzip2 compressed and Base64 encoded:
>>> b64string = base64.b64encode(content)
>>> Base64Bzip2Text.parse('hallo')
Traceback (most recent call last):
...
valueError: Not a valid Base64 string: hallo
type_class#

alias of Base64Type

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Base64Upload[source]#

Bases: Upload

Syntax to allow uploading a base64 encoded file.

>>> import base64
>>> content = b'...'
>>> b64string = base64.b64encode(content)
>>> Base64Upload.parse(b64string) == b64string
True
>>> Base64Upload.parse('hallo')
Traceback (most recent call last):
...
valueError: Not a valid Base64 string: ...
type_class#

alias of Base64Type

widget: str | None = 'umc/modules/udm/CertificateUploader'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#
class univention.admin.syntax.Base64BaseUpload[source]#

Bases: Base64Upload

Syntax to allow uploading a base64 encoded file.

>>> import base64
>>> content = b'...'
>>> b64string = base64.b64encode(content)
>>> Base64BaseUpload.parse(b64string) == b64string
True
>>> Base64BaseUpload.parse('hallo')
Traceback (most recent call last):
...
valueError: Not a valid Base64 string: ...
widget: str | None = 'ImageUploader'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#
class univention.admin.syntax.jpegPhoto[source]#

Bases: Upload

Syntax to allow uploading a JPEG or PNG photo.

>>> jpegPhoto.tostring(None)
''
>>> import base64
>>> b64string = b'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII='
>>> jpegPhoto.parse(b64string) != b64string  # lets believe the conversion worked
True
>>> jpegPhoto.tostring(b64string) == b64string
True
>>> import bz2
>>> content = b'...'
>>> bz2string = bz2.compress(content)
>>> b64string = base64.b64encode(bz2string)
>>> jpegPhoto.parse(b64string)
Traceback (most recent call last):
...
valueError: Value must be Base64 encoded jpeg.
type_class#

alias of Base64Type

widget: str | None = 'ImageUploader'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod tostring(value: Any) str[source]#

Convert from internal representation to textual representation.

Parameters:

text – internal representation.

Returns:

textual representation.

classmethod parse(text)[source]#
class univention.admin.syntax.Base64Bzip2XML[source]#

Bases: TextArea

Syntax for some bzip2-compressed XML data.

>>> import base64
>>> import bz2
>>> content = b'<?xml?><xml/>'
>>> bz2string = bz2.compress(content)
>>> b64string = base64.b64encode(bz2string)
>>> Base64Bzip2XML.parse(b64string) == b64string
True
>>> Base64Bzip2XML.parse('hallo')
Traceback (most recent call last):
...
valueError: Not a valid Base64 string: hallo
>>> b64string = base64.b64encode(content)
>>> Base64Bzip2XML.parse(b64string)
Traceback (most recent call last):
...
valueError: Value must be bzip2 compressed and Base64 encoded: ...
>>> content = b'...'
>>> bz2string = bz2.compress(content)
>>> b64string = base64.b64encode(bz2string)
>>> Base64Bzip2XML.parse(b64string)
Traceback (most recent call last):
...
valueError: Not Base64 encoded XML data: ...
type_class#

alias of Base64Type

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Base64UMCIcon[source]#

Bases: TextArea

Syntax for a base64 encoded icon (SVG, PNG, JPEG).

>>> b64string = b'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII='
>>> Base64UMCIcon.parse(b64string) == b64string
True
>>> Base64UMCIcon.parse('hallo')
Traceback (most recent call last):
...
valueError: Not a valid Base64 string: hallo
type_class#

alias of Base64Type

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.GNUMessageCatalog[source]#

Bases: TextArea

Syntax for a base64 encoded binary message catalog .mo.

>>> b64string = b'3hIElQAAAAABAAAAHAAAACQAAAADAAAALAAAAAEAAAA4AAAAAQAAADoAAAAAAAAAAAAAAAEAAABfAF8A'
>>> GNUMessageCatalog.parse(b64string) == b64string
True
>>> GNUMessageCatalog.parse('hallo')
Traceback (most recent call last):
...
valueError: Not a valid Base64 string: hallo
>>> GNUMessageCatalog.parse('aGFsbG8K')
Traceback (most recent call last):
...
valueError: Not Base64 encoded GNU message catalog (.mo) data: aGFsbG8K
type_class#

alias of Base64Type

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Localesubdirname[source]#

Bases: string

Syntax for a locale, e.g. language[_COUNTRY][.encoding][@variant].

Must match a directory in /usr/share/locale/.

>>> Localesubdirname.parse('de')
'de'
>>> Localesubdirname.parse('fantasy')
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.UMCMessageCatalogFilename[source]#

Bases: string

Syntax for a message catalog filename for UMC module translations`.

Must have a filename like <language code>-<umcmoduleid>`.

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Localesubdirname_and_GNUMessageCatalog[source]#

Bases: complex

Syntax for a message catalog and its language.

See GNUMessageCatalog and Localesubdirname.

>>> Localesubdirname_and_GNUMessageCatalog.parse(('de', '3hIElQ==')) # first bytes of vim.mo
['de', '3hIElQ==']
>>> Localesubdirname_and_GNUMessageCatalog.parse(('de', 'qwerty'))
Traceback (most recent call last):
...
univention.admin.uexceptions.valueError:
>>> Localesubdirname_and_GNUMessageCatalog().new()
['', '']
>>> Localesubdirname_and_GNUMessageCatalog().any()
['*', '*']
>>> Localesubdirname_and_GNUMessageCatalog().type_class_multivalue.__name__
'ComplexMultiValueKeyValueDictType'
delimiter: str = ': '#

Delimiter to separate the sub-items. Two possibilities:

  1. Either a single string like =, which is used to concatenate all subitems.

  2. A sequence of n+1 strings like [‘’, ‘: ‘, ‘=’, ‘’] to concatenate n sub-items. The first and last value is used as a prefix/suffix.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Locale subdir name', <class 'univention.admin.syntax.Localesubdirname'>), ('GNU message catalog', <class 'univention.admin.syntax.GNUMessageCatalog'>)]#
subsyntax_key_value = True#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.UMCMessageCatalogFilename_and_GNUMessageCatalog[source]#

Bases: complex

Syntax for a message catalog and the corresponding UMCMessageCatalogFilename.

See GNUMessageCatalog and UMCMessageCatalogFilename.

delimiter: str = ': '#

Delimiter to separate the sub-items. Two possibilities:

  1. Either a single string like =, which is used to concatenate all subitems.

  2. A sequence of n+1 strings like [‘’, ‘: ‘, ‘=’, ‘’] to concatenate n sub-items. The first and last value is used as a prefix/suffix.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('UMCMessageCatalogFilename', <class 'univention.admin.syntax.UMCMessageCatalogFilename'>), ('GNU message catalog', <class 'univention.admin.syntax.GNUMessageCatalog'>)]#
subsyntax_key_value = True#
all_required = True#

All sub-values must contain a value.

multivalue = True#
class univention.admin.syntax.integer[source]#

Bases: simple

Syntax for positive numeric values.

>>> integer.parse('1')
'1'
>>> integer.parse('0')
'0'
>>> integer.parse(2)
'2'
>>> integer.parse('-1')
Traceback (most recent call last):
    ...
valueError:
>>> integer.parse('1.1')
Traceback (most recent call last):
    ...
valueError:
>>> integer.parse('text')
Traceback (most recent call last):
    ...
valueError:
>>> integer.parse('')
Traceback (most recent call last):
    ...
valueError:
min_length = 1#
max_length = 0#
size: str | Sequence[str] = 'Half'#

Widget size. See SIZES.

type_class#

alias of IntegerType

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.integerOrEmpty[source]#

Bases: integer

Syntax for positive numeric values or the empty value.

>>> integerOrEmpty.parse(None)
>>> integerOrEmpty.parse("")
>>> integerOrEmpty.parse(0)
'0'
>>> integer.parse("0")
'0'
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.boolean[source]#

Bases: simple

Syntax for a boolean checkbox, which internally stores the state as 0 and 1.

>>> boolean.parse('')
''
>>> boolean.parse('0')
'0'
>>> boolean.parse('1')
'1'
>>> boolean.parse(True)
'1'
>>> boolean.parse(False)
'0'
>>> boolean.sanitize_property_search_value(True)
'1'
>>> boolean.sanitize_property_search_value(False)
'0'
>>> boolean.get_object_property_filter('myAttr', '1')
'myAttr=1'
>>> boolean.get_object_property_filter('myAttr', '0')
'(|(myAttr=0)(!(myAttr=*)))'
>>> boolean.get_object_property_filter('myAttr', '')
''
>>> boolean.parse('2')
Traceback (most recent call last):
    ...
valueError:
>>> boolean.parse('0.1')
Traceback (most recent call last):
    ...
valueError:
>>> boolean.parse('text')
Traceback (most recent call last):
    ...
valueError:
min_length = 1#
max_length = 1#
regex: Pattern | None = re.compile('^[01]?$')#

Regular expression to validate the value.

error_message = 'Value must be 0 or 1'#

Error message when an invalid item is selected.

type_class#

alias of BooleanType

widget: str | None = 'CheckBox'#

The corresponding widget which is used in UMC

search_widget = 'CheckBox'#

The corresponding widget which is used in UMC when searching for values of this property

widget_default_search_pattern: bool | str | None = False#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

classmethod get_object_property_filter(object_property, object_property_value, allow_asterisks=True)[source]#

Get a LDAP filter for a certain property

>>> ISyntax.get_object_property_filter('foo', 'bar')
'foo=bar'
>>> ISyntax.get_object_property_filter('foo', 'bar*')
'(|(foo=bar*)(foo=bar))'
classmethod sanitize_property_search_value(search_value)[source]#
class univention.admin.syntax.AppActivatedBoolean[source]#

Bases: boolean

class univention.admin.syntax.filesize[source]#

Bases: simple

Syntax class for a file size supporting SI suffixes like KB.

>>> filesize.parse('0')
'0'
>>> filesize.parse('1b')
'1b'
>>> filesize.parse('2kB')
'2kB'
>>> filesize.parse('3Mb')
'3Mb'
>>> filesize.parse('4GB')
'4GB'
>>> filesize.parse('5pb')
Traceback (most recent call last):
    ...
valueError:
>>> filesize.parse('-6')
Traceback (most recent call last):
    ...
valueError:
>>> filesize.parse('-7.8')
Traceback (most recent call last):
    ...
valueError:
>>> filesize.parse('text')
Traceback (most recent call last):
    ...
valueError:
min_length = 1#
max_length = 0#
regex: Pattern | None = re.compile('^[0-9]+(|[gGmMkK])(|[bB])$')#

Regular expression to validate the value.

error_message = 'Value must be an integer followed by one of GB,MB,KB,B or nothing (equals B)!'#

Error message when an invalid item is selected.

class univention.admin.syntax.mail_folder_name[source]#

Bases: simple

Syntax for IMAP mail folder names.

>>> mail_folder_name.parse('folder_name')
'folder_name'
>>> mail_folder_name.parse('folder name')
Traceback (most recent call last):
    ...
valueError:
>>> mail_folder_name.parse('folder  name')
Traceback (most recent call last):
    ...
valueError:
>>> mail_folder_name.parse('folder!name')
Traceback (most recent call last):
    ...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.mail_folder_type[source]#

Bases: select

Syntax for IMAP mail folder types.

>>> mail_folder_type().new()
''
>>> mail_folder_type().any()
'*'
>>> mail_folder_type.parse('')
''
>>> mail_folder_type.parse('mail')
'mail'
>>> mail_folder_type.parse('event')
'event'
>>> mail_folder_type.parse('contact')
'contact'
>>> mail_folder_type.parse('task')
'task'
>>> mail_folder_type.parse('note')
'note'
>>> mail_folder_type.parse('journal')
'journal'
>>> mail_folder_type.parse('invalid')
name = 'mail_folder_type'#
choices: Sequence[Any] = [('', 'undefined'), ('mail', 'mails'), ('event', 'events'), ('contact', 'contacts'), ('task', 'tasks'), ('note', 'notes'), ('journal', 'journals')]#
class univention.admin.syntax.string_numbers_letters_dots[source]#

Bases: simple

Syntax for string consisting of only digits, letters and dots.

>>> string_numbers_letters_dots.parse('a')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots.parse('A')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots.parse('0')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots.parse('aA')
'aA'
>>> string_numbers_letters_dots.parse('a.A')
'a.A'
>>> string_numbers_letters_dots.parse('a_A')
'a_A'
>>> string_numbers_letters_dots.parse('a-A')
'a-A'
>>> string_numbers_letters_dots.parse('.')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots.parse('_')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots.parse('-')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots.parse('/')
Traceback (most recent call last):
    ...
valueError:
regex: Pattern | None = re.compile('(?u)(^[a-zA-Z0-9])[a-zA-Z0-9._-]*([a-zA-Z0-9]$)')#

Regular expression to validate the value.

error_message = 'Value must not contain anything other than digits, letters or dots, must be at least 2 characters long, and start and end with a digit or letter!'#

Error message when an invalid item is selected.

class univention.admin.syntax.string_numbers_letters_dots_spaces[source]#

Bases: simple

Syntax for string consisting of only digits, letters, dots and spaces. The later two are not allowed at the beginning and at the end.

>>> string_numbers_letters_dots_spaces.parse('a')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots_spaces.parse('A')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots_spaces.parse('0')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots_spaces.parse('aA')
'aA'
>>> string_numbers_letters_dots_spaces.parse('a.A')
'a.A'
>>> string_numbers_letters_dots_spaces.parse('a_A')
'a_A'
>>> string_numbers_letters_dots_spaces.parse('a-A')
'a-A'
>>> string_numbers_letters_dots_spaces.parse('a A')
'a A'
>>> string_numbers_letters_dots_spaces.parse('.')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots_spaces.parse('_')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots_spaces.parse('-')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots_spaces.parse(' ')
Traceback (most recent call last):
    ...
valueError:
>>> string_numbers_letters_dots_spaces.parse('/')
Traceback (most recent call last):
    ...
valueError:
regex: Pattern | None = re.compile('(?u)(^[a-zA-Z0-9])[a-zA-Z0-9._ -]*([a-zA-Z0-9]$)')#

Regular expression to validate the value.

error_message = 'Value must not contain anything other than digits, letters, dots or spaces, must be at least 2 characters long, and start and end with a digit or letter!'#

Error message when an invalid item is selected.

class univention.admin.syntax.phone[source]#

Bases: simple

Syntax for (international) telephone numbers.

>>> phone.parse('+49 421 22232-0')
'+49 421 22232-0'
>>> phone.parse('++49 (0)700 Vanity')
'++49 (0)700 Vanity'
>>> phone.parse(r'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._ ()\/+-')
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._ ()\\/+-'
>>> phone.parse('^°!$§%&[]{}<>|*~#",.;:')
Traceback (most recent call last):
    ...
valueError:
min_length = 1#
max_length = 16#
regex: Pattern | None = re.compile('(?u)[a-zA-Z0-9._ ()\\\\/+-]*$')#

Regular expression to validate the value.

error_message = 'Value must not contain anything other than digits, letters, dots, brackets, slash, plus, or minus!'#

Error message when an invalid item is selected.

class univention.admin.syntax.IA5string[source]#

Bases: string

Syntax for string from International Alphabet 5 (printable ASCII)

>>> IA5string.parse(r''' !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~''')
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
>>> IA5string.parse(b'abc')
'abc'
>>> IA5string.parse('öäüÖÄÜ߀')
Traceback (most recent call last):
    ...
valueError:
classmethod parse(text: Any) str[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.uid[source]#

Bases: simple

Syntax for user account names.

>>> uid.parse('a')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('A')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('0')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('aA')
'aA'
>>> uid.parse('a.A')
'a.A'
>>> uid.parse('a_A')
'a_A'
>>> uid.parse('a-A')
'a-A'
>>> uid.parse('.')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('_')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('-')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('/')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('admin')
Traceback (most recent call last):
    ...
valueError:
>>> uid.parse('Admin')
'Admin'
min_length = 1#
max_length = 16#
regex: Pattern | None = re.compile('(?u)(^[a-zA-Z0-9])[a-zA-Z0-9._-]*([a-zA-Z0-9]$)')#

Regular expression to validate the value.

error_message = 'Value must not contain anything other than digits, letters, dots, dash or underscore, must be at least 2 characters long, must start and end with a digit or letter, and must not be admin!'#

Error message when an invalid item is selected.

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.uid_umlauts[source]#

Bases: simple

Syntax for user account names supporting umlauts.

>>> uid_umlauts.parse(u'üser') == u'üser'
True
>>> uid_umlauts.parse('user') == 'user'
True
>>> uid_umlauts.parse(b'admin')
'admin'
>>> uid_umlauts.parse('üs er')
Traceback (most recent call last):
...
univention.admin.uexceptions.valueError:
>>> uid_umlauts.parse('ädmin no.2')
Traceback (most recent call last):
...
valueError:
>>> uid_umlauts.parse('admin@2')
Traceback (most recent call last):
...
valueError:
name = 'uid'#
min_length = 1#
max_length = 16#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.uid_umlauts_lower_except_first_letter[source]#

Bases: simple

Syntax for user account names supporting umlauts expecpt for the first character.

>>> uid_umlauts_lower_except_first_letter.parse('admin')
'admin'
>>> uid_umlauts_lower_except_first_letter.parse(b'admin')
'admin'
>>> uid_umlauts_lower_except_first_letter.parse(u'ädmin') == u'ädmin'  # depends on current locale
True
>>> uid_umlauts_lower_except_first_letter.parse('admin@2')
Traceback (most recent call last):
...
valueError:
>>> uid_umlauts_lower_except_first_letter.parse('ADMIN')
Traceback (most recent call last):
...
valueError:
min_length = 1#
max_length = 16#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.gid[source]#

Bases: simple

Syntax for group account names.

>>> gid.parse(u'group')
u'group'
>>> gid.parse(u'Groupe d’accès d’autorisation Windows')  # depends on current locale
u'Groupe d’accès d’autorisation Windows'
min_length = 1#
max_length = 32#
regex: Pattern | None = re.compile('(?u)^\\w([\\w -.’]*\\w)?$')#

Regular expression to validate the value.

error_message = 'A group name must start and end with a letter, number or underscore. In between additionally spaces, dashes and dots are allowed.'#

Error message when an invalid item is selected.

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.sharePath[source]#

Bases: simple

Syntax for file share paths. The path must be absolute and the following paths are not allowed:

  • /dev/

  • /proc/

  • /root/

  • /sys/

  • /tmp/

>>> sharePath.parse('/home/Administator')
'/home/Administator'
>>> sharePath.parse('./my-folder')
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> sharePath.parse('/root/')
Traceback (most recent call last):
...
valueError:
regex: Pattern | None = re.compile('^/[^"]+$')#

Regular expression to validate the value.

error_message = 'Path may not contain double quotes (")!'#

Error message when an invalid item is selected.

classmethod parse(text: str) str[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.passwd[source]#

Bases: simple

Syntax for passwords.

>>> passwd.parse('now this is a clever password')
'now this is a clever password'
>>> passwd.parse('secret')
Traceback (most recent call last):
...
valueError:
min_length = 8#
max_length = 0#
type_class#

alias of PasswordType

widget: str | None = 'PasswordInputBox'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.userPasswd[source]#

Bases: simple

Syntax for user account passwords.

>>> userPasswd.parse('now this is a clever password')
'now this is a clever password'
>>> userPasswd.parse('')
Traceback (most recent call last):
...
valueError:
type_class#

alias of PasswordType

widget: str | None = 'PasswordInputBox'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.hostName[source]#

Bases: simple

hostname based upon RFC 1123:

<let-or-digit>[*[<let-or-digit-or-hyphen>]<let-or-digit>]

also allow _ for Microsoft.

>>> hostName.parse('a')
'a'
>>> hostName.parse('0')
'0'
>>> hostName.parse('')
Traceback (most recent call last):
...
valueError: This is not a valid hostname.
>>> hostName.parse('a' * 64)
Traceback (most recent call last):
...
valueError: This is not a valid hostname.
>>> hostName.parse('!')
Traceback (most recent call last):
...
valueError: This is not a valid hostname.
>>> hostName.parse('-')
Traceback (most recent call last):
...
valueError: This is not a valid hostname.
min_length = 1#
max_length = 63#
regex: Pattern | None = re.compile('^(?![_-])[a-zA-Z0-9_-]{1,63}(?<![_-])$')#

Regular expression to validate the value.

error_message = 'This is not a valid hostname.'#

Error message when an invalid item is selected.

univention.admin.syntax.windowsHostName#

alias of hostName

class univention.admin.syntax.ipv4Address[source]#

Bases: simple

Syntax class for an IPv4 address. 0.0.0.0 is allowed.

>>> ipv4Address.parse('0.0.0.0')
'0.0.0.0'
>>> ipv4Address.parse('hi!')
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.ipAddress[source]#

Bases: simple

Syntax class for an IPv4 or IPv6 address. 0.0.0.0 and IPv4-mapped IPv6 addresses are allowed.

>>> ipAddress.parse('0.0.0.0')
'0.0.0.0'
>>> ipAddress.parse('::1')
'::1'
>>> ipAddress.parse('hi!')
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.hostOrIP[source]#

Bases: simple

Syntax class for an IPv4 or IPv6 address or a host name. 0.0.0.0 and IPv4-mapped IPv6 addresses are allowed.

>>> hostOrIP.parse('1.2.3.4')
'1.2.3.4'
>>> hostOrIP.parse('1:2:3:4:5:6:7:8')
'1:2:3:4:5:6:7:8'
>>> hostOrIP.parse('0x7f000001')
'0x7f000001'
>>> hostOrIP.parse('example')
'example'
>>> hostOrIP.parse('hi!')
Traceback (most recent call last):
...
valueError:
min_length = 0#
max_length = 0#
classmethod ipAddress(text)[source]#
classmethod hostName(text)[source]#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.v4netmask[source]#

Bases: simple

Syntax for a IPv4 network mask. May be entered as a bit mask or the number of bits.

>>> v4netmask.parse('255.255.255.0')
'24'
>>> v4netmask.parse('24')
'24'
>>> v4netmask.parse('0.0.0.0')
'0'
>>> v4netmask.parse('255.255.255.255')
'32'
>>> v4netmask.parse('33')
Traceback (most recent call last):
...
valueError: Not a valid netmask!
min_length = 1#
max_length = 15#
classmethod netmaskBits(dotted)[source]#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.netmask[source]#

Bases: simple

Syntax for a IPv4 or IPv6 network mask. May be entered as a bit mask or the number of bits.

>>> netmask.parse('255.255.255.0')
'24'
>>> netmask.parse('1')
'1'
>>> netmask.parse('127')
'127'
>>> netmask.parse('0')
Traceback (most recent call last):
...
valueError: Not a valid netmask!
>>> netmask.parse('128')
Traceback (most recent call last):
...
valueError: Not a valid netmask!
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.ipnetwork[source]#

Bases: simple

Syntax for a IPv4 or IPv6 network address block.

>>> ipnetwork.parse('1.2.3.4/255.255.255.0')
'1.2.3.0/24'
>>> ipnetwork.parse('1.2.3.4/24')
'1.2.3.0/24'
>>> ipnetwork.parse('1:2:3:4:5:6:7:8/64')
'1:2:3:4/64'
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.IP_AddressRange[source]#

Bases: complex

Syntax for an IPv4 or IPv6 address range.

>>> IP_AddressRange.parse(('1.2.3.4', ''))
['1.2.3.4']
>>> IP_AddressRange.parse(('1.2.3.4', '5.6.7.8'))
['1.2.3.4', '5.6.7.8']
>>> IP_AddressRange.parse(('::1', '::2'))
['::1', '::2']
>>> IP_AddressRange.parse(('5.6.7.8', '1.2.3.4'))
Traceback (most recent call last):
...
valueInvalidSyntax: Illegal range
>>> IP_AddressRange.parse(('::2', '::1'))
Traceback (most recent call last):
...
valueInvalidSyntax: Illegal range
>>> IP_AddressRange.parse(('1.2.3.4', '::1'))
Traceback (most recent call last):
...
valueError: Not a valid IP address!
>>> IP_AddressRange().type_class.__name__
'ComplexMultiValueDictType'
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('First address', <class 'univention.admin.syntax.ipAddress'>), ('Last address', <class 'univention.admin.syntax.ipAddress'>))#
subsyntax_names: tuple[str, ...] = ('first', 'last')#
classmethod parse(texts)[source]#
class univention.admin.syntax.IPv4_AddressRange[source]#

Bases: IP_AddressRange

Syntax for an IPv4 address range.

>>> IPv4_AddressRange.todict(('1.2.3.4',)) == {'first': '1.2.3.4', 'last': None}
True
>>> IPv4_AddressRange.todict(('1.2.3.4', '5.6.7.8')) == {'first': '1.2.3.4', 'last': '5.6.7.8'}
True
>>> IPv4_AddressRange.fromdict({'first': '1.2.3.4', 'last': '5.6.7.8'})
['1.2.3.4', '5.6.7.8']
>>> IPv4_AddressRange.fromdict({'first': '1.2.3.4'})
Traceback (most recent call last):
...
valueInvalidSyntax: missing argument 'last'
>>> IPv4_AddressRange.tostring(['1.2.3.4'])
'1.2.3.4'
>>> IPv4_AddressRange.tostring(['1.2.3.4', '5.6.7.8'])
'1.2.3.4 5.6.7.8'
>>> IPv4_AddressRange.parse(('1.2.3.4',))
['1.2.3.4']
>>> IPv4_AddressRange.parse(('1.2.3.4', '5.6.7.8'))
['1.2.3.4', '5.6.7.8']
>>> IPv4_AddressRange.parse(('5.6.7.8', '1.2.3.4'))
Traceback (most recent call last):
...
valueInvalidSyntax: Illegal range
min_elements: int | None = 1#

Minimum number of required values.

all_required = False#

All sub-values must contain a value.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('First address', <class 'univention.admin.syntax.ipv4Address'>), ('Last address', <class 'univention.admin.syntax.ipv4Address'>))#
subsyntax_names: tuple[str, ...] = ('first', 'last')#
class univention.admin.syntax.ipProtocol[source]#

Bases: select

Syntax class to choose between TCP und UDP.

choices: Sequence[Any] = [('tcp', 'TCP'), ('udp', 'UDP')]#
class univention.admin.syntax.ipProtocolSRV[source]#

Bases: select

Syntax for DNS service record.

choices: Sequence[Any] = [('tcp', 'TCP'), ('udp', 'UDP'), ('msdcs', 'MSDCS'), ('sites', 'SITES'), ('DomainDnsZones', 'DOMAINDNSZONES'), ('ForestDnsZones', 'FORESTDNSZONES')]#
size: str | Sequence[str] = 'OneThird'#

Widget size. See SIZES.

class univention.admin.syntax.absolutePath[source]#

Bases: simple

Syntax for an absolute file system path.

>>> absolutePath.parse('/etc/')
'/etc/'
>>> absolutePath.parse('../etc/')
Traceback (most recent call last):
...
valueError:
min_length = 1#
max_length = 0#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.emailForwardSetting[source]#

Bases: select

Syntax for selecting the e-mail forwarding setting.

choices: Sequence[Any] = [('0', 'Redirect all e-mails to forward addresses'), ('1', 'Keep e-mails and forward a copy')]#
class univention.admin.syntax.emailAddress[source]#

Bases: simple

Syntax class for an e-mail address.

>>> emailAddress.parse('quite@an.email.address')
'quite@an.email.address'
>>> emailAddress.parse('simple@example.com')
'simple@example.com'
>>> emailAddress.parse('very.common@example.com')
'very.common@example.com'
>>> emailAddress.parse('disposable.style.email.with+symbol@example.com')
'disposable.style.email.with+symbol@example.com'
>>> emailAddress.parse('other.email-with-hyphen@example.com')
'other.email-with-hyphen@example.com'
>>> emailAddress.parse('fully-qualified-domain@example.com')
'fully-qualified-domain@example.com'
>>> emailAddress.parse('user.name+tag+sorting@example.com')
'user.name+tag+sorting@example.com'
>>> emailAddress.parse('x@example.com')
'x@example.com'
>>> emailAddress.parse('example-indeed@strange-example.com')
'example-indeed@strange-example.com'
>>> emailAddress.parse('test/test@test.com')
'test/test@test.com'
>>> emailAddress.parse('admin@mailserver1')
'admin@mailserver1'
>>> emailAddress.parse('example@s.example')
'example@s.example'
>>> emailAddress.parse('mailhost!username@example.org')
'mailhost!username@example.org'
>>> emailAddress.parse('user%example.com@example.org')
'user%example.com@example.org'
>>> emailAddress.parse('user-@example.org')
'user-@example.org'
>>> emailAddress.parse('not quite an email address')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('Abc.example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('this is"not\\allowed@example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('this\\ still\\"not\\\\allowed@example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('A@b@c@example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('a"b(c)d,e:f;g<h>i[j\\k]l@example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('just"not"right@example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('1234567890123456789012345678901234567890123456789012345678901234+x@example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('i_like_underscore@but_its_not_allowed_in_this_part.example.com')
Traceback (most recent call last):
...
valueError:
>>> emailAddress.parse('QA[icon]CHOCOLATE[icon]@test.com')
Traceback (most recent call last):
...
valueError:
min_length = 3#
max_length = 0#
extra_validation = True#
type_class#

alias of EMailAddressType

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.emailAddressThatMayEndWithADot[source]#

Bases: emailAddress

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.emailAddressTemplate[source]#

Bases: emailAddress

Syntax class for an e-mail address in the UDM univention.admin.handlers.settings.usertemplate module.

extra_validation = False#
class univention.admin.syntax.emailAddressValidDomain[source]#

Bases: UDM_Objects, emailAddress

Syntax class for an e-mail address in one of the registered e-mail domains.

>>> from univention.admin.uldap import getMachineConnection
>>> if os.path.exists('/etc/machine.secret'):
...     lo, pos = getMachineConnection()
...     emailAddressValidDomain.checkLdap(lo, 'user@example.com')
... else:
...     raise univention.admin.uexceptions.valueError()
Traceback (most recent call last):
...
valueError:
name = 'emailAddressValidDomain'#
errMsgDomain = 'The domain part of the following mail addresses is not in list of configured mail domains: %s'#
type_class#

alias of EMailAddressType

udm_modules: Sequence[str] = ('mail/domain',)#

Sequence of UDM module names to search for.

key = '%(name)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

label: str | None = '%(name)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

empty_value = False#

Allow to select no entry.

regex: Pattern | None = re.compile('[^ ]+@[^ ]+')#

Regular expression for validating the values.

error_message = 'Not a valid email address!'#

Error message when an invalid item is selected.

widget_default_search_pattern: bool | str | None = '*@*'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

search_widget = 'MailBox'#

The corresponding widget which is used in UMC when searching for values of this property

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

classmethod get_widget(prop)[source]#
classmethod checkLdap(lo, mailaddresses, property='mailPrimaryAddress')[source]#

Check the given value against the current LDAP state by reading directly from LDAP directory. The function returns nothing or raises an exception, if the value does not match with predefined constrains.

Parameters:
  • lo – LDAP connection.

  • value – The value to check.

  • property – The property name

Returns:

None on errors.

Raises:

Exception – on errors.

Deprecated since version 5.0-2: Univention internal use only!

class univention.admin.syntax.primaryEmailAddressValidDomain[source]#

Bases: emailAddressValidDomain

Syntax class for the primary e-mail address in one of the registered e-mail domains.

name = 'primaryEmailAddressValidDomain'#
errMsgDomain = 'The domain part of the primary mail address is not in list of configured mail domains: %s'#
class univention.admin.syntax.MailDomain[source]#

Bases: UDM_Attribute

udm_module: str | None = 'mail/domain'#

UDM module name to search for.

attribute: str | None = 'name'#

The UDM property name to use as the value for this syntax class.

class univention.admin.syntax.iso8601Date[source]#

Bases: simple

A date of the format:

  • yyyy-ddd (2009-213)

  • yyyy-mm (2009-05)

  • yyyy-mm-dd (2009-05-13)

  • yyyy-Www (2009-W21)

  • yyyy-Www-D (2009-W21-4)

with the dashes being optional

>>> iso8601Date.to_datetime('2020-05')
datetime.date(2020, 5, 1)
>>> iso8601Date.to_datetime('2020-05-13')
datetime.date(2020, 5, 13)
>>> iso8601Date.to_datetime('2020-W42')
datetime.date(2020, 5, 1)
>>> iso8601Date.to_datetime('2020-W42-0')
datetime.date(2020, 10, 22)
>>> from datetime import date
>>> iso8601Date.from_datetime(date(2020, 5, 13))
'2020-05-13'
>>> iso8601Date.parse('2020-05-13')
'2020-05-13'
>>> iso8601Date.parse('00.00.01')
Traceback (most recent call last):
...
valueError:
regex: Pattern | None = re.compile('^(\\d{4}(?:(?:(?:\\-)?(?:00[1-9]|0[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-6]))?|(?:(?:\\-)?(?:1[0-2]|0[1-9]))?|(?:(?:\\-)?(?:1[0-2]|0[1-9])(?:\\-)?(?:0[1-9]|[12][0-9]|3[01]))?|(?:(?:\\-)?W(?:0[1-)#

Regular expression to validate the value.

error_message = 'The given date does not conform to iso8601, example: "2009-01-01".'#

Error message when an invalid item is selected.

widget: str | None = 'DateBox'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = '1970-01-01'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

type_class#

alias of DateType

classmethod to_datetime(value)[source]#
classmethod from_datetime(value)[source]#
class univention.admin.syntax.date[source]#

Bases: simple

Syntax for a German date (DD.MM.YY). Also accepts the ISO format (YYYY-MM-DD).

Warning

Centuries are always stripped! See date2.

>>> date.parse(None)
''
>>> date.parse('21.12.03')
'21.12.03'
>>> date.parse('1961-01-01')
'01.01.61'
>>> date.parse('2061-01-01')
'01.01.61'
>>> date.parse('01.02.00')
'01.02.00'
>>> date.parse('01.02.99')
'01.02.99'
>>> date.parse('00.00.01')
Traceback (most recent call last):
...
valueError:
>>> date.parse('01x02y03')
Traceback (most recent call last):
...
valueError:
>>> from datetime import datetime
>>> date.from_datetime(datetime(2020, 1, 1))
'2020-01-01T00:00:00'
>>> date.to_datetime('31.12.19')
datetime.date(2019, 12, 31)

Bug #20230: >>> date.parse(‘31.2.1’) #doctest: +IGNORE_EXCEPTION_DETAIL +SKIP Traceback (most recent call last): … valueError:

name = 'date'#
min_length = 5#
max_length = 0#
widget: str | None = 'DateBox'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = '1970-01-01'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

type_class#

alias of DateType

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

classmethod to_datetime(value)[source]#
classmethod from_datetime(value)[source]#
class univention.admin.syntax.date2[source]#

Bases: date

Syntax for an ISO date (YYYY-MM-DD). Also accepts the German format (DD.MM.YY). If no century is specified, the date is mapped to 1970..2069.

>>> date2.parse('21.12.75')
'1975-12-21'
>>> date2.parse('21.12.03')
'2003-12-21'
>>> date2.parse('1961-01-01')
'1961-01-01'
>>> date2.to_datetime('1961-01-01')
datetime.date(1961, 1, 1)
>>> date2.parse('2001-02-31')
'2001-02-31'
>>> date2.parse('just a string')
Traceback (most recent call last):
...
valueError: Full domain name must be between 1 and 253 characters long!
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

classmethod to_datetime(value)[source]#
class univention.admin.syntax.reverseLookupSubnet[source]#

Bases: simple

Syntax for IPv4 or IPv6 sub-network.

>>> reverseLookupSubnet.parse('1.2.3')
'1.2.3'
>>> reverseLookupSubnet.parse('1')
'1'
>>> reverseLookupSubnet.parse('1000:2000:3000:4000:5000:6000:7000:800')
'1000:2000:3000:4000:5000:6000:7000:800'
regex_IPv4 = '((([1-9]?[0-9])|(1[0-9]{0,2})|(2([0-4][0-9]|5[0-5])))\\.){1,2}(([1-9]?[0-9])|(1[0-9]{0,2})|(2([0-4][0-9]|5[0-5])))'#
regex_IPv6 = '(([0-9a-f]{4}:){0,7}[0-9a-f]{1,3})|(([0-9a-f]{4}:){0,6}[0-9a-f]{1,4})'#
regex: Pattern | None = re.compile('^((((([1-9]?[0-9])|(1[0-9]{0,2})|(2([0-4][0-9]|5[0-5])))\\.){1,2}(([1-9]?[0-9])|(1[0-9]{0,2})|(2([0-4][0-9]|5[0-5]))))|((([0-9a-f]{4}:){0,7}[0-9a-f]{1,3})|(([0-9a-f]{4}:){0,6}[0-9a-f]{1,4})))$')#

Regular expression to validate the value.

error_message = 'A subnet for reverse lookup consists of the first 1-3 octets of an IPv4 address (example: "192.168.0") or of the first 1 to 31 nibbles of an expanded (with leading zeroes and without ::-substitution) IPv6 address (example: "2001:0db8:010" for "2001:db8:100::/24")'#

Error message when an invalid item is selected.

class univention.admin.syntax.reverseLookupZoneName[source]#

Bases: simple

Syntax for a DNS reverse zone name.

>>> reverseLookupZoneName.parse('3.2.1.in-addr.arpa')
'3.2.1.in-addr.arpa'
>>> reverseLookupZoneName.parse('8.7.6.5.4.3.2.1.ip6.arpa')
'8.7.6.5.4.3.2.1.ip6.arpa'
regex: Pattern | None = re.compile('^((([0-9a-f]\\.){1,31}ip6\\.arpa)|(((([1-9]?[0-9])|(1[0-9]{0,2})|(2([0-4][0-9]|5[0-5])))\\.){1,3}in-addr.arpa))$')#

Regular expression to validate the value.

error_message = 'The name of a reverse zone for IPv4 consists of the reversed subnet address followed by .in-addr.arpa (example: "0.168.192.in-addr.arpa") or for IPv6 in nibble format followed by .ip6.arpa (example: "0.0.0.0.0.0.1.0.8.b.d.0.1.0.0.2.ip6.arpa")'#

Error message when an invalid item is selected.

class univention.admin.syntax.dnsName[source]#

Bases: simple

RFC 1123: a ‘.’ separated FQDN

>>> dnsName.parse('a')
'a'
>>> dnsName.parse('a.')
'a.'
>>> dnsName.parse(r'a\.b.')
'a\\.b.'
>>> dnsName.parse('@')
'\\@'
>>> dnsName.parse(' ')
'\\032'
>>> dnsName.parse('')
Traceback (most recent call last):
...
valueError: Missing value!
>>> dnsName.parse('\\')
Traceback (most recent call last):
...
valueError: Invalid escape sequence: '\\'.

A host name (label) can be up to 63 characters

>>> dnsName.parse('0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')
'0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
>>> dnsName.parse('0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz')
Traceback (most recent call last):
...
valueError: Labels must be between 1 and 63 characters long!
>>> dnsName.parse(''.join(r'\%03d' % c for c in range(255) if c not in {46, 92}))
Traceback (most recent call last):
...
valueError: Labels must be between 1 and 63 characters long!
>>> dnsName.parse('a..')
Traceback (most recent call last):
...
valueError: Labels must be between 1 and 63 characters long!

A full domain name is limited to 253 octets (255 - trailing NUL - trailing ROOT)

>>> dnsName.parse('a.' * 127) == 'a.' * 127
True
>>> dnsName.parse('a.' * 128)
Traceback (most recent call last):
...
valueError: Full domain name must be between 1 and 253 characters long!
min_length = 1#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

univention.admin.syntax.DNS_Name#

alias of dnsName

univention.admin.syntax.dnsZone#

alias of dnsName

class univention.admin.syntax.dnsHostname[source]#

Bases: dnsName

RFC 1123: a ‘.’ separated FQHN

A host name (label) can start or end with a letter or a number

>>> dnsHostname.parse('a')
'a'
>>> dnsHostname.parse('A.')
'A.'
>>> dnsName.parse('0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')
'0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
>>> dnsName.parse('0.example.com')
'0.example.com'

A host name (label) MUST NOT consist of all numeric values

>>> dnsHostname.parse('0')
Traceback (most recent call last):
...
valueError: Full name must not be all numeric!

A host name (label) MUST NOT start or end with a ‘-’ (dash)

>>> dnsHostname.parse('-')
Traceback (most recent call last):
...
valueError: A hostname or any part of a FQDN, separated by dots, starts and ends with a letter or a digit.
    In between letters, digits, dashes and underscores are allowed. Only numbers are not allowed.
LABEL = re.compile('^(?![0-9]+$|[_-])[a-zA-Z0-9_-]{1,63}(?<![_-])$')#
NUMERIC = re.compile('^[0-9.]+$')#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.dnsName_umlauts[source]#

Bases: simple

>>> dnsName_umlauts.parse(u'ä') == u'ä'
True
>>> dnsName_umlauts.parse('a_0-A')
'a_0-A'
>>> dnsName_umlauts.parse('0')
Traceback (most recent call last):
...
valueError: A hostname or any part of a FQDN, separated by dots, starts and ends with a letter or a digit.
    In between letters, digits, dashes and underscores are allowed. Only numbers are not allowed.
>>> dnsName_umlauts.parse('-')
Traceback (most recent call last):
...
valueError: A hostname or any part of a FQDN, separated by dots, starts and ends with a letter or a digit.
    In between letters, digits, dashes and underscores are allowed. Only numbers are not allowed.
>>> dnsName_umlauts.parse('_')
Traceback (most recent call last):
...
valueError: A hostname or any part of a FQDN, separated by dots, starts and ends with a letter or a digit.
    In between letters, digits, dashes and underscores are allowed. Only numbers are not allowed.
min_length = 1#
max_length = 63#
regex: Pattern | None = re.compile('^(?![0-9]+$|[_-])[\\w_-]{1,63}(?<![_-])$')#

Regular expression to validate the value.

error_message = 'A hostname or any part of a FQDN, separated by dots, starts and ends with a letter or a digit. In between letters, digits, dashes and underscores are allowed. Only numbers are not allowed.'#

Error message when an invalid item is selected.

class univention.admin.syntax.keyAndValue[source]#

Bases: complex

Syntax for key-value-pairs separated by =.

>>> keyAndValue.tostring(['key', 'value'])
'key = value'
>>> keyAndValue.tostring(['key'])
''
>>> keyAndValue.parse(('key',))
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> keyAndValue.parse(('key', 'value', 'and then some'))
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> keyAndValue.parse((None, 'value'))
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> keyAndValue.parse(('key', 'value'))
['key', 'value']
delimiter: str = ' = '#

Delimiter to separate the sub-items. Two possibilities:

  1. Either a single string like =, which is used to concatenate all subitems.

  2. A sequence of n+1 strings like [‘’, ‘: ‘, ‘=’, ‘’] to concatenate n sub-items. The first and last value is used as a prefix/suffix.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Key', <class 'univention.admin.syntax.string'>), ('Value', <class 'univention.admin.syntax.string'>)]#
subsyntax_key_value = True#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.dnsMX[source]#

Bases: complex

Syntax for DNS mail exchange record.

>>> dnsMX.parse(('10', 'mail.my.domain'))
['10', 'mail.my.domain']
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Priority', <class 'univention.admin.syntax.integer'>), ('Mail server', <class 'univention.admin.syntax.dnsHostname'>)]#
subsyntax_names: tuple[str, ...] = ('priority', 'mailserver')#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.dnsSRVName[source]#

Bases: complex

Syntax for the name of a DNS service record.

>>> dnsSRVName.parse(('ldap', 'tcp'))
['ldap', 'tcp']
>>> dnsSRVName.parse(('ldap', 'tcp'))
['ldap', 'tcp']

See also

min_elements: int | None = 2#

Minimum number of required values.

all_required = False#

All sub-values must contain a value.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Service', <class 'univention.admin.syntax.string'>), ('Protocol', <class 'univention.admin.syntax.ipProtocolSRV'>), ('Extension', <class 'univention.admin.syntax.string'>)]#
subsyntax_names: tuple[str, ...] = ('service', 'protocol', 'extension')#
size: str | Sequence[str] = ('Half', 'Half', 'One')#

Widget size. See SIZES.

class univention.admin.syntax.dnsPTR[source]#

Bases: simple

DNS pointer record.

>>> dnsPTR.parse('1')
'1'
>>> dnsPTR.parse('1.2.3')
'1.2.3'
>>> dnsPTR.parse('f')
'f'
>>> dnsPTR.parse('1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.0.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f')
'1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.0.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f'
regexp = re.compile('\n        ^    (?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\n        (?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){0,2}$\n        |^    [0-9a-f]\n        (?:\\.[0-9a-f]){0,30}$\, re.VERBOSE)#
error_message = 'The reversed host name for IPv4 consists of the reversed host address (example: "4.3") or for IPv6 in nibble format (example: "8.0.0.0.7.0.0.0.0.6.0.0.0.0.5.0").'#

Error message when an invalid item is selected.

class univention.admin.syntax.postalAddress[source]#

Bases: complex

Syntax for a postal address consisting of street, postal code and city name.

>>> postalAddress.parse(('street', 'zip', 'city'))
['street', 'zip', 'city']
delimiter: str = ', '#

Delimiter to separate the sub-items. Two possibilities:

  1. Either a single string like =, which is used to concatenate all subitems.

  2. A sequence of n+1 strings like [‘’, ‘: ‘, ‘=’, ‘’] to concatenate n sub-items. The first and last value is used as a prefix/suffix.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Street', <class 'univention.admin.syntax.string'>), ('Postal code', <class 'univention.admin.syntax.OneThirdString'>), ('City', <class 'univention.admin.syntax.TwoThirdsString'>)]#
subsyntax_names: tuple[str, ...] = ('street', 'zipcode', 'city')#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.dnsSRVLocation[source]#

Bases: complex

Syntax for DNS service record.

>>> dnsSRVLocation.parse(('10', '100', '389', 'server.my.domain'))
['10', '100', '389', 'server.my.domain']
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Priority', <class 'univention.admin.syntax.integer'>), ('Weighting', <class 'univention.admin.syntax.integer'>), ('Port', <class 'univention.admin.syntax.integer'>), ('Server', <class 'univention.admin.syntax.dnsHostname'>)]#
subsyntax_names: tuple[str, ...] = ('priority', 'weigtht', 'port', 'server')#
size: str | Sequence[str] = ('OneThird', 'OneThird', 'OneThird', 'One')#

Widget size. See SIZES.

all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.unixTime[source]#

Bases: simple

Syntax for a UNIX time stamp - seconds since 1970-01-01.

regex: Pattern | None = re.compile('^[0-9]+$')#

Regular expression to validate the value.

error_message = 'Not a valid time format'#

Error message when an invalid item is selected.

type_class#

alias of DateTimeType

class univention.admin.syntax.TimeUnits[source]#

Bases: select

Syntax to select a time unit.

size: str | Sequence[str] = 'Half'#

Widget size. See SIZES.

choices: Sequence[Any] = [('seconds', 'seconds'), ('minutes', 'minutes'), ('hours', 'hours'), ('days', 'days')]#
class univention.admin.syntax.TimeString[source]#

Bases: simple

Syntax for the time of day, e.g. hour, minute and optional seconds.

>>> TimeString.parse('00:00')
'00:00'
>>> TimeString.parse('23:59:59')
'23:59:59'
error_message = 'Not a valid time format'#

Error message when an invalid item is selected.

regex: Pattern | None = re.compile('^(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?$')#

Regular expression to validate the value.

widget: str | None = 'TimeBox'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = '00:00'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

type_class#

alias of TimeType

class univention.admin.syntax.UNIX_TimeInterval[source]#

Bases: complex

Syntax for a time interval.

>>> UNIX_TimeInterval.parse(('1',))
['1']
>>> UNIX_TimeInterval.parse(('2', 'seconds'))
['2', 'seconds']
>>> UNIX_TimeInterval.parse(('3', 'minutes'))
['3', 'minutes']
>>> UNIX_TimeInterval.parse(('4', 'hours'))
['4', 'hours']
>>> UNIX_TimeInterval.parse(('5', 'days'))
['5', 'days']
>>> UNIX_TimeInterval.from_integer(3600)
['3600', 'seconds']
min_elements: int | None = 1#

Minimum number of required values.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('', <class 'univention.admin.syntax.integerOrEmpty'>), ('', <class 'univention.admin.syntax.TimeUnits'>))#
subsyntax_names: tuple[str, ...] = ('amount', 'unit')#
size: str | Sequence[str] = ('Half', 'Half')#

Widget size. See SIZES.

type_class#

alias of UnixTimeinterval

classmethod parse(texts)[source]#
classmethod from_integer(value)[source]#
classmethod to_integer(value)[source]#
class univention.admin.syntax.UNIX_BoundedTimeInterval[source]#

Bases: UNIX_TimeInterval

Syntax for a time interval with additional constraints.

lower_bound = -1#
upper_bound = -1#
error_message = 'Value out of bounds (%d - %d seconds)'#
classmethod parse(texts)[source]#
class univention.admin.syntax.SambaMinPwdAge[source]#

Bases: UNIX_BoundedTimeInterval

Syntax for the minimum password age in Samba: 0..998 days

>>> SambaMinPwdAge.parse((None, 'days'))
[None, None]
>>> SambaMinPwdAge.parse(('0', 'days'))
['0', 'days']
>>> SambaMinPwdAge.parse(('998', 'days'))
['998', 'days']
>>> SambaMinPwdAge.parse(('999', 'days'))
Traceback (most recent call last):
...
valueError:
lower_bound = 0#
upper_bound = 86227200#
class univention.admin.syntax.SambaMaxPwdAge[source]#

Bases: UNIX_BoundedTimeInterval

Syntax for the maximum password age in Samba: 0..999 days

>>> SambaMaxPwdAge.parse((None, 'days'))
[None, None]
>>> SambaMaxPwdAge.parse(('0', 'days'))
['0', 'days']
>>> SambaMaxPwdAge.parse(('999', 'days'))
['999', 'days']
>>> SambaMaxPwdAge.parse(('1000', 'days'))
Traceback (most recent call last):
...
valueError:
lower_bound = 0#
upper_bound = 86313600#
class univention.admin.syntax.NetworkType[source]#

Bases: select

Syntax to select network technology type.

choices: Sequence[Any] = [('ethernet', 'Ethernet'), ('fddi', 'FDDI'), ('token-ring', 'Token-Ring')]#
class univention.admin.syntax.MAC_Address[source]#

Bases: simple

Syntax to enter MAC address. The address is stored with octets separated by :.

>>> MAC_Address.parse('86:f5:d1:f5:6b:3e')
'86:f5:d1:f5:6b:3e'
>>> MAC_Address.parse('86-f5-d1-f5-6b-3e')
'86:f5:d1:f5:6b:3e'
>>> MAC_Address.parse('86f5d1f56b3e')
'86:f5:d1:f5:6b:3e'
>>> MAC_Address.parse('86f5.d1f5.6b3e')
'86:f5:d1:f5:6b:3e'
>>> MAC_Address.parse('aa:bb:cc:dd:ee:gg')
Traceback (most recent call last):
...
valueError:
regexLinuxFormat = re.compile('^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$')#
regexWindowsFormat = re.compile('^([0-9a-fA-F]{2}-){5}[0-9a-fA-F]{2}$')#
regexRawFormat = re.compile('^[0-9a-fA-F]{12}$')#
regexCiscoFormat = re.compile('^([0-9a-fA-F]{4}\\.){2}[0-9a-fA-F]{4}$')#
error_message = 'This is not a valid MAC address (valid examples are 86:f5:d1:f5:6b:3e, 86-f5-d1-f5-6b-3e, 86f5d1f56b3e, 86f5.d1f5.6b3e)'#

Error message when an invalid item is selected.

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.DHCP_HardwareAddress[source]#

Bases: complex

Syntax to enter DHCP hardware address consisting of network technology type and MAC address.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Type', <class 'univention.admin.syntax.NetworkType'>), ('Address', <class 'univention.admin.syntax.MAC_Address'>))#
subsyntax_names: tuple[str, ...] = ('type', 'address')#
size: str | Sequence[str] = ('One', 'One')#

Widget size. See SIZES.

all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.Packages[source]#

Bases: UDM_Attribute

Syntax to select a Debian package name from lists stored in LDAP using univention.admin.handlers.settings.packages.

udm_module: str | None = 'settings/packages'#

UDM module name to search for.

attribute: str | None = 'packageList'#

The UDM property name to use as the value for this syntax class.

label_format: str | None = '%(name)s: %($attribute$)s'#

Python format string used to convert the UDM properties to the displayed value.

class univention.admin.syntax.PackagesRemove[source]#

Bases: Packages

Syntax to select a Debian package name from lists stored in LDAP using univention.admin.handlers.settings.packages. This blacklists some important packages to prevent their removal.

>>> PackagesRemove.parse('curl')
'curl'
>>> PackagesRemove.parse('openssh-client')
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#
class univention.admin.syntax.userAttributeList[source]#

Bases: string

Syntax to enter a users attribute.

Note

unused

>>> userAttributeList.parse('uid')
'uid'
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.ldapDn[source]#

Bases: simple

LDAP distinguished name.

>>> ldapDn.parse('dc=foo,dc=bar,dc=test')
'dc=foo,dc=bar,dc=test'
>>> ldapDn.parse('')
Traceback (most recent call last):
...
valueError:

Deprecated since version 3.1-0: Use UDM_Objects.

error_message = 'Not a valid LDAP DN'#

Error message when an invalid item is selected.

type_class#

alias of DistinguishedNameType

classmethod get_widget(prop)[source]#
widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod get_choices(lo, options)[source]#

Get all already sorted choices

classmethod parse(text: Any) str[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.UMC_OperationSet[source]#

Bases: UDM_Objects

Syntax to select a UMC operation set from lists stored in LDAP using univention.admin.handlers.settings.umc_operationset.

udm_modules: Sequence[str] = ('settings/umc_operationset',)#

Sequence of UDM module names to search for.

label: str | None = '%(description)s (%(name)s)'#

The UDM property name enclosed in %()s, which is used as the displayed value.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

class univention.admin.syntax.UMC_CommandPattern[source]#

Bases: complex

Syntax to enter a UMC command pattern.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Command pattern', <class 'univention.admin.syntax.string'>), ('Option Pattern', <class 'univention.admin.syntax.string'>))#
subsyntax_names: tuple[str, ...] = ('command', 'option')#
min_elements: int | None = 1#

Minimum number of required values.

all_required = False#

All sub-values must contain a value.

size: str | Sequence[str] = ('One', 'One')#

Widget size. See SIZES.

class univention.admin.syntax.LDAP_Server[source]#

Bases: UDM_Objects

Syntax to select a LDAP server.

Deprecated since version 4.4-0: Use DomainController.

udm_modules: Sequence[str] = ('computers/domaincontroller_master', 'computers/domaincontroller_backup', 'computers/domaincontroller_slave')#

Sequence of UDM module names to search for.

udm_filter = '!(univentionObjectFlag=docker)'#

A LDAP filter string to further restrict the matching LDAP objects.

label: str | None = '%(fqdn)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

class univention.admin.syntax.IMAP_POP3[source]#

Bases: select

Syntax to select between IMAP and POP3.

choices: Sequence[Any] = [('IMAP', 'IMAP'), ('POP3', 'POP3')]#
class univention.admin.syntax.IMAP_Right[source]#

Bases: select

Syntax to select an IMAP access control permission.

choices: Sequence[Any] = [('none', 'No access'), ('read', 'Read'), ('post', 'Post'), ('append', 'Append'), ('write', 'Write'), ('all', 'All')]#
class univention.admin.syntax.UserMailAddress[source]#

Bases: UDM_Objects

Syntax to select a primary e-mail address of an user name from LDAP.

udm_modules: Sequence[str] = ('users/user',)#

Sequence of UDM module names to search for.

udm_filter = '(mailPrimaryAddress=*)'#

A LDAP filter string to further restrict the matching LDAP objects.

key = '%(mailPrimaryAddress)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

static_values: Sequence[tuple[str, str]] | None = (('anyone', 'Anyone'),)#

Sequence of additional static items.

regex: Pattern | None = re.compile('^([^\\s]+@[^\\s]+|anyone)$')#

Regular expression for validating the values.

error_message = 'Not a valid e-mail address'#

Error message when an invalid item is selected.

class univention.admin.syntax.GroupName[source]#

Bases: UDM_Objects

Syntax to select a group name from LDAP.

udm_modules: Sequence[str] = ('groups/group',)#

Sequence of UDM module names to search for.

key = '%(name)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

regex: Pattern | None = re.compile('^.+$')#

Regular expression for validating the values.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.UserName[source]#

Bases: UDM_Objects

Syntax to select an user name from LDAP.

udm_modules: Sequence[str] = ('users/user',)#

Sequence of UDM module names to search for.

key = '%(username)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

regex: Pattern | None = re.compile('^.+$')#

Regular expression for validating the values.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.SharedFolderUserACL[source]#

Bases: complex

Syntax to assign an IMAP access control permission for an user from LDAP.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('User', <class 'univention.admin.syntax.UserMailAddress'>), ('Access right', <class 'univention.admin.syntax.IMAP_Right'>))#
subsyntax_key_value = True#
class univention.admin.syntax.SharedFolderGroupACL[source]#

Bases: complex

Syntax to assign an IMAP access control permission for a group from LDAP.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Group', <class 'univention.admin.syntax.GroupName'>), ('Access right', <class 'univention.admin.syntax.IMAP_Right'>))#
subsyntax_key_value = True#
class univention.admin.syntax.SharedFolderSimpleUserACL[source]#

Bases: complex

Syntax to assign an IMAP access control permission for any user.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('User', <class 'univention.admin.syntax.string'>), ('Access right', <class 'univention.admin.syntax.IMAP_Right'>))#
subsyntax_key_value = True#
class univention.admin.syntax.SharedFolderSimpleGroupACL[source]#

Bases: complex

Syntax to assign an IMAP access control permission for any group.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Group', <class 'univention.admin.syntax.string'>), ('Access right', <class 'univention.admin.syntax.IMAP_Right'>))#
subsyntax_key_value = True#
class univention.admin.syntax.ldapDnOrNone[source]#

Bases: simple

LDAP distinguished name or None.

>>> ldapDnOrNone.parse('dc=foo,dc=bar,dc=test')
'dc=foo,dc=bar,dc=test'
>>> ldapDnOrNone.parse('None')
'None'
>>> ldapDnOrNone.parse('dc=foo,,')
Traceback (most recent call last):
...
valueError:

Deprecated since version 3.1-0: Use UDM_Objects.

classmethod get_widget(prop)[source]#
widget_default_search_pattern: bool | str | None = ''#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.ldapObjectClass[source]#

Bases: _CachedLdap

Syntax to enter a LDAP objectClass name.

class univention.admin.syntax.ldapAttribute[source]#

Bases: _CachedLdap

Syntax to enter a LDAP attribute name.

depends: str | None = 'objectClass'#

The name of another UDM property this syntax depends on.

classmethod get_choices(lo, options)[source]#

Get the choices w.r.t. dependencies

class univention.admin.syntax.ldapFilter[source]#

Bases: simple

Syntax to enter a LDAP search filter.

>>> ldapFilter.parse('uid=*')
'uid=*'
>>> ldapFilter.parse('(uid=*')
Traceback (most recent call last):
...
valueError:
type_class#

alias of LDAPFilterType

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.XResolution[source]#

Bases: simple

Syntax to enter display resolution for X11.

regex: Pattern | None = re.compile('^[0-9]+x[0-9]+$')#

Regular expression to validate the value.

error_message = 'Value consists of two integer numbers separated by an "x" (e.g. "1024x768")'#

Error message when an invalid item is selected.

class univention.admin.syntax.XSync[source]#

Bases: simple

Syntax to enter display timing settings for X11.

regex: Pattern | None = re.compile('^[0-9]+(-[0-9]+)?( +[0-9]+(-[0-9]+)?)*$')#

Regular expression to validate the value.

error_message = 'Value consists of two integer numbers separated by a "-" (e.g. "30-70")'#

Error message when an invalid item is selected.

class univention.admin.syntax.XColorDepth[source]#

Bases: simple

Syntax to enter color depth for X11.

regex: Pattern | None = re.compile('^[0-9]+$')#

Regular expression to validate the value.

class univention.admin.syntax.XModule[source]#

Bases: select

Syntax to select graphics driver for X11.

choices: Sequence[Any] = [('', ''), ('apm', 'apm'), ('ark', 'Ark'), ('ati', 'ATI'), ('chips', 'chips'), ('cirrus', 'Cirrus'), ('cyrix', 'Cyrix'), ('dummy', 'dummy'), ('fbdev', 'fbdev'), ('fglrx', 'fglrx (AMD/ATI closed source)'), ('geode', 'Geode GX2/LX'), ('glide', 'glide'), ('glint', 'glint'), ('i128', 'I128'), ('i740', 'I740'), ('i810', 'I810'), ('imstt', 'IMSTT'), ('intel', 'Intel'), ('mach64', 'Mach64 (ATI)'), ('mga', 'MGA'), ('neomagic', 'Neomagic'), ('newport', 'Newport'), ('nouveau', 'nouveau - new Nvidia OSS driver'), ('nsc', 'NSC'), ('nv', 'NV'), ('nvidia', 'NVidia (closed source)'), ('openchrome', 'OpenChrome (VIA)'), ('r128', 'ATI Rage'), ('radeonhd', 'Radeon (AMD/ATI)'), ('rendition', 'Rendition'), ('s3', 'S3'), ('s3virge', 'S3 Virge'), ('savage', 'S3 Savage'), ('siliconmotion', 'Siliconmotion'), ('sis', 'SiS'), ('sisusb', 'SiS USB'), ('tdfx', 'tdfx'), ('tga', 'Tga'), ('trident', 'Trident'), ('tseng', 'Tseng'), ('vesa', 'Vesa'), ('vga', 'VGA'), ('via', 'VIA'), ('vmware', 'VMWare')]#
class univention.admin.syntax.XMouseProtocol[source]#

Bases: select

Syntax to select mouse protocol for X11.

choices: Sequence[Any] = [('', ''), ('Auto', 'Auto'), ('IMPS/2', 'IMPS/2'), ('PS/2', 'PS/2'), ('ExplorerPS/2', 'ExplorerPS/2'), ('usb', 'USB'), ('ThinkingMouse', 'ThinkingMouse'), ('ThinkingMousePS/2', 'ThinkingMousePS/2'), ('NetScrollPS/2', 'NetScrollPS/2'), ('IntelliMouse', 'IntelliMouse'), ('NetMousePS/2', 'NetMousePS/2'), ('GlidePoint', 'GlidePoint'), ('GlidePointPS/2', 'GlidePointPS/2'), ('MouseManPlusPS/2', 'MouseManPlusPS/2'), ('ms', 'Serial')]#
class univention.admin.syntax.XDisplayPosition[source]#

Bases: select

Syntax to select display position for X11.

choices: Sequence[Any] = [('', ''), ('left', 'Left of primary display'), ('right', 'Right of primary display'), ('above', 'Above primary display'), ('below', 'Below primary display')]#
class univention.admin.syntax.XMouseDevice[source]#

Bases: select

Syntax to select mouse device for X11.

choices: Sequence[Any] = [('', ''), ('/dev/psaux', 'PS/2'), ('/dev/input/mice', 'USB'), ('/dev/ttyS0', 'Serial')]#
class univention.admin.syntax.XKeyboardLayout[source]#

Bases: select

Syntax to select keyboard layout for X11.

choices: Sequence[Any] = [('', ''), ('ad', 'Andorra'), ('af', 'Afghanistan'), ('al', 'Albania'), ('am', 'Armenia'), ('ara', 'Arabic'), ('az', 'Azerbaijan'), ('ba', 'Bosnia and Herzegovina'), ('bd', 'Bangladesh'), ('be', 'Belgium'), ('bg', 'Bulgaria'), ('brai', 'Braille'), ('br', 'Brazil'), ('bt', 'Bhutan'), ('by', 'Belarus'), ('ca', 'Canada'), ('cd', 'Congo, Democratic Republic of the'), ('ch', 'Switzerland'), ('cn', 'China'), ('cz', 'Czechia'), ('de', 'Germany'), ('dk', 'Denmark'), ('ee', 'Estonia'), ('epo', 'Esperanto'), ('es', 'Spain'), ('et', 'Ethiopia'), ('fi', 'Finland'), ('fo', 'Faroe Islands'), ('fr', 'France'), ('gb', 'United Kingdom'), ('ge', 'Georgia'), ('gh', 'Ghana'), ('gn', 'Guinea'), ('gr', 'Greece'), ('hr', 'Croatia'), ('hu', 'Hungary'), ('ie', 'Ireland'), ('il', 'Israel'), ('in', 'India'), ('iq', 'Iraq'), ('ir', 'Iran'), ('is', 'Iceland'), ('it', 'Italy'), ('jp', 'Japan'), ('kg', 'Kyrgyzstan'), ('kh', 'Cambodia'), ('kr', 'Korea, Republic of'), ('kz', 'Kazakhstan'), ('la', 'Laos'), ('latam', 'Latin American'), ('lk', 'Sri Lanka'), ('lt', 'Lithuania'), ('lv', 'Latvia'), ('ma', 'Morocco'), ('mao', 'Maori'), ('me', 'Montenegro'), ('mk', 'Macedonia'), ('mm', 'Myanmar'), ('mn', 'Mongolia'), ('mt', 'Malta'), ('mv', 'Maldives'), ('nec_vndr/jp', 'Japan (PC-98xx Series)'), ('ng', 'Nigeria'), ('nl', 'Netherlands'), ('no', 'Norway'), ('np', 'Nepal'), ('pk', 'Pakistan'), ('pl', 'Poland'), ('pt', 'Portugal'), ('ro', 'Romania'), ('rs', 'Serbia'), ('ru', 'Russia'), ('se', 'Sweden'), ('si', 'Slovenia'), ('sk', 'Slovakia'), ('sn', 'Senegal'), ('sy', 'Syria'), ('th', 'Thailand'), ('tj', 'Tajikistan'), ('tm', 'Turkmenistan'), ('tr', 'Turkey'), ('ua', 'Ukraine'), ('us', 'USA'), ('uz', 'Uzbekistan'), ('vn', 'Vietnam'), ('za', 'South Africa')]#
class univention.admin.syntax.soundModule[source]#

Bases: select

Syntax to select ALSA audio device driver.

choices: Sequence[Any] = [('', ''), ('auto', 'auto detect'), ('snd-ad1816a', 'AD1816A, AD1815'), ('snd-adlib', 'AdLib FM'), ('snd-ak4114', 'AK4114 IEC958 (S/PDIF) receiver by Asahi Kasei'), ('snd-ak4117', 'AK4117 IEC958 (S/PDIF) receiver by Asahi Kasei'), ('snd-ali5451', 'ALI M5451'), ('snd-opl3-synth', 'ALSA driver for OPL3 FM synth'), ('snd-sb16-csp', 'ALSA driver for SB16 Creative Signal Processor'), ('snd-sb-common', 'ALSA lowlevel driver for Sound Blaster cards'), ('snd-interwave', 'AMD InterWave'), ('snd-interwave-stb', 'AMD InterWave STB with TEA6330T'), ('snd-ad1889', 'Analog Devices AD1889 ALSA sound driver'), ('snd-atiixp', 'ATI IXP AC97 controller'), ('snd-atiixp-modem', 'ATI IXP MC97 controller'), ('aedsp16', 'Audio Excel DSP 16 Driver Version 1.3'), ('snd-au8810', 'Aureal vortex 8810'), ('snd-au8820', 'Aureal vortex 8820'), ('snd-au8830', 'Aureal vortex 8830'), ('snd-als100', 'Avance Logic ALS1X0'), ('snd-als300', 'Avance Logic ALS300'), ('snd-als4000', 'Avance Logic ALS4000'), ('snd-azt3328', 'Aztech AZF3328 (PCI168)'), ('snd-sgalaxy', 'Aztech Sound Galaxy'), ('snd-azt2320', 'Aztech Systems AZT2320'), ('snd-bt87x', 'Brooktree Bt87x audio driver'), ('snd-ca0106', 'CA0106'), ('snd-cs4232', 'Cirrus Logic CS4232'), ('snd-cs4236', 'Cirrus Logic CS4235-9'), ('snd-cs4281', 'Cirrus Logic CS4281'), ('snd-cmi8330', 'C-Media CMI8330'), ('snd-cmipci', 'C-Media CMI8x38 PCI'), ('snd-vx-lib', 'Common routines for Digigram VX drivers'), ('snd-cs5535audio', 'CS5535 Audio'), ('snd-dt019x', 'Diamond Technologies DT-019X / Avance Logic ALS-007'), ('snd-mixart', 'Digigram miXart'), ('snd-pcxhr', 'Digigram pcxhr 0.8.4'), ('snd-vx222', 'Digigram VX222 V2/Mic'), ('snd-vxpocket', 'Digigram VXPocket'), ('snd-dummy', 'Dummy soundcard (/dev/null)'), ('snd-virmidi', 'Dummy soundcard for virtual rawmidi devices'), ('snd-darla20', 'Echoaudio Darla20 soundcards driver'), ('snd-darla24', 'Echoaudio Darla24 soundcards driver'), ('snd-echo3g', 'Echoaudio Echo3G soundcards driver'), ('snd-gina20', 'Echoaudio Gina20 soundcards driver'), ('snd-gina24', 'Echoaudio Gina24 soundcards driver'), ('snd-indigodj', 'Echoaudio Indigo DJ soundcards driver'), ('snd-indigoio', 'Echoaudio Indigo IO soundcards driver'), ('snd-indigo', 'Echoaudio Indigo soundcards driver'), ('snd-layla20', 'Echoaudio Layla20 soundcards driver'), ('snd-layla24', 'Echoaudio Layla24 soundcards driver'), ('snd-mia', 'Echoaudio Mia soundcards driver'), ('snd-mona', 'Echoaudio Mona soundcards driver'), ('snd-emu10k1', 'EMU10K1'), ('snd-emu10k1x', 'EMU10K1X'), ('snd-emu8000-synth', 'Emu8000 synth plug-in routine'), ('snd-ens1370', 'Ensoniq AudioPCI ES1370'), ('snd-ens1371', 'Ensoniq/Creative AudioPCI ES1371+'), ('snd-sscape', 'ENSONIQ SoundScape PnP driver'), ('snd-es968', 'ESS AudioDrive ES968'), ('snd-es18xx', 'ESS ES18xx AudioDrive'), ('snd-es1688-lib', 'ESS ESx688 lowlevel module'), ('snd-es1968', 'ESS Maestro'), ('snd-maestro3', 'ESS Maestro3 PCI'), ('snd-es1938', 'ESS Solo-1'), ('snd-fm801', 'ForteMedia FM801'), ('snd-ad1848', 'Generic AD1848/AD1847/CS4248'), ('snd-cs4231', 'Generic CS4231'), ('snd-es1688', 'Generic ESS ES1688/ES688 AudioDrive'), ('snd-i2c', 'Generic i2c interface for ALSA'), ('snd-util-mem', 'Generic memory management routines for soundcard memory allocation'), ('snd-gusclassic', 'Gravis UltraSound Classic'), ('snd-gusextreme', 'Gravis UltraSound Extreme'), ('snd-gusmax', 'Gravis UltraSound MAX'), ('snd-ice1712', 'ICEnsemble ICE1712 (Envy24)'), ('snd-ice17xx-ak4xxx', 'ICEnsemble ICE17xx <-> AK4xxx AD/DA chip interface'), ('snd-cs8427', 'IEC958 (S/PDIF) receiver & transmitter by Cirrus Logic'), ('snd-intel8x0', 'Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7012; Ali 5455'), ('snd-intel8x0m', 'Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7013; NVidia MCP/2/2S/3 modems'), ('snd-hda-intel', 'Intel HDA driver'), ('kahlua', 'Kahlua VSA1 PCI Audio'), ('snd-korg1212', 'korg1212'), ('snd-serial-u16550', 'MIDI serial u16550'), ('snd-miro', 'Miro miroSOUND PCM1 pro, PCM12, PCM20 Radio'), ('pss', 'Module for PSS sound cards (based on AD1848, ADSP-2115 and ESC614).'), ('snd-mtpav', 'MOTU MidiTimePiece AV multiport MIDI'), ('snd-mpu401', 'MPU-401 UART'), ('snd-nm256', 'NeoMagic NM256AV/ZX'), ('snd-opl4-lib', 'OPL4 driver'), ('snd-opl4-synth', 'OPL4 wavetable synth driver'), ('snd-opti92x-ad1848', 'OPTi92X - AD1848'), ('snd-opti92x-cs4231', 'OPTi92X - CS4231'), ('snd-opti93x', 'OPTi93X'), ('sb', 'OSS Soundblaster ISA PnP and legacy sound driver'), ('snd-riptide', 'riptide'), ('snd-rme32', 'RME Digi32, Digi32/8, Digi32 PRO'), ('snd-rme9652', 'RME Digi9652/Digi9636'), ('snd-rme96', 'RME Digi96, Digi96/8, Digi96/8 PRO, Digi96/8 PST, Digi96/8 PAD'), ('snd-hdsp', 'RME Hammerfall DSP'), ('snd-hdspm', 'RME HDSPM'), ('snd-sb16-dsp', 'Routines for control of 16-bit SoundBlaster cards and clones'), ('snd-sb8-dsp', 'Routines for control of 8-bit SoundBlaster cards and clones'), ('snd-ad1848-lib', 'Routines for control of AD1848/AD1847/CS4248'), ('snd-opl3-lib', 'Routines for control of AdLib FM cards (OPL2/OPL3/OPL4 chips)'), ('snd-ak4xxx-adda', 'Routines for control of AK452x / AK43xx AD/DA converters'), ('snd-cs4231-lib', 'Routines for control of CS4231(A)/CS4232/InterWave & compatible chips'), ('snd-cs4236-lib', 'Routines for control of CS4235/4236B/4237B/4238B/4239 chips'), ('snd-emu10k1-synth', 'Routines for control of EMU10K1 WaveTable synth'), ('snd-emux-synth', 'Routines for control of EMU WaveTable chip'), ('snd-mpu401-uart', 'Routines for control of MPU-401 in UART mode'), ('snd-tea575x-tuner', 'Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips'), ('snd-tea6330t', 'Routines for control of the TEA6330T circuit via i2c bus'), ('snd-gus-lib', 'Routines for Gravis UltraSound soundcards'), ('snd-sonicvibes', 'S3 SonicVibes PCI'), ('snd-sb8', 'Sound Blaster 1.0/2.0/Pro'), ('snd-sb16', 'Sound Blaster 16'), ('snd-sbawe', 'Sound Blaster AWE'), ('snd-pdaudiocf', 'Sound Core PDAudio-CF'), ('snd-usb-usx2y', 'TASCAM US-X2Y Version 0.8.7.2'), ('snd-trident', 'Trident 4D-WaveDX/NX & SiS SI7018'), ('trident', 'Trident 4DWave/SiS 7018/ALi 5451 and Tvia/IGST CyberPro5050 PCI Audio Driver'), ('snd-wavefront', 'Turtle Beach Wavefront'), ('snd-ac97-codec', "Universal interface for Audio Codec '97"), ('snd-ak4531-codec', 'Universal routines for AK4531 codec'), ('snd-usb-audio', 'USB Audio'), ('snd-usb-lib', 'USB Audio/MIDI helper module'), ('snd-ice1724', 'VIA ICEnsemble ICE1724/1720 (Envy24HT/PT)'), ('snd-via82xx', 'VIA VT82xx audio'), ('snd-via82xx-modem', 'VIA VT82xx modem'), ('snd-ymfpci', 'Yamaha DS-1 PCI'), ('snd-opl3sa2', 'Yamaha OPL3SA2+')]#
class univention.admin.syntax.GroupDN[source]#

Bases: UDM_Objects

Syntax to select a group from LDAP by DN.

udm_modules: Sequence[str] = ('groups/group',)#

Sequence of UDM module names to search for.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

search_widget = 'ComboBox'#

The corresponding widget which is used in UMC when searching for values of this property

get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.GroupDNOrEmpty[source]#

Bases: GroupDN

Syntax to select a group from LDAP by DN or none.

See also

empty_value = True#

Allow to select no entry.

class univention.admin.syntax.UserDN[source]#

Bases: UDM_Objects

Syntax to select an user from LDAP by DN.

See also

udm_modules: Sequence[str] = ('users/user',)#

Sequence of UDM module names to search for.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.HostDN[source]#

Bases: UDM_Objects

Syntax to select a host from LDAP by DN.

See also

udm_modules: Sequence[str] = ('computers/computer',)#

Sequence of UDM module names to search for.

udm_filter = '!(univentionObjectFlag=docker)'#

A LDAP filter string to further restrict the matching LDAP objects.

class univention.admin.syntax.UserID[source]#

Bases: UDM_Objects

Syntax to select an user from LDAP by numeric user identifier.

See also

>>> UserID.parse('0')
'0'
>>> UserID.parse(0)
'0'
udm_modules: Sequence[str] = ('users/user',)#

Sequence of UDM module names to search for.

key = '%(uidNumber)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

label: str | None = '%(username)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

regex: Pattern | None = re.compile('^[0-9]+$')#

Regular expression for validating the values.

static_values: Sequence[tuple[str, str]] | None = (('0', 'root'),)#

Sequence of additional static items.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

type_class#

alias of IntegerType

classmethod parse(text)[source]#
class univention.admin.syntax.GroupID[source]#

Bases: UDM_Objects

Syntax to select a group from LDAP by numeric user identifier.

>>> GroupID.parse('5000')
'5000'
>>> GroupID.parse(5000)
'5000'
udm_modules: Sequence[str] = ('groups/group',)#

Sequence of UDM module names to search for.

key = '%(gidNumber)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

label: str | None = '%(name)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

regex: Pattern | None = re.compile('^[0-9]+$')#

Regular expression for validating the values.

static_values: Sequence[tuple[str, str]] | None = (('0', 'root'),)#

Sequence of additional static items.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

type_class#

alias of IntegerType

classmethod parse(text)[source]#
class univention.admin.syntax.PortalComputer[source]#

Bases: UDM_Objects

Syntax to select a UCS host from LDAP by FQDN running the portal service.

udm_modules: Sequence[str] = ('computers/domaincontroller_master', 'computers/domaincontroller_backup', 'computers/domaincontroller_slave', 'computers/memberserver')#

Sequence of UDM module names to search for.

udm_filter = '!(univentionObjectFlag=docker)'#

A LDAP filter string to further restrict the matching LDAP objects.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

widget: str | None = 'umc/modules/udm/MultiObjectSelect'#

The corresponding widget which is used in UMC

search_widget = 'CheckBox'#

The corresponding widget which is used in UMC when searching for values of this property

widget_default_search_pattern: bool | str | None = False#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

class univention.admin.syntax.IComputer_FQDN[source]#

Bases: UDM_Objects

Syntax to select a host from LDAP by FQDN.

See also

>>> IComputer_FQDN.parse('a.bc')
'a.bc'
>>> IComputer_FQDN.parse('')
Traceback (most recent call last):
...
valueError:
>>> IComputer_FQDN.parse('ab')
Traceback (most recent call last):
...
valueError:
>>> IComputer_FQDN.parse('a.b')
Traceback (most recent call last):
...
valueError:
>>> IComputer_FQDN.parse('a.b')
Traceback (most recent call last):
...
valueError:
>>> IComputer_FQDN.parse('-a.bc')
Traceback (most recent call last):
...
valueError:
>>> IComputer_FQDN.parse('a.b_')
Traceback (most recent call last):
...
valueError:
>>> IComputer_FQDN.parse('0.bc')
Traceback (most recent call last):
...
valueError:
udm_modules: Sequence[str] = ()#

Sequence of UDM module names to search for.

key = '%(name)s.%(domain)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

label: str | None = '%(name)s.%(domain)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

regex: Pattern | None = re.compile('\n        (?=^ .{4,254}$ )\n        (?: (?![0-9]+\\. | [_-]) [a-zA-Z0-9_-]{1,63} (?<![_-]) \\. )+\n            (?![0-9]+$  | [_-]) [a-zA-Z0-9_-]{2,63} (?<![_-]) $\n        ', re.VERBOSE)#

Regular expression for validating the values.

error_message = 'Not a valid FQDN'#

Error message when an invalid item is selected.

udm_filter = '!(univentionObjectFlag=docker)'#

A LDAP filter string to further restrict the matching LDAP objects.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

class univention.admin.syntax.DomainController[source]#

Bases: IComputer_FQDN

Syntax to select a UCS Directory Node from LDAP by FQDN.

udm_modules: Sequence[str] = ('computers/domaincontroller_master', 'computers/domaincontroller_backup', 'computers/domaincontroller_slave')#

Sequence of UDM module names to search for.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.Windows_Server[source]#

Bases: IComputer_FQDN

Syntax to select a Windows server from LDAP by FQDN.

udm_modules: Sequence[str] = ('computers/windows', 'computers/windows_domaincontroller')#

Sequence of UDM module names to search for.

class univention.admin.syntax.UCS_Server[source]#

Bases: IComputer_FQDN

Syntax to select a UCS host from LDAP by FQDN.

udm_modules: Sequence[str] = ('computers/domaincontroller_master', 'computers/domaincontroller_backup', 'computers/domaincontroller_slave', 'computers/memberserver')#

Sequence of UDM module names to search for.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.ServicePrint_FQDN[source]#

Bases: IComputer_FQDN

Syntax to select a UCS host from LDAP by FQDN offering print services.

See also

udm_modules: Sequence[str] = ('computers/domaincontroller_master', 'computers/domaincontroller_backup', 'computers/domaincontroller_slave', 'computers/memberserver')#

Sequence of UDM module names to search for.

udm_filter = '(&(!(univentionObjectFlag=docker))(service=Print))'#

A LDAP filter string to further restrict the matching LDAP objects.

class univention.admin.syntax.MailHomeServer[source]#

Bases: IComputer_FQDN

Syntax to select a UCS host from LDAP by FQDN offering IMAP services.

See also

udm_modules: Sequence[str] = ('computers/computer',)#

Sequence of UDM module names to search for.

udm_filter = '(&(!(univentionObjectFlag=docker))(objectClass=univentionHost)(service=IMAP))'#

A LDAP filter string to further restrict the matching LDAP objects.

empty_value = True#

Allow to select no entry.

class univention.admin.syntax.KDE_Profile[source]#

Bases: UDM_Attribute

Syntax to select a KDE profile from lists stored in LDAP using univention.admin.handlers.settings.default.

udm_module: str | None = 'settings/default'#

UDM module name to search for.

attribute: str | None = 'defaultKdeProfiles'#

The UDM property name to use as the value for this syntax class.

class univention.admin.syntax.primaryGroup[source]#

Bases: ldapDn

Syntax to select a group from LDAP.

Deprecated since version 3.1-0: Use GroupDN.

searchFilter = 'objectClass=posixGroup'#
description = 'Primary Group'#
class univention.admin.syntax.primaryGroup2[source]#

Bases: ldapDn

Syntax to select a group from LDAP.

Deprecated since version 3.1-0: Use GroupDN.

searchFilter = 'objectClass=posixGroup'#
description = 'Primary Group'#
class univention.admin.syntax.network[source]#

Bases: UDM_Objects

Syntax to select a network declaration from LDAP using univention.admin.handlers.networks.network.

udm_modules: Sequence[str] = ('networks/network',)#

Sequence of UDM module names to search for.

description = 'Network'#
label: str | None = '%(name)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

empty_value = True#

Allow to select no entry.

get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.IP_AddressList[source]#

Bases: ipAddress, select

Syntax to select an IP address from the lists of addresses stored with the machine account.

choices: Sequence[tuple[str, str]] = []#
depends: str | None = 'ip'#

The name of another UDM property this syntax depends on.

javascript_dependency: bool = True#

Whether dependencies should be resolved via Javascript (instead via a further request)

widget: str | None = 'ComboBox'#

The corresponding widget which is used in UMC

class univention.admin.syntax.IP_AddressListEmpty[source]#

Bases: IP_AddressList

Syntax to select no or an IP address from the lists of addresses stored with the machine account.

choices: Sequence[tuple[str, str]] = [('', 'From known-hosts pool')]#
empty_value = True#

Allow the empty value.

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.MAC_AddressList[source]#

Bases: MAC_Address, select

Syntax to select a MAC address from the lists of addresses stored with the machine account.

choices: Sequence[tuple[str, str]] = []#
depends: str | None = 'mac'#

The name of another UDM property this syntax depends on.

javascript_dependency: bool = True#

Whether dependencies should be resolved via Javascript (instead via a further request)

widget: str | None = 'ComboBox'#

The corresponding widget which is used in UMC

class univention.admin.syntax.DNS_ForwardZone[source]#

Bases: UDM_Objects

Syntax to select no or one DNS forward zone from LDAP using univention.admin.handlers.dns.forward_zone.

description = 'DNS forward zone'#
udm_modules: Sequence[str] = ('dns/forward_zone',)#

Sequence of UDM module names to search for.

empty_value = True#

Allow to select no entry.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.DNS_ReverseZone[source]#

Bases: UDM_Objects

Syntax to select no or one DNS reverse zone from LDAP using univention.admin.handlers.dns.reverse_zone.

description = 'DNS reverse zone'#
udm_modules: Sequence[str] = ('dns/reverse_zone',)#

Sequence of UDM module names to search for.

label: str | None = '%(subnet)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

empty_value = True#

Allow to select no entry.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.DNS_ReverseZoneNonempty[source]#

Bases: DNS_ReverseZone

Syntax to select one DNS reverse zone from LDAP using univention.admin.handlers.dns.reverse_zone.

empty_value = False#

Allow to select no entry.

class univention.admin.syntax.DNS_ForwardZoneNonempty[source]#

Bases: DNS_ForwardZone

Syntax to select one DNS forward zone from LDAP using univention.admin.handlers.dns.forward_zone.

empty_value = False#

Allow to select no entry.

class univention.admin.syntax.dnsEntry[source]#

Bases: complex

Syntax to configure a DNS forward zone entry for a computer.

description = 'DNS Entry'#
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('DNS forward zone', <class 'univention.admin.syntax.DNS_ForwardZoneNonempty'>), ('IP address', <class 'univention.admin.syntax.IP_AddressList'>))#
subsyntax_names: tuple[str, ...] = ('forward-zone', 'ip')#
size: str | Sequence[str] = ('One', 'One')#

Widget size. See SIZES.

min_elements: int | None = 1#

Minimum number of required values.

class univention.admin.syntax.dnsEntryReverse[source]#

Bases: complex

Syntax to configure a DNS reverse zone entry for a computer.

description = 'DNS Entry Reverse'#
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('DNS reverse zone', <class 'univention.admin.syntax.DNS_ReverseZoneNonempty'>), ('IP address', <class 'univention.admin.syntax.IP_AddressList'>))#
subsyntax_names: tuple[str, ...] = ('reverse-zone', 'ip')#
size: str | Sequence[str] = ('One', 'One')#

Widget size. See SIZES.

min_elements: int | None = 1#

Minimum number of required values.

class univention.admin.syntax.DNS_ForwardZoneList[source]#

Bases: select

Syntax to select DNS forward zone for alias entries.

>>> DNS_ForwardZoneList.parse('some name')
'some name'
>>> DNS_ForwardZoneList.get_choices(None, {'dependencies': {'dnsEntryZoneForward': [["zoneName=example.org,cn=dns,dc=base", "1.2.3.4"]]}})
[('example.org', 'example.org')]
depends: str | None = 'dnsEntryZoneForward'#

The name of another UDM property this syntax depends on.

javascript_dependency: bool = True#

Whether dependencies should be resolved via Javascript (instead via a further request)

classmethod get_choices(lo, options)[source]#

Get the choices w.r.t. dependencies

class univention.admin.syntax.dnsEntryAlias[source]#

Bases: complex

Syntax to configure a DNS alias record.

description = 'DNS Entry Alias'#
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Zone of existing host record', <class 'univention.admin.syntax.DNS_ForwardZoneList'>), ('DNS forward zone', <class 'univention.admin.syntax.DNS_ForwardZone'>), ('Alias', <class 'univention.admin.syntax.dnsName'>))#
subsyntax_names: tuple[str, ...] = ('zone', 'forward-zone', 'alias')#
size: str | Sequence[str] = ('TwoThirds', 'TwoThirds', 'TwoThirds')#

Widget size. See SIZES.

class univention.admin.syntax.dhcpService[source]#

Bases: UDM_Objects

Syntax to select a DHCP service from LDAP using univention.admin.handlers.dhcp.service.

udm_modules: Sequence[str] = ('dhcp/service',)#

Sequence of UDM module names to search for.

description = 'DHCP service'#
label: str | None = '%(name)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

empty_value = True#

Allow to select no entry.

class univention.admin.syntax.dhcpEntry[source]#

Bases: complex

Syntax to configure a DHCP host entry.

>>> dhcpEntry.parse(["cn=service", "aabbccddeeff"])
['cn=service', '', 'aa:bb:cc:dd:ee:ff']
>>> dhcpEntry.parse(["cn=service", "127.0.0.1", "aabbccddeeff"])
['cn=service', '127.0.0.1', 'aa:bb:cc:dd:ee:ff']
min_elements: int | None = 1#

Minimum number of required values.

all_required = False#

All sub-values must contain a value.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('DHCP service', <class 'univention.admin.syntax.dhcpService'>), ('IP address', <class 'univention.admin.syntax.IP_AddressListEmpty'>), ('MAC address', <class 'univention.admin.syntax.MAC_AddressList'>))#
subsyntax_names: tuple[str, ...] = ('service', 'ip', 'mac')#
description = 'DHCP Entry'#
size: str | Sequence[str] = ('TwoThirds', 'TwoThirds', 'TwoThirds')#

Widget size. See SIZES.

classmethod parse(text)[source]#
class univention.admin.syntax.DHCP_Option[source]#

Bases: complex

Syntax to enter free-form DHCP options.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Name', <class 'univention.admin.syntax.string'>), ('Value', <class 'univention.admin.syntax.string'>))#
subsyntax_key_value = True#
description = 'DHCP option'#
size: str | Sequence[str] = ('One', 'One')#

Widget size. See SIZES.

class univention.admin.syntax.WritableShare[source]#

Bases: UDM_Objects

Syntax for selecting defined writeable NFS shares.

See also

udm_modules: Sequence[str] = ('shares/share',)#

Sequence of UDM module names to search for.

udm_filter = 'writeable=1'#

A LDAP filter string to further restrict the matching LDAP objects.

label: str | None = '%(name)s (%(path)s on %(host)s)'#

The UDM property name enclosed in %()s, which is used as the displayed value.

size: str | Sequence[str] = 'OneAndAHalf'#

Widget size. See SIZES.

empty_value = True#

Allow to select no entry.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.AllowDenyIgnore[source]#

Bases: select

Syntax class for a tri-state select between allow, deny and ignore.

choices: Sequence[Any] = [('', ''), ('allow', 'allow'), ('deny', 'deny'), ('ignore', 'ignore')]#
class univention.admin.syntax.IStates[source]#

Bases: select

Base syntax to select item from list of choices with a mapping between Python and LDAP values.

values: Sequence[tuple[Any, tuple[str, str]]] = []#

Map Python type to 2-tuple (LDAP-value, translated-text).

choices: Sequence[Any] = []#
classmethod parse(text)[source]#
classmethod get_object_property_filter(object_property, object_property_value, allow_asterisks=True)[source]#

Get a LDAP filter for a certain property

>>> ISyntax.get_object_property_filter('foo', 'bar')
'foo=bar'
>>> ISyntax.get_object_property_filter('foo', 'bar*')
'(|(foo=bar*)(foo=bar))'
classmethod sanitize_property_search_value(search_value)[source]#
class univention.admin.syntax.AllowDeny[source]#

Bases: IStates

Syntax class for a tri-state select between None, “allow” and “deny”.

>>> AllowDeny.choices
[('', ''), ('allow', 'allow'), ('deny', 'deny')]
>>> AllowDeny.sanitize_property_search_value(True)
'allow'
>>> AllowDeny.sanitize_property_search_value(False)
'deny'
values: Sequence[tuple[Any, tuple[str, str]]] = ((None, ('', '')), (True, ('allow', 'allow')), (False, ('deny', 'deny')))#

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class#

alias of TriBooleanType

class univention.admin.syntax.booleanNone[source]#

Bases: IStates

Syntax class for a tri-state select between None, “yes” and “no”.

>>> booleanNone.parse("yes")
'yes'
>>> booleanNone.parse("no")
'no'
>>> booleanNone.parse("maybe")
Traceback (most recent call last):
...
valueInvalidSyntax:
values: Sequence[tuple[Any, tuple[str, str]]] = ((None, ('', '')), (True, ('yes', 'Yes')), (False, ('no', 'No')))#

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class#

alias of TriBooleanType

class univention.admin.syntax.auto_one_zero[source]#

Bases: select

Syntax class for a tri-state select between “Auto”, “Yes” and “No”.

choices: Sequence[Any] = [('Auto', 'Auto'), ('1', 'Yes'), ('0', 'No')]#
class univention.admin.syntax.TrueFalse[source]#

Bases: IStates

Syntax class for a tri-state select between None, “true” and “false”.

>>> TrueFalse.sanitize_property_search_value(True)
'true'
>>> TrueFalse.sanitize_property_search_value(False)
'false'
values: Sequence[tuple[Any, tuple[str, str]]] = ((None, ('', '')), (True, ('true', 'True')), (False, ('false', 'False')))#

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class#

alias of TriBooleanType

class univention.admin.syntax.TrueFalseUpper[source]#

Bases: IStates

Syntax class for a tri-state select between None, “TRUE” and “FALSE”.

>>> TrueFalseUpper.sanitize_property_search_value(True)
'TRUE'
>>> TrueFalseUpper.sanitize_property_search_value(False)
'FALSE'
>>> TrueFalseUpper.get_object_property_filter("myAttr", "wrong...")
''
>>> TrueFalseUpper.get_object_property_filter("myAttr", "TRUE")
'myAttr=TRUE'
>>> TrueFalseUpper.get_object_property_filter("myAttr", "")
'(!(myAttr=*))'
values: Sequence[tuple[Any, tuple[str, str]]] = ((None, ('', '')), (True, ('TRUE', 'True')), (False, ('FALSE', 'False')))#

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class#

alias of TriBooleanType

class univention.admin.syntax.TrueFalseUp[source]#

Bases: IStates

Syntax for bool’ean value matching LDAP boolean (OID 1.3.6.1.4.1.1466.115.121.1.7).

>>> TrueFalseUp.sanitize_property_search_value(True)
'TRUE'
>>> TrueFalseUp.sanitize_property_search_value(False)
'FALSE'
>>> TrueFalseUp.get_object_property_filter("myAttr", "FALSE")
'(|(myAttr=FALSE)(!(myAttr=*)))'
values: Sequence[tuple[Any, tuple[str, str]]] = ((True, ('TRUE', 'True')), (False, ('FALSE', 'False')))#

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class#

alias of BooleanType

widget: str | None = 'CheckBox'#

The corresponding widget which is used in UMC

search_widget = 'CheckBox'#

The corresponding widget which is used in UMC when searching for values of this property

widget_default_search_pattern: bool | str | None = False#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

class univention.admin.syntax.AppActivatedTrue[source]#

Bases: TrueFalseUp

class univention.admin.syntax.OkOrNot[source]#

Bases: IStates

Syntax class to a boolean select between “OK” and “Not”.

values: Sequence[tuple[Any, tuple[str, str]]] = ((True, ('OK', 'OK')), (False, ('Not', 'Not OK')))#

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class#

alias of BooleanType

widget: str | None = 'CheckBox'#

The corresponding widget which is used in UMC

search_widget = 'CheckBox'#

The corresponding widget which is used in UMC when searching for values of this property

widget_default_search_pattern: bool | str | None = False#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

class univention.admin.syntax.AppActivatedOK[source]#

Bases: OkOrNot

class univention.admin.syntax.ddnsUpdateStyle[source]#

Bases: select

Syntax to select the DHCP dynamic DNS update style.

choices: Sequence[Any] = [('', ''), ('ad-hoc', 'ad-hoc'), ('interim', 'interim'), ('none', 'none')]#
class univention.admin.syntax.ddnsUpdates[source]#

Bases: IStates

Syntax class for a tri-state select between None, “on” and “off”.

values: Sequence[tuple[Any, tuple[str, str]]] = ((None, ('', '')), (True, ('on', 'on')), (False, ('off', 'off')))#

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class#

alias of TriBooleanType

class univention.admin.syntax.netbiosNodeType[source]#

Bases: select

Syntax to select the Windows name server mode.

choices: Sequence[Any] = [('', ''), ('1', '1 B-node: Broadcast - no WINS'), ('2', '2 P-node: Peer - WINS only'), ('4', '4 M-node: Mixed - broadcast, then WINS'), ('8', '8 H-node: Hybrid - WINS, then broadcast')]#
class univention.admin.syntax.kdeProfile[source]#

Bases: select

Syntax to select KDE profile type.

choices: Sequence[Any] = [('', 'none'), ('/home/kde.restricted', 'restricted'), ('/home/kde.lockeddown', 'locked down')]#
class univention.admin.syntax.language[source]#

Bases: select

Syntax for selecting a language by name.

choices: Sequence[Any] = [('', ''), ('af_ZA', 'Afrikaans/South Africa'), ('af_ZA.UTF-8', 'Afrikaans/South Africa(UTF-8)'), ('sq_AL', 'Albanian/Albania'), ('sq_AL.UTF-8', 'Albanian/Albania(UTF-8)'), ('am_ET', 'Amharic/Ethiopia'), ('ar_DZ', 'Arabic/Algeria'), ('ar_DZ.UTF-8', 'Arabic/Algeria(UTF-8)'), ('ar_BH', 'Arabic/Bahrain'), ('ar_BH.UTF-8', 'Arabic/Bahrain(UTF-8)'), ('ar_EG', 'Arabic/Egypt'), ('ar_EG.UTF-8', 'Arabic/Egypt(UTF-8)'), ('ar_IN', 'Arabic/India'), ('ar_IQ', 'Arabic/Iraq'), ('ar_IQ.UTF-8', 'Arabic/Iraq(UTF-8)'), ('ar_JO', 'Arabic/Jordan'), ('ar_JO.UTF-8', 'Arabic/Jordan(UTF-8)'), ('ar_KW', 'Arabic/Kuwait'), ('ar_KW.UTF-8', 'Arabic/Kuwait(UTF-8)'), ('ar_LB', 'Arabic/Lebanon'), ('ar_LB.UTF-8', 'Arabic/Lebanon(UTF-8)'), ('ar_LY', 'Arabic/Libyan Arab Jamahiriya'), ('ar_LY.UTF-8', 'Arabic/Libyan Arab Jamahiriya(UTF-8)'), ('ar_MA', 'Arabic/Morocco'), ('ar_MA.UTF-8', 'Arabic/Morocco(UTF-8)'), ('ar_OM', 'Arabic/Oman'), ('ar_OM.UTF-8', 'Arabic/Oman(UTF-8)'), ('ar_QA', 'Arabic/Qatar'), ('ar_QA.UTF-8', 'Arabic/Qatar(UTF-8)'), ('ar_SA', 'Arabic/Saudi Arabia'), ('ar_SA.UTF-8', 'Arabic/Saudi Arabia(UTF-8)'), ('ar_SD', 'Arabic/Sudan'), ('ar_SD.UTF-8', 'Arabic/Sudan(UTF-8)'), ('ar_SY', 'Arabic/Syrian Arab Republic'), ('ar_SY.UTF-8', 'Arabic/Syrian Arab Republic(UTF-8)'), ('ar_TN', 'Arabic/Tunisia'), ('ar_TN.UTF-8', 'Arabic/Tunisia(UTF-8)'), ('ar_AE', 'Arabic/United Arab Emirates'), ('ar_AE.UTF-8', 'Arabic/United Arab Emirates(UTF-8)'), ('ar_YE', 'Arabic/Yemen'), ('ar_YE.UTF-8', 'Arabic/Yemen(UTF-8)'), ('an_ES', 'Aragonese/Spain'), ('an_ES.UTF-8', 'Aragonese/Spain(UTF-8)'), ('hy_AM', 'Armenian/Armenia'), ('az_AZ', 'Azeri/Azerbaijan'), ('eu_ES@euro', 'Basque/Spain'), ('eu_ES.UTF-8', 'Basque/Spain(UTF-8)'), ('be_BY', 'Belarusian/Belarus'), ('be_BY.UTF-8', 'Belarusian/Belarus(UTF-8)'), ('bn_BD', 'Bengali/BD'), ('bn_IN', 'Bengali/India'), ('bs_BA', 'Bosnian/Bosnia and Herzegowina'), ('bs_BA.UTF-8', 'Bosnian/Bosnia and Herzegowina(UTF-8)'), ('br_FR@euro', 'Breton/France'), ('br_FR.UTF-8', 'Breton/France(UTF-8)'), ('bg_BG', 'Bulgarian/Bulgaria'), ('bg_BG.UTF-8', 'Bulgarian/Bulgaria(UTF-8)'), ('ca_ES@euro', 'Catalan/Spain'), ('ca_ES.UTF-8', 'Catalan/Spain(UTF-8)'), ('zh_HK', 'Chinese/Hong Kong'), ('zh_HK.UTF-8', 'Chinese/Hong Kong(UTF-8)'), ('zh_CN', 'Chinese/P.R. of China'), ('zh_CN.UTF-8', 'Chinese/P.R. of China(UTF-8)'), ('zh_SG', 'Chinese/Singapore'), ('zh_SG.UTF-8', 'Chinese/Singapore(UTF-8)'), ('zh_TW', 'Chinese/Taiwan R.O.C.'), ('zh_TW.UTF-8', 'Chinese/Taiwan R.O.C.(UTF-8)'), ('kw_GB', 'Cornish/Britain'), ('kw_GB.UTF-8', 'Cornish/Britain(UTF-8)'), ('hr_HR', 'Croatian/Croatia'), ('hr_HR.UTF-8', 'Croatian/Croatia(UTF-8)'), ('cs_CZ', 'Czech/Czech Republic'), ('cs_CZ.UTF-8', 'Czech/Czech Republic(UTF-8)'), ('da_DK', 'Danish/Denmark'), ('da_DK.UTF-8', 'Danish/Denmark(UTF-8)'), ('nl_BE@euro', 'Dutch/Belgium'), ('nl_BE.UTF-8', 'Dutch/Belgium(UTF-8)'), ('nl_NL@euro', 'Dutch/Netherlands'), ('nl_NL.UTF-8', 'Dutch/Netherlands(UTF-8)'), ('en_AU', 'English/Australia'), ('en_AU.UTF-8', 'English/Australia(UTF-8)'), ('en_BW', 'English/Botswana'), ('en_BW.UTF-8', 'English/Botswana(UTF-8)'), ('en_CA', 'English/Canada'), ('en_CA.UTF-8', 'English/Canada(UTF-8)'), ('en_DK', 'English/Denmark'), ('en_DK.UTF-8', 'English/Denmark(UTF-8)'), ('en_GB', 'English/Great Britain'), ('en_GB.UTF-8', 'English/Great Britain(UTF-8)'), ('en_HK', 'English/Hong Kong'), ('en_HK.UTF-8', 'English/Hong Kong(UTF-8)'), ('en_IN', 'English/India'), ('en_IE@euro', 'English/Ireland'), ('en_IE.UTF-8', 'English/Ireland(UTF-8)'), ('en_NZ', 'English/New Zealand'), ('en_NZ.UTF-8', 'English/New Zealand(UTF-8)'), ('en_PH', 'English/Philippines'), ('en_PH.UTF-8', 'English/Philippines(UTF-8)'), ('en_SG', 'English/Singapore'), ('en_SG.UTF-8', 'English/Singapore(UTF-8)'), ('en_ZA', 'English/South Africa'), ('en_ZA.UTF-8', 'English/South Africa(UTF-8)'), ('en_US', 'English/USA'), ('en_US.UTF-8', 'English/USA(UTF-8)'), ('en_ZW', 'English/Zimbabwe'), ('en_ZW.UTF-8', 'English/Zimbabwe(UTF-8)'), ('eo_EO', 'Esperanto/Esperanto'), ('et_EE', 'Estonian/Estonia'), ('et_EE.UTF-8', 'Estonian/Estonia(UTF-8)'), ('fo_FO', 'Faroese/Faroe Islands'), ('fo_FO.UTF-8', 'Faroese/Faroe Islands(UTF-8)'), ('fi_FI@euro', 'Finnish/Finland'), ('fi_FI.UTF-8', 'Finnish/Finland(UTF-8)'), ('fr_BE@euro', 'French/Belgium'), ('fr_BE.UTF-8', 'French/Belgium(UTF-8)'), ('fr_CA', 'French/Canada'), ('fr_CA.UTF-8', 'French/Canada(UTF-8)'), ('fr_FR@euro', 'French/France'), ('fr_FR.UTF-8', 'French/France(UTF-8)'), ('fr_LU@euro', 'French/Luxemburg'), ('fr_LU.UTF-8', 'French/Luxemburg(UTF-8)'), ('fr_CH', 'French/Switzerland'), ('fr_CH.UTF-8', 'French/Switzerland(UTF-8)'), ('gl_ES@euro', 'Galician/Spain'), ('gl_ES.UTF-8', 'Galician/Spain(UTF-8)'), ('ka_GE', 'Georgian/Georgia'), ('ka_GE.UTF-8', 'Georgian/Georgia(UTF-8)'), ('de_AT@euro', 'German/Austria'), ('de_AT.UTF-8', 'German/Austria(UTF-8)'), ('de_BE@euro', 'German/Belgium'), ('de_BE.UTF-8', 'German/Belgium(UTF-8)'), ('de_DE', 'German/Germany'), ('de_DE.UTF-8', 'German/Germany(UTF-8)'), ('de_DE@euro', 'German/Germany(euro)'), ('de_LU@euro', 'German/Luxemburg'), ('de_LU.UTF-8', 'German/Luxemburg(UTF-8)'), ('de_CH', 'German/Switzerland'), ('de_CH.UTF-8', 'German/Switzerland(UTF-8)'), ('el_GR@euro', 'Greek/Greece'), ('el_GR.UTF-8', 'Greek/Greece(UTF-8)'), ('kl_GL', 'Greenlandic/Greenland'), ('kl_GL.UTF-8', 'Greenlandic/Greenland(UTF-8)'), ('iw_IL', 'Hebrew/Israel'), ('iw_IL.UTF-8', 'Hebrew/Israel(UTF-8)'), ('he_IL', 'Hebrew/Israel'), ('he_IL.UTF-8', 'Hebrew/Israel(UTF-8)'), ('hi_IN', 'Hindi/India'), ('hu_HU', 'Hungarian/Hungary'), ('hu_HU.UTF-8', 'Hungarian/Hungary(UTF-8)'), ('is_IS', 'Icelandic/Iceland'), ('is_IS.UTF-8', 'Icelandic/Iceland(UTF-8)'), ('id_ID', 'Indonesian/Indonesia'), ('id_ID.UTF-8', 'Indonesian/Indonesia(UTF-8)'), ('ga_IE@euro', 'Irish/Ireland'), ('ga_IE.UTF-8', 'Irish/Ireland(UTF-8)'), ('it_IT@euro', 'Italian/Italy'), ('it_IT.UTF-8', 'Italian/Italy(UTF-8)'), ('it_CH', 'Italian/Switzerland'), ('it_CH.UTF-8', 'Italian/Switzerland(UTF-8)'), ('ja_JP', 'Japanese/Japan'), ('ko_KR', 'Korean/Republic of Korea'), ('lo_LA', 'Lao/Laos'), ('lv_LV', 'Latvian/Latvia'), ('lv_LV.UTF-8', 'Latvian/Latvia(UTF-8)'), ('lt_LT', 'Lithuanian/Lithuania'), ('lt_LT.UTF-8', 'Lithuanian/Lithuania(UTF-8)'), ('lug_UG', 'Luganda/Uganda'), ('mk_MK', 'Macedonian/Macedonia'), ('mk_MK.UTF-8', 'Macedonian/Macedonia(UTF-8)'), ('ms_MY', 'Malay/Malaysia'), ('ms_MY.UTF-8', 'Malay/Malaysia(UTF-8)'), ('ml_IN', 'Malayalam/India'), ('mt_MT', 'Maltese/malta'), ('mt_MT.UTF-8', 'Maltese/malta(UTF-8)'), ('gv_GB', 'Manx Gaelic/Britain'), ('gv_GB.UTF-8', 'Manx Gaelic/Britain(UTF-8)'), ('mi_NZ', 'Maori/New Zealand'), ('mi_NZ.UTF-8', 'Maori/New Zealand(UTF-8)'), ('mr_IN', 'Marathi/India'), ('mn_MN', 'Mongolian/Mongolia'), ('se_NO', 'Northern Saami/Norway'), ('nn_NO', 'Norwegian, Nynorsk/Norway'), ('nn_NO.UTF-8', 'Norwegian, Nynorsk/Norway(UTF-8)'), ('no_NO', 'Norwegian/Norway'), ('no_NO.UTF-8', 'Norwegian/Norway(UTF-8)'), ('oc_FR', 'Occitan/France'), ('oc_FR.UTF-8', 'Occitan/France(UTF-8)'), ('fa_IR', 'Persian/Iran'), ('pl_PL', 'Polish/Poland'), ('pl_PL.UTF-8', 'Polish/Poland(UTF-8)'), ('pt_BR', 'Portuguese/Brasil'), ('pt_BR.UTF-8', 'Portuguese/Brasil(UTF-8)'), ('pt_PT@euro', 'Portuguese/Portugal'), ('pt_PT.UTF-8', 'Portuguese/Portugal(UTF-8)'), ('ro_RO', 'Romanian/Romania'), ('ro_RO.UTF-8', 'Romanian/Romania(UTF-8)'), ('ru_RU', 'Russian/Russia'), ('ru_RU.UTF-8', 'Russian/Russia(UTF-8)'), ('ru_UA', 'Russian/Ukraine'), ('ru_UA.UTF-8', 'Russian/Ukraine(UTF-8)'), ('gd_GB', 'Scots Gaelic/Great Britain'), ('gd_GB.UTF-8', 'Scots Gaelic/Great Britain(UTF-8)'), ('sr_YU@cyrillic', 'Serbian/Yugoslavia'), ('sk_SK', 'Slovak/Slovak'), ('sk_SK.UTF-8', 'Slovak/Slovak(UTF-8)'), ('sl_SI', 'Slovenian/Slovenia'), ('sl_SI.UTF-8', 'Slovenian/Slovenia(UTF-8)'), ('st_ZA', 'Sotho/South Africa'), ('st_ZA.UTF-8', 'Sotho/South Africa(UTF-8)'), ('es_AR', 'Spanish/Argentina'), ('es_AR.UTF-8', 'Spanish/Argentina(UTF-8)'), ('es_BO', 'Spanish/Bolivia'), ('es_BO.UTF-8', 'Spanish/Bolivia(UTF-8)'), ('es_CL', 'Spanish/Chile'), ('es_CL.UTF-8', 'Spanish/Chile(UTF-8)'), ('es_CO', 'Spanish/Colombia'), ('es_CO.UTF-8', 'Spanish/Colombia(UTF-8)'), ('es_CR', 'Spanish/Costa Rica'), ('es_CR.UTF-8', 'Spanish/Costa Rica(UTF-8)'), ('es_DO', 'Spanish/Dominican Republic'), ('es_DO.UTF-8', 'Spanish/Dominican Republic(UTF-8)'), ('es_EC', 'Spanish/Ecuador'), ('es_EC.UTF-8', 'Spanish/Ecuador(UTF-8)'), ('es_SV', 'Spanish/El Salvador'), ('es_SV.UTF-8', 'Spanish/El Salvador(UTF-8)'), ('es_GT', 'Spanish/Guatemala'), ('es_GT.UTF-8', 'Spanish/Guatemala(UTF-8)'), ('es_HN', 'Spanish/Honduras'), ('es_HN.UTF-8', 'Spanish/Honduras(UTF-8)'), ('es_MX', 'Spanish/Mexico'), ('es_MX.UTF-8', 'Spanish/Mexico(UTF-8)'), ('es_NI', 'Spanish/Nicaragua'), ('es_NI.UTF-8', 'Spanish/Nicaragua(UTF-8)'), ('es_PA', 'Spanish/Panama'), ('es_PA.UTF-8', 'Spanish/Panama(UTF-8)'), ('es_PY', 'Spanish/Paraguay'), ('es_PY.UTF-8', 'Spanish/Paraguay(UTF-8)'), ('es_PE', 'Spanish/Peru'), ('es_PE.UTF-8', 'Spanish/Peru(UTF-8)'), ('es_PR', 'Spanish/Puerto Rico'), ('es_PR.UTF-8', 'Spanish/Puerto Rico(UTF-8)'), ('es_ES@euro', 'Spanish/Spain'), ('es_ES.UTF-8', 'Spanish/Spain(UTF-8)'), ('es_US', 'Spanish/USA'), ('es_US.UTF-8', 'Spanish/USA(UTF-8)'), ('es_UY', 'Spanish/Uruguay'), ('es_UY.UTF-8', 'Spanish/Uruguay(UTF-8)'), ('es_VE', 'Spanish/Venezuela'), ('es_VE.UTF-8', 'Spanish/Venezuela(UTF-8)'), ('sv_FI@euro', 'Swedish/Finland'), ('sv_FI.UTF-8', 'Swedish/Finland(UTF-8)'), ('sv_SE', 'Swedish/Sweden'), ('sv_SE.UTF-8', 'Swedish/Sweden(UTF-8)'), ('tl_PH', 'Tagalog/Philippines'), ('tl_PH.UTF-8', 'Tagalog/Philippines(UTF-8)'), ('tg_TJ', 'Tajik/Tajikistan'), ('tg_TJ.UTF-8', 'Tajik/Tajikistan(UTF-8)'), ('ta_IN', 'Tamil/India'), ('tt_RU', 'Tatar/Tatarstan'), ('te_IN', 'Telgu/India'), ('th_TH', 'Thai/Thailand'), ('th_TH.UTF-8', 'Thai/Thailand(UTF-8)'), ('ti_ER', 'Tigrigna/Eritrea'), ('ti_ET', 'Tigrigna/Ethiopia'), ('tr_TR', 'Turkish/Turkey'), ('tr_TR.UTF-8', 'Turkish/Turkey(UTF-8)'), ('uk_UA', 'Ukrainian/Ukraine'), ('uk_UA.UTF-8', 'Ukrainian/Ukraine(UTF-8)'), ('ur_PK', 'Urdu/Pakistan'), ('uz_UZ', 'Uzbek/Uzbekistan'), ('uz_UZ.UTF-8', 'Uzbek/Uzbekistan(UTF-8)'), ('vi_VN', 'Vietnamese/Vietnam'), ('wa_BE@euro', 'Walloon/Belgium'), ('wa_BE.UTF-8', 'Walloon/Belgium(UTF-8)'), ('cy_GB', 'Welsh/Great Britain'), ('cy_GB.UTF-8', 'Welsh/Great Britain(UTF-8)'), ('xh_ZA', 'Xhosa/South Africa'), ('xh_ZA.UTF-8', 'Xhosa/South Africa(UTF-8)'), ('yi_US', 'Yiddish/USA'), ('yi_US.UTF-8', 'Yiddish/USA(UTF-8)'), ('zu_ZA', 'Zulu/South Africa'), ('zu_ZA.UTF-8', 'Zulu/South Africa(UTF-8)')]#
class univention.admin.syntax.Month[source]#

Bases: select

Syntax to select the month of a year.

choices: Sequence[Any] = [('', ''), ('all', 'all'), ('January', 'January'), ('February', 'February'), ('March', 'March'), ('April', 'April'), ('May', 'May'), ('June', 'June'), ('July', 'July'), ('August', 'August'), ('September', 'September'), ('October', 'October'), ('November', 'November'), ('December', 'December')]#
class univention.admin.syntax.Weekday[source]#

Bases: select

Syntax to select the day of a week.

choices: Sequence[Any] = [('', ''), ('all', 'all'), ('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')]#
class univention.admin.syntax.Day[source]#

Bases: select

Syntax to select the day of a month.

choices: Sequence[Any] = [('', ''), ('all', 'all'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11'), ('12', '12'), ('13', '13'), ('14', '14'), ('15', '15'), ('16', '16'), ('17', '17'), ('18', '18'), ('19', '19'), ('20', '20'), ('21', '21'), ('22', '22'), ('23', '23'), ('24', '24'), ('25', '25'), ('26', '26'), ('27', '27'), ('28', '28'), ('29', '29'), ('30', '30'), ('31', '31')]#
class univention.admin.syntax.Hour[source]#

Bases: select

Syntax to select the hour of a day or all or none.

choices: Sequence[Any] = [('', ''), ('all', 'all'), ('00', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11'), ('12', '12'), ('13', '13'), ('14', '14'), ('15', '15'), ('16', '16'), ('17', '17'), ('18', '18'), ('19', '19'), ('20', '20'), ('21', '21'), ('22', '22'), ('23', '23')]#
class univention.admin.syntax.HourSimple[source]#

Bases: select

Syntax to select the hour of a day.

choices: Sequence[Any] = [('00', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10'), ('11', '11'), ('12', '12'), ('13', '13'), ('14', '14'), ('15', '15'), ('16', '16'), ('17', '17'), ('18', '18'), ('19', '19'), ('20', '20'), ('21', '21'), ('22', '22'), ('23', '23')]#
class univention.admin.syntax.Minute[source]#

Bases: select

Syntax to select the minute of a hour or all or none.

choices: Sequence[Any] = [('', ''), ('all', 'all'), ('00', '0'), ('5', '5'), ('10', '10'), ('15', '15'), ('20', '20'), ('25', '25'), ('30', '30'), ('35', '35'), ('40', '40'), ('45', '45'), ('50', '50'), ('55', '55')]#
class univention.admin.syntax.MinuteSimple[source]#

Bases: select

Syntax to select the minute of a hour.

choices: Sequence[Any] = [('00', '0'), ('5', '5'), ('10', '10'), ('15', '15'), ('20', '20'), ('25', '25'), ('30', '30'), ('35', '35'), ('40', '40'), ('45', '45'), ('50', '50'), ('55', '55')]#
class univention.admin.syntax.UNIX_AccessRight[source]#

Bases: simple

Syntax to configure UNIX file permissions.

widget: str | None = 'UnixAccessRights'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = '000'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

class univention.admin.syntax.UNIX_AccessRight_extended[source]#

Bases: simple

Syntax to configure UNIX file permissions including setUID, setGID and sticky bits.

See also

widget: str | None = 'UnixAccessRightsExtended'#

The corresponding widget which is used in UMC

widget_default_search_pattern: bool | str | None = '0000'#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

class univention.admin.syntax.sambaGroupType[source]#

Bases: select

Syntax to select Samba group type.

choices: Sequence[Any] = [('', ''), ('2', 'Domain Group'), ('3', 'Local Group'), ('5', 'Well-Known Group')]#
class univention.admin.syntax.adGroupType[source]#

Bases: select

Syntax to select Active Directory group type.

choices: Sequence[Any] = [('', ''), ('-2147483643', 'Local (Type: Security)'), ('-2147483646', 'Global (Type: Security)'), ('-2147483640', 'Universal (Type: Security)'), ('-2147483644', 'Domain local (Type: Security)'), ('4', 'Local (Type: Distribution)'), ('2', 'Global (Type: Distribution)'), ('8', 'Universal (Type: Distribution)')]#
class univention.admin.syntax.SambaLogonHours[source]#

Bases: MultiSelect

Syntax to select hour slots per day for Samba login.

>>> SambaLogonHours.parse("000000000000000000000000000000000000000000")
[]
>>> SambaLogonHours.parse("162 163")
[162, 163]
>>> SambaLogonHours.parse("5000")
Traceback (most recent call last):
...
valueError:
choices: Sequence[tuple[Any, str]] = [(0, 'Sun 0-1'), (1, 'Sun 1-2'), (2, 'Sun 2-3'), (3, 'Sun 3-4'), (4, 'Sun 4-5'), (5, 'Sun 5-6'), (6, 'Sun 6-7'), (7, 'Sun 7-8'), (8, 'Sun 8-9'), (9, 'Sun 9-10'), (10, 'Sun 10-11'), (11, 'Sun 11-12'), (12, 'Sun 12-13'), (13, 'Sun 13-14'), (14, 'Sun 14-15'), (15, 'Sun 15-16'), (16, 'Sun 16-17'), (17, 'Sun 17-18'), (18, 'Sun 18-19'), (19, 'Sun 19-20'), (20, 'Sun 20-21'), (21, 'Sun 21-22'), (22, 'Sun 22-23'), (23, 'Sun 23-24'), (24, 'Mon 0-1'), (25, 'Mon 1-2'), (26, 'Mon 2-3'), (27, 'Mon 3-4'), (28, 'Mon 4-5'), (29, 'Mon 5-6'), (30, 'Mon 6-7'), (31, 'Mon 7-8'), (32, 'Mon 8-9'), (33, 'Mon 9-10'), (34, 'Mon 10-11'), (35, 'Mon 11-12'), (36, 'Mon 12-13'), (37, 'Mon 13-14'), (38, 'Mon 14-15'), (39, 'Mon 15-16'), (40, 'Mon 16-17'), (41, 'Mon 17-18'), (42, 'Mon 18-19'), (43, 'Mon 19-20'), (44, 'Mon 20-21'), (45, 'Mon 21-22'), (46, 'Mon 22-23'), (47, 'Mon 23-24'), (48, 'Tue 0-1'), (49, 'Tue 1-2'), (50, 'Tue 2-3'), (51, 'Tue 3-4'), (52, 'Tue 4-5'), (53, 'Tue 5-6'), (54, 'Tue 6-7'), (55, 'Tue 7-8'), (56, 'Tue 8-9'), (57, 'Tue 9-10'), (58, 'Tue 10-11'), (59, 'Tue 11-12'), (60, 'Tue 12-13'), (61, 'Tue 13-14'), (62, 'Tue 14-15'), (63, 'Tue 15-16'), (64, 'Tue 16-17'), (65, 'Tue 17-18'), (66, 'Tue 18-19'), (67, 'Tue 19-20'), (68, 'Tue 20-21'), (69, 'Tue 21-22'), (70, 'Tue 22-23'), (71, 'Tue 23-24'), (72, 'Wed 0-1'), (73, 'Wed 1-2'), (74, 'Wed 2-3'), (75, 'Wed 3-4'), (76, 'Wed 4-5'), (77, 'Wed 5-6'), (78, 'Wed 6-7'), (79, 'Wed 7-8'), (80, 'Wed 8-9'), (81, 'Wed 9-10'), (82, 'Wed 10-11'), (83, 'Wed 11-12'), (84, 'Wed 12-13'), (85, 'Wed 13-14'), (86, 'Wed 14-15'), (87, 'Wed 15-16'), (88, 'Wed 16-17'), (89, 'Wed 17-18'), (90, 'Wed 18-19'), (91, 'Wed 19-20'), (92, 'Wed 20-21'), (93, 'Wed 21-22'), (94, 'Wed 22-23'), (95, 'Wed 23-24'), (96, 'Thu 0-1'), (97, 'Thu 1-2'), (98, 'Thu 2-3'), (99, 'Thu 3-4'), (100, 'Thu 4-5'), (101, 'Thu 5-6'), (102, 'Thu 6-7'), (103, 'Thu 7-8'), (104, 'Thu 8-9'), (105, 'Thu 9-10'), (106, 'Thu 10-11'), (107, 'Thu 11-12'), (108, 'Thu 12-13'), (109, 'Thu 13-14'), (110, 'Thu 14-15'), (111, 'Thu 15-16'), (112, 'Thu 16-17'), (113, 'Thu 17-18'), (114, 'Thu 18-19'), (115, 'Thu 19-20'), (116, 'Thu 20-21'), (117, 'Thu 21-22'), (118, 'Thu 22-23'), (119, 'Thu 23-24'), (120, 'Fri 0-1'), (121, 'Fri 1-2'), (122, 'Fri 2-3'), (123, 'Fri 3-4'), (124, 'Fri 4-5'), (125, 'Fri 5-6'), (126, 'Fri 6-7'), (127, 'Fri 7-8'), (128, 'Fri 8-9'), (129, 'Fri 9-10'), (130, 'Fri 10-11'), (131, 'Fri 11-12'), (132, 'Fri 12-13'), (133, 'Fri 13-14'), (134, 'Fri 14-15'), (135, 'Fri 15-16'), (136, 'Fri 16-17'), (137, 'Fri 17-18'), (138, 'Fri 18-19'), (139, 'Fri 19-20'), (140, 'Fri 20-21'), (141, 'Fri 21-22'), (142, 'Fri 22-23'), (143, 'Fri 23-24'), (144, 'Sat 0-1'), (145, 'Sat 1-2'), (146, 'Sat 2-3'), (147, 'Sat 3-4'), (148, 'Sat 4-5'), (149, 'Sat 5-6'), (150, 'Sat 6-7'), (151, 'Sat 7-8'), (152, 'Sat 8-9'), (153, 'Sat 9-10'), (154, 'Sat 10-11'), (155, 'Sat 11-12'), (156, 'Sat 12-13'), (157, 'Sat 13-14'), (158, 'Sat 14-15'), (159, 'Sat 15-16'), (160, 'Sat 16-17'), (161, 'Sat 17-18'), (162, 'Sat 18-19'), (163, 'Sat 19-20'), (164, 'Sat 20-21'), (165, 'Sat 21-22'), (166, 'Sat 22-23'), (167, 'Sat 23-24')]#

The list of choices.

type_class#

alias of SambaLogonHours

classmethod parse(value)[source]#
classmethod tostring(value: list[int]) str[source]#

Convert from internal representation to textual representation.

Parameters:

text – internal representation.

Returns:

textual representation.

class univention.admin.syntax.SambaPrivileges[source]#

Bases: select

Syntax to select Samba privileges.

empty_value = True#

Allow the empty value.

choices: Sequence[Any] = [('SeMachineAccountPrivilege', 'Add machines to domain'), ('SeSecurityPrivilege', 'Manage auditing and security log'), ('SeTakeOwnershipPrivilege', 'Take ownership of files or other objects'), ('SeBackupPrivilege', 'Back up files and directories'), ('SeRestorePrivilege', 'Restore files and directories'), ('SeRemoteShutdownPrivilege', 'Force shutdown from a remote system'), ('SePrintOperatorPrivilege', 'Manage printers'), ('SeAddUsersPrivilege', 'Add users and groups to the domain'), ('SeDiskOperatorPrivilege', 'Manage disk shares')]#
class univention.admin.syntax.UCSServerRole[source]#

Bases: select

Syntax to select UCS server role.

>>> UCSServerRole.parse('Undefined')
>>> UCSServerRole.parse('')
>>> UCSServerRole.parse('domaincontroller_master')
'domaincontroller_master'
empty_value = True#

Allow the empty value.

choices: Sequence[Any] = [('domaincontroller_master', 'Primary Directory Node'), ('domaincontroller_backup', 'Backup Directory Node'), ('domaincontroller_slave', 'Replica Directory Node'), ('memberserver', 'Managed Node')]#
class univention.admin.syntax.ServiceMail[source]#

Bases: UDM_Objects

Syntax to select a UCS host from LDAP by DN offering SMTP services.

See also

udm_modules: Sequence[str] = ('computers/domaincontroller_master', 'computers/domaincontroller_backup', 'computers/domaincontroller_slave', 'computers/memberserver')#

Sequence of UDM module names to search for.

udm_filter = '(&(!(univentionObjectFlag=docker))(service=SMTP))'#

A LDAP filter string to further restrict the matching LDAP objects.

class univention.admin.syntax.ServicePrint[source]#

Bases: UDM_Objects

Syntax to select a UCS host from LDAP by DN offering print services.

udm_modules: Sequence[str] = ('computers/domaincontroller_master', 'computers/domaincontroller_backup', 'computers/domaincontroller_slave', 'computers/memberserver')#

Sequence of UDM module names to search for.

udm_filter = '(&(!(univentionObjectFlag=docker))(service=Print))'#

A LDAP filter string to further restrict the matching LDAP objects.

class univention.admin.syntax.Service[source]#

Bases: UDM_Objects

Syntax to select a UCS service types from LDAP using univention.admin.handlers.settings.service.

udm_modules: Sequence[str] = ('settings/service',)#

Sequence of UDM module names to search for.

regex: Pattern | None = None#

Regular expression for validating the values.

key = '%(name)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

label: str | None = '%(name)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

class univention.admin.syntax.nfssync[source]#

Bases: select

Syntax to select the NFS synchronization type.

choices: Sequence[Any] = [('sync', 'synchronous'), ('async', 'asynchronous')]#
class univention.admin.syntax.RecycleBinSupportedModules[source]#

Bases: select

Syntax for selecting an UDM module for the recyclebin

>>> RecycleBinSupportedModules.parse('users/user')
'users/user'
>>> RecycleBinSupportedModules.parse('nonexistant')
Traceback (most recent call last):
...
valueInvalidSyntax:
choices: Sequence[Any] = [('groups/group', 'Group'), ('users/user', 'User')]#
classmethod parse(text)[source]#
classmethod update_choices()[source]#

Update internal list of UDM modules in univentionAdminModules.

class univention.admin.syntax.RecycleBinReference[source]#

Bases: complex

Syntax for recyclebin references (objects that referenced the deleted object).

description = 'Reference'#
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Source attribute', <class 'univention.admin.syntax.string'>), ('Target module', <class 'univention.admin.syntax.string'>), ('Target property', <class 'univention.admin.syntax.string'>), ('Lookup attribute', <class 'univention.admin.syntax.string'>), ('Lookup value', <class 'univention.admin.syntax.string'>)]#
subsyntax_names: tuple[str, ...] = ('source_attr', 'target_module', 'target_property', 'lookup_attribute', 'lookup_value')#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.univentionAdminModules[source]#

Bases: select

Syntax for selecting an UDM module.

>>> univention.admin.modules.update()
>>> univentionAdminModules.parse('users/user')
'users/user'
>>> univentionAdminModules.parse('nonexistant')
Traceback (most recent call last):
...
valueInvalidSyntax:
choices: Sequence[Any] = [('appcenter/app', 'Appcenter: App Metadata'), ('blocklists/list', 'Blocklist'), ('computers/domaincontroller_backup', 'Computer: Backup Directory Node'), ('computers/trustaccount', 'Computer: Domain trust account'), ('computers/ipmanagedclient', 'Computer: IP client'), ('computers/linux', 'Computer: Linux'), ('computers/memberserver', 'Computer: Managed Node'), ('computers/domaincontroller_master', 'Computer: Primary Directory Node'), ('computers/domaincontroller_slave', 'Computer: Replica Directory Node'), ('computers/ubuntu', 'Computer: Ubuntu'), ('computers/windows_domaincontroller', 'Computer: Windows Domaincontroller'), ('computers/windows', 'Computer: Windows Workstation/Server'), ('computers/macos', 'Computer: macOS Client'), ('users/contact', 'Contact'), ('container/cn', 'Container: Container'), ('container/dc', 'Container: Domain'), ('container/msgpo', 'Container: MS Group Policy'), ('container/ou', 'Container: Organisational Unit'), ('dhcp/host', 'DHCP: Host'), ('dhcp/pool', 'DHCP: Pool'), ('dhcp/server', 'DHCP: Server'), ('dhcp/service', 'DHCP: Service'), ('dhcp/shared', 'DHCP: Shared network'), ('dhcp/sharedsubnet', 'DHCP: Shared subnet'), ('dhcp/subnet', 'DHCP: Subnet'), ('dns/alias', 'DNS: Alias record'), ('dns/forward_zone', 'DNS: Forward lookup zone'), ('dns/host_record', 'DNS: Host Record'), ('dns/ns_record', 'DNS: NS Record'), ('dns/ptr_record', 'DNS: Pointer record'), ('dns/reverse_zone', 'DNS: Reverse lookup zone'), ('dns/srv_record', 'DNS: Service record'), ('dns/txt_record', 'DNS: TXT Record'), ('settings/data', 'Data'), ('users/federated_account', 'Federated account'), ('groups/group', 'Group'), ('test/ip_phone', 'IP-Phone'), ('kerberos/kdcentry', 'Kerberos: KDC Entry'), ('ms/domainpolicy', 'MS Domain Policy'), ('mail/domain', 'Mail domain'), ('mail/folder', 'Mail folder (IMAP)'), ('mail/lists', 'Mailing list'), ('nagios/service', 'Nagios service'), ('networks/network', 'Networks: Network'), ('policies/release', 'Policy: Automatic updates'), ('policies/dhcp_scope', 'Policy: DHCP Allow/Deny'), ('policies/dhcp_boot', 'Policy: DHCP Boot'), ('policies/dhcp_dns', 'Policy: DHCP DNS'), ('policies/dhcp_dnsupdate', 'Policy: DHCP Dynamic DNS'), ('policies/dhcp_netbios', 'Policy: DHCP NetBIOS'), ('policies/dhcp_leasetime', 'Policy: DHCP lease time'), ('policies/dhcp_routing', 'Policy: DHCP routing'), ('policies/dhcp_statements', 'Policy: DHCP statements'), ('policies/desktop', 'Policy: Desktop'), ('policies/ldapserver', 'Policy: LDAP server'), ('policies/maintenance', 'Policy: Maintenance'), ('policies/nfsmounts', 'Policy: NFS mounts'), ('policies/memberpackages', 'Policy: Packages for Managed Nodes'), ('policies/masterpackages', 'Policy: Packages for Primary/Backup Nodes'), ('policies/slavepackages', 'Policy: Packages for Replica Nodes'), ('policies/pwhistory', 'Policy: Passwords'), ('policies/printserver', 'Policy: Print server'), ('policies/recyclebin', 'Policy: Recyclebin Configuration'), ('policies/repositoryserver', 'Policy: Repository server'), ('policies/repositorysync', 'Policy: Repository synchronisation'), ('policies/umc', 'Policy: UMC'), ('policies/registry', 'Policy: Univention Configuration Registry'), ('policies/admin_container', 'Policy: Univention Directory Manager container settings'), ('policies/share_userquota', 'Policy: User quota'), ('settings/default', 'Preferences: Default'), ('settings/directory', 'Preferences: Default Container'), ('shares/printer', 'Printer share: Printer'), ('shares/printergroup', 'Printer share: Printer group'), ('recyclebin/removedobject', 'Recyclebin: Deleted Object'), ('settings/console_helpdesk', 'Settings: Console Helpdesk'), ('settings/extended_attribute', 'Settings: Extended attribute'), ('settings/extended_options', 'Settings: Extended option'), ('settings/ldapacl', 'Settings: LDAP ACL Extension'), ('settings/ldapschema', 'Settings: LDAP Schema Extension'), ('settings/license', 'Settings: License'), ('settings/lock', 'Settings: Lock'), ('settings/msprintconnectionpolicy', 'Settings: MS Print Connection Policy'), ('settings/mswmifilter', 'Settings: MS WMI Filter'), ('settings/packages', 'Settings: Package List'), ('settings/printermodel', 'Settings: Printer Driver List'), ('settings/printeruri', 'Settings: Printer URI List'), ('settings/prohibited_username', 'Settings: Prohibited user names'), ('settings/sambaconfig', 'Settings: Samba Configuration'), ('settings/sambadomain', 'Settings: Samba Domain'), ('settings/service', 'Settings: Service'), ('settings/syntax', 'Settings: Syntax Definition'), ('settings/udm_hook', 'Settings: UDM Hook'), ('settings/udm_module', 'Settings: UDM Module'), ('settings/udm_syntax', 'Settings: UDM Syntax'), ('settings/umc_operationset', 'Settings: UMC operation set'), ('settings/usertemplate', 'Settings: User Template'), ('shares/share', 'Share: Directory'), ('users/ldap', 'Simple authentication account'), ('settings/cn', 'Univention Settings'), ('blocklists/entry', 'Univention blocklist entries'), ('users/user', 'User'), ('users/passwd', 'User: Password')]#
classmethod parse(text)[source]#
classmethod update_choices()[source]#

Update internal list of UDM modules in univentionAdminModules.

class univention.admin.syntax.UDM_PropertySelect[source]#

Bases: complex

Syntax to enter UDM module and property name.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('UDM module', <class 'univention.admin.syntax.string'>), ('property', <class 'univention.admin.syntax.string'>))#
subsyntax_names: tuple[str, ...] = ('module', 'property')#
class univention.admin.syntax.listAttributes[source]#

Bases: string

Syntax to enter UDM property name.

Deprecated since version 5.0: Old syntax required by univention.admin.handler.settings.syntax. Should be removed after migrating to UDM_PropertySelect.

>>> listAttributes.parse("a value")
'a value'
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.timeSpec[source]#

Bases: select

Time format used by at.

choices: Sequence[Any] = [('', 'No Reboot'), ('now', 'Immediately'), ('00:00', '00:00'), ('00:15', '00:15'), ('00:30', '00:30'), ('00:45', '00:45'), ('01:00', '01:00'), ('01:15', '01:15'), ('01:30', '01:30'), ('01:45', '01:45'), ('02:00', '02:00'), ('02:15', '02:15'), ('02:30', '02:30'), ('02:45', '02:45'), ('03:00', '03:00'), ('03:15', '03:15'), ('03:30', '03:30'), ('03:45', '03:45'), ('04:00', '04:00'), ('04:15', '04:15'), ('04:30', '04:30'), ('04:45', '04:45'), ('05:00', '05:00'), ('05:15', '05:15'), ('05:30', '05:30'), ('05:45', '05:45'), ('06:00', '06:00'), ('06:15', '06:15'), ('06:30', '06:30'), ('06:45', '06:45'), ('07:00', '07:00'), ('07:15', '07:15'), ('07:30', '07:30'), ('07:45', '07:45'), ('08:00', '08:00'), ('08:15', '08:15'), ('08:30', '08:30'), ('08:45', '08:45'), ('09:00', '09:00'), ('09:15', '09:15'), ('09:30', '09:30'), ('09:45', '09:45'), ('10:00', '10:00'), ('10:15', '10:15'), ('10:30', '10:30'), ('10:45', '10:45'), ('11:00', '11:00'), ('11:15', '11:15'), ('11:30', '11:30'), ('11:45', '11:45'), ('12:00', '12:00'), ('12:15', '12:15'), ('12:30', '12:30'), ('12:45', '12:45'), ('13:00', '13:00'), ('13:15', '13:15'), ('13:30', '13:30'), ('13:45', '13:45'), ('14:00', '14:00'), ('14:15', '14:15'), ('14:30', '14:30'), ('14:45', '14:45'), ('15:00', '15:00'), ('15:15', '15:15'), ('15:30', '15:30'), ('15:45', '15:45'), ('16:00', '16:00'), ('16:15', '16:15'), ('16:30', '16:30'), ('16:45', '16:45'), ('17:00', '17:00'), ('17:15', '17:15'), ('17:30', '17:30'), ('17:45', '17:45'), ('18:00', '18:00'), ('18:15', '18:15'), ('18:30', '18:30'), ('18:45', '18:45'), ('19:00', '19:00'), ('19:15', '19:15'), ('19:30', '19:30'), ('19:45', '19:45'), ('20:00', '20:00'), ('20:15', '20:15'), ('20:30', '20:30'), ('20:45', '20:45'), ('21:00', '21:00'), ('21:15', '21:15'), ('21:30', '21:30'), ('21:45', '21:45'), ('22:00', '22:00'), ('22:15', '22:15'), ('22:30', '22:30'), ('22:45', '22:45'), ('23:00', '23:00'), ('23:15', '23:15'), ('23:30', '23:30'), ('23:45', '23:45')]#
class univention.admin.syntax.optionsUsersUser[source]#

Bases: select

Syntax to select options for UDM module univention.admin.handlers.users.user.

choices: Sequence[Any] = [('pki', 'Public key infrastructure account')]#
classmethod update_choices()[source]#
class univention.admin.syntax.allModuleOptions[source]#

Bases: combobox

Syntax to select options for UDM modules.

depends: str | None = 'module'#

The name of another UDM property this syntax depends on.

classmethod update_choices()[source]#
classmethod get_choices(lo, options)[source]#

Get the choices w.r.t. dependencies

choices: Sequence[Any] = [('options', 'Allow custom DHCP options'), ('options', 'Allow custom DHCP options'), ('options', 'Allow custom DHCP options'), ('options', 'Allow custom DHCP options'), ('options', 'Allow custom DHCP options'), ('options', 'Allow custom DHCP options'), ('redirection', 'Call redirect option'), ('group-settings', 'Default Group Settings'), ('group-settings', 'Default Group Settings'), ('group-settings', 'Default Group Settings'), ('nfs', 'Export for NFS clients (NFSv3 and NFSv4)'), ('samba', 'Export for Samba clients'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos principal'), ('kerberos', 'Kerberos realm'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('nagios', 'Nagios support'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix account'), ('posix', 'Posix group'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('pki', 'Public key infrastructure account'), ('samba', 'Samba'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba account'), ('samba', 'Samba group'), ('Version 1', 'Version 1 license'), ('Version 2', 'Version 2 license')]#
class univention.admin.syntax.nagiosHostsEnabledDn[source]#

Bases: UDM_Objects

Syntax to select Nagios enabled hosts from LDAP.

udm_modules: Sequence[str] = ('computers/computer',)#

Sequence of UDM module names to search for.

udm_filter = '(&(!(univentionObjectFlag=docker))(objectClass=univentionNagiosHostClass)(univentionNagiosEnabled=1)(aRecord=*))'#

A LDAP filter string to further restrict the matching LDAP objects.

class univention.admin.syntax.nagiosServiceDn[source]#

Bases: UDM_Objects

Syntax to select a Nagios services from LDAP using univention.admin.handlers.nagios.service.

udm_modules: Sequence[str] = ('nagios/service',)#

Sequence of UDM module names to search for.

class univention.admin.syntax.UCR_Variable[source]#

Bases: complex

Syntax to enter UCR variable name and value.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Variable', <class 'univention.admin.syntax.string'>), ('Value', <class 'univention.admin.syntax.string'>))#
subsyntax_names: tuple[str, ...] = ('variable', 'value')#
subsyntax_key_value = True#

Bases: select

Selection list from LDAP search.

Searches can be either defined dynamically via a UDM settings/syntax definition and using

LDAP_Search(syntax_name=’<NAME>’)

or programmatically by directly instantiating

LDAP_Search(filter=’LDAP-Search-Filter>’, attribute=[‘<LDAP attributes>’, …], value=’<LDAP attribute>’, base=’<LDAP base>’)

>>> from univention.admin.uldap import getMachineConnection
>>> from univention.lib.misc import custom_username
>>> syntax = LDAP_Search('mysyntax', '(univentionObjectType=users/user)', ['uid'])
>>> if os.path.exists('/etc/machine.secret'):
...     lo, pos = getMachineConnection()
...     syntax._load(lo)
...     any(dn.startswith('uid=' + custom_username('Administrator')) for dn, value in syntax.get_choices(lo, {}))
... else:
...     True
True
>>> syntax = LDAP_Search('mysyntax2', '(univentionObjectType=fantasy)', ['cn'])
>>> if os.path.exists('/etc/machine.secret'):
...     syntax.get_choices(lo, {})
... else:
...     []
[]

Creates an syntax object providing a list of choices defined by a LDAP objects

Parameters:
  • syntax_name – name of the syntax LDAP object.

  • filter – an LDAP filter to find the LDAP objects providing the list of choices. The filter may contain patterns, that are …

  • attribute – a list of UDM module attributes definitions like shares/share: dn to be used as human readable representation for each element of the choices.

  • value – the UDM module attribute that will be stored to identify the selected element. The value is specified like shares/share: dn.

  • viewonly – If set to True the values can not be changed.

  • addEmptyValue – If set to True an empty value is add to the list of choices.

  • appendEmptyValue – Same as addEmptyValue but added at the end. Used to automatically choose an existing entry in frontend.

FILTER_PATTERN = '(&(objectClass=univentionSyntax)(cn=%s))'#
base = ''#
value = 'dn'#
viewonly = False#
addEmptyValue = False#
appendEmptyValue = False#
classmethod get_widget(prop)[source]#
search_widget = 'ComboBox'#

The corresponding widget which is used in UMC when searching for values of this property

classmethod parse(text)[source]#
classmethod get_choices(lo, options)[source]#

Get the choices w.r.t. dependencies

classmethod get_umc_choices(lo, options)[source]#

Workaround for UMC - we should get rid of this class at all

classmethod sort_choices(choices)[source]#
get_widget_choices_options(udm_property)[source]#
class univention.admin.syntax.nfsShare[source]#

Bases: UDM_Objects

Syntax for selecting defined NFS shares.

See also

udm_modules: Sequence[str] = ('shares/share',)#

Sequence of UDM module names to search for.

label: str | None = '%(name)s (%(host)s)'#

The UDM property name enclosed in %()s, which is used as the displayed value.

udm_filter = 'objectClass=univentionShareNFS'#

A LDAP filter string to further restrict the matching LDAP objects.

use_objects = False#

By default with True create Python UDM instance for each LDAP entry. With False only work with the LDAP attribute data.

class univention.admin.syntax.nfsMounts[source]#

Bases: complex

Syntax to define a NFS mount point.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('NFS share', <class 'univention.admin.syntax.nfsShare'>), ('Mount point', <class 'univention.admin.syntax.string'>)]#
subsyntax_names: tuple[str, ...] = ('nfs-share', 'mount-point')#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.languageCode[source]#

Bases: combobox

Syntax for a language, e.g. language_COUNTRY.

>>> languageCode.parse("de_DE")
'de_DE'
>>> languageCode.parse("en_US")
'en_US'
>>> languageCode.parse("C")
Traceback (most recent call last):
...
valueError:
>>> languageCode.parse("german")
Traceback (most recent call last):
...
valueError:
choices: Sequence[Any] = [('af_ZA', 'Afrikaans/South Africa'), ('sq_AL', 'Albanian/Albania'), ('am_ET', 'Amharic/Ethiopia'), ('ar_DZ', 'Arabic/Algeria'), ('ar_BH', 'Arabic/Bahrain'), ('ar_EG', 'Arabic/Egypt'), ('ar_IN', 'Arabic/India'), ('ar_IQ', 'Arabic/Iraq'), ('ar_JO', 'Arabic/Jordan'), ('ar_KW', 'Arabic/Kuwait'), ('ar_LB', 'Arabic/Lebanon'), ('ar_LY', 'Arabic/Libyan Arab Jamahiriya'), ('ar_MA', 'Arabic/Morocco'), ('ar_OM', 'Arabic/Oman'), ('ar_QA', 'Arabic/Qatar'), ('ar_SA', 'Arabic/Saudi Arabia'), ('ar_SD', 'Arabic/Sudan'), ('ar_SY', 'Arabic/Syrian Arab Republic'), ('ar_TN', 'Arabic/Tunisia'), ('ar_AE', 'Arabic/United Arab Emirates'), ('ar_YE', 'Arabic/Yemen'), ('an_ES', 'Aragonese/Spain'), ('hy_AM', 'Armenian/Armenia'), ('az_AZ', 'Azeri/Azerbaijan'), ('be_BY', 'Belarusian/Belarus'), ('bn_BD', 'Bengali/BD'), ('bn_IN', 'Bengali/India'), ('bs_BA', 'Bosnian/Bosnia and Herzegowina'), ('bg_BG', 'Bulgarian/Bulgaria'), ('zh_HK', 'Chinese/Hong Kong'), ('zh_CN', 'Chinese/P.R. of China'), ('zh_SG', 'Chinese/Singapore'), ('zh_TW', 'Chinese/Taiwan R.O.C.'), ('kw_GB', 'Cornish/Britain'), ('hr_HR', 'Croatian/Croatia'), ('cs_CZ', 'Czech/Czech Republic'), ('da_DK', 'Danish/Denmark'), ('en_AU', 'English/Australia'), ('en_BW', 'English/Botswana'), ('en_CA', 'English/Canada'), ('en_DK', 'English/Denmark'), ('en_GB', 'English/Great Britain'), ('en_HK', 'English/Hong Kong'), ('en_IN', 'English/India'), ('en_NZ', 'English/New Zealand'), ('en_PH', 'English/Philippines'), ('en_SG', 'English/Singapore'), ('en_ZA', 'English/South Africa'), ('en_US', 'English/USA'), ('en_ZW', 'English/Zimbabwe'), ('eo_EO', 'Esperanto/Esperanto'), ('et_EE', 'Estonian/Estonia'), ('fo_FO', 'Faroese/Faroe Islands'), ('fr_CA', 'French/Canada'), ('fr_CH', 'French/Switzerland'), ('ka_GE', 'Georgian/Georgia'), ('de_DE', 'German/Germany'), ('de_CH', 'German/Switzerland'), ('kl_GL', 'Greenlandic/Greenland'), ('iw_IL', 'Hebrew/Israel'), ('he_IL', 'Hebrew/Israel'), ('hi_IN', 'Hindi/India'), ('hu_HU', 'Hungarian/Hungary'), ('is_IS', 'Icelandic/Iceland'), ('id_ID', 'Indonesian/Indonesia'), ('it_CH', 'Italian/Switzerland'), ('ja_JP', 'Japanese/Japan'), ('ko_KR', 'Korean/Republic of Korea'), ('lo_LA', 'Lao/Laos'), ('lv_LV', 'Latvian/Latvia'), ('lt_LT', 'Lithuanian/Lithuania'), ('mk_MK', 'Macedonian/Macedonia'), ('ms_MY', 'Malay/Malaysia'), ('ml_IN', 'Malayalam/India'), ('mt_MT', 'Maltese/malta'), ('gv_GB', 'Manx Gaelic/Britain'), ('mi_NZ', 'Maori/New Zealand'), ('mr_IN', 'Marathi/India'), ('mn_MN', 'Mongolian/Mongolia'), ('se_NO', 'Northern Saami/Norway'), ('nn_NO', 'Norwegian, Nynorsk/Norway'), ('no_NO', 'Norwegian/Norway'), ('oc_FR', 'Occitan/France'), ('fa_IR', 'Persian/Iran'), ('pl_PL', 'Polish/Poland'), ('pt_BR', 'Portuguese/Brasil'), ('ro_RO', 'Romanian/Romania'), ('ru_RU', 'Russian/Russia'), ('ru_UA', 'Russian/Ukraine'), ('gd_GB', 'Scots Gaelic/Great Britain'), ('sk_SK', 'Slovak/Slovak'), ('sl_SI', 'Slovenian/Slovenia'), ('st_ZA', 'Sotho/South Africa'), ('es_AR', 'Spanish/Argentina'), ('es_BO', 'Spanish/Bolivia'), ('es_CL', 'Spanish/Chile'), ('es_CO', 'Spanish/Colombia'), ('es_CR', 'Spanish/Costa Rica'), ('es_DO', 'Spanish/Dominican Republic'), ('es_EC', 'Spanish/Ecuador'), ('es_SV', 'Spanish/El Salvador'), ('es_GT', 'Spanish/Guatemala'), ('es_HN', 'Spanish/Honduras'), ('es_MX', 'Spanish/Mexico'), ('es_NI', 'Spanish/Nicaragua'), ('es_PA', 'Spanish/Panama'), ('es_PY', 'Spanish/Paraguay'), ('es_PE', 'Spanish/Peru'), ('es_PR', 'Spanish/Puerto Rico'), ('es_US', 'Spanish/USA'), ('es_UY', 'Spanish/Uruguay'), ('es_VE', 'Spanish/Venezuela'), ('sv_SE', 'Swedish/Sweden'), ('tl_PH', 'Tagalog/Philippines'), ('tg_TJ', 'Tajik/Tajikistan'), ('ta_IN', 'Tamil/India'), ('tt_RU', 'Tatar/Tatarstan'), ('te_IN', 'Telgu/India'), ('th_TH', 'Thai/Thailand'), ('ti_ER', 'Tigrigna/Eritrea'), ('ti_ET', 'Tigrigna/Ethiopia'), ('tr_TR', 'Turkish/Turkey'), ('uk_UA', 'Ukrainian/Ukraine'), ('ur_PK', 'Urdu/Pakistan'), ('uz_UZ', 'Uzbek/Uzbekistan'), ('vi_VN', 'Vietnamese/Vietnam'), ('cy_GB', 'Welsh/Great Britain'), ('xh_ZA', 'Xhosa/South Africa'), ('yi_US', 'Yiddish/USA'), ('zu_ZA', 'Zulu/South Africa')]#
classmethod parse(text)[source]#
class univention.admin.syntax.translationTuple[source]#

Bases: complex

Syntax for some translatable text.

delimiter: str = ': '#

Delimiter to separate the sub-items. Two possibilities:

  1. Either a single string like =, which is used to concatenate all subitems.

  2. A sequence of n+1 strings like [‘’, ‘: ‘, ‘=’, ‘’] to concatenate n sub-items. The first and last value is used as a prefix/suffix.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Text', <class 'univention.admin.syntax.string'>)]#
subsyntax_key_value = True#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.translationTupleShortDescription[source]#

Bases: translationTuple

Syntax for a translated short description of an UDM property.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Translated short description', <class 'univention.admin.syntax.string'>)]#
class univention.admin.syntax.translationTupleLongDescription[source]#

Bases: translationTuple

Syntax for a translated long description of an UDM property.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Translated long description', <class 'univention.admin.syntax.string'>)]#
class univention.admin.syntax.translationTupleTabName[source]#

Bases: translationTuple

Syntax for a translated UMC tab name for an UDM property.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Translated tab name', <class 'univention.admin.syntax.string'>)]#
class univention.admin.syntax.I18N_GroupName[source]#

Bases: translationTuple

Syntax for a translated group name.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Translated group name', <class 'univention.admin.syntax.string'>)]#
class univention.admin.syntax.disabled[source]#

Bases: boolean

Syntax to select account disabled state.

>>> disabled.parse("none")
'0'
>>> disabled.parse("none2")
'0'
>>> disabled.parse("all")
'1'
>>> disabled.parse("posix_kerberos")
'1'
>>> disabled.parse("hallo")
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.locked[source]#

Bases: boolean

Syntax to select account locked state.

>>> locked.parse("none")
'0'
>>> locked.parse("posix")
'1'
>>> locked.parse("windows")
'1'
>>> locked.parse("all")
'1'
>>> locked.parse("posix_kerberos")
Traceback (most recent call last):
...
valueError:
>>> locked.parse("none2")
Traceback (most recent call last):
...
valueError:
widget: str | None = 'umc/modules/udm/LockedCheckBox'#

The corresponding widget which is used in UMC

search_widget = 'CheckBox'#

The corresponding widget which is used in UMC when searching for values of this property

widget_default_search_pattern: bool | str | None = False#

The default search pattern for this syntax. String render as TextBox, lists render as ComboBox with the possible choices, booleans render as CheckBox

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Printers[source]#

Bases: UDM_Objects

Syntax to select a printers from LDAP using univention.admin.handlers.shares.printer.

See also

udm_modules: Sequence[str] = ('shares/printer',)#

Sequence of UDM module names to search for.

depends: str | None = 'spoolHost'#

The name of another UDM property this syntax depends on.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

key = '%(name)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

classmethod udm_filter(options)[source]#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

class univention.admin.syntax.PrinterNames[source]#

Bases: UDM_Objects

Syntax to select a printers from LDAP using univention.admin.handlers.shares.printer.

See also

>>> PrinterNames().type_class
<class 'univention.admin.types.StringType'>
udm_modules: Sequence[str] = ('shares/printer',)#

Sequence of UDM module names to search for.

depends: str | None = 'spoolHost'#

The name of another UDM property this syntax depends on.

simple = True#

With True, only a single object can be selected using a ComboBox. With False multiple entries can be selected using a MultiObjectSelect widget.

key = '%(name)s'#

Either ‘dn’ or the UDM property name enclosed in %()s to use as the value for this syntax class.

regex: Pattern | None = re.compile('(?u)(^[a-zA-Z0-9])[a-zA-Z0-9_-]*([a-zA-Z0-9]$)')#

Regular expression for validating the values.

classmethod udm_filter(options)[source]#

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

class univention.admin.syntax.PrintQuotaGroup[source]#

Bases: complex

Syntax to configure a page quota for all users of a group together.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Soft limit (pages)', <class 'univention.admin.syntax.integer'>), ('Hard limit (pages)', <class 'univention.admin.syntax.integer'>), ('Group', <class 'univention.admin.syntax.GroupName'>))#
subsyntax_names: tuple[str, ...] = ('soft-limit', 'hard-limit', 'group')#
class univention.admin.syntax.PrintQuotaGroupPerUser[source]#

Bases: complex

Syntax to configure a page quota for all individual users of a group.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Soft limit (pages)', <class 'univention.admin.syntax.integer'>), ('Hard limit (pages)', <class 'univention.admin.syntax.integer'>), ('Group', <class 'univention.admin.syntax.GroupName'>))#
subsyntax_names: tuple[str, ...] = ('soft-limit', 'hard-limit', 'group')#
class univention.admin.syntax.PrintQuotaUser[source]#

Bases: complex

Syntax to configure a page quota for an individual user.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Soft limit (pages)', <class 'univention.admin.syntax.integer'>), ('Hard limit (pages)', <class 'univention.admin.syntax.integer'>), ('User', <class 'univention.admin.syntax.UserName'>))#
subsyntax_names: tuple[str, ...] = ('soft-limit', 'hard-limit', 'group')#
class univention.admin.syntax.printerName[source]#

Bases: simple

Syntax to enter a printer name.

>>> printerName.parse("drucker1")
'drucker1'
>>> printerName.parse("drücker1")
Traceback (most recent call last):
...
valueError:
min_length = 1#
max_length = 16#
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.printerModel[source]#

Bases: complex

Syntax to enter a printer model description.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Driver', <class 'univention.admin.syntax.string'>), ('Description', <class 'univention.admin.syntax.string'>)]#
subsyntax_names: tuple[str, ...] = ('driver', 'description')#
all_required = True#

All sub-values must contain a value.

class univention.admin.syntax.PrinterDriverList[source]#

Bases: UDM_Attribute

Syntax to select a printer driver from LDAP using univention.admin.handlers.settings.printermodel.

udm_module: str | None = 'settings/printermodel'#

UDM module name to search for.

attribute: str | None = 'printmodel'#

The UDM property name to use as the value for this syntax class.

is_complex = True#

True for a complex item consisting of multiple sub-items.

key_index = 0#

When the UDM property is complex: The number of the sub-item, which is used as the value for this syntax class.

label_index = 1#

When the UDM property is complex: The number of the sub-item, which is used as the display value.

udm_filter = 'dn'#

A LDAP filter string to further restrict the matching LDAP objects.

depends: str | None = 'producer'#

The name of another UDM property this syntax depends on.

class univention.admin.syntax.PrinterProducerList[source]#

Bases: UDM_Objects

Syntax to select a printer producer from LDAP using univention.admin.handlers.settings.printermodel.

udm_modules: Sequence[str] = ('settings/printermodel',)#

Sequence of UDM module names to search for.

label: str | None = '%(name)s'#

The UDM property name enclosed in %()s, which is used as the displayed value.

class univention.admin.syntax.PrinterProtocol[source]#

Bases: UDM_Attribute

Syntax to select a printer URI from LDAP using univention.admin.handlers.settings.printeruri.

udm_module: str | None = 'settings/printeruri'#

UDM module name to search for.

attribute: str | None = 'printeruri'#

The UDM property name to use as the value for this syntax class.

is_complex = False#

True for a complex item consisting of multiple sub-items.

class univention.admin.syntax.PrinterURI[source]#

Bases: complex

Syntax to configure printer.

>>> PrinterURI.parse(["uri://", "localhost"])
['uri://', 'localhost']
>>> PrinterURI.parse(["cups-pdf:/", ""])
['cups-pdf:/', '']
>>> PrinterURI.parse(["uri://", None])
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> PrinterURI.parse(["uri://", "localhost", "one more"])
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> PrinterURI.parse(["uri://"])
Traceback (most recent call last):
...
valueInvalidSyntax:
subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = (('Protocol', <class 'univention.admin.syntax.PrinterProtocol'>), ('Destination', <class 'univention.admin.syntax.string'>))#
subsyntax_names: tuple[str, ...] = ('protocol', 'destination')#
all_required = False#

All sub-values must contain a value.

classmethod parse(texts)[source]#
parse_command_line(value)[source]#
>>> PrinterURI().parse_command_line("http://localhost")
['http://', 'localhost']
>>> PrinterURI().parse_command_line("file:/foo")
['file:/', 'foo']
class univention.admin.syntax.policyName[source]#

Bases: string

Syntax to enter UDM policy name.

>>> policyName.parse('A valid name')
'A valid name'
>>> policyName.parse('An invalid name ')
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.AuthRestriction[source]#

Bases: select

Syntax to select the authentication restriction for the portal.

choices: Sequence[Any] = [('admin', 'Visible for Admins only'), ('authenticated', 'Visible for authenticated users'), ('anonymous', 'Visible for everyone')]#
class univention.admin.syntax.PortalFontColor[source]#

Bases: select

Syntax to select the color of the font in the portal.

choices: Sequence[Any] = [('white', 'White'), ('black', 'Black')]#
class univention.admin.syntax.PortalDefaultLinkTarget[source]#

Bases: select

choices: Sequence[Any] = [('samewindow', 'Same tab'), ('newwindow', 'New tab')]#
class univention.admin.syntax.PortalEntryLinkTarget[source]#

Bases: select

choices: Sequence[Any] = [('useportaldefault', 'Use default of portal'), ('samewindow', 'Same tab'), ('newwindow', 'New tab')]#
class univention.admin.syntax.LocalizedDisplayName[source]#

Bases: translationTuple

Syntax for a translated display name of a portal entry.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Display Name', <class 'univention.admin.syntax.string'>)]#
class univention.admin.syntax.LocalizedDescription[source]#

Bases: translationTuple

Syntax for a translated description of a portal entry.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Description', <class 'univention.admin.syntax.string'>)]#
class univention.admin.syntax.LocalizedAnonymousEmpty[source]#

Bases: translationTuple

Syntax for a translated description of a portal entry. In addition to LocalizedDescription it allows to specify a fallback for anonymous visitors.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Message that is shown to anonymous visitors when the portal is empty', <class 'univention.admin.syntax.TwoEditor'>)]#
class univention.admin.syntax.mailHomeServer(syntax_name=None, filter=None, attribute=[], base='', value='dn', viewonly=False, addEmptyValue=False, appendEmptyValue=False)[source]#

Bases: LDAP_Search

Syntax to select UCS servers providing the IMAP service.

Deprecated since version 3.2-1: Use MailHomeServer.

Creates an syntax object providing a list of choices defined by a LDAP objects

Parameters:
  • syntax_name – name of the syntax LDAP object.

  • filter – an LDAP filter to find the LDAP objects providing the list of choices. The filter may contain patterns, that are …

  • attribute – a list of UDM module attributes definitions like shares/share: dn to be used as human readable representation for each element of the choices.

  • value – the UDM module attribute that will be stored to identify the selected element. The value is specified like shares/share: dn.

  • viewonly – If set to True the values can not be changed.

  • addEmptyValue – If set to True an empty value is add to the list of choices.

  • appendEmptyValue – Same as addEmptyValue but added at the end. Used to automatically choose an existing entry in frontend.

class univention.admin.syntax.hostname_or_ipadress_or_network[source]#

Bases: simple

Syntax for (fully qualified) host name or IP address or IP network.

>>> hostname_or_ipadress_or_network.parse('hostname')
'hostname'
>>> hostname_or_ipadress_or_network.parse('10.10.10.0/24')
'10.10.10.0/24'
>>> hostname_or_ipadress_or_network.parse('10.10.10.0/255.255.255.0')
'10.10.10.0/255.255.255.0'
>>> hostname_or_ipadress_or_network.parse('illegalhostname$!"§%&/(')
Traceback (most recent call last):
...
valueError:
>>> hostname_or_ipadress_or_network.parse('10.10.10.0/')
Traceback (most recent call last):
...
valueError:
>>> hostname_or_ipadress_or_network.parse('/24')
Traceback (most recent call last):
...
valueError:
>>> hostname_or_ipadress_or_network.parse('10.10.10.0/255')
Traceback (most recent call last):
...
valueError:
classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.ObjectFlag[source]#

Bases: select

Syntax for UDM object flags.

empty_value = True#

Allow the empty value.

choices: Sequence[Any] = [('hidden', 'Mark this object as hidden'), ('temporary', 'Mark this object as temporary'), ('functional', 'Ignore this object in standard UDM modules'), ('docker', 'This object is related to a Docker App container'), ('synced', 'This object is synchronized from Active Directory')]#
class univention.admin.syntax.ExampleSyntax#

Bases: select

This is an example for a syntax having 3 values.

choices: Sequence[Any] = [('value1', 'This item selects value 1'), ('value2', 'This item selects value 2'), ('value3', 'This item selects value 3')]#
class univention.admin.syntax.SignedInteger#

Bases: integer

classmethod parse(text)#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

class univention.admin.syntax.Country[source]#

Bases: select

Syntax for selecting a country by name. Stored as the ISO 3166-1 two-letter country code.

empty_value = True#

Allow the empty value.

choices: list[tuple[str, str]] = [('AF', 'Afghanistan'), ('AL', 'Albania'), ('DZ', 'Algeria'), ('AS', 'American Samoa'), ('AD', 'Andorra'), ('AO', 'Angola'), ('AI', 'Anguilla'), ('AQ', 'Antarctica'), ('AG', 'Antigua and Barbuda'), ('AR', 'Argentina'), ('AM', 'Armenia'), ('AW', 'Aruba'), ('AU', 'Australia'), ('AT', 'Austria'), ('AZ', 'Azerbaijan'), ('BS', 'Bahamas'), ('BH', 'Bahrain'), ('BD', 'Bangladesh'), ('BB', 'Barbados'), ('BY', 'Belarus'), ('BE', 'Belgium'), ('BZ', 'Belize'), ('BJ', 'Benin'), ('BM', 'Bermuda'), ('BT', 'Bhutan'), ('BO', 'Bolivia, Plurinational State of'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('BA', 'Bosnia and Herzegovina'), ('BW', 'Botswana'), ('BV', 'Bouvet Island'), ('BR', 'Brazil'), ('IO', 'British Indian Ocean Territory'), ('BN', 'Brunei Darussalam'), ('BG', 'Bulgaria'), ('BF', 'Burkina Faso'), ('BI', 'Burundi'), ('CV', 'Cabo Verde'), ('KH', 'Cambodia'), ('CM', 'Cameroon'), ('CA', 'Canada'), ('KY', 'Cayman Islands'), ('CF', 'Central African Republic'), ('TD', 'Chad'), ('CL', 'Chile'), ('CN', 'China'), ('CX', 'Christmas Island'), ('CC', 'Cocos (Keeling) Islands'), ('CO', 'Colombia'), ('KM', 'Comoros'), ('CG', 'Congo'), ('CD', 'Congo, The Democratic Republic of the'), ('CK', 'Cook Islands'), ('CR', 'Costa Rica'), ('HR', 'Croatia'), ('CU', 'Cuba'), ('CW', 'Curaçao'), ('CY', 'Cyprus'), ('CZ', 'Czechia'), ('CI', "Côte d'Ivoire"), ('DK', 'Denmark'), ('DJ', 'Djibouti'), ('DM', 'Dominica'), ('DO', 'Dominican Republic'), ('EC', 'Ecuador'), ('EG', 'Egypt'), ('SV', 'El Salvador'), ('GQ', 'Equatorial Guinea'), ('ER', 'Eritrea'), ('EE', 'Estonia'), ('SZ', 'Eswatini'), ('ET', 'Ethiopia'), ('FK', 'Falkland Islands (Malvinas)'), ('FO', 'Faroe Islands'), ('FJ', 'Fiji'), ('FI', 'Finland'), ('FR', 'France'), ('GF', 'French Guiana'), ('PF', 'French Polynesia'), ('TF', 'French Southern Territories'), ('GA', 'Gabon'), ('GM', 'Gambia'), ('GE', 'Georgia'), ('DE', 'Germany'), ('GH', 'Ghana'), ('GI', 'Gibraltar'), ('GR', 'Greece'), ('GL', 'Greenland'), ('GD', 'Grenada'), ('GP', 'Guadeloupe'), ('GU', 'Guam'), ('GT', 'Guatemala'), ('GG', 'Guernsey'), ('GN', 'Guinea'), ('GW', 'Guinea-Bissau'), ('GY', 'Guyana'), ('HT', 'Haiti'), ('HM', 'Heard Island and McDonald Islands'), ('VA', 'Holy See (Vatican City State)'), ('HN', 'Honduras'), ('HK', 'Hong Kong'), ('HU', 'Hungary'), ('IS', 'Iceland'), ('IN', 'India'), ('ID', 'Indonesia'), ('IR', 'Iran, Islamic Republic of'), ('IQ', 'Iraq'), ('IE', 'Ireland'), ('IM', 'Isle of Man'), ('IL', 'Israel'), ('IT', 'Italy'), ('JM', 'Jamaica'), ('JP', 'Japan'), ('JE', 'Jersey'), ('JO', 'Jordan'), ('KZ', 'Kazakhstan'), ('KE', 'Kenya'), ('KI', 'Kiribati'), ('KP', "Korea, Democratic People's Republic of"), ('KR', 'Korea, Republic of'), ('KW', 'Kuwait'), ('KG', 'Kyrgyzstan'), ('LA', "Lao People's Democratic Republic"), ('LV', 'Latvia'), ('LB', 'Lebanon'), ('LS', 'Lesotho'), ('LR', 'Liberia'), ('LY', 'Libya'), ('LI', 'Liechtenstein'), ('LT', 'Lithuania'), ('LU', 'Luxembourg'), ('MO', 'Macao'), ('MG', 'Madagascar'), ('MW', 'Malawi'), ('MY', 'Malaysia'), ('MV', 'Maldives'), ('ML', 'Mali'), ('MT', 'Malta'), ('MH', 'Marshall Islands'), ('MQ', 'Martinique'), ('MR', 'Mauritania'), ('MU', 'Mauritius'), ('YT', 'Mayotte'), ('MX', 'Mexico'), ('FM', 'Micronesia, Federated States of'), ('MD', 'Moldova, Republic of'), ('MC', 'Monaco'), ('MN', 'Mongolia'), ('ME', 'Montenegro'), ('MS', 'Montserrat'), ('MA', 'Morocco'), ('MZ', 'Mozambique'), ('MM', 'Myanmar'), ('NA', 'Namibia'), ('NR', 'Nauru'), ('NP', 'Nepal'), ('NL', 'Netherlands'), ('NC', 'New Caledonia'), ('NZ', 'New Zealand'), ('NI', 'Nicaragua'), ('NE', 'Niger'), ('NG', 'Nigeria'), ('NU', 'Niue'), ('NF', 'Norfolk Island'), ('MK', 'North Macedonia'), ('MP', 'Northern Mariana Islands'), ('NO', 'Norway'), ('OM', 'Oman'), ('PK', 'Pakistan'), ('PW', 'Palau'), ('PS', 'Palestine, State of'), ('PA', 'Panama'), ('PG', 'Papua New Guinea'), ('PY', 'Paraguay'), ('PE', 'Peru'), ('PH', 'Philippines'), ('PN', 'Pitcairn'), ('PL', 'Poland'), ('PT', 'Portugal'), ('PR', 'Puerto Rico'), ('QA', 'Qatar'), ('RO', 'Romania'), ('RU', 'Russian Federation'), ('RW', 'Rwanda'), ('RE', 'Réunion'), ('BL', 'Saint Barthélemy'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('KN', 'Saint Kitts and Nevis'), ('LC', 'Saint Lucia'), ('MF', 'Saint Martin (French part)'), ('PM', 'Saint Pierre and Miquelon'), ('VC', 'Saint Vincent and the Grenadines'), ('WS', 'Samoa'), ('SM', 'San Marino'), ('ST', 'Sao Tome and Principe'), ('SA', 'Saudi Arabia'), ('SN', 'Senegal'), ('RS', 'Serbia'), ('SC', 'Seychelles'), ('SL', 'Sierra Leone'), ('SG', 'Singapore'), ('SX', 'Sint Maarten (Dutch part)'), ('SK', 'Slovakia'), ('SI', 'Slovenia'), ('SB', 'Solomon Islands'), ('SO', 'Somalia'), ('ZA', 'South Africa'), ('GS', 'South Georgia and the South Sandwich Islands'), ('SS', 'South Sudan'), ('ES', 'Spain'), ('LK', 'Sri Lanka'), ('SD', 'Sudan'), ('SR', 'Suriname'), ('SJ', 'Svalbard and Jan Mayen'), ('SE', 'Sweden'), ('CH', 'Switzerland'), ('SY', 'Syrian Arab Republic'), ('TW', 'Taiwan, Province of China'), ('TJ', 'Tajikistan'), ('TZ', 'Tanzania, United Republic of'), ('TH', 'Thailand'), ('TL', 'Timor-Leste'), ('TG', 'Togo'), ('TK', 'Tokelau'), ('TO', 'Tonga'), ('TT', 'Trinidad and Tobago'), ('TN', 'Tunisia'), ('TM', 'Turkmenistan'), ('TC', 'Turks and Caicos Islands'), ('TV', 'Tuvalu'), ('TR', 'Türkiye'), ('UG', 'Uganda'), ('UA', 'Ukraine'), ('AE', 'United Arab Emirates'), ('GB', 'United Kingdom'), ('US', 'United States'), ('UM', 'United States Minor Outlying Islands'), ('UY', 'Uruguay'), ('UZ', 'Uzbekistan'), ('VU', 'Vanuatu'), ('VE', 'Venezuela, Bolivarian Republic of'), ('VN', 'Viet Nam'), ('VG', 'Virgin Islands, British'), ('VI', 'Virgin Islands, U.S.'), ('WF', 'Wallis and Futuna'), ('EH', 'Western Sahara'), ('YE', 'Yemen'), ('ZM', 'Zambia'), ('ZW', 'Zimbabwe'), ('AX', 'Åland Islands')]#
classmethod update_choices()[source]#
class univention.admin.syntax.RadiusClientType[source]#

Bases: select

choices: Sequence[Any] = [('other', 'other'), ('cisco', 'cisco'), ('computone', 'computone'), ('livingston', 'livingston'), ('juniper', 'juniper'), ('max40xx', 'max40xx'), ('multitech', 'multitech'), ('netserver', 'netserver'), ('pathras', 'pathras'), ('patton', 'patton'), ('portslave', 'portslave'), ('tc', 'tc'), ('usrhiper', 'usrhiper')]#
class univention.admin.syntax.mailinglist_name[source]#

Bases: gid

error_message = 'A mailing list name must start and end with a letter, number or underscore. In between additionally spaces, dashes and dots are allowed.'#

Error message when an invalid item is selected.

class univention.admin.syntax.TimeZone[source]#

Bases: select

static available_timezones()[source]#
choices: Sequence[Any] = [('America/Jujuy', 'America/Jujuy'), ('Europe/Samara', 'Europe/Samara'), ('Europe/Monaco', 'Europe/Monaco'), ('America/Glace_Bay', 'America/Glace_Bay'), ('Asia/Tbilisi', 'Asia/Tbilisi'), ('Australia/South', 'Australia/South'), ('America/Detroit', 'America/Detroit'), ('Mexico/BajaSur', 'Mexico/BajaSur'), ('Asia/Krasnoyarsk', 'Asia/Krasnoyarsk'), ('Pacific/Noumea', 'Pacific/Noumea'), ('Pacific/Chatham', 'Pacific/Chatham'), ('Australia/Yancowinna', 'Australia/Yancowinna'), ('GB-Eire', 'GB-Eire'), ('Pacific/Chuuk', 'Pacific/Chuuk'), ('America/Boa_Vista', 'America/Boa_Vista'), ('Asia/Ulan_Bator', 'Asia/Ulan_Bator'), ('GMT-0', 'GMT-0'), ('America/Dawson', 'America/Dawson'), ('Etc/GMT+5', 'Etc/GMT+5'), ('Europe/Lisbon', 'Europe/Lisbon'), ('Indian/Chagos', 'Indian/Chagos'), ('Africa/Maputo', 'Africa/Maputo'), ('Europe/Vaduz', 'Europe/Vaduz'), ('America/Monterrey', 'America/Monterrey'), ('Indian/Mahe', 'Indian/Mahe'), ('Pacific/Enderbury', 'Pacific/Enderbury'), ('America/Argentina/Jujuy', 'America/Argentina/Jujuy'), ('Etc/GMT', 'Etc/GMT'), ('Atlantic/Faeroe', 'Atlantic/Faeroe'), ('Asia/Bangkok', 'Asia/Bangkok'), ('America/New_York', 'America/New_York'), ('Europe/Mariehamn', 'Europe/Mariehamn'), ('Asia/Barnaul', 'Asia/Barnaul'), ('Africa/Lusaka', 'Africa/Lusaka'), ('Australia/Broken_Hill', 'Australia/Broken_Hill'), ('Africa/Blantyre', 'Africa/Blantyre'), ('US/Mountain', 'US/Mountain'), ('US/East-Indiana', 'US/East-Indiana'), ('America/Aruba', 'America/Aruba'), ('Africa/Nairobi', 'Africa/Nairobi'), ('Asia/Phnom_Penh', 'Asia/Phnom_Penh'), ('Europe/Kiev', 'Europe/Kiev'), ('Africa/Khartoum', 'Africa/Khartoum'), ('Europe/Riga', 'Europe/Riga'), ('Africa/Ndjamena', 'Africa/Ndjamena'), ('America/Thule', 'America/Thule'), ('America/Indianapolis', 'America/Indianapolis'), ('Atlantic/Cape_Verde', 'Atlantic/Cape_Verde'), ('Asia/Bahrain', 'Asia/Bahrain'), ('Europe/Belfast', 'Europe/Belfast'), ('Pacific/Tarawa', 'Pacific/Tarawa'), ('America/Asuncion', 'America/Asuncion'), ('Universal', 'Universal'), ('Europe/Brussels', 'Europe/Brussels'), ('Europe/Berlin', 'Europe/Berlin'), ('Africa/Juba', 'Africa/Juba'), ('Asia/Jayapura', 'Asia/Jayapura'), ('America/Chicago', 'America/Chicago'), ('Europe/London', 'Europe/London'), ('Asia/Shanghai', 'Asia/Shanghai'), ('Indian/Maldives', 'Indian/Maldives'), ('Atlantic/Stanley', 'Atlantic/Stanley'), ('Pacific/Johnston', 'Pacific/Johnston'), ('Pacific/Midway', 'Pacific/Midway'), ('Europe/Kirov', 'Europe/Kirov'), ('America/Belem', 'America/Belem'), ('Africa/Bissau', 'Africa/Bissau'), ('America/St_Vincent', 'America/St_Vincent'), ('America/Blanc-Sablon', 'America/Blanc-Sablon'), ('ROK', 'ROK'), ('Greenwich', 'Greenwich'), ('America/Costa_Rica', 'America/Costa_Rica'), ('Asia/Singapore', 'Asia/Singapore'), ('Etc/GMT+7', 'Etc/GMT+7'), ('America/Phoenix', 'America/Phoenix'), ('America/Cordoba', 'America/Cordoba'), ('Brazil/Acre', 'Brazil/Acre'), ('America/Shiprock', 'America/Shiprock'), ('Asia/Hovd', 'Asia/Hovd'), ('Canada/Pacific', 'Canada/Pacific'), ('Indian/Reunion', 'Indian/Reunion'), ('Asia/Rangoon', 'Asia/Rangoon'), ('GB', 'GB'), ('US/Hawaii', 'US/Hawaii'), ('Asia/Tel_Aviv', 'Asia/Tel_Aviv'), ('Etc/GMT-14', 'Etc/GMT-14'), ('Etc/GMT-10', 'Etc/GMT-10'), ('America/Puerto_Rico', 'America/Puerto_Rico'), ('Australia/Adelaide', 'Australia/Adelaide'), ('America/Ensenada', 'America/Ensenada'), ('Australia/Darwin', 'Australia/Darwin'), ('Europe/Guernsey', 'Europe/Guernsey'), ('Pacific/Port_Moresby', 'Pacific/Port_Moresby'), ('Asia/Ho_Chi_Minh', 'Asia/Ho_Chi_Minh'), ('Pacific/Fiji', 'Pacific/Fiji'), ('Africa/El_Aaiun', 'Africa/El_Aaiun'), ('Africa/Conakry', 'Africa/Conakry'), ('Arctic/Longyearbyen', 'Arctic/Longyearbyen'), ('Atlantic/Reykjavik', 'Atlantic/Reykjavik'), ('America/Montreal', 'America/Montreal'), ('America/Catamarca', 'America/Catamarca'), ('Etc/GMT-9', 'Etc/GMT-9'), ('Africa/Algiers', 'Africa/Algiers'), ('Pacific/Efate', 'Pacific/Efate'), ('America/Indiana/Knox', 'America/Indiana/Knox'), ('America/Inuvik', 'America/Inuvik'), ('Europe/Athens', 'Europe/Athens'), ('Asia/Chongqing', 'Asia/Chongqing'), ('Europe/Minsk', 'Europe/Minsk'), ('Etc/Zulu', 'Etc/Zulu'), ('America/Merida', 'America/Merida'), ('America/Argentina/San_Luis', 'America/Argentina/San_Luis'), ('Asia/Tokyo', 'Asia/Tokyo'), ('EET', 'EET'), ('Etc/GMT-6', 'Etc/GMT-6'), ('Europe/Paris', 'Europe/Paris'), ('Asia/Hebron', 'Asia/Hebron'), ('Africa/Ouagadougou', 'Africa/Ouagadougou'), ('America/Antigua', 'America/Antigua'), ('America/Santo_Domingo', 'America/Santo_Domingo'), ('Europe/Prague', 'Europe/Prague'), ('Libya', 'Libya'), ('Europe/Skopje', 'Europe/Skopje'), ('Etc/GMT-11', 'Etc/GMT-11'), ('America/Hermosillo', 'America/Hermosillo'), ('America/Bahia_Banderas', 'America/Bahia_Banderas'), ('Australia/North', 'Australia/North'), ('Canada/Yukon', 'Canada/Yukon'), ('Israel', 'Israel'), ('PRC', 'PRC'), ('America/Cayman', 'America/Cayman'), ('Australia/Eucla', 'Australia/Eucla'), ('Antarctica/McMurdo', 'Antarctica/McMurdo'), ('Africa/Kinshasa', 'Africa/Kinshasa'), ('Asia/Makassar', 'Asia/Makassar'), ('Asia/Yakutsk', 'Asia/Yakutsk'), ('America/Lower_Princes', 'America/Lower_Princes'), ('Brazil/DeNoronha', 'Brazil/DeNoronha'), ('America/Tijuana', 'America/Tijuana'), ('Indian/Christmas', 'Indian/Christmas'), ('Europe/Vienna', 'Europe/Vienna'), ('America/Sitka', 'America/Sitka'), ('America/Caracas', 'America/Caracas'), ('Etc/GMT-5', 'Etc/GMT-5'), ('Asia/Famagusta', 'Asia/Famagusta'), ('America/Rainy_River', 'America/Rainy_River'), ('Asia/Magadan', 'Asia/Magadan'), ('America/Yakutat', 'America/Yakutat'), ('EST', 'EST'), ('WET', 'WET'), ('Asia/Sakhalin', 'Asia/Sakhalin'), ('Africa/Kigali', 'Africa/Kigali'), ('Iceland', 'Iceland'), ('America/St_Lucia', 'America/St_Lucia'), ('Europe/Busingen', 'Europe/Busingen'), ('Asia/Kamchatka', 'Asia/Kamchatka'), ('America/Los_Angeles', 'America/Los_Angeles'), ('America/Grand_Turk', 'America/Grand_Turk'), ('Australia/Canberra', 'Australia/Canberra'), ('UCT', 'UCT'), ('America/Ciudad_Juarez', 'America/Ciudad_Juarez'), ('Etc/GMT+10', 'Etc/GMT+10'), ('Europe/Kaliningrad', 'Europe/Kaliningrad'), ('America/Miquelon', 'America/Miquelon'), ('America/Menominee', 'America/Menominee'), ('Europe/Podgorica', 'Europe/Podgorica'), ('Etc/GMT-7', 'Etc/GMT-7'), ('Etc/GMT-3', 'Etc/GMT-3'), ('Etc/Universal', 'Etc/Universal'), ('HST', 'HST'), ('Canada/Atlantic', 'Canada/Atlantic'), ('Asia/Taipei', 'Asia/Taipei'), ('Zulu', 'Zulu'), ('Asia/Vientiane', 'Asia/Vientiane'), ('Asia/Saigon', 'Asia/Saigon'), ('Africa/Lome', 'Africa/Lome'), ('Asia/Jakarta', 'Asia/Jakarta'), ('America/Fort_Wayne', 'America/Fort_Wayne'), ('America/Mendoza', 'America/Mendoza'), ('America/Boise', 'America/Boise'), ('Asia/Istanbul', 'Asia/Istanbul'), ('Asia/Samarkand', 'Asia/Samarkand'), ('Etc/GMT+3', 'Etc/GMT+3'), ('Asia/Vladivostok', 'Asia/Vladivostok'), ('Asia/Karachi', 'Asia/Karachi'), ('Asia/Bishkek', 'Asia/Bishkek'), ('Europe/Sarajevo', 'Europe/Sarajevo'), ('Pacific/Pitcairn', 'Pacific/Pitcairn'), ('Asia/Tehran', 'Asia/Tehran'), ('Pacific/Kosrae', 'Pacific/Kosrae'), ('Europe/Tiraspol', 'Europe/Tiraspol'), ('Cuba', 'Cuba'), ('Asia/Beirut', 'Asia/Beirut'), ('America/Edmonton', 'America/Edmonton'), ('America/Argentina/La_Rioja', 'America/Argentina/La_Rioja'), ('Europe/Vilnius', 'Europe/Vilnius'), ('Etc/UCT', 'Etc/UCT'), ('Australia/Hobart', 'Australia/Hobart'), ('Poland', 'Poland'), ('Etc/GMT+2', 'Etc/GMT+2'), ('Asia/Calcutta', 'Asia/Calcutta'), ('Australia/Brisbane', 'Australia/Brisbane'), ('Asia/Qostanay', 'Asia/Qostanay'), ('Etc/GMT+8', 'Etc/GMT+8'), ('Atlantic/Madeira', 'Atlantic/Madeira'), ('America/Porto_Velho', 'America/Porto_Velho'), ('America/Rosario', 'America/Rosario'), ('Asia/Riyadh', 'Asia/Riyadh'), ('Chile/EasterIsland', 'Chile/EasterIsland'), ('Pacific/Guam', 'Pacific/Guam'), ('Europe/Bratislava', 'Europe/Bratislava'), ('America/Regina', 'America/Regina'), ('Asia/Nicosia', 'Asia/Nicosia'), ('Asia/Qyzylorda', 'Asia/Qyzylorda'), ('Asia/Baku', 'Asia/Baku'), ('America/Tortola', 'America/Tortola'), ('Europe/Astrakhan', 'Europe/Astrakhan'), ('America/Dominica', 'America/Dominica'), ('US/Michigan', 'US/Michigan'), ('Africa/Addis_Ababa', 'Africa/Addis_Ababa'), ('Africa/Freetown', 'Africa/Freetown'), ('America/Indiana/Vevay', 'America/Indiana/Vevay'), ('Europe/Simferopol', 'Europe/Simferopol'), ('America/Metlakatla', 'America/Metlakatla'), ('America/Knox_IN', 'America/Knox_IN'), ('America/Kentucky/Louisville', 'America/Kentucky/Louisville'), ('Europe/Istanbul', 'Europe/Istanbul'), ('Europe/Amsterdam', 'Europe/Amsterdam'), ('Africa/Windhoek', 'Africa/Windhoek'), ('Pacific/Niue', 'Pacific/Niue'), ('Africa/Bamako', 'Africa/Bamako'), ('Asia/Choibalsan', 'Asia/Choibalsan'), ('Europe/Tallinn', 'Europe/Tallinn'), ('Etc/GMT-1', 'Etc/GMT-1'), ('Etc/GMT-13', 'Etc/GMT-13'), ('America/Manaus', 'America/Manaus'), ('America/Louisville', 'America/Louisville'), ('Pacific/Apia', 'Pacific/Apia'), ('America/El_Salvador', 'America/El_Salvador'), ('Asia/Thimbu', 'Asia/Thimbu'), ('Africa/Lagos', 'Africa/Lagos'), ('Factory', 'Factory'), ('Antarctica/Mawson', 'Antarctica/Mawson'), ('Africa/Accra', 'Africa/Accra'), ('Asia/Kuala_Lumpur', 'Asia/Kuala_Lumpur'), ('Indian/Antananarivo', 'Indian/Antananarivo'), ('Pacific/Ponape', 'Pacific/Ponape'), ('America/Whitehorse', 'America/Whitehorse'), ('Atlantic/Azores', 'Atlantic/Azores'), ('Etc/GMT+12', 'Etc/GMT+12'), ('CET', 'CET'), ('Europe/Nicosia', 'Europe/Nicosia'), ('America/Bogota', 'America/Bogota'), ('UTC', 'UTC'), ('America/Coral_Harbour', 'America/Coral_Harbour'), ('Pacific/Guadalcanal', 'Pacific/Guadalcanal'), ('Africa/Gaborone', 'Africa/Gaborone'), ('Africa/Mogadishu', 'Africa/Mogadishu'), ('Asia/Yekaterinburg', 'Asia/Yekaterinburg'), ('Europe/Volgograd', 'Europe/Volgograd'), ('America/Tegucigalpa', 'America/Tegucigalpa'), ('America/Port-au-Prince', 'America/Port-au-Prince'), ('Pacific/Majuro', 'Pacific/Majuro'), ('America/Argentina/Ushuaia', 'America/Argentina/Ushuaia'), ('Europe/Rome', 'Europe/Rome'), ('Europe/Warsaw', 'Europe/Warsaw'), ('Japan', 'Japan'), ('America/Atka', 'America/Atka'), ('Indian/Mauritius', 'Indian/Mauritius'), ('Australia/Lindeman', 'Australia/Lindeman'), ('Europe/Moscow', 'Europe/Moscow'), ('Brazil/West', 'Brazil/West'), ('Africa/Cairo', 'Africa/Cairo'), ('America/Punta_Arenas', 'America/Punta_Arenas'), ('America/Jamaica', 'America/Jamaica'), ('Pacific/Yap', 'Pacific/Yap'), ('Europe/Dublin', 'Europe/Dublin'), ('Africa/Douala', 'Africa/Douala'), ('Africa/Johannesburg', 'Africa/Johannesburg'), ('US/Arizona', 'US/Arizona'), ('Europe/Zaporozhye', 'Europe/Zaporozhye'), ('Atlantic/Bermuda', 'Atlantic/Bermuda'), ('Atlantic/Faroe', 'Atlantic/Faroe'), ('Etc/GMT+4', 'Etc/GMT+4'), ('Pacific/Gambier', 'Pacific/Gambier'), ('Europe/Bucharest', 'Europe/Bucharest'), ('Etc/GMT0', 'Etc/GMT0'), ('Asia/Dili', 'Asia/Dili'), ('Asia/Macao', 'Asia/Macao'), ('Mexico/General', 'Mexico/General'), ('America/Argentina/Catamarca', 'America/Argentina/Catamarca'), ('Asia/Omsk', 'Asia/Omsk'), ('America/Indiana/Vincennes', 'America/Indiana/Vincennes'), ('America/Argentina/San_Juan', 'America/Argentina/San_Juan'), ('Asia/Chita', 'Asia/Chita'), ('Asia/Novokuznetsk', 'Asia/Novokuznetsk'), ('Europe/Budapest', 'Europe/Budapest'), ('America/Guatemala', 'America/Guatemala'), ('Antarctica/Troll', 'Antarctica/Troll'), ('Turkey', 'Turkey'), ('America/Santa_Isabel', 'America/Santa_Isabel'), ('Pacific/Samoa', 'Pacific/Samoa'), ('Pacific/Rarotonga', 'Pacific/Rarotonga'), ('Indian/Comoro', 'Indian/Comoro'), ('Pacific/Saipan', 'Pacific/Saipan'), ('Pacific/Funafuti', 'Pacific/Funafuti'), ('America/Martinique', 'America/Martinique'), ('Portugal', 'Portugal'), ('America/Chihuahua', 'America/Chihuahua'), ('America/Toronto', 'America/Toronto'), ('Europe/Gibraltar', 'Europe/Gibraltar'), ('Asia/Katmandu', 'Asia/Katmandu'), ('Australia/Tasmania', 'Australia/Tasmania'), ('America/Resolute', 'America/Resolute'), ('America/Grenada', 'America/Grenada'), ('Australia/West', 'Australia/West'), ('Etc/GMT+9', 'Etc/GMT+9'), ('Pacific/Pohnpei', 'Pacific/Pohnpei'), ('Asia/Yangon', 'Asia/Yangon'), ('Pacific/Easter', 'Pacific/Easter'), ('America/Anguilla', 'America/Anguilla'), ('EST5EDT', 'EST5EDT'), ('Europe/Uzhgorod', 'Europe/Uzhgorod'), ('Pacific/Kiritimati', 'Pacific/Kiritimati'), ('Antarctica/Macquarie', 'Antarctica/Macquarie'), ('America/Santarem', 'America/Santarem'), ('Africa/Porto-Novo', 'Africa/Porto-Novo'), ('Africa/Bangui', 'Africa/Bangui'), ('Africa/Niamey', 'Africa/Niamey'), ('Pacific/Pago_Pago', 'Pacific/Pago_Pago'), ('Antarctica/Vostok', 'Antarctica/Vostok'), ('America/Scoresbysund', 'America/Scoresbysund'), ('Canada/Saskatchewan', 'Canada/Saskatchewan'), ('US/Indiana-Starke', 'US/Indiana-Starke'), ('Singapore', 'Singapore'), ('America/Mazatlan', 'America/Mazatlan'), ('Europe/Malta', 'Europe/Malta'), ('Africa/Casablanca', 'Africa/Casablanca'), ('America/Goose_Bay', 'America/Goose_Bay'), ('Antarctica/Casey', 'Antarctica/Casey'), ('Australia/LHI', 'Australia/LHI'), ('America/Nassau', 'America/Nassau'), ('Asia/Baghdad', 'Asia/Baghdad'), ('Etc/GMT-4', 'Etc/GMT-4'), ('Asia/Irkutsk', 'Asia/Irkutsk'), ('Canada/Central', 'Canada/Central'), ('Asia/Kolkata', 'Asia/Kolkata'), ('Africa/Nouakchott', 'Africa/Nouakchott'), ('Etc/GMT-0', 'Etc/GMT-0'), ('America/Araguaina', 'America/Araguaina'), ('America/Curacao', 'America/Curacao'), ('America/Nipigon', 'America/Nipigon'), ('Europe/Tirane', 'Europe/Tirane'), ('Europe/Belgrade', 'Europe/Belgrade'), ('Etc/UTC', 'Etc/UTC'), ('Europe/Stockholm', 'Europe/Stockholm'), ('US/Samoa', 'US/Samoa'), ('GMT', 'GMT'), ('America/Yellowknife', 'America/Yellowknife'), ('Europe/Luxembourg', 'Europe/Luxembourg'), ('Africa/Sao_Tome', 'Africa/Sao_Tome'), ('Etc/GMT-2', 'Etc/GMT-2'), ('America/Coyhaique', 'America/Coyhaique'), ('America/Moncton', 'America/Moncton'), ('America/Noronha', 'America/Noronha'), ('NZ', 'NZ'), ('Pacific/Palau', 'Pacific/Palau'), ('Canada/Mountain', 'Canada/Mountain'), ('Pacific/Nauru', 'Pacific/Nauru'), ('Asia/Ulaanbaatar', 'Asia/Ulaanbaatar'), ('Asia/Tomsk', 'Asia/Tomsk'), ('America/Dawson_Creek', 'America/Dawson_Creek'), ('Australia/Lord_Howe', 'Australia/Lord_Howe'), ('Etc/GMT+0', 'Etc/GMT+0'), ('Pacific/Tongatapu', 'Pacific/Tongatapu'), ('US/Alaska', 'US/Alaska'), ('Asia/Dhaka', 'Asia/Dhaka'), ('America/Recife', 'America/Recife'), ('US/Pacific', 'US/Pacific'), ('Africa/Lubumbashi', 'Africa/Lubumbashi'), ('Europe/San_Marino', 'Europe/San_Marino'), ('America/La_Paz', 'America/La_Paz'), ('NZ-CHAT', 'NZ-CHAT'), ('America/Port_of_Spain', 'America/Port_of_Spain'), ('Asia/Chungking', 'Asia/Chungking'), ('America/Indiana/Petersburg', 'America/Indiana/Petersburg'), ('Indian/Kerguelen', 'Indian/Kerguelen'), ('localtime', 'localtime'), ('Asia/Srednekolymsk', 'Asia/Srednekolymsk'), ('Asia/Hong_Kong', 'Asia/Hong_Kong'), ('America/Iqaluit', 'America/Iqaluit'), ('America/Buenos_Aires', 'America/Buenos_Aires'), ('Asia/Khandyga', 'Asia/Khandyga'), ('Asia/Pontianak', 'Asia/Pontianak'), ('Asia/Ashgabat', 'Asia/Ashgabat'), ('Australia/NSW', 'Australia/NSW'), ('Asia/Kabul', 'Asia/Kabul'), ('Africa/Harare', 'Africa/Harare'), ('Etc/GMT-12', 'Etc/GMT-12'), ('CST6CDT', 'CST6CDT'), ('America/Nuuk', 'America/Nuuk'), ('America/Fort_Nelson', 'America/Fort_Nelson'), ('Asia/Novosibirsk', 'Asia/Novosibirsk'), ('GMT+0', 'GMT+0'), ('Asia/Qatar', 'Asia/Qatar'), ('America/Paramaribo', 'America/Paramaribo'), ('America/Campo_Grande', 'America/Campo_Grande'), ('Asia/Brunei', 'Asia/Brunei'), ('Antarctica/Syowa', 'Antarctica/Syowa'), ('America/Kentucky/Monticello', 'America/Kentucky/Monticello'), ('Africa/Luanda', 'Africa/Luanda'), ('Asia/Kashgar', 'Asia/Kashgar'), ('America/Argentina/ComodRivadavia', 'America/Argentina/ComodRivadavia'), ('Asia/Kuching', 'Asia/Kuching'), ('Asia/Ust-Nera', 'Asia/Ust-Nera'), ('America/Havana', 'America/Havana'), ('Europe/Oslo', 'Europe/Oslo'), ('America/Panama', 'America/Panama'), ('Antarctica/Palmer', 'Antarctica/Palmer'), ('America/Cancun', 'America/Cancun'), ('America/Porto_Acre', 'America/Porto_Acre'), ('America/North_Dakota/Center', 'America/North_Dakota/Center'), ('Asia/Damascus', 'Asia/Damascus'), ('Asia/Macau', 'Asia/Macau'), ('America/Swift_Current', 'America/Swift_Current'), ('GMT0', 'GMT0'), ('Pacific/Fakaofo', 'Pacific/Fakaofo'), ('Etc/GMT+11', 'Etc/GMT+11'), ('Asia/Seoul', 'Asia/Seoul'), ('Asia/Oral', 'Asia/Oral'), ('Asia/Jerusalem', 'Asia/Jerusalem'), ('Asia/Ashkhabad', 'Asia/Ashkhabad'), ('America/Santiago', 'America/Santiago'), ('America/Godthab', 'America/Godthab'), ('Etc/GMT+1', 'Etc/GMT+1'), ('America/St_Kitts', 'America/St_Kitts'), ('Australia/Victoria', 'Australia/Victoria'), ('America/Nome', 'America/Nome'), ('Asia/Anadyr', 'Asia/Anadyr'), ('Pacific/Wake', 'Pacific/Wake'), ('America/Cambridge_Bay', 'America/Cambridge_Bay'), ('Europe/Zagreb', 'Europe/Zagreb'), ('America/Sao_Paulo', 'America/Sao_Paulo'), ('America/St_Barthelemy', 'America/St_Barthelemy'), ('Australia/ACT', 'Australia/ACT'), ('Asia/Colombo', 'Asia/Colombo'), ('Asia/Dushanbe', 'Asia/Dushanbe'), ('Australia/Queensland', 'Australia/Queensland'), ('Africa/Timbuktu', 'Africa/Timbuktu'), ('Pacific/Bougainville', 'Pacific/Bougainville'), ('Etc/GMT-8', 'Etc/GMT-8'), ('Africa/Djibouti', 'Africa/Djibouti'), ('America/Matamoros', 'America/Matamoros'), ('America/Anchorage', 'America/Anchorage'), ('Europe/Zurich', 'Europe/Zurich'), ('Atlantic/South_Georgia', 'Atlantic/South_Georgia'), ('Asia/Tashkent', 'Asia/Tashkent'), ('America/Denver', 'America/Denver'), ('America/Juneau', 'America/Juneau'), ('Europe/Ulyanovsk', 'Europe/Ulyanovsk'), ('Africa/Banjul', 'Africa/Banjul'), ('Brazil/East', 'Brazil/East'), ('America/Rio_Branco', 'America/Rio_Branco'), ('America/Vancouver', 'America/Vancouver'), ('America/Atikokan', 'America/Atikokan'), ('America/Argentina/Mendoza', 'America/Argentina/Mendoza'), ('America/Kralendijk', 'America/Kralendijk'), ('America/North_Dakota/Beulah', 'America/North_Dakota/Beulah'), ('Australia/Melbourne', 'Australia/Melbourne'), ('Africa/Monrovia', 'Africa/Monrovia'), ('Europe/Saratov', 'Europe/Saratov'), ('Europe/Copenhagen', 'Europe/Copenhagen'), ('Africa/Malabo', 'Africa/Malabo'), ('Eire', 'Eire'), ('Asia/Dacca', 'Asia/Dacca'), ('Asia/Aqtau', 'Asia/Aqtau'), ('America/Thunder_Bay', 'America/Thunder_Bay'), ('America/Barbados', 'America/Barbados'), ('Canada/Newfoundland', 'Canada/Newfoundland'), ('Europe/Helsinki', 'Europe/Helsinki'), ('Europe/Andorra', 'Europe/Andorra'), ('America/Montevideo', 'America/Montevideo'), ('Pacific/Truk', 'Pacific/Truk'), ('Jamaica', 'Jamaica'), ('America/Montserrat', 'America/Montserrat'), ('Africa/Asmera', 'Africa/Asmera'), ('Kwajalein', 'Kwajalein'), ('PST8PDT', 'PST8PDT'), ('Australia/Currie', 'Australia/Currie'), ('Etc/Greenwich', 'Etc/Greenwich'), ('America/Halifax', 'America/Halifax'), ('Mexico/BajaNorte', 'Mexico/BajaNorte'), ('Antarctica/Rothera', 'Antarctica/Rothera'), ('Europe/Jersey', 'Europe/Jersey'), ('Africa/Mbabane', 'Africa/Mbabane'), ('America/Fortaleza', 'America/Fortaleza'), ('Europe/Isle_of_Man', 'Europe/Isle_of_Man'), ('Africa/Bujumbura', 'Africa/Bujumbura'), ('America/Argentina/Tucuman', 'America/Argentina/Tucuman'), ('America/Argentina/Rio_Gallegos', 'America/Argentina/Rio_Gallegos'), ('Asia/Pyongyang', 'Asia/Pyongyang'), ('Pacific/Kanton', 'Pacific/Kanton'), ('Asia/Almaty', 'Asia/Almaty'), ('America/Argentina/Cordoba', 'America/Argentina/Cordoba'), ('Pacific/Kwajalein', 'Pacific/Kwajalein'), ('Antarctica/DumontDUrville', 'Antarctica/DumontDUrville'), ('MST', 'MST'), ('Antarctica/Davis', 'Antarctica/Davis'), ('America/North_Dakota/New_Salem', 'America/North_Dakota/New_Salem'), ('Asia/Ujung_Pandang', 'Asia/Ujung_Pandang'), ('Africa/Dakar', 'Africa/Dakar'), ('Asia/Aqtobe', 'Asia/Aqtobe'), ('ROC', 'ROC'), ('America/Managua', 'America/Managua'), ('Antarctica/South_Pole', 'Antarctica/South_Pole'), ('Africa/Brazzaville', 'Africa/Brazzaville'), ('Africa/Dar_es_Salaam', 'Africa/Dar_es_Salaam'), ('Atlantic/Jan_Mayen', 'Atlantic/Jan_Mayen'), ('Asia/Manila', 'Asia/Manila'), ('Africa/Ceuta', 'Africa/Ceuta'), ('Asia/Urumqi', 'Asia/Urumqi'), ('America/Marigot', 'America/Marigot'), ('US/Aleutian', 'US/Aleutian'), ('America/Virgin', 'America/Virgin'), ('Africa/Libreville', 'Africa/Libreville'), ('America/Eirunepe', 'America/Eirunepe'), ('Etc/GMT+6', 'Etc/GMT+6'), ('America/Cayenne', 'America/Cayenne'), ('America/Indiana/Winamac', 'America/Indiana/Winamac'), ('America/St_Thomas', 'America/St_Thomas'), ('US/Central', 'US/Central'), ('Asia/Aden', 'Asia/Aden'), ('America/Pangnirtung', 'America/Pangnirtung'), ('Asia/Kathmandu', 'Asia/Kathmandu'), ('America/Argentina/Buenos_Aires', 'America/Argentina/Buenos_Aires'), ('Europe/Kyiv', 'Europe/Kyiv'), ('Atlantic/St_Helena', 'Atlantic/St_Helena'), ('Africa/Tunis', 'Africa/Tunis'), ('Europe/Ljubljana', 'Europe/Ljubljana'), ('Europe/Vatican', 'Europe/Vatican'), ('Hongkong', 'Hongkong'), ('Iran', 'Iran'), ('Pacific/Wallis', 'Pacific/Wallis'), ('America/Ojinaga', 'America/Ojinaga'), ('America/Maceio', 'America/Maceio'), ('Pacific/Honolulu', 'Pacific/Honolulu'), ('Africa/Tripoli', 'Africa/Tripoli'), ('Canada/Eastern', 'Canada/Eastern'), ('Asia/Amman', 'Asia/Amman'), ('America/Belize', 'America/Belize'), ('Pacific/Galapagos', 'Pacific/Galapagos'), ('Pacific/Auckland', 'Pacific/Auckland'), ('Europe/Chisinau', 'Europe/Chisinau'), ('Navajo', 'Navajo'), ('Australia/Perth', 'Australia/Perth'), ('America/Indiana/Tell_City', 'America/Indiana/Tell_City'), ('Asia/Thimphu', 'Asia/Thimphu'), ('Asia/Harbin', 'Asia/Harbin'), ('Indian/Cocos', 'Indian/Cocos'), ('US/Eastern', 'US/Eastern'), ('America/Lima', 'America/Lima'), ('Asia/Atyrau', 'Asia/Atyrau'), ('America/Rankin_Inlet', 'America/Rankin_Inlet'), ('America/Cuiaba', 'America/Cuiaba'), ('Asia/Dubai', 'Asia/Dubai'), ('Asia/Yerevan', 'Asia/Yerevan'), ('Pacific/Tahiti', 'Pacific/Tahiti'), ('W-SU', 'W-SU'), ('Asia/Muscat', 'Asia/Muscat'), ('America/Indiana/Marengo', 'America/Indiana/Marengo'), ('Australia/Sydney', 'Australia/Sydney'), ('Africa/Asmara', 'Africa/Asmara'), ('America/Mexico_City', 'America/Mexico_City'), ('Pacific/Norfolk', 'Pacific/Norfolk'), ('America/Bahia', 'America/Bahia'), ('Indian/Mayotte', 'Indian/Mayotte'), ('America/St_Johns', 'America/St_Johns'), ('Pacific/Marquesas', 'Pacific/Marquesas'), ('MST7MDT', 'MST7MDT'), ('Africa/Kampala', 'Africa/Kampala'), ('Atlantic/Canary', 'Atlantic/Canary'), ('Asia/Gaza', 'Asia/Gaza'), ('America/Guayaquil', 'America/Guayaquil'), ('America/Argentina/Salta', 'America/Argentina/Salta'), ('Egypt', 'Egypt'), ('America/Winnipeg', 'America/Winnipeg'), ('Chile/Continental', 'Chile/Continental'), ('Asia/Kuwait', 'Asia/Kuwait'), ('America/Danmarkshavn', 'America/Danmarkshavn'), ('Europe/Sofia', 'Europe/Sofia'), ('America/Guadeloupe', 'America/Guadeloupe'), ('America/Indiana/Indianapolis', 'America/Indiana/Indianapolis'), ('America/Creston', 'America/Creston'), ('Europe/Madrid', 'Europe/Madrid'), ('Africa/Maseru', 'Africa/Maseru'), ('Africa/Abidjan', 'Africa/Abidjan'), ('America/Adak', 'America/Adak'), ('America/Guyana', 'America/Guyana'), ('MET', 'MET')]#
class univention.admin.syntax.DateTimeTimezone[source]#

Bases: complex

Syntax for YYYY-mm-dd HH:MM TZNAME

delimiter: str = ' '#

Delimiter to separate the sub-items. Two possibilities:

  1. Either a single string like =, which is used to concatenate all subitems.

  2. A sequence of n+1 strings like [‘’, ‘: ‘, ‘=’, ‘’] to concatenate n sub-items. The first and last value is used as a prefix/suffix.

subsyntaxes: Sequence[tuple[str, type[ISyntax]]] = [('Date', <class 'univention.admin.syntax.iso8601Date'>), ('Time', <class 'univention.admin.syntax.TimeString'>), ('Timezone', <class 'univention.admin.syntax.TimeZone'>)]#
subsyntax_names: tuple[str, ...] = ('date', 'time', 'timezone')#
size: str | Sequence[str] = ('TwoThirds', 'TwoThirds', 'TwoThirds')#

Widget size. See SIZES.

all_required = False#

All sub-values must contain a value.

min_elements: int | None = 0#

Minimum number of required values.

class univention.admin.syntax.GeneralizedTimeUTC[source]#

Bases: simple

Generalized time but without microseconds and always in UTC

classmethod parse(text)[source]#

Validate the value by parsing it.

Returns:

the parsed textual value.

Raises:

univention.admin.uexceptions.valueError – if the value is invalid.

classmethod to_datetime(value)[source]#
classmethod from_datetime(value)[source]#
class univention.admin.syntax.ActivationDateTimeTimezone[source]#

Bases: DateTimeTimezone

Syntax for YYYY-mm-dd HH:MM TZNAME Subclassed to define representative names as subsyntax_names for REST API

subsyntax_names: tuple[str, ...] = ('activation-date', 'activation-time', 'activation-timezone')#
class univention.admin.syntax.UDM_Syntax[source]#

Bases: combobox

Syntax class for Extended Attributes.

choices: list[tuple[str, str]] = [('ActivationDateTimeTimezone', 'ActivationDateTimeTimezone'), ('AllowDeny', 'AllowDeny'), ('AllowDenyIgnore', 'AllowDenyIgnore'), ('AppActivatedBoolean', 'AppActivatedBoolean'), ('AppActivatedOK', 'AppActivatedOK'), ('AppActivatedTrue', 'AppActivatedTrue'), ('AuthRestriction', 'AuthRestriction'), ('Base64BaseUpload', 'Base64BaseUpload'), ('Base64Bzip2Text', 'Base64Bzip2Text'), ('Base64Bzip2XML', 'Base64Bzip2XML'), ('Base64GzipText', 'Base64GzipText'), ('Base64UMCIcon', 'Base64UMCIcon'), ('Base64Upload', 'Base64Upload'), ('BaseFilename', 'BaseFilename'), ('Country', 'Country'), ('DHCP_HardwareAddress', 'DHCP_HardwareAddress'), ('DHCP_Option', 'DHCP_Option'), ('DNS_ForwardZone', 'DNS_ForwardZone'), ('DNS_ForwardZoneList', 'DNS_ForwardZoneList'), ('DNS_ForwardZoneNonempty', 'DNS_ForwardZoneNonempty'), ('DNS_Name', 'DNS_Name'), ('DNS_ReverseZone', 'DNS_ReverseZone'), ('DNS_ReverseZoneNonempty', 'DNS_ReverseZoneNonempty'), ('DateTimeTimezone', 'DateTimeTimezone'), ('Day', 'Day'), ('DebianPackageVersion', 'DebianPackageVersion'), ('DomainController', 'DomainController'), ('Editor', 'Editor'), ('ExampleSyntax', 'ExampleSyntax'), ('FiveThirdsString', 'FiveThirdsString'), ('FourThirdsString', 'FourThirdsString'), ('GNUMessageCatalog', 'GNUMessageCatalog'), ('GeneralizedTimeUTC', 'GeneralizedTimeUTC'), ('GroupDN', 'GroupDN'), ('GroupDNOrEmpty', 'GroupDNOrEmpty'), ('GroupID', 'GroupID'), ('GroupName', 'GroupName'), ('GuardianRole', 'GuardianRole'), ('HalfString', 'HalfString'), ('HostDN', 'HostDN'), ('Hour', 'Hour'), ('HourSimple', 'HourSimple'), ('I18N_GroupName', 'I18N_GroupName'), ('IA5string', 'IA5string'), ('IComputer_FQDN', 'IComputer_FQDN'), ('IMAP_POP3', 'IMAP_POP3'), ('IMAP_Right', 'IMAP_Right'), ('IP_AddressList', 'IP_AddressList'), ('IP_AddressListEmpty', 'IP_AddressListEmpty'), ('IP_AddressRange', 'IP_AddressRange'), ('IPv4_AddressRange', 'IPv4_AddressRange'), ('IStates', 'IStates'), ('ISyntax', 'ISyntax'), ('KDE_Profile', 'KDE_Profile'), ('LDAP_Search', 'LDAP_Search'), ('LDAP_Server', 'LDAP_Server'), ('Localesubdirname', 'Localesubdirname'), ('Localesubdirname_and_GNUMessageCatalog', 'Localesubdirname_and_GNUMessageCatalog'), ('LocalizedAnonymousEmpty', 'LocalizedAnonymousEmpty'), ('LocalizedDescription', 'LocalizedDescription'), ('LocalizedDisplayName', 'LocalizedDisplayName'), ('MAC_Address', 'MAC_Address'), ('MAC_AddressList', 'MAC_AddressList'), ('MailDomain', 'MailDomain'), ('MailHomeServer', 'MailHomeServer'), ('Minute', 'Minute'), ('MinuteSimple', 'MinuteSimple'), ('Month', 'Month'), ('MultiSelect', 'MultiSelect'), ('NetworkType', 'NetworkType'), ('ObjectFlag', 'ObjectFlag'), ('OkOrNot', 'OkOrNot'), ('OneAndAHalfString', 'OneAndAHalfString'), ('OneThirdString', 'OneThirdString'), ('Packages', 'Packages'), ('PackagesRemove', 'PackagesRemove'), ('PortalComputer', 'PortalComputer'), ('PortalDefaultLinkTarget', 'PortalDefaultLinkTarget'), ('PortalEntryLinkTarget', 'PortalEntryLinkTarget'), ('PortalFontColor', 'PortalFontColor'), ('PrintQuotaGroup', 'PrintQuotaGroup'), ('PrintQuotaGroupPerUser', 'PrintQuotaGroupPerUser'), ('PrintQuotaUser', 'PrintQuotaUser'), ('PrinterDriverList', 'PrinterDriverList'), ('PrinterNames', 'PrinterNames'), ('PrinterProducerList', 'PrinterProducerList'), ('PrinterProtocol', 'PrinterProtocol'), ('PrinterURI', 'PrinterURI'), ('Printers', 'Printers'), ('RadiusClientType', 'RadiusClientType'), ('RecycleBinReference', 'RecycleBinReference'), ('RecycleBinSupportedModules', 'RecycleBinSupportedModules'), ('SambaLogonHours', 'SambaLogonHours'), ('SambaMaxPwdAge', 'SambaMaxPwdAge'), ('SambaMinPwdAge', 'SambaMinPwdAge'), ('SambaPrivileges', 'SambaPrivileges'), ('Service', 'Service'), ('ServiceMail', 'ServiceMail'), ('ServicePrint', 'ServicePrint'), ('ServicePrint_FQDN', 'ServicePrint_FQDN'), ('SharedFolderGroupACL', 'SharedFolderGroupACL'), ('SharedFolderSimpleGroupACL', 'SharedFolderSimpleGroupACL'), ('SharedFolderSimpleUserACL', 'SharedFolderSimpleUserACL'), ('SharedFolderUserACL', 'SharedFolderUserACL'), ('SignedInteger', 'SignedInteger'), ('TextArea', 'TextArea'), ('TimeString', 'TimeString'), ('TimeUnits', 'TimeUnits'), ('TimeZone', 'TimeZone'), ('TrueFalse', 'TrueFalse'), ('TrueFalseUp', 'TrueFalseUp'), ('TrueFalseUpper', 'TrueFalseUpper'), ('TwoEditor', 'TwoEditor'), ('TwoString', 'TwoString'), ('TwoThirdsString', 'TwoThirdsString'), ('UCR_Variable', 'UCR_Variable'), ('UCSServerRole', 'UCSServerRole'), ('UCSVersion', 'UCSVersion'), ('UCS_Server', 'UCS_Server'), ('UDM_Attribute', 'UDM_Attribute'), ('UDM_Objects', 'UDM_Objects'), ('UDM_PropertySelect', 'UDM_PropertySelect'), ('UDM_Syntax', 'UDM_Syntax'), ('UMCMessageCatalogFilename', 'UMCMessageCatalogFilename'), ('UMCMessageCatalogFilename_and_GNUMessageCatalog', 'UMCMessageCatalogFilename_and_GNUMessageCatalog'), ('UMC_CommandPattern', 'UMC_CommandPattern'), ('UMC_OperationSet', 'UMC_OperationSet'), ('UNIX_AccessRight', 'UNIX_AccessRight'), ('UNIX_AccessRight_extended', 'UNIX_AccessRight_extended'), ('UNIX_BoundedTimeInterval', 'UNIX_BoundedTimeInterval'), ('UNIX_TimeInterval', 'UNIX_TimeInterval'), ('UUID', 'UUID'), ('Upload', 'Upload'), ('UserDN', 'UserDN'), ('UserID', 'UserID'), ('UserMailAddress', 'UserMailAddress'), ('UserName', 'UserName'), ('VFSObjects', 'VFSObjects'), ('Weekday', 'Weekday'), ('Windows_Server', 'Windows_Server'), ('WritableShare', 'WritableShare'), ('XColorDepth', 'XColorDepth'), ('XDisplayPosition', 'XDisplayPosition'), ('XKeyboardLayout', 'XKeyboardLayout'), ('XModule', 'XModule'), ('XMouseDevice', 'XMouseDevice'), ('XMouseProtocol', 'XMouseProtocol'), ('XResolution', 'XResolution'), ('XSync', 'XSync'), ('_CachedLdap', '_CachedLdap'), ('absolutePath', 'absolutePath'), ('adGroupType', 'adGroupType'), ('allModuleOptions', 'allModuleOptions'), ('auto_one_zero', 'auto_one_zero'), ('boolean', 'boolean'), ('booleanNone', 'booleanNone'), ('combobox', 'combobox'), ('complex', 'complex'), ('date', 'date'), ('date2', 'date2'), ('ddnsUpdateStyle', 'ddnsUpdateStyle'), ('ddnsUpdates', 'ddnsUpdates'), ('dhcpEntry', 'dhcpEntry'), ('dhcpService', 'dhcpService'), ('disabled', 'disabled'), ('dnsEntry', 'dnsEntry'), ('dnsEntryAlias', 'dnsEntryAlias'), ('dnsEntryReverse', 'dnsEntryReverse'), ('dnsHostname', 'dnsHostname'), ('dnsMX', 'dnsMX'), ('dnsName', 'dnsName'), ('dnsName_umlauts', 'dnsName_umlauts'), ('dnsPTR', 'dnsPTR'), ('dnsSRVLocation', 'dnsSRVLocation'), ('dnsSRVName', 'dnsSRVName'), ('dnsZone', 'dnsZone'), ('emailAddress', 'emailAddress'), ('emailAddressTemplate', 'emailAddressTemplate'), ('emailAddressThatMayEndWithADot', 'emailAddressThatMayEndWithADot'), ('emailAddressValidDomain', 'emailAddressValidDomain'), ('emailForwardSetting', 'emailForwardSetting'), ('filesize', 'filesize'), ('gid', 'gid'), ('hostName', 'hostName'), ('hostOrIP', 'hostOrIP'), ('hostname_or_ipadress_or_network', 'hostname_or_ipadress_or_network'), ('integer', 'integer'), ('integerOrEmpty', 'integerOrEmpty'), ('ipAddress', 'ipAddress'), ('ipProtocol', 'ipProtocol'), ('ipProtocolSRV', 'ipProtocolSRV'), ('ipnetwork', 'ipnetwork'), ('ipv4Address', 'ipv4Address'), ('iso8601Date', 'iso8601Date'), ('jpegPhoto', 'jpegPhoto'), ('kdeProfile', 'kdeProfile'), ('keyAndValue', 'keyAndValue'), ('language', 'language'), ('languageCode', 'languageCode'), ('ldapAttribute', 'ldapAttribute'), ('ldapDn', 'ldapDn'), ('ldapDnOrNone', 'ldapDnOrNone'), ('ldapFilter', 'ldapFilter'), ('ldapObjectClass', 'ldapObjectClass'), ('listAttributes', 'listAttributes'), ('locked', 'locked'), ('mailHomeServer', 'mailHomeServer'), ('mail_folder_name', 'mail_folder_name'), ('mail_folder_type', 'mail_folder_type'), ('mailinglist_name', 'mailinglist_name'), ('nagiosHostsEnabledDn', 'nagiosHostsEnabledDn'), ('nagiosServiceDn', 'nagiosServiceDn'), ('netbiosNodeType', 'netbiosNodeType'), ('netmask', 'netmask'), ('network', 'network'), ('nfsMounts', 'nfsMounts'), ('nfsShare', 'nfsShare'), ('nfssync', 'nfssync'), ('none', 'none'), ('optionsUsersUser', 'optionsUsersUser'), ('passwd', 'passwd'), ('phone', 'phone'), ('policyName', 'policyName'), ('postalAddress', 'postalAddress'), ('primaryEmailAddressValidDomain', 'primaryEmailAddressValidDomain'), ('primaryGroup', 'primaryGroup'), ('primaryGroup2', 'primaryGroup2'), ('printerModel', 'printerModel'), ('printerName', 'printerName'), ('reverseLookupSubnet', 'reverseLookupSubnet'), ('reverseLookupZoneName', 'reverseLookupZoneName'), ('sambaGroupType', 'sambaGroupType'), ('select', 'select'), ('sharePath', 'sharePath'), ('simple', 'simple'), ('soundModule', 'soundModule'), ('string', 'string'), ('string6', 'string6'), ('string64', 'string64'), ('string_numbers_letters_dots', 'string_numbers_letters_dots'), ('string_numbers_letters_dots_spaces', 'string_numbers_letters_dots_spaces'), ('timeSpec', 'timeSpec'), ('translationTuple', 'translationTuple'), ('translationTupleLongDescription', 'translationTupleLongDescription'), ('translationTupleShortDescription', 'translationTupleShortDescription'), ('translationTupleTabName', 'translationTupleTabName'), ('uid', 'uid'), ('uid_umlauts', 'uid_umlauts'), ('uid_umlauts_lower_except_first_letter', 'uid_umlauts_lower_except_first_letter'), ('univentionAdminModules', 'univentionAdminModules'), ('unixTime', 'unixTime'), ('userAttributeList', 'userAttributeList'), ('userPasswd', 'userPasswd'), ('v4netmask', 'v4netmask'), ('windowsHostName', 'windowsHostName')]#
empty_value = True#

Allow the empty value.

classmethod update_choices()[source]#
class univention.admin.syntax.VFSObjects[source]#

Bases: combobox

Syntax class to select a incomplete list of Samba VBF objects

choices: Sequence[Any] = [('aio_fork', 'aio_fork'), ('aio_pthread', 'aio_pthread'), ('aixacl2', 'aixacl2'), ('audit', 'audit'), ('btrfs', 'btrfs'), ('cacheprime', 'cacheprime'), ('cap', 'cap'), ('catia', 'catia'), ('ceph', 'ceph'), ('ceph_snapshots', 'ceph_snapshots'), ('commit', 'commit'), ('crossrename', 'crossrename'), ('default_quota', 'default_quota'), ('delay_inject', 'delay_inject'), ('dfs_samba4', 'dfs_samba4'), ('dirsort', 'dirsort'), ('error_inject', 'error_inject'), ('expand_msdfs', 'expand_msdfs'), ('extd_audit', 'extd_audit'), ('fake_acls', 'fake_acls'), ('fake_dfq', 'fake_dfq'), ('fake_perms', 'fake_perms'), ('fileid', 'fileid'), ('fruit', 'fruit'), ('full_audit', 'full_audit'), ('glusterfs', 'glusterfs'), ('glusterfs_fuse', 'glusterfs_fuse'), ('gpfs', 'gpfs'), ('io_uring', 'io_uring'), ('linux_xfs_sgid', 'linux_xfs_sgid'), ('media_harmony', 'media_harmony'), ('nfs4acl_xattr', 'nfs4acl_xattr'), ('offline', 'offline'), ('prealloc', 'prealloc'), ('preopen', 'preopen'), ('readahead', 'readahead'), ('readonly', 'readonly'), ('recycle', 'recycle'), ('shadow_copy', 'shadow_copy'), ('shadow_copy2', 'shadow_copy2'), ('shell_snap', 'shell_snap'), ('snapper', 'snapper'), ('streams_depot', 'streams_depot'), ('streams_xattr', 'streams_xattr'), ('syncops', 'syncops'), ('time_audit', 'time_audit'), ('tsmsm', 'tsmsm'), ('unityed_media', 'unityed_media'), ('virusfilter', 'virusfilter'), ('widelinks', 'widelinks'), ('worm', 'worm'), ('xattr_tdb', 'xattr_tdb'), ('zfsacl', 'zfsacl')]#
class univention.admin.syntax.GuardianRole[source]#

Bases: simple

size: str | Sequence[str] = 'Two'#

Widget size. See SIZES.

regex: Pattern | None = re.compile('^([a-z0-9-_]+:[a-z0-9-_]+:[a-z0-9-_]+)(&[a-z0-9-_]+:[a-z0-9-_]+:[a-z0-9-_=,]+)?$')#

Regular expression to validate the value.

error_message = "Guardian role strings must be lowercase ASCII alphanumeric with hyphens and underscores, in the format 'app:namespace:role' or 'app:namespace:role&app:namespace:context'.The final part of context additionally allows equal and comma."#

Error message when an invalid item is selected.

univention.admin.types module#

UDM type definitions.

class univention.admin.types.TypeHint(property, property_name, syntax=None)[source]#

Bases: object

decode(value)[source]#

Decode the given value from an UDM object’s property into a Python type. This must be graceful. Invalid values set at UDM object properties should not cause an exception!

Note

Do not overwrite in subclass!

encode(value)[source]#

Encode a value of Python type into a string / list / None / etc. suitable for setting at the UDM object.

Note

Do not overwrite in subclass!

decode_json(value)[source]#
encode_json(value)[source]#
to_json_type(value)[source]#

Transform the value resulting from self.decode() into something suitable to transmit via JSON.

For example, a Python datetime.date object into the JSON string with a date format “2019-08-30”.

from_json_type(value)[source]#

Transform a value from a JSON object into the internal Python type.

For example, converts a JSON string “2019-08-30” into a Python datetime.date object.

Warning

When overwriting the type must be checked!

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

type_check(value, types=None)[source]#

Checks if the value has the correct Python type.

type_check_json(value)[source]#
type_check_subitems(value)[source]#
tostring(value)[source]#

A printable representation for e.g. the CLI or grid columns in UMC

parse_command_line(value)[source]#

Parse a string from the command line

get_openapi_definition()[source]#
openapi_definition()[source]#
get_choices(lo, options)[source]#
has_choices()[source]#
classmethod detect(property, name)[source]#

Detect the univention.admin.types.TypeHint type of a property automatically.

We need this to be backwards compatible, with handlers, we don’t influence.

First considered is the property.type_class which can be explicit set in the module handler.

Otherwise, it depends on wheather the field is multivalue or not: multivalue: A unordered Set of syntax.type_class items singlevalue: syntax.type_class is used.

class univention.admin.types.NoneType(property, property_name, syntax=None)[source]#

Bases: TypeHint

class univention.admin.types.BooleanType(property, property_name, syntax=None)[source]#

Bases: TypeHint

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

class univention.admin.types.TriBooleanType(property, property_name, syntax=None)[source]#

Bases: BooleanType

class univention.admin.types.IntegerType(property, property_name, syntax=None)[source]#

Bases: TypeHint

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

class univention.admin.types.NumberType(property, property_name, syntax=None)[source]#

Bases: TypeHint

class univention.admin.types.StringType(property, property_name, syntax=None)[source]#

Bases: TypeHint

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

class univention.admin.types.Base64Type(property, property_name, syntax=None)[source]#

Bases: StringType

class univention.admin.types.UUID(property, property_name, syntax=None)[source]#

Bases: StringType

class univention.admin.types.PasswordType(property, property_name, syntax=None)[source]#

Bases: StringType

class univention.admin.types.DistinguishedNameType(property, property_name, syntax=None)[source]#

Bases: StringType

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

class univention.admin.types.LDAPFilterType(property, property_name, syntax=None)[source]#

Bases: StringType

class univention.admin.types.EMailAddressType(property, property_name, syntax=None)[source]#

Bases: StringType

class univention.admin.types.BinaryType(property, property_name, syntax=None)[source]#

Bases: TypeHint

Warning

Using this type bloats up the JSON value with a high factor for non ascii data.

See also

use univention.admin.types.Base64Type instead

class univention.admin.types.DateType(property, property_name, syntax=None)[source]#

Bases: StringType

>>> x = DateType(univention.admin.property(syntax=univention.admin.syntax.string), 'a_date_time')
>>> import datetime
>>> now = datetime.date(2020, 1, 1)
>>> x.to_json_type(now)
'2020-01-01'
decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

class univention.admin.types.TimeType(property, property_name, syntax=None)[source]#

Bases: StringType

>>> x = TimeType(univention.admin.property(syntax=univention.admin.syntax.string), 'a_date_time')
>>> import datetime
>>> now = datetime.time(10, 30, 0, 500)
>>> x.to_json_type(now)
'10:30:00'
decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

class univention.admin.types.DateTimeType(property, property_name, syntax=None)[source]#

Bases: StringType

A DateTime

syntax classes using this type must support the method from_datetime(), which returns something valid for syntax.parse()

>>> x = DateTimeType(univention.admin.property(syntax=univention.admin.syntax.string), 'a_date_time')
>>> import datetime
>>> now = datetime.datetime(2020, 1, 1)
>>> x.to_json_type(now)
'2020-01-01T00:00:00'
decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

class univention.admin.types.ArrayType(property, property_name, syntax=None)[source]#

Bases: TypeHint

class univention.admin.types.ListType(property, property_name, syntax=None)[source]#

Bases: ArrayType

item_type: type[TypeHint] | None = None#
type_check_subitems(value)[source]#
openapi_definition()[source]#
encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

class univention.admin.types.SetType(property, property_name, syntax=None)[source]#

Bases: ListType

class univention.admin.types.ListOfItems(property, property_name, syntax=None)[source]#

Bases: ArrayType

Array

item_types = None#
property minimum#
property maximum#
type_check_subitems(value)[source]#
encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

openapi_definition()[source]#
class univention.admin.types.DictionaryType(property, property_name, syntax=None)[source]#

Bases: TypeHint

properties = None#
decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

openapi_definition()[source]#
class univention.admin.types.KeyValueDictionaryType(property, property_name, syntax=None)[source]#

Bases: DictionaryType

key_type: type[Any] | Sequence[type[Any]] | None = None#
value_type: type[Any] | Sequence[type[Any]] | None = None#
openapi_definition()[source]#
class univention.admin.types.SambaLogonHours(property, property_name, syntax=None)[source]#

Bases: ListType

Samba Logon Hours

item_type#

alias of StringType

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

class univention.admin.types.AppcenterTranslation(property, property_name, syntax=None)[source]#

Bases: KeyValueDictionaryType

Appcenter Translation

key_type#

alias of StringType

value_type#

alias of StringType

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

class univention.admin.types.UnixTimeinterval(property, property_name, syntax=None)[source]#

Bases: IntegerType

UNIX Time inerval

decode_value(value)[source]#

Decode the value into a Python object.

Note

suitable for subclassing.

encode_value(value)[source]#

Encode the value into a UDM property value.

Note

suitable for subclassing.

univention.admin.uexceptions module#

UDM exceptions.

exception univention.admin.uexceptions.base[source]#

Bases: Exception

message = ''#
exception univention.admin.uexceptions.objectExists(*args, **kwargs)[source]#

Bases: base

message = 'Object exists.'#
exception univention.admin.uexceptions.noObject(*args, **kwargs)[source]#

Bases: base

message = 'No such object.'#
exception univention.admin.uexceptions.permissionDenied[source]#

Bases: base

message = 'Permission denied.'#
exception univention.admin.uexceptions.ldapError(*args, **kwargs)[source]#

Bases: base

message = 'LDAP Error'#
exception univention.admin.uexceptions.ldapTimeout[source]#

Bases: base

message = 'The specified timeout for the LDAP search has been exceeded.'#
exception univention.admin.uexceptions.ldapSizelimitExceeded[source]#

Bases: base

message = 'The specified size limit for the LDAP search has been exceeded.'#
exception univention.admin.uexceptions.insufficientInformation(*args, **kwargs)[source]#

Bases: base

message = 'Information provided is not sufficient.'#
exception univention.admin.uexceptions.noSuperordinate(*args, **kwargs)[source]#

Bases: insufficientInformation

exception univention.admin.uexceptions.noProperty[source]#

Bases: base

message = 'No such property.'#
exception univention.admin.uexceptions.valueError(*args, **kwargs)[source]#

Bases: base

Value error base class

exception univention.admin.uexceptions.valueMayNotChange(*args, **kwargs)[source]#

Bases: valueError

message = 'Value may not change.'#
exception univention.admin.uexceptions.valueInvalidSyntax(*args, **kwargs)[source]#

Bases: valueError

message = 'Invalid syntax.'#
exception univention.admin.uexceptions.valueRequired(*args, **kwargs)[source]#

Bases: valueError

message = 'Value is required.'#
exception univention.admin.uexceptions.valueMismatch(*args, **kwargs)[source]#

Bases: valueError

message = 'Values do not match.'#
exception univention.admin.uexceptions.noLock[source]#

Bases: base

message = 'Could not acquire lock.'#
exception univention.admin.uexceptions.authFail[source]#

Bases: base

message = 'Authentication Failed.'#
exception univention.admin.uexceptions.uidAlreadyUsed[source]#

Bases: base

message = 'The username is already in use as username or as groupname'#
exception univention.admin.uexceptions.sidAlreadyUsed[source]#

Bases: base

message = 'The relative ID (SAMBA) is already in use.'#
exception univention.admin.uexceptions.groupNameAlreadyUsed[source]#

Bases: base

message = 'The groupname is already in use as groupname or as username'#
exception univention.admin.uexceptions.uidNumberAlreadyUsedAsGidNumber[source]#

Bases: base

message = 'The uidNumber is already in use as a gidNumber'#
exception univention.admin.uexceptions.gidNumberAlreadyUsedAsUidNumber[source]#

Bases: base

message = 'The gidNumber is already in use as a uidNumber'#
exception univention.admin.uexceptions.adGroupTypeChangeLocalToAny[source]#

Bases: base

message = 'The AD group type can not be changed from type local to any other type.'#
exception univention.admin.uexceptions.adGroupTypeChangeToLocal[source]#

Bases: base

message = 'The AD group type can not be changed to type local.'#
exception univention.admin.uexceptions.adGroupTypeChangeGlobalToUniversal[source]#

Bases: base

message = 'The AD group type can not be changed from global to universal, because the group is member of another global group.'#
exception univention.admin.uexceptions.adGroupTypeChangeDomainLocalToUniversal[source]#

Bases: base

message = 'The AD group type can not be changed from domain local to universal, because the group has another domain local group as member.'#
exception univention.admin.uexceptions.adGroupTypeChangeUniversalToGlobal[source]#

Bases: base

message = 'The AD group type can not be changed from universal to global, because the group has another universal group as member.'#
exception univention.admin.uexceptions.adGroupTypeChangeGlobalToDomainLocal[source]#

Bases: base

message = 'The AD group type can not be changed from global to domain local.'#
exception univention.admin.uexceptions.adGroupTypeChangeDomainLocalToGlobal[source]#

Bases: base

message = 'The AD group type can not be changed from domain local to global.'#
exception univention.admin.uexceptions.prohibitedUsername[source]#

Bases: base

message = 'Prohibited username.'#
exception univention.admin.uexceptions.ipAlreadyUsed[source]#

Bases: base

message = 'IP address is already in use.'#
exception univention.admin.uexceptions.dnsAliasAlreadyUsed[source]#

Bases: base

message = 'DNS alias is already in use.'#
exception univention.admin.uexceptions.invalidDhcpEntry[source]#

Bases: base

message = 'The DHCP entry for this host should contain the zone DN, the IP address and the MAC address.'#
exception univention.admin.uexceptions.invalidDNSAliasEntry[source]#

Bases: base

message = 'The DNS alias entry for this host should contain the zone name, the alias zone container DN and the alias.'#
exception univention.admin.uexceptions.InvalidDNS_Information[source]#

Bases: base

message = 'The provided DNS information are invalid.'#
exception univention.admin.uexceptions.nextFreeIp[source]#

Bases: base

message = 'Next IP address not found.'#
exception univention.admin.uexceptions.ipOverridesNetwork[source]#

Bases: base

message = 'The given IP address is not within the range of the selected network'#
exception univention.admin.uexceptions.macAlreadyUsed[source]#

Bases: base

message = 'The MAC address is already in use.'#
exception univention.admin.uexceptions.mailAddressUsed[source]#

Bases: base

message = 'The mail address is already in use.'#
exception univention.admin.uexceptions.dhcpServerAlreadyUsed[source]#

Bases: base

message = 'DHCP server name already used: '#
exception univention.admin.uexceptions.kolabHomeServer[source]#

Bases: base

message = 'Default Kolab home server does not exist'#
exception univention.admin.uexceptions.primaryGroup[source]#

Bases: base

message = 'Default primary group does not exist'#
exception univention.admin.uexceptions.primaryGroupUsed[source]#

Bases: base

message = 'This is a primary group.'#
exception univention.admin.uexceptions.homeShareUsed[source]#

Bases: base

message = ''#
exception univention.admin.uexceptions.groupNotFound[source]#

Bases: base

message = 'The requested group not be found.'#
exception univention.admin.uexceptions.dhcpNotFound[source]#

Bases: base

message = 'The DHCP entry was not found.'#
exception univention.admin.uexceptions.dnsNotFound[source]#

Bases: base

message = 'The DNS entry was not found'#
exception univention.admin.uexceptions.commonNameTooLong[source]#

Bases: base

message = 'The FQDN of this object is too long, it must have less than 64 characters.'#
exception univention.admin.uexceptions.missingInformation[source]#

Bases: base

message = 'Not all needed information was entered.'#
exception univention.admin.uexceptions.policyFixedAttribute[source]#

Bases: base

message = 'Cannot overwrite a fixed attribute.'#
exception univention.admin.uexceptions.bootpXORFailover[source]#

Bases: base

message = 'Dynamic BOOTP leases are not compatible with failover.'#
exception univention.admin.uexceptions.licenseNotFound[source]#

Bases: base

message = 'No license found.'#
exception univention.admin.uexceptions.licenseInvalid[source]#

Bases: base

message = 'The license is invalid.'#
exception univention.admin.uexceptions.licenseExpired[source]#

Bases: base

message = 'The license is expired.'#
exception univention.admin.uexceptions.licenseWrongBaseDn[source]#

Bases: base

message = 'The license is invalid for the current base DN.'#
exception univention.admin.uexceptions.licenseCoreEdition[source]#

Bases: base

message = 'UCS Core Edition.'#
exception univention.admin.uexceptions.freeForPersonalUse[source]#

Bases: base

message = 'Free for personal use edition.'#
exception univention.admin.uexceptions.licenseAccounts[source]#

Bases: base

message = 'Too many user accounts'#
exception univention.admin.uexceptions.licenseClients[source]#

Bases: base

message = 'Too many client accounts'#
exception univention.admin.uexceptions.licenseDesktops[source]#

Bases: base

message = 'Too many desktop accounts'#
exception univention.admin.uexceptions.licenseGroupware[source]#

Bases: base

message = 'Too many groupware accounts'#
exception univention.admin.uexceptions.licenseUsers[source]#

Bases: base

message = 'Too many users'#
exception univention.admin.uexceptions.licenseServers[source]#

Bases: base

message = 'Too many servers'#
exception univention.admin.uexceptions.licenseManagedClients[source]#

Bases: base

message = 'Too many managed clients'#
exception univention.admin.uexceptions.licenseCorporateClients[source]#

Bases: base

message = 'Too many corporate clients'#
exception univention.admin.uexceptions.licenseDVSUsers[source]#

Bases: base

message = 'Too many DVS users'#
exception univention.admin.uexceptions.licenseDVSClients[source]#

Bases: base

message = 'Too many DVS clients'#
exception univention.admin.uexceptions.licenseDisableModify[source]#

Bases: base

message = 'During this session add and modify are disabled'#
exception univention.admin.uexceptions.pwalreadyused[source]#

Bases: base

message = 'Password has been used before. Please choose a different one.'#
exception univention.admin.uexceptions.passwordLength[source]#

Bases: base

message = 'The password is too short, at least 8 character!'#
exception univention.admin.uexceptions.rangeNotInNetwork[source]#

Bases: base

message = 'Network and IP range are incompatible.'#
exception univention.admin.uexceptions.rangeInNetworkAddress[source]#

Bases: base

message = 'The IP range contains its network address. That is not permitted!'#
exception univention.admin.uexceptions.rangeInBroadcastAddress[source]#

Bases: base

message = 'The IP range contains its broadcast address. That is not permitted!'#
exception univention.admin.uexceptions.rangesOverlapping[source]#

Bases: base

message = 'Overlapping IP ranges'#
exception univention.admin.uexceptions.invalidOptions[source]#

Bases: base

message = 'Invalid combination of options.'#
exception univention.admin.uexceptions.pwToShort[source]#

Bases: base

message = 'Password policy error: '#
exception univention.admin.uexceptions.pwQuality[source]#

Bases: base

message = 'Password policy error: '#
exception univention.admin.uexceptions.invalidOperation[source]#

Bases: base

message = 'This operation is not allowed on this object.'#
exception univention.admin.uexceptions.restoreFailed[source]#

Bases: base

message = 'Restore operation failed.'#
exception univention.admin.uexceptions.emptyPrinterGroup[source]#

Bases: base

message = 'Empty printer groups are not possible.'#
exception univention.admin.uexceptions.leavePrinterGroup[source]#

Bases: base

message = 'Printer groups with quota support can only have members with quota support.'#
exception univention.admin.uexceptions.notValidPrinter[source]#

Bases: base

message = 'Only printer objects can be members of a printer group.'#
exception univention.admin.uexceptions.notValidGroup[source]#

Bases: base

message = 'Only existing groups are allowed.'#
exception univention.admin.uexceptions.notValidUser[source]#

Bases: base

message = 'Only existing users are allowed.'#
exception univention.admin.uexceptions.templateSyntaxError(templates)[source]#

Bases: base

message = 'Invalid syntax in default value. Check these templates: %s.'#
exception univention.admin.uexceptions.nagiosARecordRequired[source]#

Bases: base

message = 'IP address entry required to assign Nagios services!'#
exception univention.admin.uexceptions.nagiosDNSForwardZoneEntryRequired[source]#

Bases: base

message = 'DNS Forward Zone entry required to assign Nagios services!'#
exception univention.admin.uexceptions.dnsAliasRecordExists[source]#

Bases: base

message = 'The DNS forward entry could not be created. Please remove existing alias records or comparable DNS objects with the same name as this host from the forward zone.'#
exception univention.admin.uexceptions.circularGroupDependency[source]#

Bases: base

message = 'Circular group dependency detected: '#
exception univention.admin.uexceptions.invalidChild[source]#

Bases: base

exception univention.admin.uexceptions.primaryGroupWithoutSamba[source]#

Bases: base

message = 'Need a primary group with samba option to create a user with samba option'#
exception univention.admin.uexceptions.wrongObjectType[source]#

Bases: base

message = 'The object type of this object differs from the specified object type.'#
exception univention.admin.uexceptions.noKerberosRealm[source]#

Bases: base

message = 'There was no valid kerberos realm found.'#
exception univention.admin.uexceptions.alreadyUsedInSubtree[source]#

Bases: base

message = 'An object with the name already exists in the subtree position'#

univention.admin.uldap module#

UDM wrapper around univention.uldap that replaces exceptions.

class univention.admin.uldap.DN(dn: str)[source]#

Bases: object

A LDAP Distinguished Name.

dn#
endswith(other: str | Self)[source]#
>>> DN('foo=1,bar=2').endswith('bar=2')
True
>>> DN('foo=1,bar=2').endswith('foo=1')
False
property parent: Self | None#
>>> DN('foo=1,bar=2').parent == DN('bar=2')
True
property rdn: Self#
>>> DN('foo=1,bar=2').rdn
('foo', '1')
classmethod set(values: list[str]) set[Self][source]#

Returns a unique set of DNs.

>>> len(DN.set(['CN=computers,dc=foo', 'cn=computers,dc=foo', 'cn = computers,dc=foo', 'CN=Computers,dc=foo']))
1
startswith(other: str | Self)[source]#
>>> DN('foo=1,bar=2').startswith('foo=1')
True
>>> DN('foo=1,bar=2').startswith('bar=2')
False
classmethod values(dns: list[Self]) set[str][source]#

Return a unique set of DN strings from DNs.

>>> DN.values(DN.set(['cn=foo', 'cn=bar']) - DN.set(['cn = foo'])) == {'cn=bar'}
True
walk(base)[source]#
>>> [str(x) for x in DN('foo=1,bar=2,baz=3,blub=4').walk('baz=3,blub=4')]
['baz=3,blub=4', 'bar=2,baz=3,blub=4', 'foo=1,bar=2,baz=3,blub=4']
class univention.admin.uldap.access(host: str = 'localhost', port: int | None = None, base: str = '', binddn: str = '', bindpw: str = '', start_tls: int | None = None, lo: access | None = None, follow_referral: bool = False, uri: str | None = None)[source]#

Bases: object

A UDM class to access a LDAP server.

Parameters:
  • host – The hostname of the LDAP server.

  • port – The TCP port number of the LDAP server.

  • base – The base distinguished name.

  • binddn – The distinguished name of the account.

  • bindpw – The user password for simple authentication.

  • start_tls – Negotiate TLS with server. If 2 is given, the command will require the operation to be successful.

  • loLDAP connection.

  • follow_referral – Follow LDAP referrals.

  • uri – LDAP connection string.

property binddn: str | None#

Return the distinguished name of the account.

Returns:

The distinguished name of the account (or None with SAML).

property bindpw: str#

Return the user password or credentials.

Returns:

The user password or credentials.

property host: str#

Return the host name of the LDAP server.

Returns:

the host name of the LDAP server.

property port: int#

Return the TCP port number of the LDAP server.

Returns:

the TCP port number of the LDAP server.

property base: str#

Return the LDAP base of the LDAP server.

Returns:

the LDAP base of the LDAP server.

property start_tls: int#
property authz_connection#

A LDAP connection running with cn=admin priviledges (in case authorization engine is enabled, otherwise just self)

Warning

use carefully: only in combination with manual access control checks to prevent information leak or priviledge escalation

bind(binddn: str, bindpw: str) None[source]#

Do simple LDAP bind using DN and password.

Parameters:
  • binddn (str) – The distinguished name of the account.

  • bindpw (str) – The user password for simple authentication.

bind_saml(bindpw: str) None[source]#

Do LDAP bind using SAML message.

Parameters:

bindpw (str) – The SAML authentication cookie.

bind_oauthbearer(authzid: str | None, bindpw: str) None[source]#

Do LDAP bind using OAuth 2.0 Access Token.

Parameters:
  • authzid (str) – Authorization Identifier

  • bindpw (str) – The Access Token (as JWT)

unbind() None[source]#

Unauthenticate.

whoami() str[source]#

Return the distinguished name of the authenticated user.

Returns:

The distinguished name.

requireLicense(require: bool = True) None[source]#

Enable or disable the UCS licence check.

Parameters:

require (bool) – True to require a valid licence.

get_schema() SubSchema[source]#

Retrieve LDAP schema information from LDAP server.

Returns:

The LDAP schema.

classmethod compare_dn(a: str, b: str) bool[source]#

Compare two distinguished names for equality.

Parameters:
  • a (str) – The first distinguished name.

  • b (str) – A second distinguished name.

Returns:

True if the DNs are the same, False otherwise.

get(dn: str, attr: list[str] = [], required: bool = False, exceptions: bool = False) dict[str, list[bytes]][source]#

Return multiple attributes of a single LDAP object.

Parameters:
  • dn (str) – The distinguished name of the object to lookup.

  • attr – The list of attributes to fetch.

  • required (bool) – Raise an exception instead of returning an empty dictionary.

  • exceptions (bool) – Ignore.

Returns:

A dictionary mapping the requested attributes to a list of their values.

Raises:

ldap.NO_SUCH_OBJECT – If the LDAP object is not accessible.

getAttr(dn: str, attr: str, required: bool = False, exceptions: bool = False) list[bytes][source]#

Return a single attribute of a single LDAP object.

Parameters:
  • dn (str) – The distinguished name of the object to lookup.

  • attr (str) – The attribute to fetch.

  • required (bool) – Raise an exception instead of returning an empty dictionary.

  • exceptions (bool) – Ignore.

Returns:

A list of values.

Raises:

ldap.NO_SUCH_OBJECT – If the LDAP object is not accessible.

search(filter: str = '(objectClass=*)', base: str = '', scope: str = 'sub', attr: list[str] = [], unique: bool = False, required: bool = False, timeout: int = -1, sizelimit: int = 0, serverctrls: list[LDAPControl] | None = None, response: dict[str, LDAPControl] | None = None) list[tuple[str, dict[str, list[bytes]]]][source]#

Perform LDAP search and return values.

Parameters:
  • filter (str) – LDAP search filter.

  • base (str) – the starting point for the search.

  • scope (str) – Specify the scope of the search to be one of base, base+one, one, sub, or domain to specify a base object, base plus one-level, one-level, subtree, or children search.

  • attr – The list of attributes to fetch.

  • unique (bool) – Raise an exception if more than one object matches.

  • required (bool) – Raise an exception instead of returning an empty dictionary.

  • timeout (int) – wait at most timeout seconds for a search to complete. -1 for no limit.

  • sizelimit (int) – retrieve at most sizelimit entries for a search. 0 for no limit.

  • serverctrls – a list of ldap.controls.LDAPControl instances sent to the server along with the LDAP request

  • response (dict) – An optional dictionary to receive the server controls of the result.

Returns:

A list of 2-tuples (dn, values) for each LDAP object, where values is a dictionary mapping attribute names to a list of values.

Raises:
searchDn(filter: str = '(objectClass=*)', base: str = '', scope: str = 'sub', unique: bool = False, required: bool = False, timeout: int = -1, sizelimit: int = 0, serverctrls: list[LDAPControl] | None = None, response: dict[str, LDAPControl] | None = None) list[str][source]#

Perform LDAP search and return distinguished names only.

Parameters:
  • filter (str) – LDAP search filter.

  • base (str) – the starting point for the search.

  • scope (str) – Specify the scope of the search to be one of base, base+one, one, sub, or domain to specify a base object, base plus one-level, one-level, subtree, or children search.

  • unique (bool) – Raise an exception if more than one object matches.

  • required (bool) – Raise an exception instead of returning an empty dictionary.

  • timeout (int) – wait at most timeout seconds for a search to complete. -1 for no limit.

  • sizelimit (int) – retrieve at most sizelimit entries for a search. 0 for no limit.

  • serverctrls – a list of ldap.controls.LDAPControl instances sent to the server along with the LDAP request.

  • response (dict) – An optional dictionary to receive the server controls of the result.

Returns:

A list of distinguished names.

Raises:
getPolicies(dn: str, policies: list[str] | None = None, attrs: dict[str, list[Any]] | None = None, result: Any = None, fixedattrs: Any = None) dict[str, dict[str, Any]][source]#

Return UCS policies for LDAP entry.

Parameters:
  • dn (str) – The distinguished name of the LDAP entry.

  • policies (list) – List of policy object classes…

  • attrs (dict) – LDAP attributes. If not given, the data is fetched from LDAP.

  • result – UNUSED!

  • fixedattrs – UNUSED!

Returns:

A mapping of policy names to

add(dn: str, al: list[tuple[str, Any]], exceptions: bool = False, serverctrls: list[ldap.controls.LDAPControl] | None = None, response: dict | None = None, ignore_license: bool = False) None[source]#

Add LDAP entry at distinguished name and attributes in add_list=(attribute-name, old-values. new-values) or (attribute-name, new-values).

Parameters:
  • dn (str) – The distinguished name of the object to add.

  • al – The add-list of 2-tuples (attribute-name, new-values).

  • exceptions (bool) – Raise the low level exception instead of the wrapping UDM exceptions.

  • serverctrls – a list of ldap.controls.LDAPControl instances sent to the server along with the LDAP request

  • ignore_license (bool) – Ignore license check if True.

  • response (dict) – An optional dictionary to receive the server controls of the result.

Raises:
modify(dn: str, changes: list[tuple[str, Any, Any]], exceptions: bool = False, ignore_license: int = False, serverctrls: list[ldap.controls.LDAPControl] | None = None, response: dict | None = None, rename_callback: Callable | None = None) str[source]#

Modify LDAP entry DN with attributes in changes=(attribute-name, old-values, new-values).

Parameters:
  • dn (str) – The distinguished name of the object to modify.

  • changes – The modify-list of 3-tuples (attribute-name, old-values, new-values).

  • exceptions (bool) – Raise the low level exception instead of the wrapping UDM exceptions.

  • ignore_license (bool) – Ignore license check if True.

  • serverctrls – a list of ldap.controls.LDAPControl instances sent to the server along with the LDAP request

  • response (dict) – An optional dictionary to receive the server controls of the result.

Returns:

The distinguished name.

rename(dn: str, newdn: str, move_childs: int = 0, ignore_license: bool = False, serverctrls: list[LDAPControl] | None = None, response: dict | None = None) None[source]#

Rename a LDAP object.

Parameters:
  • dn – The old distinguished name of the object to rename.

  • newdn – The new distinguished name of the object to rename.

  • move_childs – Also rename the sub children. Must be 0 always as 1 is not implemented.

  • ignore_license – Ignore license check if True.

  • serverctrls – a list of ldap.controls.LDAPControl instances sent to the server along with the LDAP request

  • response – An optional dictionary to receive the server controls of the result.

delete(dn: str, exceptions: bool = False) None[source]#

Delete a LDAP object.

Parameters:
  • dn (str) – The distinguished name of the object to remove.

  • exceptions (bool) – Raise the low level exception instead of the wrapping UDM exceptions.

Raises:
parentDn(dn: str) str | None[source]#

Return the parent container of a distinguished name.

Parameters:

dn (str) – The distinguished name.

Returns:

The parent distinguished name or None if the LDAP base is reached.

explodeDn(dn: str, notypes: bool = False) list[str][source]#

Break up a DN into its component parts.

Parameters:
  • dn (str) – The distinguished name.

  • notypes (bool) – Return only the component’s attribute values if True. Also the attribute types if False.

Returns:

A list of relative distinguished names.

filter_lookup_results(results, context=None)[source]#

Evaluate access control rules for filtering of results

search_filtered(context, filter='(objectClass=*)', base='', *args, **kwargs)[source]#
search_dn_filtered(context, filter='(objectClass=*)', base='', *args, **kwargs)[source]#
class univention.admin.uldap.domain(lo: access, position: position)[source]#

Bases: object

A UDM domain name.

Parameters:
getKerberosRealm() str | None[source]#

Return the name of the Kerberos realms.

Returns:

The name of the Kerberos realm.

univention.admin.uldap.explodeDn(dn: str, notypes: int = 0) list[str][source]#

Break up a DN into its component parts.

Parameters:
  • dn (str) – The distinguished name.

  • notypes (int) – Return only the component’s attribute values if True. Also the attribute types if False.

Returns:

A list of relative distinguished names.

Return type:

list[str]

univention.admin.uldap.getAdminConnection(start_tls: int | None = None, decode_ignorelist: None = None) tuple[access, position][source]#

Open a LDAP connection using the admin credentials.

Parameters:

start_tls (int) – Negotiate TLS with server. If 2 is given, the command will require the operation to be successful.

Returns:

A 2-tuple (LDAP-access, LDAP-position)

univention.admin.uldap.getBaseDN(host: str = 'localhost', port: int | None = None, uri: str | None = None) str[source]#

Return the naming context of the LDAP server.

Parameters:
  • host (str) – The hostname of the LDAP server.

  • port (int) – The TCP port number of the LDAP server.

  • uri (str) – A complete LDAP URI.

Returns:

The distinguished name of the LDAP root.

univention.admin.uldap.getMachineConnection(start_tls: int | None = None, decode_ignorelist: None = None, ldap_master: bool = True) tuple[access, position][source]#

Open a LDAP connection using the machine credentials.

Parameters:
  • start_tls (int) – Negotiate TLS with server. If 2 is given, the command will require the operation to be successful.

  • ldap_master (bool) – Open a connection to the Primary if True, to the preferred LDAP server otherwise.

Returns:

A 2-tuple (LDAP-access, LDAP-position)

class univention.admin.uldap.position(base: str, loginDomain: str = '')[source]#

Bases: object

The position of a LDAP container. Supports relative distinguished names.

Parameters:
  • base (str) – The base distinguished name.

  • loginDomain (str) – The login domain name.

setBase(base: str) None[source]#

Set a new base distinguished name.

Parameters:

base (str) – The new base distinguished name.

setLoginDomain(loginDomain: str) None[source]#

Set a new login domain name.

Parameters:

loginDomain (str) – The new login domain name.

getDn() str[source]#

Return the distinguished name.

Returns:

The absolute DN.

setDn(dn: str) None[source]#

Set a new distinguished name.

Parameters:

dn (str) – The new distinguished name.

getRdn() str[source]#

Return the distinguished name relative to the LDAP base.

Returns:

The relative DN.

getBase() str[source]#

Return the LDAP base DN.

Returns:

The distinguished name of the LDAP base.

isBase() bool[source]#

Check if the position equals the LDAP base DN.

Returns:

True if the position equals the base DN, False otherwise.

getDomain() str[source]#

Return the distinguished name of the domain part of the position.

Returns:

The distinguished name.

getDomainConfigBase() str[source]#

Return the distinguished name of the configuration container.

Returns:

The distinguished name.

isDomain() bool[source]#

Check if the position equals the domain DN.

Returns:

True if the position equals the domain DN, False otherwise.

getLoginDomain() str[source]#

Return the login domain name.

Returns:

The login domain name.

switchToParent() bool[source]#

Switch position to parent container.

Returns:

False if already at the Base, True otherwise.