JClientHelper/setCredentialsFromRequest

Aus Joomla! Dokumentation
Wechseln zu: Navigation, Suche

ToDo übersetzen JClientHelper/setCredentialsFromRequest This method checks if valid credentials have been passed through the request. If so, they are set as the new credentials for the client. Since this method is used to determine, if the input fields for the client settings need to be shown, this method returns FALSE if the credentials passed by the request could be successfully stored OR the credentials have been stored via the Global Configurations. Otherwise this method reurns TRUE.

Inhaltsverzeichnis

[Bearbeiten] Definiert in

Folder blue.png /libraries/joomla

  • Folder red.png client
    • File white.png helper.php

[Bearbeiten] Syntax

static setCredentialsFromRequest( $client )
  • @return mixed - boolean True wenn die FTP Einstellungen angezeigt werden sollen / object JExeption
    • Returns FALSE if:
    • Parameters 'username' and 'password' that are passed via the request are not empty AND are valid (See JClientHelper/setCredentials). OR:
    • The credentials for the given client are set in the Global Configurations.
  • @since 1.5
Parameter Datentyp Beschreibung Standardwert
$client string Client name, currently only 'ftp' is supported ---

[Bearbeiten] Request Parameters

The method checks for the following two request parameters, that shall be used to set the credentials for the given client.

  • username
  • password

[Bearbeiten] Beispiel

In this example, we want to find out, if we need to show the login form for the FTP client:

jimport('joomla.client.helper');
 
if(JClientHelper::setCredentialsFromRequest('ftp'){
   // show login form
}
// continue with code

This code checks if the credentials for the FTP client are passed via the request, or are already stored via the Global Configurations. If this is the case, the code continues without the login form beeing displayed. Otherwise, the login form is displayed.

[Bearbeiten] Siehe auch

Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Sonstiges
Team Navigation
Werkzeuge