mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-10 21:42:44 +00:00
save user+passwd
This commit is contained in:
parent
da565948ee
commit
865f1f119b
@ -321,6 +321,8 @@ dns_pleskxml_rm() {
|
|||||||
|
|
||||||
#################### Plesk related functions
|
#################### Plesk related functions
|
||||||
|
|
||||||
|
# Get variables, and store DNS info as required
|
||||||
|
|
||||||
_pleskxml_get_variables() {
|
_pleskxml_get_variables() {
|
||||||
|
|
||||||
_pleskxml_DBG 2 'Entered _pleskxml_get_variables()'
|
_pleskxml_DBG 2 'Entered _pleskxml_get_variables()'
|
||||||
@ -362,20 +364,22 @@ _pleskxml_get_variables() {
|
|||||||
_pleskxml_errors="$_pleskxml_errors"'\nBad or unacceptable URI (If non-SSL HTTP is required, did you set "pleskxml_allow_insecure_uri"?).\nYou should set and export '"$pleskxml_uri"', containing the URI for your Plesk XML API.\nThe URI usually looks like this: https://my_plesk_uri.tld:8443'
|
_pleskxml_errors="$_pleskxml_errors"'\nBad or unacceptable URI (If non-SSL HTTP is required, did you set "pleskxml_allow_insecure_uri"?).\nYou should set and export '"$pleskxml_uri"', containing the URI for your Plesk XML API.\nThe URI usually looks like this: https://my_plesk_uri.tld:8443'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if printf '%s' "${pleskxml_user:-}" | grep -qiE '^[a-z0-9@%._-]+$'; then
|
pleskxml_user="${pleskxml_user:-$(_readaccountconf_mutable pleskxml_user)}"
|
||||||
# USER is "valid enough" to use - Plesk doesn't stipulate valid chars, but thewse are probably "safe enough". We will find out if they aren't, the hard way :)
|
if [ -z "$pleskxml_user" ]; then
|
||||||
# Note, we cannot assume "safe" characters when we use this value!
|
# clear password as well, and raise error
|
||||||
_pleskxml_user="$pleskxml_user"
|
pleskxml_pass=""
|
||||||
else
|
|
||||||
_pleskxml_errors="$_pleskxml_errors"'\nBad or unacceptable USER ACCOUNT for Plesk authentication. You should set and export '"$pleskxml_user."
|
_pleskxml_errors="$_pleskxml_errors"'\nBad or unacceptable USER ACCOUNT for Plesk authentication. You should set and export '"$pleskxml_user."
|
||||||
|
else
|
||||||
|
_pleskxml_user="$pleskxml_user"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${pleskxml_pass:-}" != "" ]; then
|
pleskxml_pass="${pleskxml_pass:-$(_readaccountconf_mutable pleskxml_pass)}"
|
||||||
# PASS is "valid enough" to use - Plesk doesn't stipulate valid chars, but thewse are probably "safe enough". We will find out if they aren't, the hard way :)
|
if [ -z "$pleskxml_pass" ]; then
|
||||||
# Note, we cannot assume "safe" characters when we use this value!
|
# clear username as well, and raise error
|
||||||
_pleskxml_pass="$pleskxml_pass"
|
pleskxml_user=""
|
||||||
else
|
|
||||||
_pleskxml_errors="$_pleskxml_errors"'\nEmpty USER PASSWORD for Plesk authentication. You should set and export '"$pleskxml_pass."
|
_pleskxml_errors="$_pleskxml_errors"'\nEmpty USER PASSWORD for Plesk authentication. You should set and export '"$pleskxml_pass."
|
||||||
|
else
|
||||||
|
_pleskxml_pass="$pleskxml_pass"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure if not supplied, optional curl args are an empty string
|
# Ensure if not supplied, optional curl args are an empty string
|
||||||
@ -386,11 +390,15 @@ _pleskxml_get_variables() {
|
|||||||
_pleskxml_DBG_VARDUMP 2
|
_pleskxml_DBG_VARDUMP 2
|
||||||
_err 'Can'\''t parse user-defined variables. Exiting.'
|
_err 'Can'\''t parse user-defined variables. Exiting.'
|
||||||
return 1
|
return 1
|
||||||
else
|
|
||||||
_pleskxml_DBG 2 "SUCCESSFULLY exiting _pleskxml_get_variables()"
|
|
||||||
_pleskxml_DBG_VARDUMP 2
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#save the api credentials to the account conf file, and return successfully
|
||||||
|
_saveaccountconf_mutable pleskxml_Key "$pleskxml_user"
|
||||||
|
_saveaccountconf_mutable pleskxml_Email "$pleskxml_pass"
|
||||||
|
|
||||||
|
_pleskxml_DBG 2 "SUCCESSFULLY exiting _pleskxml_get_variables()"
|
||||||
|
_pleskxml_DBG_VARDUMP 2
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build a cURL request for the Plesk API
|
# Build a cURL request for the Plesk API
|
||||||
|
Loading…
x
Reference in New Issue
Block a user