SSH2: move _connect() call to _login() from login()

Per bantu, this is required for it to work with Net/SFTP.php
This commit is contained in:
terrafrost 2014-04-08 08:48:12 -05:00
parent 0ad0bb4c37
commit 79719e8f74

View File

@ -1760,13 +1760,6 @@ class Net_SSH2
*/
function login($username)
{
if (!($this->bitmap & NET_SSH2_MASK_CONSTRUCTOR)) {
$this->bitmap |= NET_SSH2_MASK_CONSTRUCTOR;
if (!$this->_connect()) {
return false;
}
}
$args = func_get_args();
return call_user_func_array(array(&$this, '_login'), $args);
}
@ -1783,6 +1776,13 @@ class Net_SSH2
*/
function _login($username)
{
if (!($this->bitmap & NET_SSH2_MASK_CONSTRUCTOR)) {
$this->bitmap |= NET_SSH2_MASK_CONSTRUCTOR;
if (!$this->_connect()) {
return false;
}
}
$args = array_slice(func_get_args(), 1);
if (empty($args)) {
return $this->_login_helper($username);