showpass.cgi

Jamie/Joe,

From time to time I find myself referring to "Edit Virtual Server" to copy a password for a Virtual Server.

At the moment, when you click the "key" icon to show the "Username" and "Password", it can be difficult to copy the password since clicking on the popup (using Authentic Theme) the popup closes.

That said, I searched through "/usr/libexec/webmin/virtual-server/showpass.cgi" code and devised a clean fix that could be useful for others, so I thought I'd pass it along.

Near the end of the file, there's a few lines:

"<td><tt>",&html_escape($username),"</tt></td> </tr>\n";

To make the username selectable without making things too complicated, I changed the above code to read.

"<td><input size="20" style="border: 0;font-size: 12px;height: 30px;width: 150px"  type="text" value="",&html_escape($username),""></td></tr>\n";

Respectively, I changed the following code:

"<td><tt>",&html_escape($pass),"</tt></td> </tr>\n";

to

"<td><input size="20" style="border: 0;font-size: 12px;height: 30px;width: 150px" type="text" value="",&html_escape($pass),""></td></tr>\n";

While I've personally added the styling statically in the snippet, I suppose this could be globalized somewhere in the theme, but it was a quick fix to apply the styles inline for me.

Anyways, always happy to provide suggestions to further improve the product!

-Peter

Comments

Assigned: Unassigned »

Re-assigning this to Ilia, as it looks like a theme question.

Jamie,

Actually at first glance I thought this was the case too. But the code is generated statically in the "showpass.cgi" script, so it would seem the basic portion of the code might be more appropriate for modification in the "showpass.cgi" script itself.

I suppose styling the look and feel might be appropriately delegated to Ilia, but the basic input field itself should be put into "showpass.cgi", unless you later expose this data via another method.

Just my thought ofcourse.

-Peter

Did you check if that fix works? Because I'm not sure if showpass.cgi is being run when using the new theme.

Jamie,

The modification was taken from one of my own Virtualmin installs.

Yes, when you click the "key" icon in "Edit Virtual Server" page, the Authentic theme is essentially calling the "showpass.cgi" script for it's inline popup.

-Peter

Ilia, could you change the popup so that it has a separate close button? That seems like the more scalable solution, as there are several of these in Virtualmin and Cloudmin.

Ilia's picture
Submitted by Ilia on Thu, 02/16/2017 - 12:36

Yes, Jamie, I could do that.

Peter, at the moment, I made it intelligent enough to keep it opened in case user selected text. Anytime there is selected username/password, the popup will stay and wait for your action.

If you wish to have a close button it will require some extra rework but I think I can do it without making it look bad.

Ilia's picture
Submitted by Ilia on Fri, 02/17/2017 - 06:14

Project: Virtualmin Virtual Servers » Authentic Theme