Actions

Difference between revisions of "JClientHelper/getCredentials"

From Joomla! Documentation

(New page: 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 ===...)
 
(Fix close code tag)
 
Line 1: Line 1:
 
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
 
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===
 
===Syntax===
<code>array  getCredentials  ($client, [$force = false])<code>
+
<code>array  getCredentials  ($client, [$force = false])</code>
  
 
{| class="wikitable"
 
{| class="wikitable"

Latest revision as of 18:55, 20 June 2013

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