Overview
  • Namespace
  • Class

Namespaces

  • Omines
    • DirectAdmin
      • Context
      • Objects
        • Database
        • Domains
        • Email
        • Users
      • Utility

Classes

  • Admin
  • Reseller
  • User

Class User

User.

Omines\DirectAdmin\Objects\BaseObject
Extended by Omines\DirectAdmin\Objects\Users\User

Direct known subclasses

Omines\DirectAdmin\Objects\Users\Reseller

Indirect known subclasses

Omines\DirectAdmin\Objects\Users\Admin

Namespace: Omines\DirectAdmin\Objects\Users
Author: Niels Keurentjes niels.keurentjes@omines.com
Located at DirectAdmin/Objects/Users/User.php

Methods summary

public
# __construct( string $name, Omines\DirectAdmin\Context\UserContext $context, mixed|null $config = null )

Construct the object.

Construct the object.

Parameters

$name
Username of the account
$context
The context managing this object
$config
An optional preloaded configuration

Overrides

Omines\DirectAdmin\Objects\BaseObject::__construct
public
# clearCache( )

Clear the object's internal cache.

Clear the object's internal cache.

Overrides

Omines\DirectAdmin\Objects\BaseObject::clearCache
public Omines\DirectAdmin\Objects\Database
# createDatabase( string $name, string $username, string|null $password = null )

Creates a new database under this user.

Creates a new database under this user.

Parameters

$name
Database name, without _ prefix
$username
Username to access the database with, without _ prefix
$password
Password, or null if database user already exists

Returns

Omines\DirectAdmin\Objects\Database
Newly created database
public Omines\DirectAdmin\Objects\Domain
# createDomain( string $domainName, float|null $bandwidthLimit = null, float|null $diskLimit = null, boolean|null $ssl = null, boolean|null $php = null, boolean|null $cgi = null )

Creates a new domain under this user.

Creates a new domain under this user.

Parameters

$domainName
Domain name to create
$bandwidthLimit
Bandwidth limit in MB, or NULL to share with account
$diskLimit
Disk limit in MB, or NULL to share with account
$ssl
Whether SSL is to be enabled, or NULL to fallback to account default
$php
Whether PHP is to be enabled, or NULL to fallback to account default
$cgi
Whether CGI is to be enabled, or NULL to fallback to account default

Returns

Omines\DirectAdmin\Objects\Domain
Newly created domain
public string
# getUsername( )

Returns

string
The username
public float|null
# getBandwidthLimit( )

Returns the bandwidth limit of the user.

Returns the bandwidth limit of the user.

Returns

float|null
Limit in megabytes, or null for unlimited
public float
# getBandwidthUsage( )

Returns the current period's bandwidth usage in megabytes.

Returns the current period's bandwidth usage in megabytes.

Returns

float
public integer|null
# getDatabaseLimit( )

Returns the database quota of the user.

Returns the database quota of the user.

Returns

integer|null
Limit, or null for unlimited
public integer
# getDatabaseUsage( )

Returns the current number databases in use.

Returns the current number databases in use.

Returns

integer
public float|null
# getDiskLimit( )

Returns the disk quota of the user.

Returns the disk quota of the user.

Returns

float|null
Limit in megabytes, or null for unlimited
public float
# getDiskUsage( )

Returns the current disk usage in megabytes.

Returns the current disk usage in megabytes.

Returns

float
public Omines\DirectAdmin\Objects\Domain|null
# getDefaultDomain( )

Returns

Omines\DirectAdmin\Objects\Domain|null
The default domain for the user, if any
public integer|null
# getDomainLimit( )

Returns maximum number of domains allowed to this user, or NULL for unlimited.

Returns maximum number of domains allowed to this user, or NULL for unlimited.

Returns

integer|null
public integer
# getDomainUsage( )

Returns number of domains owned by this user.

Returns number of domains owned by this user.

Returns

integer
public boolean
# isSuspended( )

Returns whether the user is currently suspended.

Returns whether the user is currently suspended.

Returns

boolean
public Omines\DirectAdmin\Objects\Domain[]
# getDatabases( )

Returns

Omines\DirectAdmin\Objects\Domain[]
public null|Omines\DirectAdmin\Objects\Domain
# getDomain( string $domainName )

Parameters

$domainName

Returns

null|Omines\DirectAdmin\Objects\Domain
public Omines\DirectAdmin\Objects\Domain[]
# getDomains( )

Returns

Omines\DirectAdmin\Objects\Domain[]
public string
# getType( )

Returns

string
The user type, as one of the ACCOUNT_TYPE_ constants in the DirectAdmin class
public boolean
# hasCGI( )

Returns

boolean
Whether the user can use CGI
public boolean
# hasPHP( )

Returns

boolean
Whether the user can use PHP
public boolean
# hasSSL( )

Returns

boolean
Whether the user can use SSL
public Omines\DirectAdmin\Context\UserContext
# impersonate( )

Returns

Omines\DirectAdmin\Context\UserContext
public
# modifyConfig( array $newConfig )

Modifies the configuration of the user. For available keys in the array check the documentation on CMD_API_MODIFY_USER in the linked document.

Modifies the configuration of the user. For available keys in the array check the documentation on CMD_API_MODIFY_USER in the linked document.

Parameters

$newConfig
Associative array of values to be modified

Url

http://www.directadmin.com/api.html#modify
public
# setAllowCatchall( boolean $newValue )

Parameters

$newValue
Whether catch-all email is enabled for this user
public
# setBandwidthLimit( float|null $newValue )

Parameters

$newValue
New value, or NULL for unlimited
public
# setDiskLimit( float|null $newValue )

Parameters

$newValue
New value, or NULL for unlimited
public
# setDomainLimit( integer|null $newValue )

Parameters

$newValue
New value, or NULL for unlimited
public static Omines\DirectAdmin\Objects\Users\Admin|Omines\DirectAdmin\Objects\Users\Reseller|Omines\DirectAdmin\Objects\Users\User
# fromConfig( array $config, Omines\DirectAdmin\Context\UserContext $context )

Constructs the correct object from the given user config.

Constructs the correct object from the given user config.

Parameters

$config
The raw config from DirectAdmin
$context
The context within which the config was retrieved

Returns

Omines\DirectAdmin\Objects\Users\Admin|Omines\DirectAdmin\Objects\Users\Reseller|Omines\DirectAdmin\Objects\Users\User
The correct object

Throws

Omines\DirectAdmin\DirectAdminException
If the user type could not be determined
protected Omines\DirectAdmin\Context\UserContext
# getSelfManagedContext( )

Returns

Omines\DirectAdmin\Context\UserContext
The local user context
protected Omines\DirectAdmin\Objects\Users\User
# getSelfManagedUser( )

Returns

Omines\DirectAdmin\Objects\Users\User
The user acting as himself
protected boolean
# isSelfManaged( )

Returns

boolean
Whether the account is managing itself

Methods inherited from Omines\DirectAdmin\Objects\BaseObject

getCache(), getCacheItem(), getContext(), getName(), setCache(), toObjectArray(), toRichObjectArray()

Constants summary

string CACHE_CONFIG
# 'config'
string CACHE_DATABASES
# 'databases'
string CACHE_USAGE
# 'usage'
API documentation generated by ApiGen