✅ TEST: check if ssh2 module is installed
Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
This commit is contained in:
@@ -42,6 +42,13 @@ class OC_User_SSH extends \OCA\user_external\Base {
|
|||||||
* @return true/false
|
* @return true/false
|
||||||
*/
|
*/
|
||||||
public function checkPassword($uid, $password) {
|
public function checkPassword($uid, $password) {
|
||||||
|
if (!extension_loaded('ssh2')) {
|
||||||
|
OC::$server->getLogger()->error(
|
||||||
|
'ERROR: php-ssh2 PECL module missing',
|
||||||
|
['app' => 'user_external']
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$connection = ssh2_connect($this->host, $this->port);
|
$connection = ssh2_connect($this->host, $this->port);
|
||||||
if (ssh2_auth_password($connection, $uid, $password)) {
|
if (ssh2_auth_password($connection, $uid, $password)) {
|
||||||
$this->storeUser($uid);
|
$this->storeUser($uid);
|
||||||
|
|||||||
Reference in New Issue
Block a user