示例#1
0
        advanced=True,
        layout=[['unixhome', 'shell']]),
    Tab(_('Groups'),
        _('Group memberships'),
        advanced=True,
        layout=[
            'groups',
        ]),
    Tab(_('DNS alias'),
        _('Alias DNS entry'),
        advanced=True,
        layout=['dnsEntryZoneAlias']),
]

mapping = univention.admin.mapping.mapping()
mapping.register('name', 'cn', None, univention.admin.mapping.ListToString)
mapping.register('description', 'description', None,
                 univention.admin.mapping.ListToString)
mapping.register('domain',
                 'associatedDomain',
                 None,
                 univention.admin.mapping.ListToString,
                 encoding='ASCII')
mapping.register('inventoryNumber', 'univentionInventoryNumber')
mapping.register('mac', 'macAddress', encoding='ASCII')
mapping.register('network', 'univentionNetworkLink', None,
                 univention.admin.mapping.ListToString)
mapping.register('unixhome', 'homeDirectory', None,
                 univention.admin.mapping.ListToString)
mapping.register('shell',
                 'loginShell',
示例#2
0
        ]),
]


def unmapLocked(oldattr):
    if isLDAPLocked(oldattr):
        return u'1'
    return u'0'


def isLDAPLocked(oldattr):
    return bool(oldattr.get('pwdAccountLockedTime', [b''])[0])


mapping = univention.admin.mapping.mapping()
mapping.register('username', 'uid', None,
                 univention.admin.mapping.ListToString)
mapping.register('lastname', 'sn', None, univention.admin.mapping.ListToString)
mapping.register('name', 'cn', None, univention.admin.mapping.ListToString)
mapping.register('description', 'description', None,
                 univention.admin.mapping.ListToString)
mapping.register('password', 'userPassword',
                 univention.admin.mapping.dontMap(),
                 univention.admin.mapping.ListToString)

mapping.registerUnmapping('locked', unmapLocked)


class object(univention.admin.handlers.simpleLdap):
    module = module

    password_length = 8
		syntax=univention.admin.syntax.string,
		multivalue=True,
		include_in_default_search=True,
	),
	'fqdn': univention.admin.property(
		short_description='FQDN',
		long_description='',
		syntax=univention.admin.syntax.string,
		include_in_default_search=True,
		may_change=False,
		dontsearch=True
	)
}

mapping = univention.admin.mapping.mapping()
mapping.register('name', 'cn', None, univention.admin.mapping.ListToString)
mapping.register('description', 'description', None, univention.admin.mapping.ListToString)
mapping.register('inventoryNumber', 'univentionInventoryNumber')
mapping.register('mac', 'macAddress', encoding='ASCII')


class object(univention.admin.handlers.simpleLdap):
	module = module

	def open(self):
		super(object, self).open()
		if 'name' in self.info and 'domain' in self.info:
			# in syntax.py IComputer_FQDN key and label are '%(name)s.%(domain)s' for
			#   performance reasons. These statements and this fqdn over here have to
			#   be in sync.
			self['fqdn'] = '%s.%s' % (self['name'], self['domain'])
示例#4
0

def list2str(lst):
    """Convert list to comma separated string."""
    return ','.join(lst)


def str2list(value):
    """Split comma separated string into list."""
    if value:
        return value[0].split(',')
    return []


mapping = univention.admin.mapping.mapping()
mapping.register('name', 'cn', None, univention.admin.mapping.ListToString)
mapping.register('name_prefix', 'univentionVirtualMachineProfileNamePrefix',
                 None, univention.admin.mapping.ListToString)
mapping.register('arch', 'univentionVirtualMachineProfileArch', None,
                 univention.admin.mapping.ListToString)
mapping.register('cpus', 'univentionVirtualMachineProfileCPUs', None,
                 univention.admin.mapping.ListToString)
mapping.register('virttech', 'univentionVirtualMachineProfileVirtTech', None,
                 univention.admin.mapping.ListToString)
mapping.register('ram', 'univentionVirtualMachineProfileRAM', None,
                 univention.admin.mapping.ListToString)
mapping.register('diskspace', 'univentionVirtualMachineProfileDiskspace', None,
                 univention.admin.mapping.ListToString)
mapping.register('drivercache', 'univentionVirtualMachineProfileDriverCache',
                 None, univention.admin.mapping.ListToString)
mapping.register('vnc', 'univentionVirtualMachineProfileVNC', None,
		required=True,
		dontsearch=True,
	),
}

layout = [
	Tab(_('General'), _('Basic values'), layout=[
		Group(_('Trust account'), layout=[
			["name", "description"],
			"password"
		]),
	]),
]

mapping = univention.admin.mapping.mapping()
mapping.register('name', 'cn', None, univention.admin.mapping.ListToString)
mapping.register('description', 'description', None, univention.admin.mapping.ListToString)


class object(univention.admin.handlers.simpleLdap):
	module = module

	def open(self):
		super(object, self).open()

		self.options = ['samba']  # FIXME/TODO
		self.modifypassword = 1
		if self.exists():
			self['password'] = '******'
			self.modifypassword = 0
示例#6
0
文件: profile.py 项目: B-Rich/smart

def list2str(lst):
	"""Convert list to comma separated string."""
	return ','.join(lst)


def str2list(value):
	"""Split comma separated string into list."""
	if value:
		return value[0].split(',')
	return []


mapping = univention.admin.mapping.mapping()
mapping.register('name', 'cn', None, univention.admin.mapping.ListToString)
mapping.register('name_prefix', 'univentionVirtualMachineProfileNamePrefix', None, univention.admin.mapping.ListToString)
mapping.register('arch', 'univentionVirtualMachineProfileArch', None, univention.admin.mapping.ListToString)
mapping.register('cpus', 'univentionVirtualMachineProfileCPUs', None, univention.admin.mapping.ListToString)
mapping.register('virttech', 'univentionVirtualMachineProfileVirtTech', None, univention.admin.mapping.ListToString)
mapping.register('ram', 'univentionVirtualMachineProfileRAM', None, univention.admin.mapping.ListToString)
mapping.register('diskspace', 'univentionVirtualMachineProfileDiskspace', None, univention.admin.mapping.ListToString)
mapping.register('drivercache', 'univentionVirtualMachineProfileDriverCache', None, univention.admin.mapping.ListToString)
mapping.register('vnc', 'univentionVirtualMachineProfileVNC', None, univention.admin.mapping.ListToString)
mapping.register('interface', 'univentionVirtualMachineProfileInterface', None, univention.admin.mapping.ListToString)
mapping.register('kblayout', 'univentionVirtualMachineProfileKBLayout', None, univention.admin.mapping.ListToString)
mapping.register('kernel', 'univentionVirtualMachineProfileKernel', None, univention.admin.mapping.ListToString)
mapping.register('kernel_parameter', 'univentionVirtualMachineProfileKernelParameter', None, univention.admin.mapping.ListToString)
mapping.register('initramfs', 'univentionVirtualMachineProfileInitRAMfs', None, univention.admin.mapping.ListToString)
mapping.register('advkernelconf', 'univentionVirtualMachineAdvancedKernelConfig', None, univention.admin.mapping.ListToString)
mapping.register('bootdev', 'univentionVirtualMachineProfileBootDevices', list2str, str2list )
            Group(_('DHCP'), layout=['dhcpEntryZone']),
        ]),
    Tab(_('Groups'),
        _('Group memberships'),
        advanced=True,
        layout=[
            "groups",
        ]),
    Tab(_('DNS alias'),
        _('Alias DNS entry'),
        advanced=True,
        layout=['dnsEntryZoneAlias']),
]

mapping = univention.admin.mapping.mapping()
mapping.register('name', 'cn', None, univention.admin.mapping.ListToString)
mapping.register('description', 'description', None,
                 univention.admin.mapping.ListToString)
mapping.register('inventoryNumber', 'univentionInventoryNumber')
mapping.register('mac', 'macAddress', encoding='ASCII')
mapping.register('network', 'univentionNetworkLink', None,
                 univention.admin.mapping.ListToString)
mapping.register('domain',
                 'associatedDomain',
                 None,
                 univention.admin.mapping.ListToString,
                 encoding='ASCII')

# add Nagios extension
nagios.addPropertiesMappingOptionsAndLayout(property_descriptions, mapping,
                                            options, layout)