Child pages
  • WHM API 1 Functions - verify_user_has_feature

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

This function checks whether a user can access a particular feature.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/verify_user_has_feature?api.version=1&user=username&feature=sslinstall
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/verify_user_has_feature?api.version=1&user=username&feature=sslinstall
Expand
titleCommand Line
Code Block
languagebash
whmapi1 verify_user_has_feature user=username feature=featurename

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{  
   "metadata":{  
      "reason":"OK",
      "version":1,
      "command":"verify_user_has_feature",
      "result":1
   },
   "data":{  
      "query_feature":"sslinstall",
      "has_feature":1
   }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<result>
    <metadata>
        <result>1</result>
        <version>1</version>
        <reason>OK</reason>
        <command>verify_user_has_feature</command>
    </metadata>
    <data>
        <has_feature>1</has_feature>
        <query_feature>sslinstall</query_feature>
    </data>
</result>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

Parameters

ParameterTypeDescriptionPossible valuesExample

user

string

Required

The user's username.

A valid cPanel username.username
featurestring

Required

The feature's name.


 

A valid feature name.

Note
titleNote:

Call WHM API 1's get_feature_names function to view available features.

sslinstall

Returns

ReturnTypeDescriptionPossible valuesExample
query_featurestringThe feature's name.A valid feature name.sslinstall

has_feature

Boolean

Whether the user can access the feature.

  • 1 — The user can access the feature.
  • 0 — The user cannot access the feature.
 1