Fix verification for namecheap domains not *owned* by the calling user #2106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The NameCheap DNS plugin is using NameCheap's
domains.getList
api call to try and verify that the user has access to the requested domain. That works great as long as the user is the primary owner of the domain. If the user is just a user who has been granted administrative DNS rights to the domain, then thedomains.getList
api will not include that domain in the response. See http://disq.us/p/1q6v9x9 for NameCheap's official comment (short story, getList only returns domains the user owns, not ones they've been granted admin rights for).I changed the code so that it will first attempt to verify that the user has permissions to the domain by calling the original
domains.getList
api endpoint. If that verification fails, then it falls back to calling thedomains.dns.getHosts
api endpoint directly.