UAPI Functions - UserManager::check_account_conflicts

Description

This function lists the other subaccounts or services accounts that conflict with the specified username.

Examples 


 cPanel or Webmail Session URL

https://host.example.com:2083/cpsess##########/execute/UserManager/check_account_conflicts?full_username=example1%40example.com

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List the other sub-accounts or services accounts that conflict with the specified username.
$UserManager $cpanel->uapi(
    'UserManager''check_account_conflicts',
    array(
        'full_username' =>   'example1@example.com'
    )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List the other sub-accounts or services accounts that conflict with the specified username.
my $UserManager $cpliveapi->uapi(
    'UserManager''check_account_conflicts',
    {  
    'full_username' =>   'example1@example.com'
    }
);

 cPanel Template Toolkit

<!-- List the other sub-accounts or services accounts that conflict with the specified username. -->
[% execute('UserManager', 'check_account_conflicts', {'full_username' => 'example1@example.com'}) %]

 Command Line

uapi --user=username UserManager check_account_conflicts full_username=example1%40example.com

 

Notes:

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

 Output (JSON)

{
    "messages": null,
    "errors": null,
    "status": 1,
    "metadata": {},
    "data": {
        "conflict": 0,
        "accounts": {
            "issues": [],
            "sub_account_exists": null,
            "can_set_quota": 0,
            "dismissed": null,
            "dismissed_merge_candidates": [],
            "has_siblings": null,
            "full_username": "example1@example.com",
            "parent_type": null,
            "special": 0,
            "can_set_password": 0,
            "domain": "example.com",
            "merge_candidates": [{
                "issues": [],
                "sub_account_exists": null,
                "can_set_quota": 1,
                "dismissed": null,
                "has_siblings": null,
                "full_username": "example1@example.com",
                "parent_type": null,
                "special": 0,
                "can_set_password": 1,
                "domain": "example.com",
                "merge_candidates": [],
                "guid": null,
                "real_name": null,
                "can_delete": 1,
                "services": {
                    "email": {
                        "quota": 250,
                        "enabled": 1
                    },
                    "ftp": {
                        "enabled": 0
                    },
                    "webdisk": {
                        "enabled": 0
                    }
                },
                "phone_number": null,
                "avatar_url": null,
                "alternate_email": null,
                "username": "example1",
                "type": "service",
                "synced_password": null
            }, {
                "issues": [],
                "sub_account_exists": null,
                "can_set_quota": 1,
                "dismissed": null,
                "has_siblings": null,
                "full_username": "example1@example.com",
                "parent_type": null,
                "special": 0,
                "can_set_password": 1,
                "domain": "example.com",
                "merge_candidates": [],
                "guid": null,
                "real_name": null,
                "can_delete": 1,
                "services": {
                    "email": {
                        "enabled": 0
                    },
                    "ftp": {
                        "quota": "0.00",
                        "homedir": "public_html/example.com/example1",
                        "enabled": 1
                    },
                    "webdisk": {
                        "enabled": 0
                    }
                },
                "phone_number": null,
                "avatar_url": null,
                "alternate_email": null,
                "username": "example1",
                "type": "service",
                "synced_password": null
            }],
            "guid": null,
            "real_name": null,
            "can_delete": 0,
            "services": {
                "email": {
                    "enabled": 0
                },
                "ftp": {
                    "enabled": 0
                },
                "webdisk": {
                    "enabled": 0
                }
            },
            "phone_number": null,
            "avatar_url": null,
            "alternate_email": null,
            "username": "example1",
            "type": "hypothetical",
            "synced_password": null
        }
    }
}

 

Note:

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

 

Parameters

Parameter

Type

Description

Possible values

Example

 full_username 

 string 

Required

 The subaccount's username and domain name. 

 A valid username, the @ character, and the associated domain. 

 example1@example.com 

 

Returns

 

Note:

If the function returns more than one account, it will return some values multiple times within the return arrays.

 

Return

Type

Description

Possible values

Example

accounts

hash

This hash contains service accounts that match  thefull_usernameparameter's value.

This hash includes  the alternate_email,avatar_url, can_delete ,can_set_password can_set_quota,dismissed, dismissed_merge_candidates,domain, full_username, guid,has_siblings, issues, merge_candidates,parent_type, phone_number, real_name,services, special, sub_account_exists,synced_password, type,  and usernamereturns.

 

alternate_email

string

An alternate email address for the subaccount's user.

The function returns this value in theaccounts hash.

A valid email address.

 user@example.com

avatar_url

string

 The user's subaccount profile photo.

The function returns this value in theaccounts hash.

A valid HTTPS URL that points to an image file.

 

can_delete

Boolean

Whether the cPanel account user can delete the subaccount.

The function returns this value in theaccounts hash.

  • 1 — Can delete.
  • 0 — Cannot delete.

0

can_set_password

Boolean

Whether the cPanel account user can change the subaccount's password.

The function returns this value in theaccounts hash.

  • 1 — Can change password.
  • 0 — Cannot change password.

Note:

The function returns 0 for subaccounts that inherit their password from the cPanel account.

1

can_set_quota

Boolean

Whether the cPanel account user can change the subaccount's disk usage quota.

The function returns this value in theaccounts hash.

  • 1 — Can change.
  • 0 — Cannot change.

0

dismissed

Boolean

Whether the cPanel account user dismissed the merge prompt for the service account.

Note:

Only service accounts return this value.

The function returns this value in theaccounts hash.

 

  • 1 — Dismissed.
  • 0 — Did not dismiss.

1

 dismissed_merge_candidates 

array

An array of hashes that represent the service accounts that the user dismissed the merge prompt for.

The function returns this array in theaccounts hash.

This array contains the alternate_email,avatar_url, can_delete,can_set_password, can_set_quota,dismissed, domain, full_username, guid,has_siblings, issues, merge_candidates,parent_type, phone_number, real_name,services, special, sub_account_exists,synced_password, type, and usernamereturns.

 

domain

string

The subaccount user's associated domain.

The function returns this value in theaccounts hash.

A domain that the cPanel account owns.

example.com

full_username

string

The subaccount's username and domain name.

The function returns this value in theaccounts hash.

A valid username, the @ character, and the associated domain.

user@example.com

guid

string

The subaccount unique identifier.

The function returns this value in theaccounts hash.

The system-assigned unique value.

 

issues

array

Information about any issues or problems with the subaccount.

The function returns this array in theaccounts hash.

This array contains the type, area, service,message, used, and limit returns.

 

type

string

The type of issue.

The function returns this value in theissues array.

  • error
  • warning
  • info

info

area

string

The affected section of cPanel & WHM.

The function returns this value in theissues array.

quota

quota

service

string

The affected service.

The function returns this value in theissues array.

  • email
  • ftp
  • webdisk

email

message

string

The description of the issue.

The function returns this value in theissues array.

A valid string.

Your account is over quota.

used

integer

The number of Megabytes (MB) that the account currently uses.

The function returns this value in theissues array.

A positive integer.

2000

limit

integer

 The set quota Megabyte (MB) limit for the affected subaccount.

The function returns this value in theissues array.

A positive integer.

1500

merge_candidates

array

An array of hashes that represent the service accounts that the system could merge for this subaccount.

The function returns this value in theaccounts hash.

This array contains the alternate_email,avatar_url, can_delete,can_set_password, can_set_quota,dismissed, domain, full_username, guid,has_siblings, issues, merge_candidates,parent_type, phone_number, real_name,services, special, sub_account_exists,synced_password, type, and usernamereturns.

 

has_siblings

Boolean

Whether the service account shares  thefull_usernameparameter's value with another service account.

The function returns this value in theaccounts hash.

  • 1 — Shares.
  • 0 — Does not share.

0

parent_type

string

The type of account that could own the service account.

The function returns this value in theaccounts hash.

  • sub — A subaccount.
  • hypothetical — A hypothetical subaccount that does not yet exist, but that the user could create as part of a merge.
  • null— Not a merge candidate.

 

 hypothetical

phone_number

string

The subaccount user's phone number.

The function returns this value in theaccounts hash.

A valid phone number that conforms to ITU-T's E.164-recommended standard for the representation of telephone numbers.

+15551234567

real_name

string

 The name of the subaccount's user.

The function returns this value in theaccounts hash.

  • A first name, a last name, or a first name and last name.
  • An empty string.

John Doe

services

hash

Information about the  subaccount's access to email, FTP, and Web Disk.

The function returns this hash in theaccounts hash.

This hash includes the email, ftp, andwebdisk returns.

 

email

hash

 Information that indicates the subaccount's email status.

The function returns this hash in theservices hash.

This hash includes the enabled and quotareturns.

 

enabled

Boolean

Whether the subaccount can access Webmail, POP, and IMAP services.

The function returns this value in theemail hash.

  • 1 — Can access.
  • 0 — Cannot access.

1

quota

string

The subaccount's email disk space quota.

The function returns this value in theemail hash.

  • A positive integer between 1 and 999999that represents the maximum disk space that the subaccount may use, in Megabytes (MB).
  • 0 — Unlimited.

100

ftp

hash

This hash includes the  information that indicates the subaccount's FTP status.

 The function returns this hash in theservices hash.

This hash includes the enabled, quota, andhomedir returns.

 

enabled

Boolean

Whether the subaccount can access FTP.

The function returns this value in the ftphash.

  • 1 — Can access.
  • 0 — Cannot access.

0

quota

string

The subaccount's FTP disk space quota.

The function returns this value in the ftphash.

  • An integer that represents the subaccount's maximum FTP disk usage, in Megabytes (MB).
  • 0 — Unlimited.

100

homedir

string

The subaccount's FTP home directory.

The function returns this value in the ftphash.

A valid path, relative to the cPanel account's home directory.

/subaccount

webdisk

hash

This hash includes the  information that indicates the subaccount's Web Disk status.

 The function returns this hash in theservices hash.

This hash includes the enabled, homedir,perms, and private returns.

 

enabled

Boolean

Whether the subaccount can access Web Disk.

The function returns this value in thewebdisk hash.

  • 1 — Can access.
  • 0 — Cannot access.

0

homedir

string

The subaccount's Web Disk directory.

The function returns this value in thewebdisk hash.

A valid path, relative to the cPanel account's home directory.

/bob

perms

string

Whether to grant write permissions to the subaccount.

The function returns this value in thewebdisk hash.

  • ro — Read-only permissions.
  • rw — Read and write permissions.

rw

private

Boolean

Whether to set the Web Disk directory's permissions to public or private.

The function returns this value in thewebdisk hash.

  • 1 — Private (0700).
  • 0 — Public (0755).

0

special

Boolean

Whether the account is a system-created special account that the usercannot remove.

The function returns this value in theaccounts hash.

  • 1 — Can remove.
  • 0 — Cannot remove.

1

sub_account_exists

Boolean

Whether a subaccount exists with the same username.

The function returns this value in theaccounts hash.

  • 1 — Exists.
  • 0 — Does not exist.

Note:

The function returns a null value if the account is not a service account.

0

synced_password

Boolean

Whether the user has synchronized the passwords for each of the subaccount's service accounts.

The function returns this value in theaccounts hash.

  • 1 — Synchronized.
  • 0 — Not synchronized.

Note:

The function returns a null value if the account is not a subaccount.

0

type

 string

The type of account.

The function returns this value in theaccounts hash.

  • sub — A subaccount.
  • hypothetical — A hypothetical subaccount that does not exist, but that the user could create as part of a merge.
  • service — A service account.
  • cpanel — The cPanel account.

sub

username

string

The username for the subaccount.

The function returns this value in theaccounts hash.

 

A username that meets the subaccount name limitations.

  • Length — 64 characters
  • Characters — a-z, A-Z, 0-9, dot (.), hyphen (-), underscore (_)

Note:

This value does not include the domain name.

example

conflict

 Boolean 

Whether the system  detected an account conflict. 

The function returns this value in theaccounts hash.

  • 1 — Conflict.
  • 0 — No conflict.

0

 

  • 13 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....