WordPress at Your Fingertips
function is not described

ftp_base::login() public WP 1.0

{} It's a method of the class: ftp_base{}

No Hooks.

Return

null. Nothing.

Usage

$ftp_base = new ftp_base();
$ftp_base->login( $user, $pass );
$user **
-
Default: NULL
$pass **
-
Default: NULL

Code of ftp_base::login() WP 5.8.2

function login($user=NULL, $pass=NULL) {
	if(!is_null($user)) $this->_login=$user;
	else $this->_login="anonymous";
	if(!is_null($pass)) $this->_password=$pass;
	else $this->_password="anon@anon.com";
	if(!$this->_exec("USER ".$this->_login, "login")) return FALSE;
	if(!$this->_checkCode()) return FALSE;
	if($this->_code!=230) {
		if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
	}
	$this->SendMSG("Authentication succeeded");
	if(empty($this->_features)) {
		if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled");
		else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features)));
	}
	return TRUE;
}