Get docroot easily via hooks
As a Developer, I want to get docroot easily via hooks, so that I don't have to store a hash or know a user's password.
Presently if you are using hooks in cPanel&WHM getting the docroot of an account is a pain. In fact some resort to directly reading cache files (which is not recommended) as a means of doing this. However there are many scenarios where knowing an account's docroot can be very useful.
Yes this data can be accessed via the APIs but that would require either storing a hash in a place users can read it (a security risk) or knowing the user's password (not advised).
As a result an easier way to get an account's docroot easily from code executing in a hook is desired.
This is a feature that has been migrated over from the cPanel Forums. All previous comments and discussions concerning this feature can be located at: