web2ldap  1.7.7
About: web2ldap is a full-featured web-based LDAPv3 client.
  Fossies Dox: web2ldap-1.7.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

apple.py
Go to the documentation of this file.
1# -*- coding: ascii -*-
2"""
3web2ldap plugin classes for attributes defined in apple.schema
4"""
5
6from ...web.forms import Field
7from ..searchform import SEARCH_OPT_IS_EQUAL
8from ..schema.syntaxes import (
9 XmlValue,
10 UUID,
11 DynamicValueSelectList,
12 syntax_registry,
13)
14
15
16syntax_registry.reg_at(
17 UUID.oid, [
18 '1.3.6.1.4.1.63.1000.1.1.1.1.20', # apple-generateduid
19 ]
20)
21
22
24 oid: str = 'UUIDReference-oid'
25 ldap_url = 'ldap:///_?apple-generateduid,entryDN?sub?(apple-generateduid=*)'
26
27 def display(self, vidx, links) -> str:
28 value_disp = self._app.form.s2d(self.av_u)
29 return ' '.join((
30 value_disp,
31 self._app.anchor(
32 'searchform', '»',
33 (
34 ('dn', self._dn),
35 ('searchform_mode', 'adv'),
36 ('search_attr', 'apple-generateduid'),
37 ('search_option', SEARCH_OPT_IS_EQUAL),
38 ('search_string', value_disp),
39 ),
40 title='Search entry by UUID',
41 )
42 ))
43
44 def input_field(self) -> Field:
45 return DynamicValueSelectList.input_field(self)
46
47syntax_registry.reg_at(
48 UUIDReference.oid, [
49 '1.3.6.1.4.1.63.1000.1.1.1.14.7', # apple-group-memberguid
50 '1.3.6.1.4.1.63.1000.1.1.1.14.10', # apple-ownerguid
51 ]
52)
53
54
55syntax_registry.reg_at(
56 XmlValue.oid, [
57 '1.3.6.1.4.1.63.1000.1.1.1.19.6', # apple-serviceinfo
58 '1.3.6.1.4.1.63.1000.1.1.1.17.1', # apple-xmlplist
59 '1.3.6.1.4.1.63.1000.1.1.1.14.8', # apple-group-services
60 '1.3.6.1.4.1.63.1000.1.1.1.1.9', # apple-user-mailattribute
61 '1.3.6.1.4.1.63.1000.1.1.1.1.10', # apple-mcxflags
62 '1.3.6.1.4.1.63.1000.1.1.1.1.16', # apple-mcxsettings, apple-mcxsettings2
63 '1.3.6.1.4.1.63.1000.1.1.1.1.13', # apple-user-printattribute
64 ]
65)
66
67
68# Register all syntax classes in this module
69syntax_registry.reg_syntaxes(__name__)
str display(self, vidx, links)
Definition: apple.py:27