UAPI Functions - SiteTemplates::list_user_settings

Description

This function lists information for the cPanel account's Site Publisher websites.

Note:

To retrieve the list of Site Publisher website information, the function queries the configurations.json file in each domain's document root. 

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/SiteTemplates/list_user_settings

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List information for the account's Site Publisher websites.
$templates $cpanel->uapi(
    'SiteTemplates''list_user_settings'
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List information for the account's Site Publisher websites.
my $templates $cpliveapi->uapi(
    'SiteTemplates''list_user_settings',
);

 cPanel Template Toolkit

<!-- List the account's backup files. -->
[% data = execute( 'SiteTemplates', 'list_user_settings' ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

 Command Line

uapi --user=username SiteTemplates list_user_settings

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

   "status":1,
   "errors":null,
   "messages":null,
   "data":[ 
      
         "template_settings":{ 
            "is_empty":0,
            "path":"/var/cpanel/customizations/site_templates",
            "template":"mytemplate"
         },
         "homedir":"/home/example",
         "documentroot":"/home/example/public_html",
         "serveralias":[ 
            "www.example.com"
         ],
         "type":"main_domain",
         "domain":"example.com"
      }
   ],
   "metadata":{ 
      "transformed":1
   }
}

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

This function does not accept parameters.


Returns

Return
Type
Description
Possible values
Example
 
hash
An unnamed hash of each domain's site template information.
This hash includes the homedir, documentroot, type, and domainreturns, the serveralias array, and the template_settingshash.
 
 template_settings 
hash
A hash of template settings.
The function returns this hash in the unnamed hash.
This hash includes the is_empty, path, and template returns.
Important:
This hash also contains the user's website content. The template provider determines these values.

 
is_empty
 Boolean 
Whether the domain'sconfigurations.jsonfile exists and contains template information.
The function returns this value in thetemplate_settingshash.
  • 1 — The configurations.json file exists and contains template information.
  • 0 — The configurations.json file does not exist, or does not contain template information.
0
path
string
The template directory path.
The function returns this value in thetemplate_settingshash.
 
  • /var/cpanel/customizations/site_templates/ — Templates that the root user owns.
  • /home/username/var/cpanel/reseller/site_templates/ — Templates that a reseller owns, where username represents the reseller's username.
  • /usr/local/cpanel/etc/site_templates/ — cPanel-provided templates.
 
 
template
string
The template's name.
The function returns this value in thetemplate_settingshash.
The name of a template, as it appears in theconfigurations.json file.
mytemplate
homedir
string
The user's home directory.
The function returns this value in the unnamed hash.
The absolute path to the cPanel account's home directory.
/home/example
documentroot
string
The domain's document root.
The function returns this value in the unnamed hash.
The absolute path to the directory's document root inside of the account's home directory.
 /home/example/public_html 
serveralias
array
An array of the domain's aliases.
The function returns this array in the unnamed hash.
An array of one or more of the domain's aliases.
www.example.com
type
string
The domain's type.
The function returns this value in the unnamed hash.
  • main — The main domain.
  • sub — A subdomain.
main
domain
string
The domain name.
The function returns this value in the unnamed hash.
A valid domain name.
example.com

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....