Overview
  • Namespace
  • Class

Namespaces

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

Classes

  • AdminContext
  • BaseContext
  • ResellerContext
  • UserContext

Class ResellerContext

Context for reseller functions.

Omines\DirectAdmin\Context\BaseContext
Extended by Omines\DirectAdmin\Context\UserContext
Extended by Omines\DirectAdmin\Context\ResellerContext

Direct known subclasses

Omines\DirectAdmin\Context\AdminContext

Namespace: Omines\DirectAdmin\Context
Author: Niels Keurentjes niels.keurentjes@omines.com
Located at DirectAdmin/Context/ResellerContext.php

Methods summary

public Omines\DirectAdmin\Objects\Users\User
# createUser( string $username, string $password, string $email, string $domain, string $ip, string|array $package = [] )

Creates a new user on the server.

Creates a new user on the server.

Parameters

$username
Login for the new user
$password
Password for the new user
$email
Email for the new user
$domain
Default domain for the new user
$ip
IP for the user
$package
Either a package name or an array of options for custom

Returns

Omines\DirectAdmin\Objects\Users\User
Newly created user

Url

http://www.directadmin.com/api.html#create for options to use.
protected object
# createAccount( string $username, string $password, string $email, array $options, string $endpoint, string $returnType )

Internal helper function for creating new accounts.

Internal helper function for creating new accounts.

Parameters

$username
Login for the new user
$password
Password for the new user
$email
Email for the new user
$options
List of DA account options to apply
$endpoint
API endpoint to invoke
$returnType
Class name that should wrap the resulting account

Returns

object
An instance of the type specified in $returnType
public
# deleteAccount( string $username )

Deletes a single account.

Deletes a single account.

Parameters

$username
Account to delete
public
# deleteAccounts( array $usernames )

Deletes multiple accounts.

Deletes multiple accounts.

Parameters

$usernames
Accounts to delete
public
# suspendAccount( string $username )

Suspends a single account.

Suspends a single account.

Parameters

$username
Account to delete
public
# unsuspendAccount( string $username )

Unsuspends a single account.

Unsuspends a single account.

Parameters

$username
Account to delete
public
# suspendAccounts( array $usernames, boolean $suspend = true )

Suspends (or unsuspends) multiple accounts.

Suspends (or unsuspends) multiple accounts.

Parameters

$usernames
Accounts to delete
$suspend
(true - suspend, false - unsuspend)
public
# unsuspendAccounts( array $usernames )

Unsuspends multiple accounts.

Unsuspends multiple accounts.

Parameters

$usernames
Accounts to delete
public array
# getIPs( )

Returns all IPs available to this reseller.

Returns all IPs available to this reseller.

Returns

array
List of IPs as strings
public Omines\DirectAdmin\Objects\Users\User|null
# getUser( string $username )

Returns a single user by name.

Returns a single user by name.

Parameters

$username

Returns

Omines\DirectAdmin\Objects\Users\User|null
public Omines\DirectAdmin\Objects\Users\User[]
# getUsers( )

Returns all users for this reseller.

Returns all users for this reseller.

Returns

Omines\DirectAdmin\Objects\Users\User[]
Associative array of users
public Omines\DirectAdmin\Context\UserContext
# impersonateUser( string $username, boolean $validate = false )

Impersonates a user, allowing the reseller/admin to act on their behalf.

Impersonates a user, allowing the reseller/admin to act on their behalf.

Parameters

$username
Login of the account to impersonate
$validate
Whether to check the user exists and is a user

Returns

Omines\DirectAdmin\Context\UserContext

Methods inherited from Omines\DirectAdmin\Context\UserContext

__construct(), getContextUser(), getDomain(), getDomains(), getType(), getUsername()

Methods inherited from Omines\DirectAdmin\Context\BaseContext

getConnection(), invokeApiGet(), invokeApiPost()

API documentation generated by ApiGen