ftp_base::login()publicWP 1.0

Method of the class: ftp_base{}

No Hooks.

Return

null. Nothing (null).

Usage

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

ftp_base::login() code WP 6.5.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="[email protected]";
	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("Cannot get features list. All supported - disabled");
		else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features)));
	}
	return TRUE;
}