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

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a01b2bdbc004_38190f3c755ce@gitlab-sidekiq-low-urgency-cpu-bound-v2-d56957658-lbrdv.mail>

luci pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
41044cee by UshindiG at 2026-05-11T10:27:09+00:00
[FIX] ShowTikiOrg: Improve SSH connection handling and error reporting
---
* [FIX] ShowTikiOrg: Improve SSH connection handling and error reporting

See merge request tikiwiki/tiki!10073

- - - - -


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/41044cee50d77e420a74069f3d5427fbddd2bf06

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/41044cee50d77e420a74069f3d5427fbddd2bf06
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.