class ClientHelper

Client helper class

Methods

static  array
getCredentials( string $client, boolean $force = false)

Method to return the array of client layer configuration options

static  boolean
setCredentials( string $client, string $user, string $pass)

Method to set client login credentials

static  boolean
hasCredentials( string $client)

Method to determine if client login credentials are present

static  mixed
setCredentialsFromRequest( string $client)

Determine whether input fields for client settings need to be shown

Details

static array getCredentials( string $client, boolean $force = false)

Method to return the array of client layer configuration options

Parameters

string $client Client name, currently only 'ftp' is supported
boolean $force Forces re-creation of the login credentials. Set this to true if login credentials in the session storage have changed

Return Value

array Client layer configuration options, consisting of at least these fields: enabled, host, port, user, pass, root

static boolean setCredentials( string $client, string $user, string $pass)

Method to set client login credentials

Parameters

string $client Client name, currently only 'ftp' is supported
string $user Username
string $pass Password

Return Value

boolean True if the given login credentials have been set and are valid

static boolean hasCredentials( string $client)

Method to determine if client login credentials are present

Parameters

string $client Client name, currently only 'ftp' is supported

Return Value

boolean True if login credentials are available

static mixed setCredentialsFromRequest( string $client)

Determine whether input fields for client settings need to be shown

If valid credentials were passed along with the request, they are saved to the session. This functions returns an exception if invalid credentials have been given or if the connection to the server failed for some other reason.

Parameters

string $client The name of the client.

Return Value

mixed True, if FTP settings; JError if using legacy tree.

Exceptions

InvalidArgumentException if credentials invalid