From 1d2a662669d3530ae289d6a5133ec182f99c7d7c Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 22 May 2019 20:50:47 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20TEST:=20check=20if=20ssh2=20module?= =?UTF-8?q?=20is=20installed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Sulzer --- lib/ssh.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ssh.php b/lib/ssh.php index 6948645..14e771f 100644 --- a/lib/ssh.php +++ b/lib/ssh.php @@ -42,6 +42,13 @@ class OC_User_SSH extends \OCA\user_external\Base { * @return true/false */ 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); if (ssh2_auth_password($connection, $uid, $password)) { $this->storeUser($uid);