From b289d26c892d8e4a7d78314514c32e72518d278a Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 21 Dec 2024 00:25:05 -0500 Subject: [PATCH] fix some stuff to use .NET OMS, and allow viewing of certain credentials --- .../src/mocha-php/ui/pages/SUVPage.phpx.php | 136 ++++++++++++++---- 1 file changed, 112 insertions(+), 24 deletions(-) diff --git a/mocha-php/src/mocha-php/ui/pages/SUVPage.phpx.php b/mocha-php/src/mocha-php/ui/pages/SUVPage.phpx.php index 328027b..7850195 100644 --- a/mocha-php/src/mocha-php/ui/pages/SUVPage.phpx.php +++ b/mocha-php/src/mocha-php/ui/pages/SUVPage.phpx.php @@ -289,33 +289,79 @@ EOF prepare($query); - $result = $stmt->execute(); - $rows = $stmt->fetchAll(); - foreach ($rows as $values) + $use_dotnet = true; + + if ($use_dotnet) { - if ($values["is_library"] != 0) + // using .NET OMS + $curl = curl_init("http://localhost:4436/tenants"); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + if ($curl == false) { - continue; } - ?> - - "> - Active - Development - Local - No Charge - - - - - - - + + + Active + Development + Local + No Charge + + + + + + + prepare($query); + try + { + $result = $stmt->execute(); + $rows = $stmt->fetchAll(); + foreach ($rows as $values) + { + if ($values["is_library"] != 0) + { + continue; + } + ?> + + "> + Active + Development + Local + No Charge + + + + + + + " . $ex . ""); + } } ?> @@ -363,6 +409,48 @@ EOF }; $tabContainer->TabPages[] = $page; + global $passwd_file; + $passwd_file = "/etc/mocha/passwd"; + if (file_exists($passwd_file)) + { + $page = new TabPage(); + $page->Title = "Access"; + $page->Content = function() + { + global $passwd_file; + ?> +

SFTP Accounts

+

Use these details to log into your SUV for SFTP transfers.

+

+ These credentials are stored as plain text and should not be used in production environments. + To push changes from your SUV to a production server, run mocha suv migrate from a shell. +

+ + + + + + + + + "); + } + ?> + +
User namePassword
" . trim($lineSplit[0]) . "" . trim($lineSplit[1]) . "
+ TabPages[] = $page; + } $tabContainer->Render(); }