[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [FIX] ShowTikiOrg: Improve SSH connection handling and error reporting

"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a2ad7d554225_38195a14741ee@gitlab-sidekiq-low-urgency-cpu-bound-v2-664f5d7498-vnc22.mail>

ushindi bienvenu pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki


Commits:
f7af4cb3 by UshindiG at 2026-06-11T15:36:21+00:00
[FIX] ShowTikiOrg: Improve SSH connection handling and error reporting
---
* [FIX] ShowTikiOrg: Improve SSH connection handling and error reporting
---
* [FIX] ShowTikiOrg: Improve SSH connection handling and error reporting

See merge request tikiwiki/tiki!10073

(cherry picked from commit 41044cee50d77e420a74069f3d5427fbddd2bf06)

See merge request tikiwiki/tiki!10497

- - - - -


1 changed file:

- lib/core/Tracker/Field/ShowTikiOrg.php


Changes:

=====================================
lib/core/Tracker/Field/ShowTikiOrg.php
=====================================
@@ -133,11 +133,8 @@ class Tracker_Field_ShowTikiOrg extends \Tracker\Field\AbstractItemField
             $ret['username'] = 'user';
         }
 
-        $conn = new SSH2($this->getOption('domain'));
-
         try {
             if (! is_readable($this->getOption('privateKey'))) {
-                Feedback::error(tra("Unable to read the ssh private key file, in the ShowTikiOrg tracker field"));
                 $ret['status'] = 'INVKEYS';
                 return $ret;
             }
@@ -147,20 +144,26 @@ class Tracker_Field_ShowTikiOrg extends \Tracker\Field\AbstractItemField
             return $ret;
         }
 
-        if (! $privateKeyLoaded) {
-            $ret['status'] = 'INVKEYS';
+        try {
+            $conn = new SSH2($this->getOption('domain'));
+            $conntry = $conn->login($this->getOption('remoteShellUser'), $privateKeyLoaded);
+        } catch (\Throwable $e) {
+            $ret['status'] = 'DISCO';
             return $ret;
         }
 
-        $conntry = $conn->login($this->getOption('remoteShellUser'), $privateKeyLoaded);
-
         if (! $conntry) {
             $ret['status'] = 'DISCO';
             return $ret;
         }
 
         $infostring = "info -i $id -U $userid";
-        $infooutput = $conn->exec($infostring);
+        try {
+            $infooutput = $conn->exec($infostring);
+        } catch (\Throwable $e) {
+            $ret['status'] = 'DISCO';
+            return $ret;
+        }
         $ret['debugoutput'] = $infostring . " " . $infooutput;
 
         if (str_contains($infooutput, 'MAINTENANCE: ')) {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f7af4cb33e1826d3e981d65290f24b4f33957163

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f7af4cb33e1826d3e981d65290f24b4f33957163
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.