safe to use API-version 1 for Htaccess
Hi friends, I want to programmatically set up .htpasswd authentication on many cPanel websites. I need functions to turn off/on, create/delete/list users.
cPanel API 1 has a set of functions that do everything:
cPanel API 1 Functions - Htaccess::set_pass - Developer Documentation - cPanel Documentation
However they come with a prominent warning: cPanel API 1 is deprecated. We strongly recommend that you do not use cPanel API 1. However, no equivalent function exists in our newer APIs.
There is an API 2 module that only does "listusers", without ability to edit, and it has a similar warning: We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
cPanel API 2 Functions - Htaccess::listuser - Developer Documentation - cPanel Documentation
Would it be reasonable for me to just code up what I need in API v1? I note that the cPanel interactive dashboard has functions to manage .htpasswd access... I assume these are using API v1 under the hood? Is there some better approach that I don't know about?
Thanks!
Please sign in to leave a comment.
Comments
0 comments