univention.admin package

UDM basic functionality

univention.admin.ucr_overwrite_properties(module, lo)[source]

Overwrite properties in property_descriptions by UCR variables

univention.admin.pattern_replace(pattern, object)[source]

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

class univention.admin.property(short_description='', long_description='', syntax=None, module_search=None, multivalue=False, one_only=False, parent=None, options=[], license=[], required=False, may_change=True, identifies=False, unique=False, default=None, prevent_umc_default_popup=False, dontsearch=False, show_in_lists=True, cli_enabled=True, editable=True, configObjectPosition=None, configAttributeName=None, include_in_default_search=False, nonempty_is_default=False, readonly_when_synced=False, size=None, copyable=False, type_class=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.

UMLAUTS = {'Ä': 'Ae', 'Ö': 'Oe', 'Ü': 'Ue', 'Þ': 'P', 'ä': 'ae', 'ð': 'o', 'ö': 'oe', 'ü': 'ue', 'þ': 'p'}
new()[source]
default(object)[source]
safe_default(object)[source]
check_default(object)[source]
matches(options)[source]
class univention.admin.option(short_description='', long_description='', default=0, editable=False, disabled=False, objectClasses=None, is_app_option=False)[source]

Bases: object

UDM option to make properties conditional.

matches(objectClasses)[source]
univention.admin.ucr_overwrite_module_layout(module)[source]

Overwrite the tab layout through UCR variables.

univention.admin.ucr_overwrite_layout(module, ucr_property, tab)[source]

Overwrite the advanced setting in the layout

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

Bases: object

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

class univention.admin.policiesGroup(id, short_description=None, long_description='', members=[])[source]

Bases: object

Subpackages

Submodules

univention.admin.allocators module

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

univention.admin.allocators.requestUserSid(lo, position, uid_s)[source]
univention.admin.allocators.requestGroupSid(lo, position, gid_s, generateDomainLocalSid=False)[source]
univention.admin.allocators.acquireRange(lo, position, atype, attr, ranges, scope='base')[source]
univention.admin.allocators.acquireUnique(lo, position, type, value, attr, scope='base')[source]
univention.admin.allocators.request(lo, position, type, value=None)[source]
univention.admin.allocators.confirm(lo, position, type, value, updateLastUsedValue=True)[source]
univention.admin.allocators.release(lo, position, type, value)[source]

univention.admin.config module

UDM configuration basics

Deprecated since version UCS: 4.4

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

Bases: object

UDM configuration object.

Deprecated since version UCS: 4.4 use None instead

items()[source]
univention.admin.config.getDefaultContainer(lo, module)[source]

Return any random default container for a UDM module.

Deprecated since version UCS: 4.4

Parameters
Returns

A distinguished name.

Return type

str

univention.admin.config.getDefaultValue(lo, name, position=None)[source]

Return the default value for a UDM module.

Parameters
Returns

The default value.

Return type

str

univention.admin.cron module

UDM functions for creating crontab entries.

univention.admin.cron.month_map(month)[source]

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

>>> month_map('*')
'*'
>>> month_map('January')
1
univention.admin.cron.weekday_map(weekday)[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)[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)[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)[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, expressions)[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, rewrite_function, mapping)[source]
class univention.admin.filter.expression(variable='', value='', operator='=', escape=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, args)[source]
transform_to_conjunction(con)[source]
univention.admin.filter.parse(filter_s, begin=0, end=- 1)[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, expression_walk_function=None, conjunction_walk_function=None, arg=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)[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.hook module

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

univention.admin.hook.import_hook_files()[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)[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)[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, al=[])[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)[source]

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

Parameters

obj – The UDM object instance.

hook_ldap_pre_modify(obj)[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, ml=[])[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)[source]

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

Parameters

obj – The UDM object instance.

hook_ldap_pre_remove(obj)[source]

This method is called before an UDM object is removed.

Parameters

obj – The UDM object instance.

hook_ldap_post_remove(obj)[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: univention.admin.hook.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
hook_open(obj)[source]

Open UDM object by loading value from LDAP.

Parameters

obj – The UDM object instance.

hook_ldap_addlist(obj, al)[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, ml)[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)[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)[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: univention.admin.layout.ILayoutElement

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

Bases: univention.admin.layout.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 univention.lib.i18n.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.mapping module

Functions to map between UDM properties and LDAP attributes.

univention.admin.mapping.MapToBytes(udm_value, encoding=())[source]
univention.admin.mapping.UnmapToUnicode(ldap_value, encoding=())[source]
univention.admin.mapping.DaysToSeconds(days)[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)[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)[source]

Convert string to lower-case.

Parameters

string – a string.

Returns

the lower-cased string.

>>> StringToLower("Aa")
'aa'
univention.admin.mapping.ListUniq(list)[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, encoding=())[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_)[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)[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)[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)[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)[source]

‘Do nothing’ mapping returning None.

univention.admin.mapping.IgnoreNone(value, encoding=())[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(value)[source]

Map number of seconds to a human understandable time interval.

Parameters

value – 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)[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)[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)[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, encoding=())[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, encoding=())[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, unmap_name, map_value=None, unmap_value=None, encoding='UTF-8', encoding_errors='strict')[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, pop_unmap=True)[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, unmap_value, encoding='UTF-8', encoding_errors='strict')[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)[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)[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, value, encoding_errors=None)[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, value, encoding_errors=None)[source]
unmapValue(unmap_name, value)[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)[source]

Unmaps LDAP attribute values to UDM property values.

shouldMap(map_name)[source]
shouldUnmap(unmap_name)[source]
getEncoding(map_name)[source]
univention.admin.mapping.mapCmp(mapping, key, old, new)[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, old)[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, old)[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, diff)[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, diff)[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, mapping)[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, **kwds)[source]

Bases: typing_extensions.Protocol

module = ''
childs = False
operations = []
short_description = ''
object_name = ''
object_name_plural = ''
long_description = ''
options = {}
property_descriptions = {}
default_property_descriptions = {}
policy_apply_to = []
policy_position_dn_prefix = ''
policy_oc = ''
docleanup = False
layout = []
mapping = None
initialized = False
extended_attribute_tabnames = []
extended_udm_attributes = []
class object(co, lo, position, dn='', superordinate=None, attributes=None)[source]

Bases: object

static identify(dn, attr)[source]
static lookup(co, lo, filter='', base='', superordinate=None, scope='base+one', unique=False, required=False, timeout=- 1, sizelimit=0)[source]
univention.admin.modules.modules = {'appcenter/app': <module 'univention.admin.handlers.appcenter.app' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/appcenter/app.py'>, 'computers/computer': <module 'univention.admin.handlers.computers.computer' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/computer.py'>, 'computers/domaincontroller_backup': <module 'univention.admin.handlers.computers.domaincontroller_backup' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/domaincontroller_backup.py'>, 'computers/domaincontroller_master': <module 'univention.admin.handlers.computers.domaincontroller_master' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/domaincontroller_master.py'>, 'computers/domaincontroller_slave': <module 'univention.admin.handlers.computers.domaincontroller_slave' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/domaincontroller_slave.py'>, 'computers/ipmanagedclient': <module 'univention.admin.handlers.computers.ipmanagedclient' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/ipmanagedclient.py'>, 'computers/linux': <module 'univention.admin.handlers.computers.linux' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/linux.py'>, 'computers/macos': <module 'univention.admin.handlers.computers.macos' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/macos.py'>, 'computers/memberserver': <module 'univention.admin.handlers.computers.memberserver' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/memberserver.py'>, 'computers/trustaccount': <module 'univention.admin.handlers.computers.trustaccount' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/trustaccount.py'>, 'computers/ubuntu': <module 'univention.admin.handlers.computers.ubuntu' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/ubuntu.py'>, 'computers/windows': <module 'univention.admin.handlers.computers.windows' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/windows.py'>, 'computers/windows_domaincontroller': <module 'univention.admin.handlers.computers.windows_domaincontroller' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/computers/windows_domaincontroller.py'>, 'container/cn': <module 'univention.admin.handlers.container.cn' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/container/cn.py'>, 'container/dc': <module 'univention.admin.handlers.container.dc' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/container/dc.py'>, 'container/msgpo': <module 'univention.admin.handlers.container.msgpo' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/container/msgpo.py'>, 'container/ou': <module 'univention.admin.handlers.container.ou' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/container/ou.py'>, 'dhcp/dhcp': <module 'univention.admin.handlers.dhcp.dhcp' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/dhcp.py'>, 'dhcp/host': <module 'univention.admin.handlers.dhcp.host' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/host.py'>, 'dhcp/pool': <module 'univention.admin.handlers.dhcp.pool' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/pool.py'>, 'dhcp/server': <module 'univention.admin.handlers.dhcp.server' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/server.py'>, 'dhcp/service': <module 'univention.admin.handlers.dhcp.service' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/service.py'>, 'dhcp/shared': <module 'univention.admin.handlers.dhcp.shared' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/shared.py'>, 'dhcp/sharedsubnet': <module 'univention.admin.handlers.dhcp.sharedsubnet' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/sharedsubnet.py'>, 'dhcp/subnet': <module 'univention.admin.handlers.dhcp.subnet' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dhcp/subnet.py'>, 'dns/alias': <module 'univention.admin.handlers.dns.alias' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/alias.py'>, 'dns/dns': <module 'univention.admin.handlers.dns.dns' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/dns.py'>, 'dns/forward_zone': <module 'univention.admin.handlers.dns.forward_zone' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/forward_zone.py'>, 'dns/host_record': <module 'univention.admin.handlers.dns.host_record' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/host_record.py'>, 'dns/ns_record': <module 'univention.admin.handlers.dns.ns_record' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/ns_record.py'>, 'dns/ptr_record': <module 'univention.admin.handlers.dns.ptr_record' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/ptr_record.py'>, 'dns/reverse_zone': <module 'univention.admin.handlers.dns.reverse_zone' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/reverse_zone.py'>, 'dns/srv_record': <module 'univention.admin.handlers.dns.srv_record' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/srv_record.py'>, 'dns/txt_record': <module 'univention.admin.handlers.dns.txt_record' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/dns/txt_record.py'>, 'groups/group': <module 'univention.admin.handlers.groups.group' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/groups/group.py'>, 'kerberos/kdcentry': <module 'univention.admin.handlers.kerberos.kdcentry' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/kerberos/kdcentry.py'>, 'mail/domain': <module 'univention.admin.handlers.mail.domain' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/mail/domain.py'>, 'mail/folder': <module 'univention.admin.handlers.mail.folder' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/mail/folder.py'>, 'mail/lists': <module 'univention.admin.handlers.mail.lists' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/mail/lists.py'>, 'mail/mail': <module 'univention.admin.handlers.mail.mail' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/mail/mail.py'>, 'ms/domainpolicy': <module 'univention.admin.handlers.ms.domainpolicy' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/domainpolicy.py'>, 'ms/gpipsec-filter': <module 'univention.admin.handlers.ms.gpipsec-filter' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpipsec-filter.py'>, 'ms/gpipsec-isakmp-policy': <module 'univention.admin.handlers.ms.gpipsec-isakmp-policy' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpipsec-isakmp-policy.py'>, 'ms/gpipsec-negotiation-policy': <module 'univention.admin.handlers.ms.gpipsec-negotiation-policy' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpipsec-negotiation-policy.py'>, 'ms/gpipsec-nfa': <module 'univention.admin.handlers.ms.gpipsec-nfa' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpipsec-nfa.py'>, 'ms/gpipsec-policy': <module 'univention.admin.handlers.ms.gpipsec-policy' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpipsec-policy.py'>, 'ms/gpsi-category-registration': <module 'univention.admin.handlers.ms.gpsi-category-registration' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpsi-category-registration.py'>, 'ms/gpsi-class-store': <module 'univention.admin.handlers.ms.gpsi-class-store' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpsi-class-store.py'>, 'ms/gpsi-package-registration': <module 'univention.admin.handlers.ms.gpsi-package-registration' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpsi-package-registration.py'>, 'ms/gpwl-wired': <module 'univention.admin.handlers.ms.gpwl-wired' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpwl-wired.py'>, 'ms/gpwl-wireless': <module 'univention.admin.handlers.ms.gpwl-wireless' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpwl-wireless.py'>, 'ms/gpwl-wireless-blob': <module 'univention.admin.handlers.ms.gpwl-wireless-blob' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/ms/gpwl-wireless-blob.py'>, 'nagios/nagios': <module 'univention.admin.handlers.nagios.nagios' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/nagios/nagios.py'>, 'nagios/service': <module 'univention.admin.handlers.nagios.service' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/nagios/service.py'>, 'nagios/timeperiod': <module 'univention.admin.handlers.nagios.timeperiod' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/nagios/timeperiod.py'>, 'networks/network': <module 'univention.admin.handlers.networks.network' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/networks/network.py'>, 'policies/admin_container': <module 'univention.admin.handlers.policies.admin_container' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/admin_container.py'>, 'policies/desktop': <module 'univention.admin.handlers.policies.desktop' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/desktop.py'>, 'policies/dhcp_boot': <module 'univention.admin.handlers.policies.dhcp_boot' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_boot.py'>, 'policies/dhcp_dns': <module 'univention.admin.handlers.policies.dhcp_dns' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_dns.py'>, 'policies/dhcp_dnsupdate': <module 'univention.admin.handlers.policies.dhcp_dnsupdate' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_dnsupdate.py'>, 'policies/dhcp_leasetime': <module 'univention.admin.handlers.policies.dhcp_leasetime' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_leasetime.py'>, 'policies/dhcp_netbios': <module 'univention.admin.handlers.policies.dhcp_netbios' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_netbios.py'>, 'policies/dhcp_routing': <module 'univention.admin.handlers.policies.dhcp_routing' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_routing.py'>, 'policies/dhcp_scope': <module 'univention.admin.handlers.policies.dhcp_scope' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_scope.py'>, 'policies/dhcp_statements': <module 'univention.admin.handlers.policies.dhcp_statements' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/dhcp_statements.py'>, 'policies/ldapserver': <module 'univention.admin.handlers.policies.ldapserver' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/ldapserver.py'>, 'policies/maintenance': <module 'univention.admin.handlers.policies.maintenance' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/maintenance.py'>, 'policies/masterpackages': <module 'univention.admin.handlers.policies.masterpackages' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/masterpackages.py'>, 'policies/memberpackages': <module 'univention.admin.handlers.policies.memberpackages' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/memberpackages.py'>, 'policies/nfsmounts': <module 'univention.admin.handlers.policies.nfsmounts' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/nfsmounts.py'>, 'policies/policy': <module 'univention.admin.handlers.policies.policy' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/policy.py'>, 'policies/printserver': <module 'univention.admin.handlers.policies.printserver' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/printserver.py'>, 'policies/pwhistory': <module 'univention.admin.handlers.policies.pwhistory' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/pwhistory.py'>, 'policies/registry': <module 'univention.admin.handlers.policies.registry' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/registry.py'>, 'policies/release': <module 'univention.admin.handlers.policies.release' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/release.py'>, 'policies/repositoryserver': <module 'univention.admin.handlers.policies.repositoryserver' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/repositoryserver.py'>, 'policies/repositorysync': <module 'univention.admin.handlers.policies.repositorysync' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/repositorysync.py'>, 'policies/share_userquota': <module 'univention.admin.handlers.policies.share_userquota' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/share_userquota.py'>, 'policies/slavepackages': <module 'univention.admin.handlers.policies.slavepackages' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/slavepackages.py'>, 'policies/umc': <module 'univention.admin.handlers.policies.umc' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/policies/umc.py'>, 'saml/idpconfig': <module 'univention.admin.handlers.saml.idpconfig' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/saml/idpconfig.py'>, 'saml/serviceprovider': <module 'univention.admin.handlers.saml.serviceprovider' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/saml/serviceprovider.py'>, 'settings/cn': <module 'univention.admin.handlers.settings.cn' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/cn.py'>, 'settings/console_helpdesk': <module 'univention.admin.handlers.settings.console_helpdesk' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/console_helpdesk.py'>, 'settings/data': <module 'univention.admin.handlers.settings.data' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/data.py'>, 'settings/default': <module 'univention.admin.handlers.settings.default' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/default.py'>, 'settings/directory': <module 'univention.admin.handlers.settings.directory' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/directory.py'>, 'settings/extended_attribute': <module 'univention.admin.handlers.settings.extended_attribute' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/extended_attribute.py'>, 'settings/extended_options': <module 'univention.admin.handlers.settings.extended_options' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/extended_options.py'>, 'settings/ldapacl': <module 'univention.admin.handlers.settings.ldapacl' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/ldapacl.py'>, 'settings/ldapschema': <module 'univention.admin.handlers.settings.ldapschema' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/ldapschema.py'>, 'settings/license': <module 'univention.admin.handlers.settings.license' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/license.py'>, 'settings/lock': <module 'univention.admin.handlers.settings.lock' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/lock.py'>, 'settings/msprintconnectionpolicy': <module 'univention.admin.handlers.settings.msprintconnectionpolicy' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/msprintconnectionpolicy.py'>, 'settings/mswmifilter': <module 'univention.admin.handlers.settings.mswmifilter' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/mswmifilter.py'>, 'settings/packages': <module 'univention.admin.handlers.settings.packages' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/packages.py'>, 'settings/portal': <module 'univention.admin.handlers.settings.portal' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/portal.py'>, 'settings/portal_all': <module 'univention.admin.handlers.settings.portal_all' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/portal_all.py'>, 'settings/portal_category': <module 'univention.admin.handlers.settings.portal_category' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/portal_category.py'>, 'settings/portal_entry': <module 'univention.admin.handlers.settings.portal_entry' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/portal_entry.py'>, 'settings/printermodel': <module 'univention.admin.handlers.settings.printermodel' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/printermodel.py'>, 'settings/printeruri': <module 'univention.admin.handlers.settings.printeruri' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/printeruri.py'>, 'settings/prohibited_username': <module 'univention.admin.handlers.settings.prohibited_username' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/prohibited_username.py'>, 'settings/sambaconfig': <module 'univention.admin.handlers.settings.sambaconfig' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/sambaconfig.py'>, 'settings/sambadomain': <module 'univention.admin.handlers.settings.sambadomain' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/sambadomain.py'>, 'settings/service': <module 'univention.admin.handlers.settings.service' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/service.py'>, 'settings/settings': <module 'univention.admin.handlers.settings.settings' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/settings.py'>, 'settings/syntax': <module 'univention.admin.handlers.settings.syntax' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/syntax.py'>, 'settings/udm_hook': <module 'univention.admin.handlers.settings.udm_hook' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/udm_hook.py'>, 'settings/udm_module': <module 'univention.admin.handlers.settings.udm_module' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/udm_module.py'>, 'settings/udm_syntax': <module 'univention.admin.handlers.settings.udm_syntax' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/udm_syntax.py'>, 'settings/umc_operationset': <module 'univention.admin.handlers.settings.umc_operationset' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/umc_operationset.py'>, 'settings/usertemplate': <module 'univention.admin.handlers.settings.usertemplate' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/settings/usertemplate.py'>, 'shares/print': <module 'univention.admin.handlers.shares.print' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/shares/print.py'>, 'shares/printer': <module 'univention.admin.handlers.shares.printer' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/shares/printer.py'>, 'shares/printergroup': <module 'univention.admin.handlers.shares.printergroup' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/shares/printergroup.py'>, 'shares/share': <module 'univention.admin.handlers.shares.share' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/shares/share.py'>, 'test/ip_phone': <module 'univention.admin.handlers.test.ip_phone' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/test/ip_phone.py'>, 'users/contact': <module 'univention.admin.handlers.users.contact' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/users/contact.py'>, 'users/ldap': <module 'univention.admin.handlers.users.ldap' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/users/ldap.py'>, 'users/passwd': <module 'univention.admin.handlers.users.passwd' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/users/passwd.py'>, 'users/self': <module 'univention.admin.handlers.users.self' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/users/self.py'>, 'users/user': <module 'univention.admin.handlers.users.user' from '/builds/univention/dist/ucsapidoc/py/univention/admin/handlers/users/user.py'>}

Mapping from module name to Python module.

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

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

univention.admin.modules.get(module)[source]

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.get_module(module)[source]

interim function, must only be used by univention-directory-manager-modules!

Deprecated since version UCS: 4.4

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, position, module, template_object=None, force_reload=False)[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, module, position)[source]

Overwrite options defined via LDAP.

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

Bases: dict

Extended attribute layout.

property name
property overwrite
property tabName
property groupName
property position
property groupPosition
property advanced
property is_app_tab
univention.admin.modules.update_extended_attributes(lo, module, position)[source]

Load extended attribute from LDAP and modify UDM handler.

univention.admin.modules.identify(dn, attr, module_name='', canonical=0, module_base=None)[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, attr, type='')[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, dn, attr)[source]
univention.admin.modules.name(module)[source]

Return name of module.

univention.admin.modules.superordinate_names(module_name)[source]

Return name of superordinate module.

univention.admin.modules.superordinate_name(module_name)[source]

Return name of first superordinate module.

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

univention.admin.modules.superordinate(module)[source]

Return instance of superordinate module.

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

univention.admin.modules.superordinates(module)[source]

Return instance of superordinate module.

univention.admin.modules.subordinates(module)[source]

Return list of instances of subordinate modules.

Parameters

module

???

Returns

list of UDM handler modules.

univention.admin.modules.find_superordinate(dn, co, lo)[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, object=None)[source]

return layout of properties

univention.admin.modules.options(module_name)[source]

return options available for module

univention.admin.modules.attributes(module_name)[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)[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)[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)[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)[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)[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, co, lo, filter='', base='', superordinate=None, scope='base+one', unique=False, required=False, timeout=- 1, sizelimit=0)[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)[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)[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)[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, superordinate=None)[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, operation)[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, lo, dn, attr=None, modules=[], module_base=None)[source]
univention.admin.modules.objectShadowType(co, lo, dn, attr=None, modules=[])[source]
univention.admin.modules.findObject(co, lo, dn, type, attr=None, module_base=None)[source]
univention.admin.modules.policyOc(module_name)[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)[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()[source]
univention.admin.modules.policyTypes(module_name)[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)[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)[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)[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

nagiosGetAssignedServices()[source]
nagiosGetParentHosts()[source]
nagios_open()[source]
nagiosSaveParentHostList(ml)[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)[source]

Return handler name for UDM object.

Parameters

objectUDM object instance

Returns

UDM handler name or None.

univention.admin.objects.get_superordinate(module, co, lo, dn)[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, co, lo, position, dn='', attr=None, superordinate=None, attributes=None)[source]

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

Parameters
  • moduleUDM handler.

  • coUDM configuation object.

  • loLDAP connection.

  • positionUDM position instance.

univention.admin.objects.open(object)[source]

Initialization of properties not necessary for browsing etc.

Parameters

objectUDM object.

univention.admin.objects.default(module, co, lo, position)[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)[source]

Return short description for object.

Parameters

objectUDM object.

univention.admin.objects.shadow(lo, module, object, position)[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)[source]

Return the DN of the object.

Parameters

objectUDM object.

Returns

the DN or None.

univention.admin.objects.ocToType(oc)[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, key)[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, key)[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, policy_type)[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, policy_type)[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, policy_type, new_reference)[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, policy_type)[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)[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)[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, method_id=None, salt=None)[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)[source]

Return bcrypt hash.

Parameters

password – password string.

Returns

the hashed password string.

univention.admin.password.ntlm(password)[source]

Return tuple with NT and LanMan hash.

Parameters

password – password string.

Returns

2-tuple (NT, LanMan)

univention.admin.password.krb5_asn1(principal, password, krb5_context=None)[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)[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)[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)[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)[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, pwhistory, pwhlen)[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, pwhistory)[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)[source]
univention.admin.policy.policy_object_tab()[source]
univention.admin.policy.requiredObjectClassesProperty(**kwargs)[source]
univention.admin.policy.prohibitedObjectClassesProperty(**kwargs)[source]
univention.admin.policy.fixedAttributesProperty(**kwargs)[source]
univention.admin.policy.emptyAttributesProperty(**kwargs)[source]
univention.admin.policy.ldapFilterProperty(**kwargs)[source]

univention.admin.samba module

UDM samba related code

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

Bases: object

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

univention.admin.syntax module

Example for UDM syntax.

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

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

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

Update choices which are defined in LDAP

>>> import univention.admin.modules
>>> univention.admin.modules.update()
>>> update_choices()
>>> ('settings/portal', 'Portal: Portal') in univentionAdminModules.choices
True
univention.admin.syntax.is_syntax(syntax_obj, syntax_type)[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 = 'One'

Widget size. See SIZES.

type_class = None
type_class_multivalue = None
name = 'ISyntax'
type = 'ISyntax'
classmethod tostring(text)[source]

Convert from internal representation to textual representation.

Parameters

text – internal representation.

Returns

textual representation.

parse_command_line(value)[source]
classmethod new()[source]

Return the initial value.

classmethod any()[source]

Return the default search filter.

classmethod get_choices(lo, options)[source]

Get all already sorted choices

classmethod sort_choices(choices)[source]
widget = 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 = '*'

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: univention.admin.syntax.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 = None

Regular expression to validate the value.

error_message = 'Invalid value'

Error message when an invalid item is selected.

type_class

alias of univention.admin.types.StringType

widget = 'TextBox'

The corresponding widget which is used in UMC

widget_default_search_pattern = '*'

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 checkLdap(lo, value)[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.

Returns

None on errors.

Raises

Exception – on errors.

class univention.admin.syntax.select[source]

Bases: univention.admin.syntax.ISyntax

Select item from list of choices:

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

Allow the empty value.

type_class

alias of univention.admin.types.StringType

widget = '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 = None

The name of another UDM property this syntax depends on.

javascript_dependency = False

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

classmethod parse(text)[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: univention.admin.syntax.select

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

self.choices = [(id, _("Display text"), ...]
widget = '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: univention.admin.syntax.ISyntax

Select multiple items from a list of choices.

choices = []

The list of choices.

empty_value = True

Allow the empty value.

error_message = 'Invalid value'

Error message when an invalid item is selected.

widget = '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)[source]
class univention.admin.syntax.complex[source]

Bases: univention.admin.syntax.ISyntax

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

delimiter = ' '

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 = None

Minimum number of required values.

all_required = True

All sub-values must contain a value.

subsyntaxes = []
subsyntax_names = ()
subsyntax_key_value = False
classmethod get_widget(prop)[source]
widget = 'MultiInput'

The corresponding widget which is used in UMC

widget_multivalue = 'ComplexInput'
widget_default_search_pattern = 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, minn=None)[source]
classmethod fromdict(value)[source]
classmethod todict(value)[source]
property type_class
property type_class_multivalue
classmethod tostring(texts)[source]

Convert from internal representation to textual representation.

Parameters

text – internal representation.

Returns

textual representation.

classmethod new()[source]

Return the initial value.

classmethod any()[source]

Return the default search filter.

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

Bases: univention.admin.syntax.ISyntax, univention.admin.syntax._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 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 = None

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

regex = re.compile('^([^=,]+=[^=,]+,)*[^=,]+=[^=,]+$')

Regular expression for validating the values.

static_values = None

Sequence of additional static items.

empty_value = False

Allow to select no entry.

depends = 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 = ''

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

widget = '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: univention.admin.syntax.ISyntax, univention.admin.syntax._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 = None

UDM module name to search for.

udm_filter = ''

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

attribute = 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 = None

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

regex = None

Regular expression for validating the values.

static_values = None

Sequence of additional static items.

empty_value = False

Allow to select no entry.

depends = None

The name of another UDM property this syntax depends on.

error_message = 'Invalid value'

Error message when an invalid item is selected.

widget = 'ComboBox'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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: univention.admin.syntax.simple

class univention.admin.syntax.string[source]

Bases: univention.admin.syntax.simple

Syntax for a string with unlimited length.

min_length = 0
max_length = 0
type_class

alias of univention.admin.types.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: univention.admin.syntax.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.OneThirdString[source]

Bases: univention.admin.syntax.string

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

size = 'OneThird'

Widget size. See SIZES.

class univention.admin.syntax.string6[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.string

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

size = 'Half'

Widget size. See SIZES.

class univention.admin.syntax.TwoThirdsString[source]

Bases: univention.admin.syntax.string

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

size = 'TwoThirds'

Widget size. See SIZES.

class univention.admin.syntax.FourThirdsString[source]

Bases: univention.admin.syntax.string

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

size = 'FourThirds'

Widget size. See SIZES.

class univention.admin.syntax.OneAndAHalfString[source]

Bases: univention.admin.syntax.string

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

size = 'OneAndAHalf'

Widget size. See SIZES.

class univention.admin.syntax.FiveThirdsString[source]

Bases: univention.admin.syntax.string

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

size = 'FiveThirds'

Widget size. See SIZES.

class univention.admin.syntax.TwoString[source]

Bases: univention.admin.syntax.string

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

size = 'Two'

Widget size. See SIZES.

class univention.admin.syntax.TextArea[source]

Bases: univention.admin.syntax.string

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

widget = 'TextArea'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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: univention.admin.syntax.string

widget = 'Editor'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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: univention.admin.syntax.Editor

size = 'Two'

Widget size. See SIZES.

class univention.admin.syntax.UCSVersion[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.ISyntax

Syntax to allow uploading a binary file.

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

alias of univention.admin.types.BinaryType

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

Bases: univention.admin.syntax.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 univention.admin.types.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: univention.admin.syntax.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 univention.admin.types.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: univention.admin.syntax.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 univention.admin.types.Base64Type

widget = 'umc/modules/udm/CertificateUploader'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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: univention.admin.syntax.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 = 'ImageUploader'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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: univention.admin.syntax.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 univention.admin.types.Base64Type

widget = 'ImageUploader'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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)[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: univention.admin.syntax.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 univention.admin.types.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: univention.admin.syntax.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 univention.admin.types.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: univention.admin.syntax.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 univention.admin.types.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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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 = ': '

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 = [('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: univention.admin.syntax.complex

Syntax for a message catalog and the corresponding UMCMessageCatalogFilename.

See GNUMessageCatalog and UMCMessageCatalogFilename.

delimiter = ': '

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 = [('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: univention.admin.syntax.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 = 'Half'

Widget size. See SIZES.

type_class

alias of univention.admin.types.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: univention.admin.syntax.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: univention.admin.syntax.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 = 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 univention.admin.types.BooleanType

widget = '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 = 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: univention.admin.syntax.boolean

class univention.admin.syntax.filesize[source]

Bases: univention.admin.syntax.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 = 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: univention.admin.syntax.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: univention.admin.syntax.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 = [('', 'undefined'), ('mail', 'mails'), ('event', 'events'), ('contact', 'contacts'), ('task', 'tasks'), ('note', 'notes'), ('journal', 'journals')]
class univention.admin.syntax.string_numbers_letters_dots[source]

Bases: univention.admin.syntax.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 = 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: univention.admin.syntax.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 = 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: univention.admin.syntax.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 = 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: univention.admin.syntax.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)[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: univention.admin.syntax.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 = 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.

class univention.admin.syntax.uid_umlauts[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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 = 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.

class univention.admin.syntax.sharePath[source]

Bases: univention.admin.syntax.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 = re.compile('^([^"])+$')

Regular expression to validate the value.

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

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.passwd[source]

Bases: univention.admin.syntax.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 univention.admin.types.PasswordType

widget = 'PasswordInputBox'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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: univention.admin.syntax.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 univention.admin.types.PasswordType

widget = 'PasswordInputBox'

The corresponding widget which is used in UMC

widget_default_search_pattern = ''

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: univention.admin.syntax.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 = 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 univention.admin.syntax.hostName

class univention.admin.syntax.ipv4Address[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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 = (('First address', <class 'univention.admin.syntax.ipAddress'>), ('Last address', <class 'univention.admin.syntax.ipAddress'>))
subsyntax_names = ('first', 'last')
classmethod parse(texts)[source]
class univention.admin.syntax.IPv4_AddressRange[source]

Bases: univention.admin.syntax.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 = 1

Minimum number of required values.

all_required = False

All sub-values must contain a value.

subsyntaxes = (('First address', <class 'univention.admin.syntax.ipv4Address'>), ('Last address', <class 'univention.admin.syntax.ipv4Address'>))
subsyntax_names = ('first', 'last')
class univention.admin.syntax.ipProtocol[source]

Bases: univention.admin.syntax.select

Syntax class to choose between TCP und UDP.

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

Bases: univention.admin.syntax.select

Syntax for DNS service record.

choices = [('tcp', 'TCP'), ('udp', 'UDP'), ('msdcs', 'MSDCS'), ('sites', 'SITES'), ('DomainDnsZones', 'DOMAINDNSZONES'), ('ForestDnsZones', 'FORESTDNSZONES')]
size = 'OneThird'

Widget size. See SIZES.

class univention.admin.syntax.absolutePath[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.select

Syntax for selecting the e-mail forwarding setting.

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

Bases: univention.admin.syntax.simple

Syntax class for an e-mail address.

>>> emailAddress.parse('quite@an.email.address')
'quite@an.email.address'
>>> emailAddress.parse('not quite an email address') 
Traceback (most recent call last):
...
valueError:
min_length = 3
max_length = 0
type_class

alias of univention.admin.types.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.emailAddressTemplate[source]

Bases: univention.admin.syntax.emailAddress

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

class univention.admin.syntax.emailAddressValidDomain[source]

Bases: univention.admin.syntax.UDM_Objects, univention.admin.syntax.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 univention.admin.types.EMailAddressType

udm_modules = ('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 = '%(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 = 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 = '*@*'

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 get_widget(prop)[source]
classmethod checkLdap(lo, mailaddresses)[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.

Returns

None on errors.

Raises

Exception – on errors.

class univention.admin.syntax.primaryEmailAddressValidDomain[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.UDM_Attribute

udm_module = 'mail/domain'

UDM module name to search for.

attribute = 'name'

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

class univention.admin.syntax.iso8601Date[source]

Bases: univention.admin.syntax.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 = 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 = 'DateBox'

The corresponding widget which is used in UMC

widget_default_search_pattern = '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 univention.admin.types.DateType

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

Bases: univention.admin.syntax.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 = 'DateBox'

The corresponding widget which is used in UMC

widget_default_search_pattern = '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 univention.admin.types.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: univention.admin.syntax.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: univention.admin.syntax.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 = 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: univention.admin.syntax.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 = 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: univention.admin.syntax.simple

RFC 1123: a ‘.’ separated FQDN

>>> dnsName.parse('') 
Traceback (most recent call last):
...
valueError: Missing value!

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

>>> dnsName.parse('0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz') 
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 (including the separators).

>>> dnsName.parse('a.' * 128) 
Traceback (most recent call last):
...
valueError: Full domain name must be between 1 and 253 characters long!
min_length = 1
max_length = 253
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 univention.admin.syntax.dnsName

univention.admin.syntax.dnsZone

alias of univention.admin.syntax.dnsName

class univention.admin.syntax.dnsHostname[source]

Bases: univention.admin.syntax.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 host name or FQDN must start with a letter and end with a letter or number. In between additionally dashes, dots and underscores are 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: univention.admin.syntax.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 host name or FQDN must start with a letter and end with a letter or number. In between additionally dashes, dots and underscores are allowed.
>>> dnsName_umlauts.parse('-') 
Traceback (most recent call last):
...
valueError: A host name or FQDN must start with a letter and end with a letter or number. In between additionally dashes, dots and underscores are allowed.
>>> dnsName_umlauts.parse('_') 
Traceback (most recent call last):
...
valueError: A host name or FQDN must start with a letter and end with a letter or number. In between additionally dashes, dots and underscores are allowed.
min_length = 1
max_length = 63
regex = re.compile('^(?![0-9]+$|[_-])[\\w_-]{1,63}(?<![_-])$')

Regular expression to validate the value.

error_message = 'A host name or FQDN must start with a letter and end with a letter or number. In between additionally dashes, dots and underscores are allowed.'

Error message when an invalid item is selected.

class univention.admin.syntax.keyAndValue[source]

Bases: univention.admin.syntax.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 = ' = '

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 = [('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: univention.admin.syntax.complex

Syntax for DNS mail exchange record.

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

All sub-values must contain a value.

class univention.admin.syntax.dnsSRVName[source]

Bases: univention.admin.syntax.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 = 2

Minimum number of required values.

all_required = False

All sub-values must contain a value.

subsyntaxes = [('Service', <class 'univention.admin.syntax.string'>), ('Protocol', <class 'univention.admin.syntax.ipProtocolSRV'>), ('Extension', <class 'univention.admin.syntax.string'>)]
subsyntax_names = ('service', 'protocol', 'extension')
size = ('Half', 'Half', 'One')

Widget size. See SIZES.

class univention.admin.syntax.dnsPTR[source]

Bases: univention.admin.syntax.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\t\t^    (?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\n\t\t(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){0,2}$\n\t\t|^    [0-9a-f]\n\t\t(?:\\.[0-9a-f]){0,30}$\n\t\t', 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: univention.admin.syntax.complex

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

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

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 = [('Street', <class 'univention.admin.syntax.string'>), ('Postal code', <class 'univention.admin.syntax.OneThirdString'>), ('City', <class 'univention.admin.syntax.TwoThirdsString'>)]
subsyntax_names = ('street', 'zipcode', 'city')
all_required = True

All sub-values must contain a value.

class univention.admin.syntax.dnsSRVLocation[source]

Bases: univention.admin.syntax.complex

Syntax for DNS service record.

>>> dnsSRVLocation.parse(('10', '100', '389', 'server.my.domain'))
['10', '100', '389', 'server.my.domain']
subsyntaxes = [('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 = ('priority', 'weigtht', 'port', 'server')
size = ('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: univention.admin.syntax.simple

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

regex = 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 univention.admin.types.DateTimeType

class univention.admin.syntax.TimeUnits[source]

Bases: univention.admin.syntax.select

Syntax to select a time unit.

size = 'Half'

Widget size. See SIZES.

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

Bases: univention.admin.syntax.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 = re.compile('^(?:[01][0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?$')

Regular expression to validate the value.

widget = 'TimeBox'

The corresponding widget which is used in UMC

widget_default_search_pattern = '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 univention.admin.types.TimeType

class univention.admin.syntax.UNIX_TimeInterval[source]

Bases: univention.admin.syntax.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 = 1

Minimum number of required values.

subsyntaxes = (('', <class 'univention.admin.syntax.integerOrEmpty'>), ('', <class 'univention.admin.syntax.TimeUnits'>))
subsyntax_names = ('amount', 'unit')
size = ('Half', 'Half')

Widget size. See SIZES.

type_class

alias of univention.admin.types.UnixTimeinterval

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

Bases: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.select

Syntax to select network technology type.

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

Bases: univention.admin.syntax.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: univention.admin.syntax.complex

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

subsyntaxes = (('Type', <class 'univention.admin.syntax.NetworkType'>), ('Address', <class 'univention.admin.syntax.MAC_Address'>))
subsyntax_names = ('type', 'address')
size = ('One', 'One')

Widget size. See SIZES.

all_required = True

All sub-values must contain a value.

class univention.admin.syntax.Packages[source]

Bases: univention.admin.syntax.UDM_Attribute

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

udm_module = 'settings/packages'

UDM module name to search for.

attribute = 'packageList'

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

label_format = '%(name)s: %($attribute$)s'

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

class univention.admin.syntax.PackagesRemove[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.simple

LDAP distinguished name.

>>> ldapDn.parse('dc=foo,dc=bar,dc=test')
'dc=foo,dc=bar,dc=test'

Deprecated since version 3.1-0: Use UDM_Objects.

regex = re.compile('^([^=,]+=[^=,]+,)*[^=,]+=[^=,]+$')

Regular expression to validate the value.

error_message = 'Not a valid LDAP DN'

Error message when an invalid item is selected.

type_class

alias of univention.admin.types.DistinguishedNameType

classmethod get_widget(prop)[source]
widget_default_search_pattern = ''

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

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

Bases: univention.admin.syntax.UDM_Objects

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

udm_modules = ('settings/umc_operationset',)

Sequence of UDM module names to search for.

label = '%(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: univention.admin.syntax.complex

Syntax to enter a UMC command pattern.

subsyntaxes = (('Command pattern', <class 'univention.admin.syntax.string'>), ('Option Pattern', <class 'univention.admin.syntax.string'>))
subsyntax_names = ('command', 'option')
min_elements = 1

Minimum number of required values.

all_required = False

All sub-values must contain a value.

size = ('One', 'One')

Widget size. See SIZES.

class univention.admin.syntax.LDAP_Server[source]

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a LDAP server.

Deprecated since version 4.4-0: Use DomainController.

udm_modules = ('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 = '%(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: univention.admin.syntax.select

Syntax to select between IMAP and POP3.

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

Bases: univention.admin.syntax.select

Syntax to select an IMAP access control permission.

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

Bases: univention.admin.syntax.UDM_Objects

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

udm_modules = ('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 = (('anyone', 'Anyone'),)

Sequence of additional static items.

regex = 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: univention.admin.syntax.UDM_Objects

Syntax to select a group name from LDAP.

udm_modules = ('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 = 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: univention.admin.syntax.UDM_Objects

Syntax to select an user name from LDAP.

udm_modules = ('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 = 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: univention.admin.syntax.complex

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

subsyntaxes = (('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: univention.admin.syntax.complex

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

subsyntaxes = (('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: univention.admin.syntax.complex

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

subsyntaxes = (('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: univention.admin.syntax.complex

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

subsyntaxes = (('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: univention.admin.syntax.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 = ''

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: univention.admin.syntax._CachedLdap

Syntax to enter a LDAP objectClass name.

class univention.admin.syntax.ldapAttribute[source]

Bases: univention.admin.syntax._CachedLdap

Syntax to enter a LDAP attribute name.

depends = '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: univention.admin.syntax.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 univention.admin.types.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: univention.admin.syntax.simple

Syntax to enter display resolution for X11.

regex = 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: univention.admin.syntax.simple

Syntax to enter display timing settings for X11.

regex = 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: univention.admin.syntax.simple

Syntax to enter color depth for X11.

regex = re.compile('^[0-9]+$')

Regular expression to validate the value.

class univention.admin.syntax.XModule[source]

Bases: univention.admin.syntax.select

Syntax to select graphics driver for X11.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select mouse protocol for X11.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select display position for X11.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select mouse device for X11.

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

Bases: univention.admin.syntax.select

Syntax to select keyboard layout for X11.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select ALSA audio device driver.

choices = [('', ''), ('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: univention.admin.syntax.UDM_Objects

Syntax to select a group from LDAP by DN.

udm_modules = ('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: univention.admin.syntax.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: univention.admin.syntax.UDM_Objects

Syntax to select an user from LDAP by DN.

See also

udm_modules = ('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: univention.admin.syntax.UDM_Objects

Syntax to select a host from LDAP by DN.

See also

udm_modules = ('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: univention.admin.syntax.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 = ('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 = '%(username)s'

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

regex = re.compile('^[0-9]+$')

Regular expression for validating the values.

static_values = (('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 univention.admin.types.IntegerType

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

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a group from LDAP by numeric user identifier.

>>> GroupID.parse('5000')
'5000'
>>> GroupID.parse(5000)
'5000'
udm_modules = ('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 = '%(name)s'

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

regex = re.compile('^[0-9]+$')

Regular expression for validating the values.

static_values = (('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 univention.admin.types.IntegerType

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

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a UCS host from LDAP by FQDN running the portal service.

udm_modules = ('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 = '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 = 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: univention.admin.syntax.UDM_Objects

Syntax to select a host from LDAP by FQDN.

See also

udm_modules = ()

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 = '%(name)s.%(domain)s'

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

regex = re.compile('(?=^.{1,254}$)(^(?:(?!\\d+\\.)[a-zA-Z0-9_\\-]{1,63}\\.?)+(?:[a-zA-Z0-9]{2,})$)')

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: univention.admin.syntax.IComputer_FQDN

Syntax to select a UCS Directory Node from LDAP by FQDN.

udm_modules = ('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: univention.admin.syntax.IComputer_FQDN

Syntax to select a Windows server from LDAP by FQDN.

udm_modules = ('computers/windows', 'computers/windows_domaincontroller')

Sequence of UDM module names to search for.

class univention.admin.syntax.UCS_Server[source]

Bases: univention.admin.syntax.IComputer_FQDN

Syntax to select a UCS host from LDAP by FQDN.

udm_modules = ('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: univention.admin.syntax.IComputer_FQDN

Syntax to select a UCS host from LDAP by FQDN offering print services.

See also

udm_modules = ('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: univention.admin.syntax.IComputer_FQDN

Syntax to select a UCS host from LDAP by FQDN offering IMAP services.

See also

udm_modules = ('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: univention.admin.syntax.UDM_Attribute

Syntax to select a KDE profile from lists stored in LDAP using univention.admin.handlers.settings.default.

udm_module = 'settings/default'

UDM module name to search for.

attribute = 'defaultKdeProfiles'

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

class univention.admin.syntax.primaryGroup[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.UDM_Objects

Syntax to select a network declaration from LDAP using univention.admin.handlers.networks.network.

udm_modules = ('networks/network',)

Sequence of UDM module names to search for.

description = 'Network'
label = '%(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: univention.admin.syntax.ipAddress, univention.admin.syntax.select

Syntax to select an IP address from the lists of addresses stored with the machine account.

choices = []
depends = 'ip'

The name of another UDM property this syntax depends on.

javascript_dependency = True

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

widget = 'ComboBox'

The corresponding widget which is used in UMC

class univention.admin.syntax.IP_AddressListEmpty[source]

Bases: univention.admin.syntax.IP_AddressList

Syntax to select no or an IP address from the lists of addresses stored with the machine account.

choices = [('', '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: univention.admin.syntax.MAC_Address, univention.admin.syntax.select

Syntax to select a MAC address from the lists of addresses stored with the machine account.

choices = []
depends = 'mac'

The name of another UDM property this syntax depends on.

javascript_dependency = True

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

widget = 'ComboBox'

The corresponding widget which is used in UMC

class univention.admin.syntax.DNS_ForwardZone[source]

Bases: univention.admin.syntax.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 = ('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: univention.admin.syntax.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 = ('dns/reverse_zone',)

Sequence of UDM module names to search for.

label = '%(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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.complex

Syntax to configure a DNS forward zone entry for a computer.

description = 'DNS Entry'
subsyntaxes = (('DNS forward zone', <class 'univention.admin.syntax.DNS_ForwardZoneNonempty'>), ('IP address', <class 'univention.admin.syntax.IP_AddressList'>))
subsyntax_names = ('forward-zone', 'ip')
size = ('One', 'One')

Widget size. See SIZES.

min_elements = 1

Minimum number of required values.

class univention.admin.syntax.dnsEntryReverse[source]

Bases: univention.admin.syntax.complex

Syntax to configure a DNS reverse zone entry for a computer.

description = 'DNS Entry Reverse'
subsyntaxes = (('DNS reverse zone', <class 'univention.admin.syntax.DNS_ReverseZoneNonempty'>), ('IP address', <class 'univention.admin.syntax.IP_AddressList'>))
subsyntax_names = ('reverse-zone', 'ip')
size = ('One', 'One')

Widget size. See SIZES.

min_elements = 1

Minimum number of required values.

class univention.admin.syntax.DNS_ForwardZoneList[source]

Bases: univention.admin.syntax.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 = 'dnsEntryZoneForward'

The name of another UDM property this syntax depends on.

javascript_dependency = 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: univention.admin.syntax.complex

Syntax to configure a DNS alias record.

description = 'DNS Entry Alias'
subsyntaxes = (('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 = ('zone', 'forward-zone', 'alias')
size = ('TwoThirds', 'TwoThirds', 'TwoThirds')

Widget size. See SIZES.

class univention.admin.syntax.dhcpService[source]

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a DHCP service from LDAP using univention.admin.handlers.dhcp.service.

udm_modules = ('dhcp/service',)

Sequence of UDM module names to search for.

description = 'DHCP service'
label = '%(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: univention.admin.syntax.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 = 1

Minimum number of required values.

all_required = False

All sub-values must contain a value.

subsyntaxes = (('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 = ('service', 'ip', 'mac')
description = 'DHCP Entry'
size = ('TwoThirds', 'TwoThirds', 'TwoThirds')

Widget size. See SIZES.

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

Bases: univention.admin.syntax.complex

Syntax to enter free-form DHCP options.

subsyntaxes = (('Name', <class 'univention.admin.syntax.string'>), ('Value', <class 'univention.admin.syntax.string'>))
subsyntax_key_value = True
description = 'DHCP option'
size = ('One', 'One')

Widget size. See SIZES.

class univention.admin.syntax.WritableShare[source]

Bases: univention.admin.syntax.UDM_Objects

Syntax for selecting defined writeable NFS shares.

See also

udm_modules = ('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 = '%(name)s (%(path)s on %(host)s)'

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

size = '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: univention.admin.syntax.select

Syntax class for a tri-state select between allow, deny and ignore.

choices = [('', ''), ('allow', 'allow'), ('deny', 'deny'), ('ignore', 'ignore')]
class univention.admin.syntax.IStates[source]

Bases: univention.admin.syntax.select

Base syntax to select item from list of choices with a mapping between Python and LDAP values.

values = []

Map Python type to 2-tuple (LDAP-value, translated-text).

choices = []
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: univention.admin.syntax.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 = ((None, ('', '')), (True, ('allow', 'allow')), (False, ('deny', 'deny')))

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class

alias of univention.admin.types.TriBooleanType

class univention.admin.syntax.booleanNone[source]

Bases: univention.admin.syntax.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 = ((None, ('', '')), (True, ('yes', 'Yes')), (False, ('no', 'No')))

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class

alias of univention.admin.types.TriBooleanType

class univention.admin.syntax.auto_one_zero[source]

Bases: univention.admin.syntax.select

Syntax class for a tri-state select between “Auto”, “Yes” and “No”.

choices = [('Auto', 'Auto'), ('1', 'Yes'), ('0', 'No')]
class univention.admin.syntax.TrueFalse[source]

Bases: univention.admin.syntax.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 = ((None, ('', '')), (True, ('true', 'True')), (False, ('false', 'False')))

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class

alias of univention.admin.types.TriBooleanType

class univention.admin.syntax.TrueFalseUpper[source]

Bases: univention.admin.syntax.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 = ((None, ('', '')), (True, ('TRUE', 'True')), (False, ('FALSE', 'False')))

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class

alias of univention.admin.types.TriBooleanType

class univention.admin.syntax.TrueFalseUp[source]

Bases: univention.admin.syntax.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 = ((True, ('TRUE', 'True')), (False, ('FALSE', 'False')))

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class

alias of univention.admin.types.BooleanType

widget = '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 = 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: univention.admin.syntax.TrueFalseUp

class univention.admin.syntax.OkOrNot[source]

Bases: univention.admin.syntax.IStates

Syntax class to a boolean select between “OK” and “Not”.

values = ((True, ('OK', 'OK')), (False, ('Not', 'Not OK')))

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class

alias of univention.admin.types.BooleanType

widget = '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 = 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: univention.admin.syntax.OkOrNot

class univention.admin.syntax.ddnsUpdateStyle[source]

Bases: univention.admin.syntax.select

Syntax to select the DHCP dynamic DNS update style.

choices = [('', ''), ('ad-hoc', 'ad-hoc'), ('interim', 'interim'), ('none', 'none')]
class univention.admin.syntax.ddnsUpdates[source]

Bases: univention.admin.syntax.IStates

Syntax class for a tri-state select between None, “on” and “off”.

values = ((None, ('', '')), (True, ('on', 'on')), (False, ('off', 'off')))

Map Python type to 2-tuple (LDAP-value, translated-text).

type_class

alias of univention.admin.types.TriBooleanType

class univention.admin.syntax.netbiosNodeType[source]

Bases: univention.admin.syntax.select

Syntax to select the Windows name server mode.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select KDE profile type.

choices = [('', 'none'), ('/home/kde.restricted', 'restricted'), ('/home/kde.lockeddown', 'locked down')]
class univention.admin.syntax.language[source]

Bases: univention.admin.syntax.select

Syntax for selecting a language by name.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select the month of a year.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select the day of a week.

choices = [('', ''), ('all', 'all'), ('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')]
class univention.admin.syntax.Day[source]

Bases: univention.admin.syntax.select

Syntax to select the day of a month.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select the hour of a day or all or none.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select the hour of a day.

choices = [('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: univention.admin.syntax.select

Syntax to select the minute of a hour or all or none.

choices = [('', ''), ('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: univention.admin.syntax.select

Syntax to select the minute of a hour.

choices = [('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: univention.admin.syntax.simple

Syntax to configure UNIX file permissions.

widget = 'UnixAccessRights'

The corresponding widget which is used in UMC

widget_default_search_pattern = '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: univention.admin.syntax.simple

Syntax to configure UNIX file permissions including setUID, setGID and sticky bits.

See also

widget = 'UnixAccessRightsExtended'

The corresponding widget which is used in UMC

widget_default_search_pattern = '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: univention.admin.syntax.select

Syntax to select Samba group type.

choices = [('', ''), ('2', 'Domain Group'), ('3', 'Local Group'), ('5', 'Well-Known Group')]
class univention.admin.syntax.adGroupType[source]

Bases: univention.admin.syntax.select

Syntax to select Active Directory group type.

choices = [('', ''), ('-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: univention.admin.syntax.MultiSelect

Syntax to select hour slots per day for Samba login.

>>> SambaLogonHours.parse("162 163")
[162, 163]
>>> SambaLogonHours.parse("5000") 
Traceback (most recent call last):
...
valueError:
choices = [(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 univention.admin.types.SambaLogonHours

classmethod parse(value)[source]
classmethod tostring(value)[source]

Convert from internal representation to textual representation.

Parameters

text – internal representation.

Returns

textual representation.

class univention.admin.syntax.SambaPrivileges[source]

Bases: univention.admin.syntax.select

Syntax to select Samba privileges.

empty_value = True

Allow the empty value.

choices = [('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: univention.admin.syntax.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 = [('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: univention.admin.syntax.UDM_Objects

Syntax to select a UCS host from LDAP by DN offering SMTP services.

See also

udm_modules = ('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: univention.admin.syntax.UDM_Objects

Syntax to select a UCS host from LDAP by DN offering print services.

udm_modules = ('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: univention.admin.syntax.UDM_Objects

Syntax to select a UCS service types from LDAP using univention.admin.handlers.settings.service.

udm_modules = ('settings/service',)

Sequence of UDM module names to search for.

regex = 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 = '%(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: univention.admin.syntax.select

Syntax to select the NFS synchronization type.

choices = [('sync', 'synchronous'), ('async', 'asynchronous')]
class univention.admin.syntax.univentionAdminModules[source]

Bases: univention.admin.syntax.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 = [('appcenter/app', 'Appcenter: App Metadata'), ('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'), ('groups/group', 'Group'), ('test/ip_phone', 'IP-Phone'), ('kerberos/kdcentry', 'Kerberos: KDC Entry'), ('ms/domainpolicy', 'MS Domain Policy'), ('ms/gpipsec-policy', 'MS IPsec policy'), ('ms/gpipsec-isakmp-policy', 'MS IPsec policy: ISAKMP Policy'), ('ms/gpipsec-nfa', 'MS IPsec policy: NFA'), ('ms/gpipsec-negotiation-policy', 'MS IPsec policy: Negotiation Policy'), ('ms/gpipsec-filter', 'MS IPsec policy: filter'), ('ms/gpsi-category-registration', 'MS Software Installation Group Policy: Category Registration'), ('ms/gpwl-wired', 'MS wired Group Policy'), ('ms/gpwl-wireless', 'MS wireless Group Policy'), ('ms/gpwl-wireless-blob', 'MS wireless Group Policy blob'), ('mail/domain', 'Mail domain'), ('mail/folder', 'Mail folder (IMAP)'), ('mail/lists', 'Mailing list'), ('nagios/service', 'Nagios service'), ('nagios/timeperiod', 'Nagios time period'), ('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/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/portal_category', 'Portal: Category'), ('settings/portal_entry', 'Portal: Entry'), ('settings/portal', 'Portal: Portal'), ('settings/default', 'Preferences: Default'), ('settings/directory', 'Preferences: Default Container'), ('shares/printer', 'Printer share: Printer'), ('shares/printergroup', 'Printer share: Printer group'), ('saml/idpconfig', 'SAML IdP configuration'), ('saml/serviceprovider', 'SAML service provider'), ('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'), ('ms/gpsi-class-store', 'Software Installation Group Policy: Class Store'), ('ms/gpsi-package-registration', 'Software Installation Group Policy: Package Registration'), ('settings/cn', 'Univention Settings'), ('users/user', 'User'), ('users/passwd', 'User: Password'), ('users/self', 'User: Self')]
classmethod parse(text)[source]
classmethod update_choices()[source]

Update internal list of UDM modules in univentionAdminModules.

class univention.admin.syntax.UDM_PropertySelect[source]

Bases: univention.admin.syntax.complex

Syntax to enter UDM module and property name.

subsyntaxes = (('UDM module', <class 'univention.admin.syntax.string'>), ('property', <class 'univention.admin.syntax.string'>))
subsyntax_names = ('module', 'property')
class univention.admin.syntax.listAttributes[source]

Bases: univention.admin.syntax.string

Syntax to enter UDM property name.

Deprecated since version 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: univention.admin.syntax.select

Time format used by at.

choices = [('', '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: univention.admin.syntax.select

Syntax to select options for UDM module univention.admin.handlers.users.user.

choices = [('pki', 'Public key infrastructure account')]
classmethod update_choices()[source]
class univention.admin.syntax.allModuleOptions[source]

Bases: univention.admin.syntax.combobox

Syntax to select options for UDM modules.

depends = '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 = [('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'), ('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'), ('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: univention.admin.syntax.UDM_Objects

Syntax to select Nagios enabled hosts from LDAP.

udm_modules = ('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: univention.admin.syntax.UDM_Objects

Syntax to select a Nagios services from LDAP using univention.admin.handlers.nagios.service.

udm_modules = ('nagios/service',)

Sequence of UDM module names to search for.

class univention.admin.syntax.NagiosTimePeriod[source]

Bases: univention.admin.syntax.UDM_Attribute

udm_module = 'nagios/timeperiod'

UDM module name to search for.

attribute = 'name'

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

class univention.admin.syntax.UCR_Variable[source]

Bases: univention.admin.syntax.complex

Syntax to enter UCR variable name and value.

subsyntaxes = (('Variable', <class 'univention.admin.syntax.string'>), ('Value', <class 'univention.admin.syntax.string'>))
subsyntax_names = ('variable', 'value')
subsyntax_key_value = True

Bases: univention.admin.syntax.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, attrs 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: univention.admin.syntax.UDM_Objects

Syntax for selecting defined NFS shares.

See also

udm_modules = ('shares/share',)

Sequence of UDM module names to search for.

label = '%(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: univention.admin.syntax.complex

Syntax to define a NFS mount point.

subsyntaxes = [('NFS share', <class 'univention.admin.syntax.nfsShare'>), ('Mount point', <class 'univention.admin.syntax.string'>)]
subsyntax_names = ('nfs-share', 'mount-point')
all_required = True

All sub-values must contain a value.

class univention.admin.syntax.languageCode[source]

Bases: univention.admin.syntax.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 = [('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: univention.admin.syntax.complex

Syntax for some translatable text.

delimiter = ': '

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 = [('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: univention.admin.syntax.translationTuple

Syntax for a translated short description of an UDM property.

subsyntaxes = [('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: univention.admin.syntax.translationTuple

Syntax for a translated long description of an UDM property.

subsyntaxes = [('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: univention.admin.syntax.translationTuple

Syntax for a translated UMC tab name for an UDM property.

subsyntaxes = [('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: univention.admin.syntax.translationTuple

Syntax for a translated group name.

subsyntaxes = [('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: univention.admin.syntax.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: univention.admin.syntax.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 = '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 = 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: univention.admin.syntax.UDM_Objects

Syntax to select a printers from LDAP using univention.admin.handlers.shares.printer.

See also

udm_modules = ('shares/printer',)

Sequence of UDM module names to search for.

depends = '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: univention.admin.syntax.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 = ('shares/printer',)

Sequence of UDM module names to search for.

depends = '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 = 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: univention.admin.syntax.complex

Syntax to configure a page quota for all users of a group together.

subsyntaxes = (('Soft limit (pages)', <class 'univention.admin.syntax.integer'>), ('Hard limit (pages)', <class 'univention.admin.syntax.integer'>), ('Group', <class 'univention.admin.syntax.GroupName'>))
subsyntax_names = ('soft-limit', 'hard-limit', 'group')
class univention.admin.syntax.PrintQuotaGroupPerUser[source]

Bases: univention.admin.syntax.complex

Syntax to configure a page quota for all individual users of a group.

subsyntaxes = (('Soft limit (pages)', <class 'univention.admin.syntax.integer'>), ('Hard limit (pages)', <class 'univention.admin.syntax.integer'>), ('Group', <class 'univention.admin.syntax.GroupName'>))
subsyntax_names = ('soft-limit', 'hard-limit', 'group')
class univention.admin.syntax.PrintQuotaUser[source]

Bases: univention.admin.syntax.complex

Syntax to configure a page quota for an individual user.

subsyntaxes = (('Soft limit (pages)', <class 'univention.admin.syntax.integer'>), ('Hard limit (pages)', <class 'univention.admin.syntax.integer'>), ('User', <class 'univention.admin.syntax.UserName'>))
subsyntax_names = ('soft-limit', 'hard-limit', 'group')
class univention.admin.syntax.printerName[source]

Bases: univention.admin.syntax.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: univention.admin.syntax.complex

Syntax to enter a printer model description.

subsyntaxes = [('Driver', <class 'univention.admin.syntax.string'>), ('Description', <class 'univention.admin.syntax.string'>)]
subsyntax_names = ('driver', 'description')
all_required = True

All sub-values must contain a value.

class univention.admin.syntax.PrinterDriverList[source]

Bases: univention.admin.syntax.UDM_Attribute

Syntax to select a printer driver from LDAP using univention.admin.handlers.settings.printermodel.

udm_module = 'settings/printermodel'

UDM module name to search for.

attribute = '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 = 'producer'

The name of another UDM property this syntax depends on.

class univention.admin.syntax.PrinterProducerList[source]

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a printer producer from LDAP using univention.admin.handlers.settings.printermodel.

udm_modules = ('settings/printermodel',)

Sequence of UDM module names to search for.

label = '%(name)s'

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

class univention.admin.syntax.PrinterProtocol[source]

Bases: univention.admin.syntax.UDM_Attribute

Syntax to select a printer URI from LDAP using univention.admin.handlers.settings.printeruri.

udm_module = 'settings/printeruri'

UDM module name to search for.

attribute = '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: univention.admin.syntax.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 = (('Protocol', <class 'univention.admin.syntax.PrinterProtocol'>), ('Destination', <class 'univention.admin.syntax.string'>))
subsyntax_names = ('protocol', 'destination')
all_required = False

All sub-values must contain a value.

classmethod parse(texts)[source]
class univention.admin.syntax.policyName[source]

Bases: univention.admin.syntax.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.Portals[source]

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a portal from LDAP using univention.admin.handlers.settings.portal.

udm_modules = ('settings/portal',)

Sequence of UDM module names to search for.

label = '%(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.PortalEntries[source]

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a portal entries from LDAP using univention.admin.handlers.settings.portal_entry.

udm_modules = ('settings/portal_entry',)

Sequence of UDM module names to search for.

label = '%(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.PortalLinksPosition[source]

Bases: univention.admin.syntax.select

Syntax to select the position of links on the portal.

choices = [('footer', 'Footer')]

Bases: univention.admin.syntax.complex

Syntax to configure links on the portal.

delimiter = '$$'

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 = [('Position', <class 'univention.admin.syntax.PortalLinksPosition'>), ('Link', <class 'univention.admin.syntax.string'>), ('Locale', <class 'univention.admin.syntax.languageCode'>), ('Name', <class 'univention.admin.syntax.string'>)]
subsyntax_names = ('position', 'link', 'locale', 'name')
all_required = True

All sub-values must contain a value.

class univention.admin.syntax.PortalCategory[source]

Bases: univention.admin.syntax.select

Syntax to select a portal category version 1 from a static list with just 2 categories.

See also

choices = [('admin', 'Shown in category "Administration"'), ('service', 'Shown in category "Installed services"')]
class univention.admin.syntax.PortalCategoryV2[source]

Bases: univention.admin.syntax.UDM_Objects

Syntax to select a portal category version 2 from LDAP using univention.admin.handlers.settings.portal_category.

See also

udm_modules = ('settings/portal_category',)

Sequence of UDM module names to search for.

label = '%(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.PortalEntrySelection[source]

Bases: univention.admin.syntax.complex

Syntax to select a portal entry.

subsyntaxes = [('Portal Entry', <class 'univention.admin.syntax.PortalEntries'>)]
subsyntax_names = ('portal-entry',)
widget = 'umc/modules/udm/PortalContent'

The corresponding widget which is used in UMC

widget_multivalue = 'umc/modules/udm/PortalContent'
widget_default_search_pattern = 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.PortalCategorySelection[source]

Bases: univention.admin.syntax.simple

Syntax to select a portal category.

>>> PCS = PortalCategorySelection
>>> x = PCS.tostring([["cn=category1", []], ["cn=category2", ["cn=entry1", "cn=entry2"]]])
>>> x.replace(' ','').replace('\n','')
'[["cn=category1",[]],["cn=category2",["cn=entry1","cn=entry2"]]]'
>>> PCS.parse(PCS().parse_command_line('[["cn=category1",[]],["cn=category2",["cn=entry1","cn=entry2"]]]'))
[['cn=category1', []], ['cn=category2', ['cn=entry1', 'cn=entry2']]]
>>> PCS.parse(PCS().parse_command_line('[["cn=category1",[]],["",["cn=entry1","cn=entry2"]]]')) 
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> PCS.parse(PCS().parse_command_line('[["cn=category1"]]')) 
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> PCS.parse(PCS().parse_command_line('[["cn=category1",[], []]]')) 
Traceback (most recent call last):
...
valueInvalidSyntax:
>>> PCS.parse(PCS().parse_command_line('hallo')) 
Traceback (most recent call last):
...
valueInvalidSyntax:
subsyntaxes = [('Portal Category', <class 'univention.admin.syntax.PortalCategoryV2'>), ('Portal Entry', <class 'univention.admin.syntax.PortalEntrySelection'>)]
subsyntax_names = ('portal-category', 'portal-entry')
widget = 'umc/modules/udm/PortalContent'

The corresponding widget which is used in UMC

widget_default_search_pattern = None

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

parse_command_line(value)[source]
classmethod parse(texts, minn=None)[source]

Validate the value by parsing it.

Returns

the parsed textual value.

Raises

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

classmethod tostring(texts)[source]

Convert from internal representation to textual representation.

Parameters

text – internal representation.

Returns

textual representation.

class univention.admin.syntax.AuthRestriction[source]

Bases: univention.admin.syntax.select

Syntax to select the authentication restriction for the portal.

choices = [('admin', 'Visible for Admins only'), ('authenticated', 'Visible for authenticated users'), ('anonymous', 'Visible for everyone')]
class univention.admin.syntax.PortalFontColor[source]

Bases: univention.admin.syntax.select

Syntax to select the color of the font in the portal.

choices = [('white', 'White'), ('black', 'Black')]
class univention.admin.syntax.ExampleSyntax

Bases: univention.admin.syntax.select

This is an example for a syntax having 3 values.

choices = [('value1', 'This item selects value 1'), ('value2', 'This item selects value 2'), ('value3', 'This item selects value 3')]
class univention.admin.syntax.PortalDefaultLinkTarget[source]

Bases: univention.admin.syntax.select

choices = [('samewindow', 'Same tab'), ('newwindow', 'New tab')]
class univention.admin.syntax.SignedInteger

Bases: univention.admin.syntax.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.attributeMapping

Bases: univention.admin.syntax.complex

Syntax for key-value-pairs separated by = where the value is optional.

all_required = 0

All sub-values must contain a value.

delimiter = ' = '

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 = 1

Minimum number of required values.

subsyntax_key_value = True
subsyntaxes = [('LDAP Attribute Name', <class 'univention.admin.syntax.string'>), ('Service Attribute Name', <class 'univention.admin.syntax.string'>)]
class univention.admin.syntax.samlserviceprovider

Bases: univention.admin.syntax.UDM_Objects

regex = None

Regular expression for validating the values.

udm_modules = ('saml/serviceprovider',)

Sequence of UDM module names to search for.

class univention.admin.syntax.PortalEntryLinkTarget[source]

Bases: univention.admin.syntax.select

choices = [('useportaldefault', 'Use default of portal'), ('samewindow', 'Same tab'), ('newwindow', 'New tab')]
class univention.admin.syntax.LocalizedDisplayName[source]

Bases: univention.admin.syntax.translationTuple

Syntax for a translated display name of a portal entry.

subsyntaxes = [('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: univention.admin.syntax.translationTuple

Syntax for a translated description of a portal entry.

subsyntaxes = [('Language code (e.g. en_US)', <class 'univention.admin.syntax.languageCode'>), ('Description', <class 'univention.admin.syntax.string'>)]
class univention.admin.syntax.LocalizedAnonymousEmpty[source]

Bases: univention.admin.syntax.translationTuple

Syntax for a translated description of a portal entry. In addition to LocalizedDescription it allows to specify a fallback for anonymous visitors.

subsyntaxes = [('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: univention.admin.syntax.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: univention.admin.syntax.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: univention.admin.syntax.select

Syntax for UDM object flags.

empty_value = True

Allow the empty value.

choices = [('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.Country[source]

Bases: univention.admin.syntax.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 = [('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'), ('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'), ('MK', 'Macedonia, Republic of'), ('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'), ('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'), ('SZ', 'Swaziland'), ('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'), ('TR', 'Turkey'), ('TM', 'Turkmenistan'), ('TC', 'Turks and Caicos Islands'), ('TV', 'Tuvalu'), ('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: univention.admin.syntax.select

choices = [('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: univention.admin.syntax.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: univention.admin.syntax.select

choices = [('Africa/Abidjan', 'Africa/Abidjan'), ('Africa/Accra', 'Africa/Accra'), ('Africa/Addis_Ababa', 'Africa/Addis_Ababa'), ('Africa/Algiers', 'Africa/Algiers'), ('Africa/Asmara', 'Africa/Asmara'), ('Africa/Asmera', 'Africa/Asmera'), ('Africa/Bamako', 'Africa/Bamako'), ('Africa/Bangui', 'Africa/Bangui'), ('Africa/Banjul', 'Africa/Banjul'), ('Africa/Bissau', 'Africa/Bissau'), ('Africa/Blantyre', 'Africa/Blantyre'), ('Africa/Brazzaville', 'Africa/Brazzaville'), ('Africa/Bujumbura', 'Africa/Bujumbura'), ('Africa/Cairo', 'Africa/Cairo'), ('Africa/Casablanca', 'Africa/Casablanca'), ('Africa/Ceuta', 'Africa/Ceuta'), ('Africa/Conakry', 'Africa/Conakry'), ('Africa/Dakar', 'Africa/Dakar'), ('Africa/Dar_es_Salaam', 'Africa/Dar_es_Salaam'), ('Africa/Djibouti', 'Africa/Djibouti'), ('Africa/Douala', 'Africa/Douala'), ('Africa/El_Aaiun', 'Africa/El_Aaiun'), ('Africa/Freetown', 'Africa/Freetown'), ('Africa/Gaborone', 'Africa/Gaborone'), ('Africa/Harare', 'Africa/Harare'), ('Africa/Johannesburg', 'Africa/Johannesburg'), ('Africa/Juba', 'Africa/Juba'), ('Africa/Kampala', 'Africa/Kampala'), ('Africa/Khartoum', 'Africa/Khartoum'), ('Africa/Kigali', 'Africa/Kigali'), ('Africa/Kinshasa', 'Africa/Kinshasa'), ('Africa/Lagos', 'Africa/Lagos'), ('Africa/Libreville', 'Africa/Libreville'), ('Africa/Lome', 'Africa/Lome'), ('Africa/Luanda', 'Africa/Luanda'), ('Africa/Lubumbashi', 'Africa/Lubumbashi'), ('Africa/Lusaka', 'Africa/Lusaka'), ('Africa/Malabo', 'Africa/Malabo'), ('Africa/Maputo', 'Africa/Maputo'), ('Africa/Maseru', 'Africa/Maseru'), ('Africa/Mbabane', 'Africa/Mbabane'), ('Africa/Mogadishu', 'Africa/Mogadishu'), ('Africa/Monrovia', 'Africa/Monrovia'), ('Africa/Nairobi', 'Africa/Nairobi'), ('Africa/Ndjamena', 'Africa/Ndjamena'), ('Africa/Niamey', 'Africa/Niamey'), ('Africa/Nouakchott', 'Africa/Nouakchott'), ('Africa/Ouagadougou', 'Africa/Ouagadougou'), ('Africa/Porto-Novo', 'Africa/Porto-Novo'), ('Africa/Sao_Tome', 'Africa/Sao_Tome'), ('Africa/Timbuktu', 'Africa/Timbuktu'), ('Africa/Tripoli', 'Africa/Tripoli'), ('Africa/Tunis', 'Africa/Tunis'), ('Africa/Windhoek', 'Africa/Windhoek'), ('America/Adak', 'America/Adak'), ('America/Anchorage', 'America/Anchorage'), ('America/Anguilla', 'America/Anguilla'), ('America/Antigua', 'America/Antigua'), ('America/Araguaina', 'America/Araguaina'), ('America/Argentina/Buenos_Aires', 'America/Argentina/Buenos_Aires'), ('America/Argentina/Catamarca', 'America/Argentina/Catamarca'), ('America/Argentina/ComodRivadavia', 'America/Argentina/ComodRivadavia'), ('America/Argentina/Cordoba', 'America/Argentina/Cordoba'), ('America/Argentina/Jujuy', 'America/Argentina/Jujuy'), ('America/Argentina/La_Rioja', 'America/Argentina/La_Rioja'), ('America/Argentina/Mendoza', 'America/Argentina/Mendoza'), ('America/Argentina/Rio_Gallegos', 'America/Argentina/Rio_Gallegos'), ('America/Argentina/Salta', 'America/Argentina/Salta'), ('America/Argentina/San_Juan', 'America/Argentina/San_Juan'), ('America/Argentina/San_Luis', 'America/Argentina/San_Luis'), ('America/Argentina/Tucuman', 'America/Argentina/Tucuman'), ('America/Argentina/Ushuaia', 'America/Argentina/Ushuaia'), ('America/Aruba', 'America/Aruba'), ('America/Asuncion', 'America/Asuncion'), ('America/Atikokan', 'America/Atikokan'), ('America/Atka', 'America/Atka'), ('America/Bahia', 'America/Bahia'), ('America/Bahia_Banderas', 'America/Bahia_Banderas'), ('America/Barbados', 'America/Barbados'), ('America/Belem', 'America/Belem'), ('America/Belize', 'America/Belize'), ('America/Blanc-Sablon', 'America/Blanc-Sablon'), ('America/Boa_Vista', 'America/Boa_Vista'), ('America/Bogota', 'America/Bogota'), ('America/Boise', 'America/Boise'), ('America/Buenos_Aires', 'America/Buenos_Aires'), ('America/Cambridge_Bay', 'America/Cambridge_Bay'), ('America/Campo_Grande', 'America/Campo_Grande'), ('America/Cancun', 'America/Cancun'), ('America/Caracas', 'America/Caracas'), ('America/Catamarca', 'America/Catamarca'), ('America/Cayenne', 'America/Cayenne'), ('America/Cayman', 'America/Cayman'), ('America/Chicago', 'America/Chicago'), ('America/Chihuahua', 'America/Chihuahua'), ('America/Coral_Harbour', 'America/Coral_Harbour'), ('America/Cordoba', 'America/Cordoba'), ('America/Costa_Rica', 'America/Costa_Rica'), ('America/Creston', 'America/Creston'), ('America/Cuiaba', 'America/Cuiaba'), ('America/Curacao', 'America/Curacao'), ('America/Danmarkshavn', 'America/Danmarkshavn'), ('America/Dawson', 'America/Dawson'), ('America/Dawson_Creek', 'America/Dawson_Creek'), ('America/Denver', 'America/Denver'), ('America/Detroit', 'America/Detroit'), ('America/Dominica', 'America/Dominica'), ('America/Edmonton', 'America/Edmonton'), ('America/Eirunepe', 'America/Eirunepe'), ('America/El_Salvador', 'America/El_Salvador'), ('America/Ensenada', 'America/Ensenada'), ('America/Fort_Nelson', 'America/Fort_Nelson'), ('America/Fort_Wayne', 'America/Fort_Wayne'), ('America/Fortaleza', 'America/Fortaleza'), ('America/Glace_Bay', 'America/Glace_Bay'), ('America/Godthab', 'America/Godthab'), ('America/Goose_Bay', 'America/Goose_Bay'), ('America/Grand_Turk', 'America/Grand_Turk'), ('America/Grenada', 'America/Grenada'), ('America/Guadeloupe', 'America/Guadeloupe'), ('America/Guatemala', 'America/Guatemala'), ('America/Guayaquil', 'America/Guayaquil'), ('America/Guyana', 'America/Guyana'), ('America/Halifax', 'America/Halifax'), ('America/Havana', 'America/Havana'), ('America/Hermosillo', 'America/Hermosillo'), ('America/Indiana/Indianapolis', 'America/Indiana/Indianapolis'), ('America/Indiana/Knox', 'America/Indiana/Knox'), ('America/Indiana/Marengo', 'America/Indiana/Marengo'), ('America/Indiana/Petersburg', 'America/Indiana/Petersburg'), ('America/Indiana/Tell_City', 'America/Indiana/Tell_City'), ('America/Indiana/Vevay', 'America/Indiana/Vevay'), ('America/Indiana/Vincennes', 'America/Indiana/Vincennes'), ('America/Indiana/Winamac', 'America/Indiana/Winamac'), ('America/Indianapolis', 'America/Indianapolis'), ('America/Inuvik', 'America/Inuvik'), ('America/Iqaluit', 'America/Iqaluit'), ('America/Jamaica', 'America/Jamaica'), ('America/Jujuy', 'America/Jujuy'), ('America/Juneau', 'America/Juneau'), ('America/Kentucky/Louisville', 'America/Kentucky/Louisville'), ('America/Kentucky/Monticello', 'America/Kentucky/Monticello'), ('America/Knox_IN', 'America/Knox_IN'), ('America/Kralendijk', 'America/Kralendijk'), ('America/La_Paz', 'America/La_Paz'), ('America/Lima', 'America/Lima'), ('America/Los_Angeles', 'America/Los_Angeles'), ('America/Louisville', 'America/Louisville'), ('America/Lower_Princes', 'America/Lower_Princes'), ('America/Maceio', 'America/Maceio'), ('America/Managua', 'America/Managua'), ('America/Manaus', 'America/Manaus'), ('America/Marigot', 'America/Marigot'), ('America/Martinique', 'America/Martinique'), ('America/Matamoros', 'America/Matamoros'), ('America/Mazatlan', 'America/Mazatlan'), ('America/Mendoza', 'America/Mendoza'), ('America/Menominee', 'America/Menominee'), ('America/Merida', 'America/Merida'), ('America/Metlakatla', 'America/Metlakatla'), ('America/Mexico_City', 'America/Mexico_City'), ('America/Miquelon', 'America/Miquelon'), ('America/Moncton', 'America/Moncton'), ('America/Monterrey', 'America/Monterrey'), ('America/Montevideo', 'America/Montevideo'), ('America/Montreal', 'America/Montreal'), ('America/Montserrat', 'America/Montserrat'), ('America/Nassau', 'America/Nassau'), ('America/New_York', 'America/New_York'), ('America/Nipigon', 'America/Nipigon'), ('America/Nome', 'America/Nome'), ('America/Noronha', 'America/Noronha'), ('America/North_Dakota/Beulah', 'America/North_Dakota/Beulah'), ('America/North_Dakota/Center', 'America/North_Dakota/Center'), ('America/North_Dakota/New_Salem', 'America/North_Dakota/New_Salem'), ('America/Nuuk', 'America/Nuuk'), ('America/Ojinaga', 'America/Ojinaga'), ('America/Panama', 'America/Panama'), ('America/Pangnirtung', 'America/Pangnirtung'), ('America/Paramaribo', 'America/Paramaribo'), ('America/Phoenix', 'America/Phoenix'), ('America/Port-au-Prince', 'America/Port-au-Prince'), ('America/Port_of_Spain', 'America/Port_of_Spain'), ('America/Porto_Acre', 'America/Porto_Acre'), ('America/Porto_Velho', 'America/Porto_Velho'), ('America/Puerto_Rico', 'America/Puerto_Rico'), ('America/Punta_Arenas', 'America/Punta_Arenas'), ('America/Rainy_River', 'America/Rainy_River'), ('America/Rankin_Inlet', 'America/Rankin_Inlet'), ('America/Recife', 'America/Recife'), ('America/Regina', 'America/Regina'), ('America/Resolute', 'America/Resolute'), ('America/Rio_Branco', 'America/Rio_Branco'), ('America/Rosario', 'America/Rosario'), ('America/Santa_Isabel', 'America/Santa_Isabel'), ('America/Santarem', 'America/Santarem'), ('America/Santiago', 'America/Santiago'), ('America/Santo_Domingo', 'America/Santo_Domingo'), ('America/Sao_Paulo', 'America/Sao_Paulo'), ('America/Scoresbysund', 'America/Scoresbysund'), ('America/Shiprock', 'America/Shiprock'), ('America/Sitka', 'America/Sitka'), ('America/St_Barthelemy', 'America/St_Barthelemy'), ('America/St_Johns', 'America/St_Johns'), ('America/St_Kitts', 'America/St_Kitts'), ('America/St_Lucia', 'America/St_Lucia'), ('America/St_Thomas', 'America/St_Thomas'), ('America/St_Vincent', 'America/St_Vincent'), ('America/Swift_Current', 'America/Swift_Current'), ('America/Tegucigalpa', 'America/Tegucigalpa'), ('America/Thule', 'America/Thule'), ('America/Thunder_Bay', 'America/Thunder_Bay'), ('America/Tijuana', 'America/Tijuana'), ('America/Toronto', 'America/Toronto'), ('America/Tortola', 'America/Tortola'), ('America/Vancouver', 'America/Vancouver'), ('America/Virgin', 'America/Virgin'), ('America/Whitehorse', 'America/Whitehorse'), ('America/Winnipeg', 'America/Winnipeg'), ('America/Yakutat', 'America/Yakutat'), ('America/Yellowknife', 'America/Yellowknife'), ('Antarctica/Casey', 'Antarctica/Casey'), ('Antarctica/Davis', 'Antarctica/Davis'), ('Antarctica/DumontDUrville', 'Antarctica/DumontDUrville'), ('Antarctica/Macquarie', 'Antarctica/Macquarie'), ('Antarctica/Mawson', 'Antarctica/Mawson'), ('Antarctica/McMurdo', 'Antarctica/McMurdo'), ('Antarctica/Palmer', 'Antarctica/Palmer'), ('Antarctica/Rothera', 'Antarctica/Rothera'), ('Antarctica/South_Pole', 'Antarctica/South_Pole'), ('Antarctica/Syowa', 'Antarctica/Syowa'), ('Antarctica/Troll', 'Antarctica/Troll'), ('Antarctica/Vostok', 'Antarctica/Vostok'), ('Arctic/Longyearbyen', 'Arctic/Longyearbyen'), ('Asia/Aden', 'Asia/Aden'), ('Asia/Almaty', 'Asia/Almaty'), ('Asia/Amman', 'Asia/Amman'), ('Asia/Anadyr', 'Asia/Anadyr'), ('Asia/Aqtau', 'Asia/Aqtau'), ('Asia/Aqtobe', 'Asia/Aqtobe'), ('Asia/Ashgabat', 'Asia/Ashgabat'), ('Asia/Ashkhabad', 'Asia/Ashkhabad'), ('Asia/Atyrau', 'Asia/Atyrau'), ('Asia/Baghdad', 'Asia/Baghdad'), ('Asia/Bahrain', 'Asia/Bahrain'), ('Asia/Baku', 'Asia/Baku'), ('Asia/Bangkok', 'Asia/Bangkok'), ('Asia/Barnaul', 'Asia/Barnaul'), ('Asia/Beirut', 'Asia/Beirut'), ('Asia/Bishkek', 'Asia/Bishkek'), ('Asia/Brunei', 'Asia/Brunei'), ('Asia/Calcutta', 'Asia/Calcutta'), ('Asia/Chita', 'Asia/Chita'), ('Asia/Choibalsan', 'Asia/Choibalsan'), ('Asia/Chongqing', 'Asia/Chongqing'), ('Asia/Chungking', 'Asia/Chungking'), ('Asia/Colombo', 'Asia/Colombo'), ('Asia/Dacca', 'Asia/Dacca'), ('Asia/Damascus', 'Asia/Damascus'), ('Asia/Dhaka', 'Asia/Dhaka'), ('Asia/Dili', 'Asia/Dili'), ('Asia/Dubai', 'Asia/Dubai'), ('Asia/Dushanbe', 'Asia/Dushanbe'), ('Asia/Famagusta', 'Asia/Famagusta'), ('Asia/Gaza', 'Asia/Gaza'), ('Asia/Harbin', 'Asia/Harbin'), ('Asia/Hebron', 'Asia/Hebron'), ('Asia/Ho_Chi_Minh', 'Asia/Ho_Chi_Minh'), ('Asia/Hong_Kong', 'Asia/Hong_Kong'), ('Asia/Hovd', 'Asia/Hovd'), ('Asia/Irkutsk', 'Asia/Irkutsk'), ('Asia/Istanbul', 'Asia/Istanbul'), ('Asia/Jakarta', 'Asia/Jakarta'), ('Asia/Jayapura', 'Asia/Jayapura'), ('Asia/Jerusalem', 'Asia/Jerusalem'), ('Asia/Kabul', 'Asia/Kabul'), ('Asia/Kamchatka', 'Asia/Kamchatka'), ('Asia/Karachi', 'Asia/Karachi'), ('Asia/Kashgar', 'Asia/Kashgar'), ('Asia/Kathmandu', 'Asia/Kathmandu'), ('Asia/Katmandu', 'Asia/Katmandu'), ('Asia/Khandyga', 'Asia/Khandyga'), ('Asia/Kolkata', 'Asia/Kolkata'), ('Asia/Krasnoyarsk', 'Asia/Krasnoyarsk'), ('Asia/Kuala_Lumpur', 'Asia/Kuala_Lumpur'), ('Asia/Kuching', 'Asia/Kuching'), ('Asia/Kuwait', 'Asia/Kuwait'), ('Asia/Macao', 'Asia/Macao'), ('Asia/Macau', 'Asia/Macau'), ('Asia/Magadan', 'Asia/Magadan'), ('Asia/Makassar', 'Asia/Makassar'), ('Asia/Manila', 'Asia/Manila'), ('Asia/Muscat', 'Asia/Muscat'), ('Asia/Nicosia', 'Asia/Nicosia'), ('Asia/Novokuznetsk', 'Asia/Novokuznetsk'), ('Asia/Novosibirsk', 'Asia/Novosibirsk'), ('Asia/Omsk', 'Asia/Omsk'), ('Asia/Oral', 'Asia/Oral'), ('Asia/Phnom_Penh', 'Asia/Phnom_Penh'), ('Asia/Pontianak', 'Asia/Pontianak'), ('Asia/Pyongyang', 'Asia/Pyongyang'), ('Asia/Qatar', 'Asia/Qatar'), ('Asia/Qostanay', 'Asia/Qostanay'), ('Asia/Qyzylorda', 'Asia/Qyzylorda'), ('Asia/Rangoon', 'Asia/Rangoon'), ('Asia/Riyadh', 'Asia/Riyadh'), ('Asia/Saigon', 'Asia/Saigon'), ('Asia/Sakhalin', 'Asia/Sakhalin'), ('Asia/Samarkand', 'Asia/Samarkand'), ('Asia/Seoul', 'Asia/Seoul'), ('Asia/Shanghai', 'Asia/Shanghai'), ('Asia/Singapore', 'Asia/Singapore'), ('Asia/Srednekolymsk', 'Asia/Srednekolymsk'), ('Asia/Taipei', 'Asia/Taipei'), ('Asia/Tashkent', 'Asia/Tashkent'), ('Asia/Tbilisi', 'Asia/Tbilisi'), ('Asia/Tehran', 'Asia/Tehran'), ('Asia/Tel_Aviv', 'Asia/Tel_Aviv'), ('Asia/Thimbu', 'Asia/Thimbu'), ('Asia/Thimphu', 'Asia/Thimphu'), ('Asia/Tokyo', 'Asia/Tokyo'), ('Asia/Tomsk', 'Asia/Tomsk'), ('Asia/Ujung_Pandang', 'Asia/Ujung_Pandang'), ('Asia/Ulaanbaatar', 'Asia/Ulaanbaatar'), ('Asia/Ulan_Bator', 'Asia/Ulan_Bator'), ('Asia/Urumqi', 'Asia/Urumqi'), ('Asia/Ust-Nera', 'Asia/Ust-Nera'), ('Asia/Vientiane', 'Asia/Vientiane'), ('Asia/Vladivostok', 'Asia/Vladivostok'), ('Asia/Yakutsk', 'Asia/Yakutsk'), ('Asia/Yangon', 'Asia/Yangon'), ('Asia/Yekaterinburg', 'Asia/Yekaterinburg'), ('Asia/Yerevan', 'Asia/Yerevan'), ('Atlantic/Azores', 'Atlantic/Azores'), ('Atlantic/Bermuda', 'Atlantic/Bermuda'), ('Atlantic/Canary', 'Atlantic/Canary'), ('Atlantic/Cape_Verde', 'Atlantic/Cape_Verde'), ('Atlantic/Faeroe', 'Atlantic/Faeroe'), ('Atlantic/Faroe', 'Atlantic/Faroe'), ('Atlantic/Jan_Mayen', 'Atlantic/Jan_Mayen'), ('Atlantic/Madeira', 'Atlantic/Madeira'), ('Atlantic/Reykjavik', 'Atlantic/Reykjavik'), ('Atlantic/South_Georgia', 'Atlantic/South_Georgia'), ('Atlantic/St_Helena', 'Atlantic/St_Helena'), ('Atlantic/Stanley', 'Atlantic/Stanley'), ('Australia/ACT', 'Australia/ACT'), ('Australia/Adelaide', 'Australia/Adelaide'), ('Australia/Brisbane', 'Australia/Brisbane'), ('Australia/Broken_Hill', 'Australia/Broken_Hill'), ('Australia/Canberra', 'Australia/Canberra'), ('Australia/Currie', 'Australia/Currie'), ('Australia/Darwin', 'Australia/Darwin'), ('Australia/Eucla', 'Australia/Eucla'), ('Australia/Hobart', 'Australia/Hobart'), ('Australia/LHI', 'Australia/LHI'), ('Australia/Lindeman', 'Australia/Lindeman'), ('Australia/Lord_Howe', 'Australia/Lord_Howe'), ('Australia/Melbourne', 'Australia/Melbourne'), ('Australia/NSW', 'Australia/NSW'), ('Australia/North', 'Australia/North'), ('Australia/Perth', 'Australia/Perth'), ('Australia/Queensland', 'Australia/Queensland'), ('Australia/South', 'Australia/South'), ('Australia/Sydney', 'Australia/Sydney'), ('Australia/Tasmania', 'Australia/Tasmania'), ('Australia/Victoria', 'Australia/Victoria'), ('Australia/West', 'Australia/West'), ('Australia/Yancowinna', 'Australia/Yancowinna'), ('Brazil/Acre', 'Brazil/Acre'), ('Brazil/DeNoronha', 'Brazil/DeNoronha'), ('Brazil/East', 'Brazil/East'), ('Brazil/West', 'Brazil/West'), ('CET', 'CET'), ('CST6CDT', 'CST6CDT'), ('Canada/Atlantic', 'Canada/Atlantic'), ('Canada/Central', 'Canada/Central'), ('Canada/Eastern', 'Canada/Eastern'), ('Canada/Mountain', 'Canada/Mountain'), ('Canada/Newfoundland', 'Canada/Newfoundland'), ('Canada/Pacific', 'Canada/Pacific'), ('Canada/Saskatchewan', 'Canada/Saskatchewan'), ('Canada/Yukon', 'Canada/Yukon'), ('Chile/Continental', 'Chile/Continental'), ('Chile/EasterIsland', 'Chile/EasterIsland'), ('Cuba', 'Cuba'), ('EET', 'EET'), ('EST', 'EST'), ('EST5EDT', 'EST5EDT'), ('Egypt', 'Egypt'), ('Eire', 'Eire'), ('Etc/GMT', 'Etc/GMT'), ('Etc/GMT+0', 'Etc/GMT+0'), ('Etc/GMT+1', 'Etc/GMT+1'), ('Etc/GMT+10', 'Etc/GMT+10'), ('Etc/GMT+11', 'Etc/GMT+11'), ('Etc/GMT+12', 'Etc/GMT+12'), ('Etc/GMT+2', 'Etc/GMT+2'), ('Etc/GMT+3', 'Etc/GMT+3'), ('Etc/GMT+4', 'Etc/GMT+4'), ('Etc/GMT+5', 'Etc/GMT+5'), ('Etc/GMT+6', 'Etc/GMT+6'), ('Etc/GMT+7', 'Etc/GMT+7'), ('Etc/GMT+8', 'Etc/GMT+8'), ('Etc/GMT+9', 'Etc/GMT+9'), ('Etc/GMT-0', 'Etc/GMT-0'), ('Etc/GMT-1', 'Etc/GMT-1'), ('Etc/GMT-10', 'Etc/GMT-10'), ('Etc/GMT-11', 'Etc/GMT-11'), ('Etc/GMT-12', 'Etc/GMT-12'), ('Etc/GMT-13', 'Etc/GMT-13'), ('Etc/GMT-14', 'Etc/GMT-14'), ('Etc/GMT-2', 'Etc/GMT-2'), ('Etc/GMT-3', 'Etc/GMT-3'), ('Etc/GMT-4', 'Etc/GMT-4'), ('Etc/GMT-5', 'Etc/GMT-5'), ('Etc/GMT-6', 'Etc/GMT-6'), ('Etc/GMT-7', 'Etc/GMT-7'), ('Etc/GMT-8', 'Etc/GMT-8'), ('Etc/GMT-9', 'Etc/GMT-9'), ('Etc/GMT0', 'Etc/GMT0'), ('Etc/Greenwich', 'Etc/Greenwich'), ('Etc/UCT', 'Etc/UCT'), ('Etc/UTC', 'Etc/UTC'), ('Etc/Universal', 'Etc/Universal'), ('Etc/Zulu', 'Etc/Zulu'), ('Europe/Amsterdam', 'Europe/Amsterdam'), ('Europe/Andorra', 'Europe/Andorra'), ('Europe/Astrakhan', 'Europe/Astrakhan'), ('Europe/Athens', 'Europe/Athens'), ('Europe/Belfast', 'Europe/Belfast'), ('Europe/Belgrade', 'Europe/Belgrade'), ('Europe/Berlin', 'Europe/Berlin'), ('Europe/Bratislava', 'Europe/Bratislava'), ('Europe/Brussels', 'Europe/Brussels'), ('Europe/Bucharest', 'Europe/Bucharest'), ('Europe/Budapest', 'Europe/Budapest'), ('Europe/Busingen', 'Europe/Busingen'), ('Europe/Chisinau', 'Europe/Chisinau'), ('Europe/Copenhagen', 'Europe/Copenhagen'), ('Europe/Dublin', 'Europe/Dublin'), ('Europe/Gibraltar', 'Europe/Gibraltar'), ('Europe/Guernsey', 'Europe/Guernsey'), ('Europe/Helsinki', 'Europe/Helsinki'), ('Europe/Isle_of_Man', 'Europe/Isle_of_Man'), ('Europe/Istanbul', 'Europe/Istanbul'), ('Europe/Jersey', 'Europe/Jersey'), ('Europe/Kaliningrad', 'Europe/Kaliningrad'), ('Europe/Kiev', 'Europe/Kiev'), ('Europe/Kirov', 'Europe/Kirov'), ('Europe/Lisbon', 'Europe/Lisbon'), ('Europe/Ljubljana', 'Europe/Ljubljana'), ('Europe/London', 'Europe/London'), ('Europe/Luxembourg', 'Europe/Luxembourg'), ('Europe/Madrid', 'Europe/Madrid'), ('Europe/Malta', 'Europe/Malta'), ('Europe/Mariehamn', 'Europe/Mariehamn'), ('Europe/Minsk', 'Europe/Minsk'), ('Europe/Monaco', 'Europe/Monaco'), ('Europe/Moscow', 'Europe/Moscow'), ('Europe/Nicosia', 'Europe/Nicosia'), ('Europe/Oslo', 'Europe/Oslo'), ('Europe/Paris', 'Europe/Paris'), ('Europe/Podgorica', 'Europe/Podgorica'), ('Europe/Prague', 'Europe/Prague'), ('Europe/Riga', 'Europe/Riga'), ('Europe/Rome', 'Europe/Rome'), ('Europe/Samara', 'Europe/Samara'), ('Europe/San_Marino', 'Europe/San_Marino'), ('Europe/Sarajevo', 'Europe/Sarajevo'), ('Europe/Saratov', 'Europe/Saratov'), ('Europe/Simferopol', 'Europe/Simferopol'), ('Europe/Skopje', 'Europe/Skopje'), ('Europe/Sofia', 'Europe/Sofia'), ('Europe/Stockholm', 'Europe/Stockholm'), ('Europe/Tallinn', 'Europe/Tallinn'), ('Europe/Tirane', 'Europe/Tirane'), ('Europe/Tiraspol', 'Europe/Tiraspol'), ('Europe/Ulyanovsk', 'Europe/Ulyanovsk'), ('Europe/Uzhgorod', 'Europe/Uzhgorod'), ('Europe/Vaduz', 'Europe/Vaduz'), ('Europe/Vatican', 'Europe/Vatican'), ('Europe/Vienna', 'Europe/Vienna'), ('Europe/Vilnius', 'Europe/Vilnius'), ('Europe/Volgograd', 'Europe/Volgograd'), ('Europe/Warsaw', 'Europe/Warsaw'), ('Europe/Zagreb', 'Europe/Zagreb'), ('Europe/Zaporozhye', 'Europe/Zaporozhye'), ('Europe/Zurich', 'Europe/Zurich'), ('GB', 'GB'), ('GB-Eire', 'GB-Eire'), ('GMT', 'GMT'), ('GMT+0', 'GMT+0'), ('GMT-0', 'GMT-0'), ('GMT0', 'GMT0'), ('Greenwich', 'Greenwich'), ('HST', 'HST'), ('Hongkong', 'Hongkong'), ('Iceland', 'Iceland'), ('Indian/Antananarivo', 'Indian/Antananarivo'), ('Indian/Chagos', 'Indian/Chagos'), ('Indian/Christmas', 'Indian/Christmas'), ('Indian/Cocos', 'Indian/Cocos'), ('Indian/Comoro', 'Indian/Comoro'), ('Indian/Kerguelen', 'Indian/Kerguelen'), ('Indian/Mahe', 'Indian/Mahe'), ('Indian/Maldives', 'Indian/Maldives'), ('Indian/Mauritius', 'Indian/Mauritius'), ('Indian/Mayotte', 'Indian/Mayotte'), ('Indian/Reunion', 'Indian/Reunion'), ('Iran', 'Iran'), ('Israel', 'Israel'), ('Jamaica', 'Jamaica'), ('Japan', 'Japan'), ('Kwajalein', 'Kwajalein'), ('Libya', 'Libya'), ('MET', 'MET'), ('MST', 'MST'), ('MST7MDT', 'MST7MDT'), ('Mexico/BajaNorte', 'Mexico/BajaNorte'), ('Mexico/BajaSur', 'Mexico/BajaSur'), ('Mexico/General', 'Mexico/General'), ('NZ', 'NZ'), ('NZ-CHAT', 'NZ-CHAT'), ('Navajo', 'Navajo'), ('PRC', 'PRC'), ('PST8PDT', 'PST8PDT'), ('Pacific/Apia', 'Pacific/Apia'), ('Pacific/Auckland', 'Pacific/Auckland'), ('Pacific/Bougainville', 'Pacific/Bougainville'), ('Pacific/Chatham', 'Pacific/Chatham'), ('Pacific/Chuuk', 'Pacific/Chuuk'), ('Pacific/Easter', 'Pacific/Easter'), ('Pacific/Efate', 'Pacific/Efate'), ('Pacific/Enderbury', 'Pacific/Enderbury'), ('Pacific/Fakaofo', 'Pacific/Fakaofo'), ('Pacific/Fiji', 'Pacific/Fiji'), ('Pacific/Funafuti', 'Pacific/Funafuti'), ('Pacific/Galapagos', 'Pacific/Galapagos'), ('Pacific/Gambier', 'Pacific/Gambier'), ('Pacific/Guadalcanal', 'Pacific/Guadalcanal'), ('Pacific/Guam', 'Pacific/Guam'), ('Pacific/Honolulu', 'Pacific/Honolulu'), ('Pacific/Johnston', 'Pacific/Johnston'), ('Pacific/Kanton', 'Pacific/Kanton'), ('Pacific/Kiritimati', 'Pacific/Kiritimati'), ('Pacific/Kosrae', 'Pacific/Kosrae'), ('Pacific/Kwajalein', 'Pacific/Kwajalein'), ('Pacific/Majuro', 'Pacific/Majuro'), ('Pacific/Marquesas', 'Pacific/Marquesas'), ('Pacific/Midway', 'Pacific/Midway'), ('Pacific/Nauru', 'Pacific/Nauru'), ('Pacific/Niue', 'Pacific/Niue'), ('Pacific/Norfolk', 'Pacific/Norfolk'), ('Pacific/Noumea', 'Pacific/Noumea'), ('Pacific/Pago_Pago', 'Pacific/Pago_Pago'), ('Pacific/Palau', 'Pacific/Palau'), ('Pacific/Pitcairn', 'Pacific/Pitcairn'), ('Pacific/Pohnpei', 'Pacific/Pohnpei'), ('Pacific/Ponape', 'Pacific/Ponape'), ('Pacific/Port_Moresby', 'Pacific/Port_Moresby'), ('Pacific/Rarotonga', 'Pacific/Rarotonga'), ('Pacific/Saipan', 'Pacific/Saipan'), ('Pacific/Samoa', 'Pacific/Samoa'), ('Pacific/Tahiti', 'Pacific/Tahiti'), ('Pacific/Tarawa', 'Pacific/Tarawa'), ('Pacific/Tongatapu', 'Pacific/Tongatapu'), ('Pacific/Truk', 'Pacific/Truk'), ('Pacific/Wake', 'Pacific/Wake'), ('Pacific/Wallis', 'Pacific/Wallis'), ('Pacific/Yap', 'Pacific/Yap'), ('Poland', 'Poland'), ('Portugal', 'Portugal'), ('ROC', 'ROC'), ('ROK', 'ROK'), ('Singapore', 'Singapore'), ('Turkey', 'Turkey'), ('UCT', 'UCT'), ('US/Alaska', 'US/Alaska'), ('US/Aleutian', 'US/Aleutian'), ('US/Arizona', 'US/Arizona'), ('US/Central', 'US/Central'), ('US/East-Indiana', 'US/East-Indiana'), ('US/Eastern', 'US/Eastern'), ('US/Hawaii', 'US/Hawaii'), ('US/Indiana-Starke', 'US/Indiana-Starke'), ('US/Michigan', 'US/Michigan'), ('US/Mountain', 'US/Mountain'), ('US/Pacific', 'US/Pacific'), ('US/Samoa', 'US/Samoa'), ('UTC', 'UTC'), ('Universal', 'Universal'), ('W-SU', 'W-SU'), ('WET', 'WET'), ('Zulu', 'Zulu')]
class univention.admin.syntax.DateTimeTimezone[source]

Bases: univention.admin.syntax.complex

Syntax for YYYY-mm-dd HH:MM TZNAME

delimiter = ' '

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 = [('Date', <class 'univention.admin.syntax.iso8601Date'>), ('Time', <class 'univention.admin.syntax.TimeString'>), ('Timezone', <class 'univention.admin.syntax.TimeZone'>)]
subsyntax_names = ('date', 'time', 'timezone')
size = ('TwoThirds', 'TwoThirds', 'TwoThirds')

Widget size. See SIZES.

all_required = False

All sub-values must contain a value.

min_elements = 0

Minimum number of required values.

class univention.admin.syntax.ActivationDateTimeTimezone[source]

Bases: univention.admin.syntax.DateTimeTimezone

Syntax for YYYY-mm-dd HH:MM TZNAME Subclassed to define representative names as subsyntax_names for REST API

subsyntax_names = ('activation-date', 'activation-time', 'activation-timezone')
class univention.admin.syntax.UDM_Syntax[source]

Bases: univention.admin.syntax.combobox

Syntax class for Extended Attributes.

choices = [('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'), ('GroupDN', 'GroupDN'), ('GroupDNOrEmpty', 'GroupDNOrEmpty'), ('GroupID', 'GroupID'), ('GroupName', 'GroupName'), ('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'), ('NagiosTimePeriod', 'NagiosTimePeriod'), ('NetworkType', 'NetworkType'), ('ObjectFlag', 'ObjectFlag'), ('OkOrNot', 'OkOrNot'), ('OneAndAHalfString', 'OneAndAHalfString'), ('OneThirdString', 'OneThirdString'), ('Packages', 'Packages'), ('PackagesRemove', 'PackagesRemove'), ('PortalCategory', 'PortalCategory'), ('PortalCategorySelection', 'PortalCategorySelection'), ('PortalCategoryV2', 'PortalCategoryV2'), ('PortalComputer', 'PortalComputer'), ('PortalDefaultLinkTarget', 'PortalDefaultLinkTarget'), ('PortalEntries', 'PortalEntries'), ('PortalEntryLinkTarget', 'PortalEntryLinkTarget'), ('PortalEntrySelection', 'PortalEntrySelection'), ('PortalFontColor', 'PortalFontColor'), ('PortalLinks', 'PortalLinks'), ('PortalLinksPosition', 'PortalLinksPosition'), ('Portals', 'Portals'), ('PrintQuotaGroup', 'PrintQuotaGroup'), ('PrintQuotaGroupPerUser', 'PrintQuotaGroupPerUser'), ('PrintQuotaUser', 'PrintQuotaUser'), ('PrinterDriverList', 'PrinterDriverList'), ('PrinterNames', 'PrinterNames'), ('PrinterProducerList', 'PrinterProducerList'), ('PrinterProtocol', 'PrinterProtocol'), ('PrinterURI', 'PrinterURI'), ('Printers', 'Printers'), ('RadiusClientType', 'RadiusClientType'), ('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'), ('Upload', 'Upload'), ('UserDN', 'UserDN'), ('UserID', 'UserID'), ('UserMailAddress', 'UserMailAddress'), ('UserName', 'UserName'), ('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'), ('attributeMapping', 'attributeMapping'), ('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'), ('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'), ('samlserviceprovider', 'samlserviceprovider'), ('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]

univention.admin.types module

UDM type definitions.

class univention.admin.types.TypeHint(property, property_name)[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)[source]

Bases: univention.admin.types.TypeHint

class univention.admin.types.BooleanType(property, property_name)[source]

Bases: univention.admin.types.TypeHint

decode_value(value)[source]

Decode the value into a python object.

Note

suitable for subclassing.

class univention.admin.types.TriBooleanType(property, property_name)[source]

Bases: univention.admin.types.BooleanType

class univention.admin.types.IntegerType(property, property_name)[source]

Bases: univention.admin.types.TypeHint

decode_value(value)[source]

Decode the value into a python object.

Note

suitable for subclassing.

class univention.admin.types.NumberType(property, property_name)[source]

Bases: univention.admin.types.TypeHint

class univention.admin.types.StringType(property, property_name)[source]

Bases: univention.admin.types.TypeHint

decode_value(value)[source]

Decode the value into a python object.

Note

suitable for subclassing.

class univention.admin.types.Base64Type(property, property_name)[source]

Bases: univention.admin.types.StringType

class univention.admin.types.PasswordType(property, property_name)[source]

Bases: univention.admin.types.StringType

class univention.admin.types.DistinguishedNameType(property, property_name)[source]

Bases: univention.admin.types.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)[source]

Bases: univention.admin.types.StringType

class univention.admin.types.EMailAddressType(property, property_name)[source]

Bases: univention.admin.types.StringType

class univention.admin.types.BinaryType(property, property_name)[source]

Bases: univention.admin.types.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)[source]

Bases: univention.admin.types.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)[source]

Bases: univention.admin.types.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)[source]

Bases: univention.admin.types.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-01 00: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)[source]

Bases: univention.admin.types.TypeHint

class univention.admin.types.ListType(property, property_name)[source]

Bases: univention.admin.types.ArrayType

item_type = 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)[source]

Bases: univention.admin.types.ListType

class univention.admin.types.ListOfItems(property, property_name)[source]

Bases: univention.admin.types.ArrayType

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)[source]

Bases: univention.admin.types.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)[source]

Bases: univention.admin.types.DictionaryType

key_type = None
value_type = None
class univention.admin.types.SambaLogonHours(property, property_name)[source]

Bases: univention.admin.types.ListType

item_type

alias of univention.admin.types.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)[source]

Bases: univention.admin.types.KeyValueDictionaryType

key_type

alias of univention.admin.types.StringType

value_type

alias of univention.admin.types.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)[source]

Bases: univention.admin.types.IntegerType

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[source]

Bases: univention.admin.uexceptions.base

message = 'Object exists.'
exception univention.admin.uexceptions.noObject[source]

Bases: univention.admin.uexceptions.base

message = 'No such object.'
exception univention.admin.uexceptions.permissionDenied[source]

Bases: univention.admin.uexceptions.base

message = 'Permission denied.'
exception univention.admin.uexceptions.ldapError(*args, **kwargs)[source]

Bases: univention.admin.uexceptions.base

message = 'LDAP Error'
exception univention.admin.uexceptions.ldapTimeout[source]

Bases: univention.admin.uexceptions.base

message = 'The specified timeout for the LDAP search has been exceeded.'
exception univention.admin.uexceptions.ldapSizelimitExceeded[source]

Bases: univention.admin.uexceptions.base

message = 'The specified size limit for the LDAP search has been exceeded.'
exception univention.admin.uexceptions.insufficientInformation[source]

Bases: univention.admin.uexceptions.base

message = 'Information provided is not sufficient.'
exception univention.admin.uexceptions.noSuperordinate[source]

Bases: univention.admin.uexceptions.insufficientInformation

exception univention.admin.uexceptions.noProperty[source]

Bases: univention.admin.uexceptions.base

message = 'No such property.'
exception univention.admin.uexceptions.valueError(*args, **kwargs)[source]

Bases: univention.admin.uexceptions.base

exception univention.admin.uexceptions.valueMayNotChange(*args, **kwargs)[source]

Bases: univention.admin.uexceptions.valueError

message = 'Value may not change.'
exception univention.admin.uexceptions.valueInvalidSyntax(*args, **kwargs)[source]

Bases: univention.admin.uexceptions.valueError

message = 'Invalid syntax.'
exception univention.admin.uexceptions.valueRequired(*args, **kwargs)[source]

Bases: univention.admin.uexceptions.valueError

message = 'Value is required.'
exception univention.admin.uexceptions.valueMismatch(*args, **kwargs)[source]

Bases: univention.admin.uexceptions.valueError

message = 'Values do not match.'
exception univention.admin.uexceptions.noLock[source]

Bases: univention.admin.uexceptions.base

message = 'Could not acquire lock.'
exception univention.admin.uexceptions.authFail[source]

Bases: univention.admin.uexceptions.base

message = 'Authentication Failed.'
exception univention.admin.uexceptions.uidAlreadyUsed[source]

Bases: univention.admin.uexceptions.base

message = 'The username is already in use as username or as groupname'
exception univention.admin.uexceptions.sidAlreadyUsed[source]

Bases: univention.admin.uexceptions.base

message = 'The relative ID (SAMBA) is already in use.'
exception univention.admin.uexceptions.groupNameAlreadyUsed[source]

Bases: univention.admin.uexceptions.base

message = 'The groupname is already in use as groupname or as username'
exception univention.admin.uexceptions.uidNumberAlreadyUsedAsGidNumber[source]

Bases: univention.admin.uexceptions.base

message = 'The uidNumber is already in use as a gidNumber'
exception univention.admin.uexceptions.gidNumberAlreadyUsedAsUidNumber[source]

Bases: univention.admin.uexceptions.base

message = 'The gidNumber is already in use as a uidNumber'
exception univention.admin.uexceptions.adGroupTypeChangeLocalToAny[source]

Bases: univention.admin.uexceptions.base

message = 'The AD group type can not be changed from type local to any other type.'
exception univention.admin.uexceptions.adGroupTypeChangeToLocal[source]

Bases: univention.admin.uexceptions.base

message = 'The AD group type can not be changed to type local.'
exception univention.admin.uexceptions.adGroupTypeChangeGlobalToUniversal[source]

Bases: univention.admin.uexceptions.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: univention.admin.uexceptions.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: univention.admin.uexceptions.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: univention.admin.uexceptions.base

message = 'The AD group type can not be changed from global to domain local.'
exception univention.admin.uexceptions.adGroupTypeChangeDomainLocalToGlobal[source]

Bases: univention.admin.uexceptions.base

message = 'The AD group type can not be changed from domain local to global.'
exception univention.admin.uexceptions.prohibitedUsername[source]

Bases: univention.admin.uexceptions.base

message = 'Prohibited username.'
exception univention.admin.uexceptions.ipAlreadyUsed[source]

Bases: univention.admin.uexceptions.base

message = 'IP address is already in use.'
exception univention.admin.uexceptions.dnsAliasAlreadyUsed[source]

Bases: univention.admin.uexceptions.base

message = 'DNS alias is already in use.'
exception univention.admin.uexceptions.invalidDhcpEntry[source]

Bases: univention.admin.uexceptions.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: univention.admin.uexceptions.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: univention.admin.uexceptions.base

message = 'The provided DNS information are invalid.'
exception univention.admin.uexceptions.nextFreeIp[source]

Bases: univention.admin.uexceptions.base

message = 'Next IP address not found.'
exception univention.admin.uexceptions.ipOverridesNetwork[source]

Bases: univention.admin.uexceptions.base

message = 'The given IP address is not within the range of the selected network'
exception univention.admin.uexceptions.macAlreadyUsed[source]

Bases: univention.admin.uexceptions.base

message = 'The MAC address is already in use.'
exception univention.admin.uexceptions.mailAddressUsed[source]

Bases: univention.admin.uexceptions.base

message = 'The mail address is already in use.'
exception univention.admin.uexceptions.dhcpServerAlreadyUsed[source]

Bases: univention.admin.uexceptions.base

message = 'DHCP server name already used: '
exception univention.admin.uexceptions.kolabHomeServer[source]

Bases: univention.admin.uexceptions.base

message = 'Default Kolab home server does not exist'
exception univention.admin.uexceptions.primaryGroup[source]

Bases: univention.admin.uexceptions.base

message = 'Default primary group does not exist'
exception univention.admin.uexceptions.primaryGroupUsed[source]

Bases: univention.admin.uexceptions.base

message = 'This is a primary group.'
exception univention.admin.uexceptions.homeShareUsed[source]

Bases: univention.admin.uexceptions.base

message = ''
exception univention.admin.uexceptions.groupNotFound[source]

Bases: univention.admin.uexceptions.base

message = 'The requested group not be found.'
exception univention.admin.uexceptions.dhcpNotFound[source]

Bases: univention.admin.uexceptions.base

message = 'The DHCP entry was not found.'
exception univention.admin.uexceptions.dnsNotFound[source]

Bases: univention.admin.uexceptions.base

message = 'The DNS entry was not found'
exception univention.admin.uexceptions.commonNameTooLong[source]

Bases: univention.admin.uexceptions.base

message = 'The FQDN of this object is too long, it must have less than 64 characters.'
exception univention.admin.uexceptions.missingInformation[source]

Bases: univention.admin.uexceptions.base

message = 'Not all needed information was entered.'
exception univention.admin.uexceptions.policyFixedAttribute[source]

Bases: univention.admin.uexceptions.base

message = 'Cannot overwrite a fixed attribute.'
exception univention.admin.uexceptions.bootpXORFailover[source]

Bases: univention.admin.uexceptions.base

message = 'Dynamic BOOTP leases are not compatible with failover.'
exception univention.admin.uexceptions.licenseNotFound[source]

Bases: univention.admin.uexceptions.base

message = 'No license found.'
exception univention.admin.uexceptions.licenseInvalid[source]

Bases: univention.admin.uexceptions.base

message = 'The license is invalid.'
exception univention.admin.uexceptions.licenseExpired[source]

Bases: univention.admin.uexceptions.base

message = 'The license is expired.'
exception univention.admin.uexceptions.licenseWrongBaseDn[source]

Bases: univention.admin.uexceptions.base

message = 'The license is invalid for the current base DN.'
exception univention.admin.uexceptions.licenseCoreEdition[source]

Bases: univention.admin.uexceptions.base

message = 'UCS Core Edition.'
exception univention.admin.uexceptions.freeForPersonalUse[source]

Bases: univention.admin.uexceptions.base

message = 'Free for personal use edition.'
exception univention.admin.uexceptions.licenseAccounts[source]

Bases: univention.admin.uexceptions.base

message = 'Too many user accounts'
exception univention.admin.uexceptions.licenseClients[source]

Bases: univention.admin.uexceptions.base

message = 'Too many client accounts'
exception univention.admin.uexceptions.licenseDesktops[source]

Bases: univention.admin.uexceptions.base

message = 'Too many desktop accounts'
exception univention.admin.uexceptions.licenseGroupware[source]

Bases: univention.admin.uexceptions.base

message = 'Too many groupware accounts'
exception univention.admin.uexceptions.licenseUsers[source]

Bases: univention.admin.uexceptions.base

message = 'Too many users'
exception univention.admin.uexceptions.licenseServers[source]

Bases: univention.admin.uexceptions.base

message = 'Too many servers'
exception univention.admin.uexceptions.licenseManagedClients[source]

Bases: univention.admin.uexceptions.base

message = 'Too many managed clients'
exception univention.admin.uexceptions.licenseCorporateClients[source]

Bases: univention.admin.uexceptions.base

message = 'Too many corporate clients'
exception univention.admin.uexceptions.licenseDVSUsers[source]

Bases: univention.admin.uexceptions.base

message = 'Too many DVS users'
exception univention.admin.uexceptions.licenseDVSClients[source]

Bases: univention.admin.uexceptions.base

message = 'Too many DVS clients'
exception univention.admin.uexceptions.licenseDisableModify[source]

Bases: univention.admin.uexceptions.base

message = 'During this session add and modify are disabled'
exception univention.admin.uexceptions.pwalreadyused[source]

Bases: univention.admin.uexceptions.base

message = 'Password has been used before. Please choose a different one.'
exception univention.admin.uexceptions.passwordLength[source]

Bases: univention.admin.uexceptions.base

message = 'The password is too short, at least 8 character!'
exception univention.admin.uexceptions.rangeNotInNetwork[source]

Bases: univention.admin.uexceptions.base

message = 'Network and IP range are incompatible.'
exception univention.admin.uexceptions.rangeInNetworkAddress[source]

Bases: univention.admin.uexceptions.base

message = 'The IP range contains its network address. That is not permitted!'
exception univention.admin.uexceptions.rangeInBroadcastAddress[source]

Bases: univention.admin.uexceptions.base

message = 'The IP range contains its broadcast address. That is not permitted!'
exception univention.admin.uexceptions.rangesOverlapping[source]

Bases: univention.admin.uexceptions.base

message = 'Overlapping IP ranges'
exception univention.admin.uexceptions.invalidOptions[source]

Bases: univention.admin.uexceptions.base

message = 'Invalid combination of options.'
exception univention.admin.uexceptions.pwToShort[source]

Bases: univention.admin.uexceptions.base

message = 'Password policy error: '
exception univention.admin.uexceptions.pwQuality[source]

Bases: univention.admin.uexceptions.base

message = 'Password policy error: '
exception univention.admin.uexceptions.invalidOperation[source]

Bases: univention.admin.uexceptions.base

message = 'This operation is not allowed on this object.'
exception univention.admin.uexceptions.emptyPrinterGroup[source]

Bases: univention.admin.uexceptions.base

message = 'Empty printer groups are not possible.'
exception univention.admin.uexceptions.leavePrinterGroup[source]

Bases: univention.admin.uexceptions.base

message = 'Printer groups with quota support can only have members with quota support.'
exception univention.admin.uexceptions.notValidPrinter[source]

Bases: univention.admin.uexceptions.base

message = 'Only printer objects can be members of a printer group.'
exception univention.admin.uexceptions.notValidGroup[source]

Bases: univention.admin.uexceptions.base

message = 'Only existing groups are allowed.'
exception univention.admin.uexceptions.notValidUser[source]

Bases: univention.admin.uexceptions.base

message = 'Only existing users are allowed.'
exception univention.admin.uexceptions.templateSyntaxError(templates)[source]

Bases: univention.admin.uexceptions.base

message = 'Invalid syntax in default value. Check these templates: %s.'
exception univention.admin.uexceptions.nagiosTimeperiodUsed[source]

Bases: univention.admin.uexceptions.base

message = 'Timeperiod Object still in use!'
exception univention.admin.uexceptions.nagiosARecordRequired[source]

Bases: univention.admin.uexceptions.base

message = 'IP address entry required to assign Nagios services!'
exception univention.admin.uexceptions.nagiosDNSForwardZoneEntryRequired[source]

Bases: univention.admin.uexceptions.base

message = 'DNS Forward Zone entry required to assign Nagios services!'
exception univention.admin.uexceptions.dnsAliasRecordExists[source]

Bases: univention.admin.uexceptions.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: univention.admin.uexceptions.base

message = 'Circular group dependency detected: '
exception univention.admin.uexceptions.invalidChild[source]

Bases: univention.admin.uexceptions.base

exception univention.admin.uexceptions.primaryGroupWithoutSamba[source]

Bases: univention.admin.uexceptions.base

message = 'Need a primary group with samba option to create a user with samba option'
exception univention.admin.uexceptions.wrongObjectType[source]

Bases: univention.admin.uexceptions.base

message = 'The object type of this object differs from the specified object type.'
exception univention.admin.uexceptions.noKerberosRealm[source]

Bases: univention.admin.uexceptions.base

message = 'There was no valid kerberos realm found.'
exception univention.admin.uexceptions.alreadyUsedInSubtree[source]

Bases: univention.admin.uexceptions.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)[source]

Bases: object

A LDAP Distinguished Name.

classmethod set(values)[source]
>>> len(DN.set(['CN=computers,dc=foo', 'cn=computers,dc=foo', 'cn = computers,dc=foo']))
1
classmethod values(values)[source]
>>> DN.values(DN.set(['cn=foo', 'cn=bar']) - DN.set(['cn = foo'])) == {'cn=bar'}
True
univention.admin.uldap.getBaseDN(host='localhost', port=None, uri=None)[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.

Return type

str

univention.admin.uldap.getAdminConnection(start_tls=2, decode_ignorelist=[])[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.

  • decode_ignorelist (list[str]) – List of LDAP attribute names which shall be handled as binary attributes.

Returns

A 2-tuple (LDAP-access, LDAP-position)

Return type

tuple[univention.admin.uldap.access, univention.admin.uldap.position]

univention.admin.uldap.getMachineConnection(start_tls=2, decode_ignorelist=[], ldap_master=True)[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.

  • decode_ignorelist (list[str]) – List of LDAP attribute names which shall be handled as binary attributes.

  • 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)

Return type

tuple[univention.admin.uldap.access, univention.admin.uldap.position]

class univention.admin.uldap.domain(lo, position)[source]

Bases: object

A UDM domain name.

Parameters
getKerberosRealm()[source]

Return the name of the Kerberos realms.

Returns

The name of the Kerberos realm.

Return type

str

class univention.admin.uldap.position(base, loginDomain='')[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)[source]

Set a new base distinguished name.

Parameters

base (str) – The new base distinguished name.

setLoginDomain(loginDomain)[source]

Set a new login domain name.

Parameters

loginDomain (str) – The new login domain name.

getDn()[source]

Return the distinguished name.

Returns

The absolute DN.

Return type

str

setDn(dn)[source]

Set a new distinguished name.

Parameters

dn (str) – The new distinguished name.

getRdn()[source]

Return the distinguished name relative to the LDAP base.

Returns

The relative DN.

Return type

str

getBase()[source]

Return the LDAP base DN.

Returns

The distinguished name of the LDAP base.

Return type

str

isBase()[source]

Check if the position equals the LDAP base DN.

Returns

True if the position equals the base DN, False otherwise.

Return type

bool

getDomain()[source]

Return the distinguished name of the domain part of the position.

Returns

The distinguished name.

Return type

str

getDomainConfigBase()[source]

Return the distinguished name of the configuration container.

Returns

The distinguished name.

Return type

str

isDomain()[source]

Check if the position equals the domain DN.

Returns

True if the position equals the domain DN, False otherwise.

Return type

bool

getLoginDomain()[source]

Return the login domain name.

Returns

The login domain name.

Return type

str

switchToParent()[source]

Switch position to parent container.

Returns

False if already at the Base, True otherwise.

Return type

bool

class univention.admin.uldap.access(host='localhost', port=None, base='', binddn='', bindpw='', start_tls=2, lo=None, follow_referral=False)[source]

Bases: object

A UDM class to access a LDAP server.

Parameters
  • host (str) – The hostname of the LDAP server.

  • port (int) – The TCP port number of the LDAP server.

  • base (str) – The base distinguished name.

  • binddn (str) – The distinguished name of the account.

  • bindpw (str) – The user password for simple authentication.

  • start_tls (int) – Negotiate TLS with server. If 2 is given, the command will require the operation to be successful.

  • lo (univention.uldap.access) – LDAP connection.

Param:bool follow_referral

Follow LDAP referrals.

property binddn

Return the distinguished name of the account.

Returns

The distinguished name of the account (or None with SAML).

Return type

str

property bindpw

Return the user password or credentials.

Returns

The user password or credentials.

Return type

str

property host

Return the host name of the LDAP server.

Returns

the host name of the LDAP server.

Return type

str

property port

Return the TCP port number of the LDAP server.

Returns

the TCP port number of the LDAP server.

Return type

int

property base

Return the LDAP base of the LDAP server.

Returns

the LDAP base of the LDAP server.

Return type

str

property start_tls
bind(binddn, bindpw)[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)[source]

Do LDAP bind using SAML message.

Parameters

bindpw (str) – The SAML authentication cookie.

unbind()[source]

Unauthenticate.

whoami()[source]

Return the distinguished name of the authenticated user.

Returns

The distinguished name.

Return type

str

requireLicense(require=True)[source]

Enable or disable the UCS licence check.

Parameters

require (bool) – True to require a valid licence.

get_schema()[source]

Retrieve LDAP schema information from LDAP server.

Returns

The LDAP schema.

Return type

ldap.schema.subentry.SubSchema

classmethod compare_dn(a, b)[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.

Return type

bool

get(dn, attr=[], required=False, exceptions=False)[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.

Return type

dict[str, list[str]]

Raises

ldap.NO_SUCH_OBJECT – If the LDAP object is not accessible.

getAttr(dn, attr, required=False, exceptions=False)[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.

Return type

list[bytes]

Raises

ldap.NO_SUCH_OBJECT – If the LDAP object is not accessible.

search(filter='(objectClass=*)', base='', scope='sub', attr=[], unique=False, required=False, timeout=- 1, sizelimit=0, serverctrls=None, response=None)[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 (list[str]) – 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 (list[ldap.controls.LDAPControl]) – 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.

Return type

list[tuple[str, dict[str, list[str]]]]

Raises
searchDn(filter='(objectClass=*)', base='', scope='sub', unique=False, required=False, timeout=- 1, sizelimit=0, serverctrls=None, response=None)[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 (list[ldap.controls.LDAPControl]) – 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.

Return type

list[str]

Raises
getPolicies(dn, policies=None, attrs=None, result=None, fixedattrs=None)[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, al, exceptions=False, serverctrls=None, response=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 (list[ldap.controls.LDAPControl]) – 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.

Raises
modify(dn, changes, exceptions=False, ignore_license=False, serverctrls=None, response=None, rename_callback=None)[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 (list[ldap.controls.LDAPControl]) – 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.

Return type

str

rename(dn, newdn, move_childs=0, ignore_license=False, serverctrls=None, response=None)[source]

Rename a LDAP object.

Parameters
  • dn (str) – The old distinguished name of the object to rename.

  • newdn (str) – The new distinguished name of the object to rename.

  • move_childs (int) – Also rename the sub children. Must be 0 always as 1 is not implemented.

  • ignore_license (bool) – Ignore license check if True.

  • serverctrls (list[ldap.controls.LDAPControl]) – 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.

delete(dn, exceptions=False)[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)[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.

Return type

str or None

explodeDn(dn, notypes=False)[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.

Return type

list[str]