Child pages
  • WHM API 1 Functions - get_users_features_settings

Versions Compared

Key

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

Description


Excerpt

This function lists the features settings of cPanel accounts.


Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/get_users_features_settings?api.version=1&user-1=example&user-2=example2&feature-1=autossl&feature-2=webmail



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/get_users_features_settings?api.version=1&user-1=example&user-2=example2&feature-1=autossl&feature-2=webmail



Expand
titleCommand Line


Code Block
languagebash
whmapi1 get_users_features_settings user-1=example user-2=example2 feature-1=autossl feature-2=webmail

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "data": {
      "users_features_settings":[
      {
          "user":"example",
          "feature":"autossl",
          "feature_list":"examplefeaturelist",
          "feature_list_setting":1,
          "cpuser_setting":1
      },
      {
          "user":"example",
          "feature":"webmail",
          "feature_list":"examplefeaturelist",
          "feature_list_setting":1,
          "cpuser_setting":undef
      },
      {
          "user":"example2",
          "feature":"autossl",
          "feature_list":"default",
          "feature_list_setting":1,
          "cpuser_setting":1
      },
      {
          "user":"example2",
          "feature":"webmail",
          "feature_list":"default",
          "feature_list_setting":1,
          "cpuser_setting":undef
      }
   ]
},
   "metadata":{  
      "command":"get_users_features_settings",
      "version":1,
      "reason":"OK",
      "result":1
   }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    <data>
        <users_features_settings>
            <user>example</user>
            <feature>autossl</feature>
            <feature_list>examplefeaturelist</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <cpuser_setting>1</cpuser_setting>
         </users_features_settings>
        <users_features_settings>
            <user>example</user>
            <feature>webmail</feature>
            <feature_list>examplefeaturelist</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <reason>undef</reason>
         </users_features_settings>
        <users_features_settings>
            <user>example2</user>
            <feature>autossl</feature>
            <feature_list>default</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <cpuser_setting>1</cpuser_setting>
         </users_features_settings>
        <users_features_settings>
            <user>example2</user>
            <feature>webmail</feature>
            <feature_list>default</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <reason>undef</reason>
         </users_features_settings>
    </data>
    <metadata>
        <result>1</result>
        <version>1</version>
        <reason>OK</reason>
        <command>get_users_features_settings</command>
    </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The user's username.

Note
titleNote:

To check multiple users, increment the parameter name. For example, user-1, user-2, and user-3.


A valid cPanel username that exists on the serverexample
featurestring

The feature's name.

Note
titleNotes:
  • To check multiple features, increment the parameter name. For example, feature-1, feature-2, and feature-3.
  • If you use this parameter, you must enter a feature name, or the function returns an error.
  • If you do not use this parameter, the function returns data for all features on the server.


A valid feature name.autossl

Returns

ReturnTypeDescriptionPossible valuesExample
users_features_settings
array of hashes

An array of hashes that contains information about the feature list settings.

The array of hashes includes the user, feature, feature_list, feature_list_setting, and cpuser_setting returns. 

user

string

The user's username.

The function returns this value in the users_features_settings hash.

A valid cPanel username that exists on the server.

example

feature

string

The feature name.

The function returns this value in the   users_features_settings   hash.

A valid feature name.autossl

feature_list

string

The feature list's name.

The function returns this value in the   users_features_settings   hash.

A valid feature list's name.default

feature_list_setting

Boolean

The user's feature list setting.

The function returns this value in the   users_features_settings   hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

cpuser_setting

Boolean

The user's setting for the feature in their cpuser file, which overrides the feature_list_setting return.

The function returns this value in the   users_features_settings   hash.

  • 1 — Enabled.
  • 0 — Disabled.
  • undef — The feature is not defined in the feature list.
1