english/libraries/joomla/client/helper.php
/**
	 * Method to determine if client login credentials are present
	 *
	 * @param   string   Client name, currently only 'ftp' is supported
	 *
	 * @return  boolean  True if login credentials are available
	 * @since   11.1
	 */
Method to determine if client login credentials are present
@param   string   Client name, currently only 'ftp' is supported

@return  boolean  True if login credentials are available
@since   11.1
Method to determine if client login credentials are present @param string Client name currently only ' ftp ' is supported @return boolean True if login credentials are available @since 11 . 1
public static function hasCredentials($client)
	{
		$return = false;
		$client = strtolower($client);
		switch ($client) {
			case 'ftp':
				$config = JFactory::getConfig();
				$options = array(
					'enabled'	=> $config->get('ftp_enable'),
					'user'		=> $config->get('ftp_user'),
					'pass'		=> $config->get('ftp_pass')
				);
				break;
			default:
				$options = array(
					'enabled'	=> false,
					'user'		=> '',
					'pass'		=> ''
				);
				break;
		}
		if ($options['enabled'] == false) {
			$return = true;
		} else if ($options['user'] != '' && $options['pass'] != '') {
			$return = true;
		} else {
			$session = JFactory::getSession();
			$user = $session->get($client.'.user', null, 'JClientHelper');
			$pass = $session->get($client.'.pass', null, 'JClientHelper');
			if ($user != '' && $pass != '') {
				$return = true;
			}
		}
		return $return;
	}
public static function hasCredentials ( $ client ) { $ return = false ; $ client = strtolower ( $ client ) ; switch ( $ client ) { case 'ftp' : $ config = JFactory :: getConfig ( ) ; $ options = array ( 'enabled' => $ config -> get ( 'ftp_enable' ) , 'user' => $ config -> get ( 'ftp_user' ) , 'pass' => $ config -> get ( 'ftp_pass' ) ) ; break ; default : $ options = array ( 'enabled' => false , 'user' => '' , 'pass' => '' ) ; break ; } if ( $ options [ 'enabled' ] == false ) { $ return = true ; } else if ( $ options [ 'user' ] != '' && $ options [ 'pass' ] != '' ) { $ return = true ; } else { $ session = JFactory :: getSession ( ) ; $ user = $ session -> get ( $ client . '.user' , null , 'JClientHelper' ) ; $ pass = $ session -> get ( $ client . '.pass' , null , 'JClientHelper' ) ; if ( $ user != '' && $ pass != '' ) { $ return = true ; } } return $ return ; }
Method to determine if client login credentials are present
 @param   string   Client name, currently only 'ftp' is supported
Method to determine if client login credentials are present @param string Client name currently only ' ftp ' is supported
// Get (unmodified) credentials for this client // The client is disabled in global config, so let's pretend we are OK // Login credentials are available in global config // Check if login credentials are available in the session