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
464022be
Commit
464022be
authored
Jan 15, 2021
by
pssara
Browse files
Fixed issue with ISP config where the Client ID was asumed to be the same as the SYS User ID
parent
44615c6f
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_ispconfig.sh
View file @
464022be
...
...
@@ -75,7 +75,7 @@ _ISPC_getZoneInfo() {
# suffix . needed for zone -> domain.tld.
curData
=
"{
\"
session_id
\"
:
\"
${
sessionID
}
\"
,
\"
primary_id
\"
:{
\"
origin
\"
:
\"
${
curZone
}
.
\"
}}"
curResult
=
"
$(
_post
"
${
curData
}
"
"
${
ISPC_Api
}
?dns_zone_get"
)
"
_debug
"Calling _ISPC_getZoneInfo: '
${
curData
}
' '
${
ISPC_Api
}
?
login
'"
_debug
"Calling _ISPC_getZoneInfo: '
${
curData
}
' '
${
ISPC_Api
}
?
dns_zone_get
'"
_debug
"Result of _ISPC_getZoneInfo: '
$curResult
'"
if
_contains
"
${
curResult
}
"
'"id":"'
;
then
zoneFound
=
true
...
...
@@ -110,7 +110,24 @@ _ISPC_getZoneInfo() {
;;
*
)
_info
"Retrieved Zone ID"
;;
esac
client_id
=
$(
echo
"
${
curResult
}
"
| _egrep_o
"sys_userid.*"
|
cut
-d
':'
-f
2 |
cut
-d
'"'
-f
2
)
sys_userid
=
$(
echo
"
${
curResult
}
"
| _egrep_o
"sys_userid.*"
|
cut
-d
':'
-f
2 |
cut
-d
'"'
-f
2
)
_debug
"SYS User ID: '
${
sys_userid
}
'"
case
"
${
sys_userid
}
"
in
''
|
*
[!
0-9]
*
)
_err
"SYS User ID is not numeric."
return
1
;;
*
)
_info
"Retrieved SYS User ID."
;;
esac
zoneFound
=
""
zoneEnd
=
""
fi
# Need to get client_id as it is different from sys_userid
curData
=
"{
\"
session_id
\"
:
\"
${
sessionID
}
\"
,
\"
sys_userid
\"
:
\"
${
sys_userid
}
\"
}"
curResult
=
"
$(
_post
"
${
curData
}
"
"
${
ISPC_Api
}
?client_get_id"
)
"
_debug
"Calling _ISPC_ClientGetID: '
${
curData
}
' '
${
ISPC_Api
}
?client_get_id'"
_debug
"Result of _ISPC_ClientGetID: '
$curResult
'"
client_id
=
$(
echo
"
${
curResult
}
"
| _egrep_o
"response.*"
|
cut
-d
':'
-f
2 |
cut
-d
'"'
-f
2 |
tr
-d
'{}'
)
_debug
"Client ID: '
${
client_id
}
'"
case
"
${
client_id
}
"
in
''
|
*
[!
0-9]
*
)
...
...
@@ -119,9 +136,6 @@ _ISPC_getZoneInfo() {
;;
*
)
_info
"Retrieved Client ID."
;;
esac
zoneFound
=
""
zoneEnd
=
""
fi
}
_ISPC_addTxt
()
{
...
...
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