Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hemio e. V.
edentata
Commits
fd4b9c7b
Commit
fd4b9c7b
authored
Nov 07, 2015
by
Michael Herold
Browse files
Adds support for NS, SSHFP and TXT records (
#19
)
parent
28a1508c
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
fd4b9c7b
v0.6.0-unreleased
- Fixes missing unicode support for requests.
- [dns] Adds support for NS, SSHFP and TXT resource records
v0.5.0
- Fixes missing generation of global gettext .mo-files.
This fixes missing l10n in top bar also.
...
...
src/module/dns/CustomCreate.php
View file @
fd4b9c7b
...
...
@@ -35,7 +35,10 @@ class CustomCreate extends Window
'AAAA'
=>
[
'address'
],
'CNAME'
=>
[
'cname'
],
'MX'
=>
[
'priority'
,
'exchange'
],
'SRV'
=>
[
'service'
,
'proto'
,
'priority'
,
'weight'
,
'port'
,
'target'
]
'NS'
=>
[
'nsdname'
],
'SRV'
=>
[
'service'
,
'proto'
,
'priority'
,
'weight'
,
'port'
,
'target'
],
'SSHFP'
=>
[
'algorithm'
,
'fptype'
,
'fingerprint'
],
'TXT'
=>
[
'txtdata'
]
];
public
function
content
(
$domain
,
$type
)
...
...
@@ -46,24 +49,30 @@ class CustomCreate extends Window
return
$this
->
details
(
$domain
,
$type
);
}
p
rotected
function
type
(
$domain
)
p
ublic
static
function
type
s
()
{
$window
=
$this
->
newWindow
(
_
(
'New Custom DNS Record'
)
,
$domain
,
_
(
'Create'
)
);
$types
=
[
return
[
'A'
=>
_
(
'Host Address (IPv4)'
),
'AAAA'
=>
_
(
'Host Address (IPv6)'
),
'CNAME'
=>
_
(
'Canonical Name for an Alias'
),
'MX'
=>
_
(
'Mail Exchange'
),
'SRV'
=>
_
(
'Service Locator'
)
'NS'
=>
_
(
'Authoritative Name Server'
),
'SRV'
=>
_
(
'Service Locator'
),
'SSHFP'
=>
_
(
'SSH Fingerprint'
),
'TXT'
=>
_
(
'Text String'
)
];
}
protected
function
type
(
$domain
)
{
$window
=
$this
->
newWindow
(
_
(
'New Custom DNS Record'
)
,
$domain
,
_
(
'Create'
)
);
$list
=
new
gui\Listbox
();
foreach
(
$
types
as
$type
=>
$desc
)
foreach
(
self
::
types
()
as
$type
=>
$desc
)
$list
->
addLinkEntry
(
$this
->
request
->
derive
(
true
,
true
,
$type
)
,
new
html\Str
(
sprintf
(
'%s: %s'
,
$type
,
$desc
))
...
...
@@ -124,9 +133,18 @@ class CustomCreate extends Window
case
'MX'
:
return
$this
->
formMx
(
$domain
);
case
'NS'
:
return
$this
->
formNs
();
case
'SRV'
:
return
$this
->
formSrv
(
$domain
);
case
'SSHFP'
:
return
$this
->
formSshfp
();
case
'TXT'
:
return
$this
->
formTxt
();
default
:
throw
new
exception\Error
(
_
(
'Unkown record type'
));
}
...
...
@@ -193,6 +211,14 @@ class CustomCreate extends Window
return
$container
;
}
protected
function
formNs
()
{
$cname
=
new
form\FieldText
(
'nsdname'
,
_
(
'Authoritive Nameserver'
));
$cname
->
setPlaceholder
(
'ns1.example.com.'
);
return
$cname
;
}
protected
function
formSrv
(
$domain
)
{
$container
=
new
form\Container
();
...
...
@@ -223,4 +249,36 @@ class CustomCreate extends Window
return
$container
;
}
protected
function
formSshfp
()
{
$container
=
new
form\Container
();
$algorithm
=
new
form\FieldSelect
(
'algorithm'
,
_
(
'Algorithm'
));
$algorithm
->
addOption
(
''
,
''
);
$algorithm
->
addOption
(
'1'
,
'RSA'
);
$algorithm
->
addOption
(
'2'
,
'DSS'
);
$fptype
=
new
form\FieldSelect
(
'fptype'
,
_
(
'Fingerprint Type'
));
$fptype
->
addOption
(
''
,
''
);
$fptype
->
addOption
(
'1'
,
'SHA-1'
);
$fptype
->
addOption
(
'2'
,
'SHA-256'
);
$fptype
->
addOption
(
'3'
,
'ECDSA'
);
$fingerprint
=
new
form\FieldText
(
'fingerprint'
,
_
(
'Fingerprint'
));
$container
[]
=
$algorithm
;
$container
[]
=
$fptype
;
$container
[]
=
$fingerprint
;
return
$container
;
}
protected
function
formTxt
()
{
$cname
=
new
form\FieldText
(
'txtdata'
,
_
(
'Text String'
));
$cname
->
setPlaceholder
(
''
);
return
$cname
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment