JClientHelper/hasCredentials
From Joomla! Documentation
< JClientHelper(Difference between revisions)
(New page: Method to determine if client login credentials are present. Returns True if login credentials are available ===Syntax=== <code>boolean hasCredentials ($client) <code> {| class="wikita...) |
|||
| Line 22: | Line 22: | ||
===Example=== | ===Example=== | ||
| + | <source lang="php"> | ||
| + | jimport('joomla.client.helper'); | ||
| + | if (JClientHelper::hasCredentials('ftp')){ | ||
| + | //Do something | ||
| + | }else { | ||
| + | //Do something | ||
| + | } | ||
| + | </source> | ||
===See also=== | ===See also=== | ||
* [http://api.joomla.org/Joomla-Framework/Client/JClientHelper.html#hasCredentials JClientHelper::hasCredentials on api.joomla.org] | * [http://api.joomla.org/Joomla-Framework/Client/JClientHelper.html#hasCredentials JClientHelper::hasCredentials on api.joomla.org] | ||
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JClientHelper]]</noinclude> | <noinclude>[[Category:Development]][[Category:Framework]][[Category:JClientHelper]]</noinclude> | ||
Latest revision as of 08:03, 14 December 2008
Method to determine if client login credentials are present. Returns True if login credentials are available
Contents |
[edit] Syntax
boolean hasCredentials ($client)
| Argument | Data type | Description | Default |
|---|---|---|---|
| $client | string | Client name, currently only 'ftp' is supported |
[edit] Returns
Returns TRUE if:
- Client is disabled in Global Configurations
- Client Credentials 'user' and 'pass' have been set in Global Configurations
- If the Client login credentials are available in the session.
[edit] Example
jimport('joomla.client.helper'); if (JClientHelper::hasCredentials('ftp')){ //Do something }else { //Do something }