# -*- coding: utf-8 -*-
#
# Copyright 2004-2022 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of this program provided by Univention to you as
# well as other copyrighted, protected or trademarked materials like
# Logos, graphics, fonts, specific documentations and configurations,
# cryptographic keys etc. are subject to a license agreement between
# you and Univention and not subject to the GNU AGPL V3.
#
# In the case you use this program under the terms of the GNU AGPL V3,
# the program is provided in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License with the Debian GNU/Linux or Univention distribution in file
# /usr/share/common-licenses/AGPL-3; if not, see
# <https://www.gnu.org/licenses/>.
"""
|UDM| exceptions.
"""
from univention.admin import localization
from univention.admin._ucr import configRegistry
translation = localization.translation('univention/admin')
_ = translation.translate
[docs]class base(Exception):
message = ''
[docs]class objectExists(base):
message = _('Object exists.')
[docs]class noObject(base):
message = _('No such object.')
[docs]class permissionDenied(base):
message = _('Permission denied.')
[docs]class ldapError(base):
message = _('LDAP Error')
def __init__(self, *args, **kwargs):
self.original_exception = kwargs.pop('original_exception', None)
super(ldapError, self).__init__(*args, **kwargs)
[docs]class ldapTimeout(base):
message = _('The specified timeout for the LDAP search has been exceeded.')
[docs]class ldapSizelimitExceeded(base):
message = _('The specified size limit for the LDAP search has been exceeded.')
[docs]class noSuperordinate(insufficientInformation):
pass
[docs]class noProperty(base):
message = _('No such property.')
[docs]class valueError(base):
def __init__(self, *args, **kwargs):
self.property = kwargs.pop('property', None)
super(valueError, self).__init__(*args, **kwargs)
[docs]class valueMayNotChange(valueError):
message = _('Value may not change.')
[docs]class valueInvalidSyntax(valueError):
message = _('Invalid syntax.')
[docs]class valueRequired(valueError):
message = _('Value is required.')
[docs]class valueMismatch(valueError):
message = _('Values do not match.')
[docs]class noLock(base):
message = _('Could not acquire lock.')
[docs]class authFail(base):
message = _('Authentication Failed.')
[docs]class uidAlreadyUsed(base):
if configRegistry.is_true('directory/manager/user_group/uniqueness', True):
message = _('The username is already in use as username or as groupname')
else:
message = _('The username is already in use')
[docs]class sidAlreadyUsed(base):
message = _('The relative ID (SAMBA) is already in use.')
[docs]class groupNameAlreadyUsed(base):
if configRegistry.is_true('directory/manager/user_group/uniqueness', True):
message = _('The groupname is already in use as groupname or as username')
else:
message = _('The groupname is already in use')
[docs]class uidNumberAlreadyUsedAsGidNumber(base):
message = _('The uidNumber is already in use as a gidNumber')
[docs]class gidNumberAlreadyUsedAsUidNumber(base):
message = _('The gidNumber is already in use as a uidNumber')
[docs]class adGroupTypeChangeLocalToAny(base):
message = _('The AD group type can not be changed from type local to any other type.')
[docs]class adGroupTypeChangeToLocal(base):
message = _('The AD group type can not be changed to type local.')
[docs]class adGroupTypeChangeGlobalToUniversal(base):
message = _('The AD group type can not be changed from global to universal, because the group is member of another global group.')
[docs]class adGroupTypeChangeDomainLocalToUniversal(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.")
[docs]class adGroupTypeChangeUniversalToGlobal(base):
message = _("The AD group type can not be changed from universal to global, because the group has another universal group as member.")
[docs]class adGroupTypeChangeGlobalToDomainLocal(base):
message = _("The AD group type can not be changed from global to domain local.")
[docs]class adGroupTypeChangeDomainLocalToGlobal(base):
message = _("The AD group type can not be changed from domain local to global.")
[docs]class prohibitedUsername(base):
message = _('Prohibited username.')
[docs]class ipAlreadyUsed(base):
message = _('IP address is already in use.')
[docs]class dnsAliasAlreadyUsed(base):
message = _('DNS alias is already in use.')
[docs]class invalidDhcpEntry(base):
message = _('The DHCP entry for this host should contain the zone DN, the IP address and the MAC address.')
[docs]class invalidDNSAliasEntry(base):
message = _('The DNS alias entry for this host should contain the zone name, the alias zone container DN and the alias.')
[docs]class nextFreeIp(base):
message = _('Next IP address not found.')
[docs]class ipOverridesNetwork(base):
message = _('The given IP address is not within the range of the selected network')
[docs]class macAlreadyUsed(base):
message = _('The MAC address is already in use.')
[docs]class mailAddressUsed(base):
message = _('The mail address is already in use.')
[docs]class dhcpServerAlreadyUsed(base):
message = _('DHCP server name already used: ')
[docs]class kolabHomeServer(base):
message = _('Default Kolab home server does not exist')
[docs]class primaryGroup(base):
message = _('Default primary group does not exist')
[docs]class primaryGroupUsed(base):
message = _('This is a primary group.')
[docs]class homeShareUsed(base):
message = ''
[docs]class groupNotFound(base):
message = _('The requested group not be found.')
[docs]class dhcpNotFound(base):
message = _('The DHCP entry was not found.')
[docs]class dnsNotFound(base):
message = _('The DNS entry was not found')
[docs]class policyFixedAttribute(base):
message = _('Cannot overwrite a fixed attribute.')
[docs]class bootpXORFailover(base):
message = _('Dynamic BOOTP leases are not compatible with failover.')
[docs]class licenseNotFound(base):
message = _('No license found.')
[docs]class licenseInvalid(base):
message = _('The license is invalid.')
[docs]class licenseExpired(base):
message = _('The license is expired.')
[docs]class licenseWrongBaseDn(base):
message = _('The license is invalid for the current base DN.')
[docs]class licenseCoreEdition(base):
message = 'UCS Core Edition.'
[docs]class freeForPersonalUse(base):
message = 'Free for personal use edition.'
[docs]class licenseAccounts(base):
message = _('Too many user accounts')
[docs]class licenseClients(base):
message = _('Too many client accounts')
[docs]class licenseDesktops(base):
message = _('Too many desktop accounts')
[docs]class licenseGroupware(base):
message = _('Too many groupware accounts')
[docs]class licenseUsers(base):
message = _('Too many users')
[docs]class licenseServers(base):
message = _('Too many servers')
[docs]class licenseManagedClients(base):
message = _('Too many managed clients')
[docs]class licenseCorporateClients(base):
message = _('Too many corporate clients')
[docs]class licenseDVSUsers(base):
message = _('Too many DVS users')
[docs]class licenseDVSClients(base):
message = _('Too many DVS clients')
[docs]class licenseDisableModify(base):
message = _('During this session add and modify are disabled')
[docs]class pwalreadyused(base):
message = _('Password has been used before. Please choose a different one.')
[docs]class passwordLength(base):
message = _('The password is too short, at least 8 character!')
[docs]class rangeNotInNetwork(base):
message = _('Network and IP range are incompatible.')
[docs]class rangeInNetworkAddress(base):
message = _('The IP range contains its network address. That is not permitted!')
[docs]class rangeInBroadcastAddress(base):
message = _('The IP range contains its broadcast address. That is not permitted!')
[docs]class rangesOverlapping(base):
message = _('Overlapping IP ranges')
[docs]class invalidOptions(base):
message = _('Invalid combination of options.')
[docs]class pwToShort(base):
message = _('Password policy error: ')
[docs]class pwQuality(base):
message = _('Password policy error: ')
[docs]class invalidOperation(base):
message = _('This operation is not allowed on this object.')
[docs]class emptyPrinterGroup(base):
message = _('Empty printer groups are not possible.')
[docs]class leavePrinterGroup(base):
message = _('Printer groups with quota support can only have members with quota support.')
[docs]class notValidPrinter(base):
message = _('Only printer objects can be members of a printer group.')
[docs]class notValidGroup(base):
message = _('Only existing groups are allowed.')
[docs]class notValidUser(base):
message = _('Only existing users are allowed.')
[docs]class templateSyntaxError(base):
message = _('Invalid syntax in default value. Check these templates: %s.')
def __init__(self, templates):
self.templates = templates
[docs]class nagiosTimeperiodUsed(base):
message = _('Timeperiod Object still in use!')
[docs]class nagiosARecordRequired(base):
message = _('IP address entry required to assign Nagios services!')
[docs]class nagiosDNSForwardZoneEntryRequired(base):
message = _('DNS Forward Zone entry required to assign Nagios services!')
[docs]class dnsAliasRecordExists(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.')
[docs]class circularGroupDependency(base):
message = _('Circular group dependency detected: ')
[docs]class invalidChild(base):
pass
[docs]class primaryGroupWithoutSamba(base):
message = _('Need a primary group with samba option to create a user with samba option')
[docs]class wrongObjectType(base):
message = _('The object type of this object differs from the specified object type.')
[docs]class noKerberosRealm(base):
message = _('There was no valid kerberos realm found.')
[docs]class alreadyUsedInSubtree(base):
message = _('An object with the name already exists in the subtree position')