Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
3bad8159
Unverified
Commit
3bad8159
authored
Apr 18, 2020
by
Nils Sandmann
Browse files
Better error handling on login, return correct return code
parent
458c0db3
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_inwx.sh
View file @
3bad8159
...
...
@@ -148,17 +148,21 @@ _inwx_login() {
</value>
</param>
</params>
</methodCall>'
$INWX_User
$INWX_Password
)
</methodCall>'
"
$INWX_User
"
"
$INWX_Password
"
)
response
=
"
$(
_post
"
$xml_content
"
"
$INWX_Api
"
""
"POST"
)
"
_H1
=
$(
printf
"Cookie: %s"
"
$(
grep
"domrobot="
"
$HTTP_HEADER
"
|
grep
"^Set-Cookie:"
| _tail_n 1 | _egrep_o
'domrobot=[^;]*;'
|
tr
-d
';'
)
"
)
export
_H1
if
!
_contains
"
$response
"
"<member><name>code</name><value><int>1000</int></value></member>"
;
then
_err
"INWX API: Authentication error (username/password correct?)"
return
1
fi
#https://github.com/inwx/php-client/blob/master/INWX/Domrobot.php#L71
if
_contains
"
$response
"
"<member><name>code</name><value><int>1000</int></value></member>"
\
&&
_contains
"
$response
"
"<member><name>tfa</name><value><string>GOOGLE-AUTH</string></value></member>"
;
then
if
_contains
"
$response
"
"<member><name>tfa</name><value><string>GOOGLE-AUTH</string></value></member>"
;
then
if
[
-z
"
$INWX_Shared_Secret
"
]
;
then
_err
"Mobile TAN detected."
_err
"
INWX API:
Mobile TAN detected."
_err
"Please define a shared secret."
return
1
fi
...
...
@@ -191,6 +195,11 @@ _inwx_login() {
</methodCall>'
"
$tan
"
)
response
=
"
$(
_post
"
$xml_content
"
"
$INWX_Api
"
""
"POST"
)
"
if
!
_contains
"
$response
"
"<member><name>code</name><value><int>1000</int></value></member>"
;
then
_err
"INWX API: Mobile TAN not correct."
return
1
fi
fi
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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