Fixing tsdns ssh login

https://easy-wi.com/forum/thread-7719.html
This commit is contained in:
GrillGuth 2016-08-31 16:50:35 +02:00 committed by GitHub
parent ef4cc2e070
commit 95b508c60e

View File

@ -122,17 +122,19 @@ function tsdns ($action, $sship, $sshport, $sshuser, $keyuse, $sshkey, $sshpw, $
$privateKey = EASYWIDIR . '/keys/' . removePub($sshkey);
$sshpw = new phpseclib\Crypt\RSA();
$key = new phpseclib\Crypt\RSA();
if ($keyuse == 'B') {
$sshpw->setPassword($sshpw);
$key->setPassword($sshpw);
}
$keyContent = @file_get_contents($privateKey);
if ($keyContent) {
$sshpw->loadKey($keyContent);
$key->loadKey($keyContent);
}
$sshpw = $key;
}
if ($sshSftpObject->login($sshuser, $sshpw)) {
@ -586,4 +588,4 @@ function getVoiceMasterList($resellerID, $adminID) {
}
return $table;
}
}