Description

This function checks whether the shared global address book is enabled on the current cPanel account's webmail accounts.

Examples


https://hostname.example.com:2083/cpsess##########/execute/DAV/has_shared_global_addressbook?name=user

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check the global address book's status.
$DAV = $cpanel->uapi(
    'DAV', 'has_shared_global_addressbook',
	array(
		'name'	=> 'user',
	)
 );

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Check the global address book's status.
my $enable_shared_global_addressbook = $cpliveapi->uapi(
    'DAV', 'has_shared_global_addressbook',
	{
		'name'	=> 'user',
	}
 );

<!-- Verify the global address book's status. -->
[% data = execute( 'DAV', 'has_shared_global_addressbook'{ 'name' => 'user' } ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

uapi --user=username DAV has_shared_global_addressbook name=user

{  
   "messages":null,
   "data":{  
      "shared":"1"
   },
   "errors":null,
   "status":"1",
   "metadata":{  

   }
}

Parameters

ParameterTypeDescriptionPossible valuesExample
namestring

A cPanel account user name or a Webmail user's email address.

If you do not specify a user, this parameter defaults to the currently-authenticated user.

A valid username.user

 

Returns

ReturnTypeDescriptionPossible valuesExample
sharedBoolean

Whether the global address book is enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1