Actions

JClientHelper/getCredentials

From Joomla! Documentation

Revision as of 07:02, 14 December 2008 by Batch1211 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Method to return the array of client layer configuration options. Returns Client layer configuration options, consisting of at least these fields: enabled, host, port, user, pass, root

Syntax

array getCredentials ($client, [$force = false])

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

Example

To get the credentials of our FTP client

jimport('joomla.client.helper');
$ftp = JClientHelper::getCredentials('ftp');
echo '<pre>';
print_r($ftp);
echo '</pre>';
/* OUTPUT:
Array
(
    [enabled] => 0
    [host] => 127.0.0.1
    [port] => 21
    [user] => user
    [pass] => password
    [root] => 
)
 
*/

See also