Customize FTP Port & Customize Email Ports  [SOLVED]

Locked
User avatar
hexacube
Posts: 18
Joined: Mon 27. Jul 2020, 09:48
Location: India
Contact:

Customize FTP Port & Customize Email Ports

Post by hexacube »

Dear all. I am using Keyhelp in Google Cloud Virtual Machine. Due to firewall restrictions, I use port 2121 for FTP & port 2587 for sending emails through amazon SES SMTP relay. Everything is configured properly and working fine.

But in user's dashboard under FTP and EMAIL, the default ports are displayed under "Connection data -> Show". Is there anyway to edit / customize this? Much appreciated if this is kept as an option under configurations / under white label.

Screenshots attached for reference. Thank You.
Attachments
Connection Data Menu - FTP
Connection Data Menu - FTP
Connection Data Menu - EMAIL
Connection Data Menu - EMAIL
User avatar
Alexander
Keyweb AG
Posts: 3814
Joined: Wed 20. Jan 2016, 02:23

Re: Customize FTP Port & Customize Email Ports

Post by Alexander »

Right now, the values are hard-coded.

In an upcoming update, I could potentially also read them from the /etc/services file. In this case, if this file lists the correct ports, than they would be shown.
Beside of that, you can also use the white label settings and write some lines of Javascript to update the port numbers accordingly.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
hexacube
Posts: 18
Joined: Mon 27. Jul 2020, 09:48
Location: India
Contact:

Re: Customize FTP Port & Customize Email Ports

Post by hexacube »

Thank you @Alexander. I will try white label with js codes to replace the port numbers displayed.
User avatar
hexacube
Posts: 18
Joined: Mon 27. Jul 2020, 09:48
Location: India
Contact:

Re: Customize FTP Port & Customize Email Ports  [SOLVED]

Post by hexacube »

Code: Select all

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    if (window.location.href.indexOf("page=user_ftp") > -1) {
      $("td:contains('21')").html("2121");
	  $("td:contains('server.mywebserver.com')").html("ftp.mywebserver.com");
    }
    if (window.location.href.indexOf("page=user_email") > -1) {
      $("tH:contains('Connection data')").html("");
	  $("td:contains('Show')").html("");
    }	
  });
</script>
I have added the above javascript + jquery under white label configuration. Its perfectly working.

1. The FTP port is now displayed as 2121 instead of 21.
2. The email ports are completely hidden for users. Since I use amazon ses as smtp, I don't want my users to take control of smtp credentials and options to use external email clients.

Let me know whether the above code is correct and safe?
User avatar
Alexander
Keyweb AG
Posts: 3814
Joined: Wed 20. Jan 2016, 02:23

Re: Customize FTP Port & Customize Email Ports

Post by Alexander »

You can remove the jquery include and the <script> tag, as this is taken care by KeyHelp.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
hexacube
Posts: 18
Joined: Mon 27. Jul 2020, 09:48
Location: India
Contact:

Re: Customize FTP Port & Customize Email Ports

Post by hexacube »

Thank you @Alexander

As suggested by u, I have removed them. Script is working fine as previous.
Locked