hMailServer web-interface redesign

Use this forum if you want to discuss a problem or ask a question related to a hMailServer beta release.
User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

hMailServer web-interface redesign

Post by coax » 2016-12-22 17:04

I was delighted when first started using hMailServer on my Windows 2016 server (replaced SmarterMail) but web-interface was punch in the eye so I decided to redesign it. The new layout will be fully responsive and free to download. It's currently 50% done and will be released once completed (hopefully by the end of 2016).

Github zip download

Comparison screenshot:
Image

Roadmap:
- acquire Grafs community license
- implement mail server load plugin for dashboard (if possible, I'm not a PHP developer and would like help with this)

Any suggestions, comments or advices for better UX highly appreciated.
Last edited by mattg on 2016-12-29 10:51, edited 1 time in total.
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
jimimaseye
Moderator
Moderator
Posts: 8175
Joined: 2011-09-08 17:48

Re: hMailServer web-interface redesign

Post by jimimaseye » 2016-12-22 23:27

That is good work! Well done and thanks for sharing.

(I hope it will be fully tested and available for all to use/choose easily).
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

User avatar
delphiham
New user
New user
Posts: 13
Joined: 2016-03-10 22:33

Re: hMailServer web-interface redesign

Post by delphiham » 2016-12-23 00:34

Nice work! I would be it :-), but i am not good on php directly, that i can help you :-(.
o

L_
OL
This is Schäuble. Copy Schäuble into your signature to help him on his way to Überwachungsstaat.

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2016-12-23 00:59

jimimaseye wrote:That is good work! Well done and thanks for sharing.

(I hope it will be fully tested and available for all to use/choose easily).
As stated above - it will be free (need to check all 3rd party scripts if they comply with both personal and commercial use) as my small contribution to Open Source community and thanks to author of hMailServer.

PHPWebAdmin is not scripted for themed use so you will need to replace official package (just the PHPWebAdmin folder) with mine. It will be published on GitHub.

As for testing, you'll all be beta testers :)
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-24 10:28

coax wrote:- implement mail server load plugin for dashboard (if possible, I'm not a PHP developer and would like help with this)
I like to try to help you with the PHP stuff. :)
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2016-12-24 13:42

Update: the layout redesign is now finished and will be thoroughly tested in the following days before it's first release on GitHub. It's fully responsive which means you can use it on mobile device.

Here's a quick demo:
Image

Features:
- modern look and feel
- responsive layout for desktop and mobile browsers
- dashboard graphs refresh with live data
- confirmation dialogs in modal
- form validation
- works with latest hMailServer (stable) version

Roadmap:
- the Imperavi Grafs is commercial script and used for demo only, the license costs $99 for unlimited use, should we crowd-fund it?
- upload it to GitHub before end of 2016
- I'd like to implement server load on dashboard
- LOG PARSER, is there any PHP script available?
- any other suggestions, what you want to see/use in web-interface?
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-24 21:15

Here are a Open Source project for charts and more.
https://d3js.org/

This is based on D3.
http://c3js.org/samples/chart_donut.html
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2016-12-26 16:55

tunis wrote:Here are a Open Source project for charts and more.
https://d3js.org/

This is based on D3.
http://c3js.org/samples/chart_donut.html
As an optimization freak, 176 KB for C3 donut chart is much. On the other hand, Grafs is only 64 Kb, has lower memory footprint, can update data and display summary data inside chart.
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2016-12-28 14:39

I expected more feedback on this, I guess people are just not using webadmin as much... thanks to @tunis for his help with server load plugin (which unfortunately isn't easy to implement on Windows Server so I ditched it).

After few days of testing and polishing I released the v0.9 beta on https://github.com/coax/hmailserver-webadmin. You can download and use it freely (even for commercial purposes). As it's beta, there might be some glitches, appreciate if you notify me here in forums or on GitHub so I can fix it asap.

I hope @martin will see this and I'd be happy to help implementing it into next official hMailServer release.
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
jimimaseye
Moderator
Moderator
Posts: 8175
Joined: 2011-09-08 17:48

Re: hMailServer web-interface redesign

Post by jimimaseye » 2016-12-28 14:47

coax wrote:I expected more feedback on this, I guess people are just not using webadmin as much...
People do use it but the forums are often only frequented by people with problems or implementing. Most folk have it running already and will not be aware of your work here. (Long term, it will be referenced by google and people searching.) We will of course make references to it here as people ask questions about the webadmin. I think the best chance is to spread the word in other forums too and/or hopefully by reference in the official Hmailserver release package. Which brings me on to..:
coax wrote:I hope @martin will see this and I'd be happy to help implementing it into next official hMailServer release.
I do too. It would be nice to at least hear his opinion.

(I personally dont use webadmin so cant view, test or feedback. Sorry)
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

User avatar
mattg
Moderator
Moderator
Posts: 20302
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: hMailServer web-interface redesign

Post by mattg » 2016-12-28 16:07

coax wrote:I expected more feedback on this
You asked for it (be careful what you ask for :D)

Please change the name of the default folder from PHPwebadmin to something else, so that we can have both installed and compare

Code: Select all

The hMailServer version does not match the WebAdmin version.
hMailServer version: 5.6.6-B2383
WebAdmin version: 5.6.5-B2367
Please make sure you are using the PHPWebAdmin version which came with your hMailServer installation.
After I fixed that...

There is a calculation issue with number of processed messages
My admin gui says (519, 4, 44) , your web portal says (475,4,44) totalling 523 processed. They don't match.
I think that processed messages is independent from both virus and Spam messages. (I've seen spam counts higher than processed message count)

Diagnostics has a 'save' button, this should say 'run', and (thankfully!!) there is no option to change which server should be pinged in the test. In the admin GUI I can run tests on the install without selecting a local domain.

The action button 'stop server' (bottom left), should say 'pause server'

Test Spamassassin connection doesn't do anything, neither did the clamAV test or external AV scan test

As per the main webadmin, the IMAP public folders can't be manipulated

Number of open sessions refreshed fairly quickly, but a message sent didn't get displayed in the queue

Unsure if re-load scripts actually did anything, there was no feedback. (I'm pretty sure that it didn't work)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2016-12-28 19:41

mattg wrote:
coax wrote:I expected more feedback on this
You asked for it (be careful what you ask for :D)
Got no problem with that, easier for me to fix things as I cannot run every possible scenario :)

Anyway, the Git is updated with version 0.9.1 beta and here's the changelog:

[new] Replaced Administrator in top menu with $username
[new] Added counters for Rules and DNS blacklists in menu
[new] Domain accounts, rules, distribution lists
[new] Renamed folder from "PHPWebAdmin" to "WebAdmin"
[new] PrintSaveButton function can accept custom captions to display text different than default "Save" (eg. PrintSaveButton("Run");)
[tweak] Better navigation tree layout
[tweak] Created jQuery version of testVirusScanner() function in hm_smtp_antivirus.php
[fix] Legit messages are now calculated from Total - Virus - Spam
[other] In IIS 6 you'll need to manually add ".svg" mime-type as "image/svg+xml"
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-28 21:22

Got error in index.php when session not exist (before login).
Here are a fix.

Code: Select all

$username = isset($_SESSION['session_username'])?$_SESSION['session_username']:''; //moved from include_treemenu.php
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-28 23:00

When not login as administrator status page fail to load.
Only admin have permission to load status.

Example fix for hm_frontpage.php

Code: Select all

<?php
switch (hmailGetAdminLevel()){
	case 0:
		echo "<h2>Account $accountaddress</h2>"; 
		break;
		
	case 1:
		echo "<h2>Domain $domainname</h2>"; 
		break;

	case 2:
		include 'hm_status.php';
}
?>
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-28 23:31

More feedback!

Add and edit boxes under Account, Aliases and Distribution lists are just one column width in full screen.

Add Unlimited instead of 0 as you have done under domins.

Code: Select all

if ($accountmaxsize == 0) $accountmaxsize = "Unlimited"; //added
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-28 23:57

Made some changes in hm_securityranges.php

There as Expires (min) it shows the expirestime even when expires not set.

This code shows as expected.

Code: Select all

$ExpiresTime =  $obSecurityRange->Expires?ceil((strtotime($obSecurityRange->ExpiresTime)-time())/60):'No Expire';
It can take a few seconds before the range removes when it expired, it the shows -0 or using this.

Code: Select all

if ($obSecurityRange->Expires) {
	$ExpiresTime = ceil((strtotime($obSecurityRange->ExpiresTime)-time())/60);
	if ($ExpiresTime <= 0) $ExpiresTime = 'Expired';
} else $ExpiresTime = 'No Expire';
Or this only shows the expirestime if it is one.

Code: Select all

$ExpiresTime = $obSecurityRange->Expires?$obSecurityRange->ExpiresTime:'No Expire';
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2016-12-29 00:50

Thanks @tunis, I appreciate your help. This has been added into next release which will also have better date formatting for all pages and some extra fields (looking at API). That release is scheduled for next week when I come back from vacation.

Also, I have to note that this redesign has been oriented at English translation, so some fields do not use EchoTranslation function (to automatically translate).

I made a JS function ($().validation) that checks input fields and this will also get more RegEx checks soon (eg. IP addresses, alphanumeric, etc)
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-29 09:50

More good to have changes.

Different color on auto-ban ip-ranges in hm_securityranges.php

Code: Select all

<tr' . (strpos($securityrangename,'Auto-ban:')!==false?' class="auto-ban"':'') . '>

.auto-ban, .auto-ban a{color:red}
New Size column in hm_accounts.php

Code: Select all

<tr>
    <th style="width:70%;"><?php EchoTranslation($str_accountaddress) ?></th>
    <th style="width:10%;">Size (MB)</th>
    <th style="width:10%;"><?php EchoTranslation($str_maxsizemb) ?></th>
    <th style="width:10%;">&nbsp;</th>
</tr>
...
$accountsize    = $obAccount->Size();
...
<td>' . Round($accountsize,3) . '</td>
New Size column in hm_domains.php

Code: Select all

<tr>
    <th style="width:65%;">Name</th>
    <th style="width:10%;">Size (MB)</th>
    <th style="width:10%;">Max size (MB)</th>
    <th style="width:10%;">Enabled</th>
    <th style="width:5%;" class="no-sort">&nbsp;</th>
</tr>
...
$domainsize = 0;
$obAccounts = $obDomain->Accounts();
$Count = $obAccounts->Count();
for ($j = 0; $j < $Count; $j++) {
	$obAccount = $obAccounts->Item($j);
	$domainsize += $obAccount->Size();
}
...
<td>' . Round($domainsize,3) . '</td>
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2016-12-29 10:32

Minutes to auto-ban are to few digits. At lest 5 or set to databas max length.
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

tester02
Normal user
Normal user
Posts: 31
Joined: 2016-04-09 23:28

Re: hMailServer web-interface redesign

Post by tester02 » 2016-12-30 01:15

When I log in with the domain rights I get the following error:

Code: Select all

Operation failed
Description: Undefined variable: state
Script: hm_status.php
Within the domain view : Signatur, Limits, DKIM Signing, Erweitert, Zusätzlich Adressierungen and Greylisting are floating right of <div class="box medium">....</div>

Inside the div is a "JA" after my domainname and I'm not sure where it comes from.

For my specs:
I'm on php 7.0 x64
hMailServer version: 5.7.0-B2382 x64

The "normal" serveradmin mode works for me so far. THANKS for your work!

User avatar
mattg
Moderator
Moderator
Posts: 20302
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: hMailServer web-interface redesign

Post by mattg » 2016-12-30 07:43

looking good

Can I add my own (customised) Quicklinks?
Can we add a link to the online documentation, the same as the admin GUI does, on a page by page basis (ie the IP ranges help button will go to the Ip ranges page on the documentation)
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2016-12-30 11:44

mattg wrote:looking good

Can I add my own (customised) Quicklinks?
Can we add a link to the online documentation, the same as the admin GUI does, on a page by page basis (ie the IP ranges help button will go to the Ip ranges page on the documentation)
I'll be polishing the webadmin next week, there are some small glitches when not logged in as administrator.

You can easily edit include_treemenu.php and edit quick links there.
Links to documentation will be added to all the pages in next release.
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
Mar_ty
New user
New user
Posts: 14
Joined: 2016-10-24 15:19
Location: USA

Re: hMailServer web-interface redesign

Post by Mar_ty » 2016-12-30 19:43

Really nice new look for web-interface. Hope to see this redesign in the next 5.7 release soon. :D
"Too much of anything is Bad, But TOO MUCH GOOD WHISKEY IS BARELY ENOUGH"
- Mark Twain

hMailServer 5.7 -B2490 64-Bit

User avatar
mattg
Moderator
Moderator
Posts: 20302
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: hMailServer web-interface redesign

Post by mattg » 2016-12-31 00:34

I'm thinking perhaps some other dials, like
- messages per hour sent
- messages per hour received
- messages sent from a single account
- unexpected disconnects in last X days
- some live logs - colour coded of course
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2017-01-01 00:26

mattg wrote:- some live logs - colour coded of course
This could be added and customized to fit.
https://github.com/hazarkarabay/hmailserver-logviewer
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

gotspatel
Normal user
Normal user
Posts: 41
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer web-interface redesign

Post by gotspatel » 2017-01-02 15:22


I'll be polishing the webadmin next week, there are some small glitches when not logged in as administrator.
Hi there,

Any chance you will upgrade it to
hMailServer version: 5.6.6-B2383

As i just upgraded hmailserver and cannot test it :lol:
The hMailServer version does not match the WebAdmin version.
hMailServer version: 5.6.6-B2383
WebAdmin version: 5.6.5-B2367
Please make sure you are using the PHPWebAdmin version which came with your hMailServer installation.

tester02
Normal user
Normal user
Posts: 31
Joined: 2016-04-09 23:28

Re: hMailServer web-interface redesign

Post by tester02 » 2017-01-02 17:32

inside include_versioncheck.php change

Code: Select all

define('REQUIRED_VERSION', '5.6.5-B2367');
to the necessary one.

User avatar
leeplarp
New user
New user
Posts: 4
Joined: 2017-01-02 19:10
Location: NYC ('The Apple'), USA

Re: hMailServer web-interface redesign

Post by leeplarp » 2017-01-02 20:33

Before posting this, I must apologize in advance to the hMailserver Community at large:
I have been a happy, loyal user of hMailserver for too many years to count. In all of that time, I
have never joined or posted in these forums, nor have I contributed in any way to the progess and
development of this brilliant software. This defines me as having been, to date thus far, a "taker"....,
a "free software parasite"...., for which I now feel slightly ashamed. Sorry, hMailserver Community.
(Okay...., I'm finished purging my genetically inbred "Italian guilt"...., it comes from my Mom.)

Moving on to the new web-interface redesign, this is the greatest thing since...., well...., since hMailserver!!
That said, while attempting to try it out, I cannot seem to get past browsing to the 'WebAdmin' directory.

Just as background, my current (fully functional) working environment is:
- Apache 2.4.23
- MariaDB 10.1.19
- PHP 5.6.28 + PEAR
In this environment the "old school" PHPWebAdmin is working just fine so..., at least in theory..., it
should not be a 'php.ini' configuration issue and I have definitely set up the 'config.php' properly for the
"new" WebAdmin.

What I get when browsing to the new 'WebAdmin' directly is the following error:

Code: Select all

Operation failed
Description: Undefined index: session_username
Script: index.php


So...., any ideas or suggestions, folks??
Thanks in advance and....,
Ciao.
"When the going gets weird...., the weird turn pro."
~~Hunter S. Thompson

tester02
Normal user
Normal user
Posts: 31
Joined: 2016-04-09 23:28

Re: hMailServer web-interface redesign

Post by tester02 » 2017-01-02 20:57

leeplarp wrote: What I get when browsing to the new 'WebAdmin' directly is the following error:

Code: Select all

Operation failed
Description: Undefined index: session_username
Script: index.php


So...., any ideas or suggestions, folks??

tunis postet already a fix for that:
tunis wrote:Got error in index.php when session not exist (before login).
Here are a fix.

Code: Select all

$username = isset($_SESSION['session_username'])?$_SESSION['session_username']:''; //moved from include_treemenu.php
so change line 44 in index.php with the code from above

User avatar
leeplarp
New user
New user
Posts: 4
Joined: 2017-01-02 19:10
Location: NYC ('The Apple'), USA

Re: hMailServer web-interface redesign

Post by leeplarp » 2017-01-02 21:51

tester02 wrote:tunis postet already a fix for that:
Thank you **muchly**, kind person!!
I missed that 'fix'...., clearly I was using faulty 'search techniques'...., silly me.
It worked like "php magic".

Now I can see just what a truly brilliant direction this web-interface redesign is taking.
You hear that, @coax??? Brilliant!!!

Thanks again.
Ciao.
"When the going gets weird...., the weird turn pro."
~~Hunter S. Thompson

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-04 14:25

Hey all, happy new year!

Just updated the WebAdmin to v0.9.2 beta and here's the changelog:

[fix] all tables are now sorting
[fix] increase autoban field size from 4 to 5
[new] all tables now show total count
[new] domains/accounts show usage size and color coded
[new] autoban color coded and show time left in minutes
[new] offline log parser
[new] menu link to documentation
[tweak] if using newer version of hMailServer just modify include_versioncheck.php
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tester02
Normal user
Normal user
Posts: 31
Joined: 2016-04-09 23:28

Re: hMailServer web-interface redesign

Post by tester02 » 2017-01-04 18:38

Thank you for the update!

Could you change initialization_test.php

Code: Select all

if ((int) $version[0] < 5) {
	echo "hMailServer WebAdmin requires PHP5 or later.";
	die;
}
Cause it works fine with php 7.

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-04 19:08

A small update to v0.9.3 includes:

[fix] SSL certificates typo
[fix] number validation
[fix] removed PHP 7 incompatibility error
[tweak] validation for IP address input field
[tweak] supports 5.6.6-B2383 by default
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
leeplarp
New user
New user
Posts: 4
Joined: 2017-01-02 19:10
Location: NYC ('The Apple'), USA

Re: hMailServer web-interface redesign

Post by leeplarp » 2017-01-05 19:31

coax wrote:A small update to v0.9.3....
I cannot thank you enough for your continued, excellent work
on this redesign project.

An awesome effort on your part.

Ciao.
"When the going gets weird...., the weird turn pro."
~~Hunter S. Thompson

User avatar
katip
Senior user
Senior user
Posts: 703
Joined: 2006-12-22 07:58
Location: Istanbul

Re: hMailServer web-interface redesign

Post by katip » 2017-01-05 20:20

any clue about this??
Attachments
Untitled 1.jpg
Katip
--
HMS 5.7.0-B2428-LTS-64-bit, MySQL 5.7.24, SA 3.4.2, ClamAV 0.101.2 + SaneS

User avatar
Conzi
Normal user
Normal user
Posts: 140
Joined: 2006-02-24 14:44
Location: Varese, Italy

Re: hMailServer web-interface redesign

Post by Conzi » 2017-01-05 20:32

katip wrote:any clue about this??
same error to me....

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-05 21:44

katip wrote:any clue about this??
Fixed, you can download either master or just https://github.com/coax/hmailserver-web ... eemenu.php and replace your own.

Next update is in 2 weeks :)
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
katip
Senior user
Senior user
Posts: 703
Joined: 2006-12-22 07:58
Location: Istanbul

Re: hMailServer web-interface redesign

Post by katip » 2017-01-06 05:10

coax wrote:or just https://github.com/coax/hmailserver-web ... eemenu.php and replace your own.
thanks but now i get this immediately after logon.
Attachments
hMailServer  webadmin.png
hMailServer webadmin.png (9.97 KiB) Viewed 22186 times
Katip
--
HMS 5.7.0-B2428-LTS-64-bit, MySQL 5.7.24, SA 3.4.2, ClamAV 0.101.2 + SaneS

User avatar
RvdH
Senior user
Senior user
Posts: 817
Joined: 2008-06-27 14:42
Location: Netherlands

Re: hMailServer web-interface redesign

Post by RvdH » 2017-01-06 16:48

Very nice project!!

katip is right, something is wrong with: https://github.com/coax/hmailserver-web ... eemenu.php as it also breaks 'Processed messages' and 'Open sessions' in the dashboard
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

User avatar
Dravion
Senior user
Senior user
Posts: 1489
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: hMailServer web-interface redesign

Post by Dravion » 2017-01-06 23:21

This line of code raises the Error

https://github.com/coax/hmailserver-web ... tus.php#L3

Code: Select all

<h2>Server</h2>
      <p class="info"><span class="green"><?php echo $state ?>
      </span><br />status</p>
      <div class="grey">

The script doesnt check if the variable $state is avaiable and is trying to printout its value
which fails: <?php echo $state ?> There is something wrong in the caller script.
However: Dont even try to access a unchecked object or variable, regardles which programming
language you use, because its a recipe for a desaster.

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2017-01-10 16:15

As a request to move rules up and down in the web interface. viewtopic.php?f=2&t=30772
I have done a change for that to implement on the new web interface.

It's just links for up and down, so coax can add icons in the design for that later.

Added on line 36 in backgrund_rule_save.php

Code: Select all

if ($action == "moverule")
   {
	  if ($savetype == "moveup")
	   	 $rule->MoveUp();
      else if ($savetype == "movedown")
         $rule->MoveDown();
		 
	  if ($domainid == 0)
          header("Location: index.php?page=rules");
      else
          header("Location: index.php?page=account&action=edit&accountid=$accountid&domainid=$domainid");
		  
	  die;
   }
Change on line 207 in hm_account.php

Code: Select all

<th style="width:55%;"><?php EchoTranslation("Name");?></th>
                <th style="width:20%;"><?php EchoTranslation("Enabled");?></th>
                <th style="width:15%;">Move rule</th>
                <th style="width:10%;">&nbsp;</th>
Changes on line 230 in hm_account.php

Code: Select all

echo '              <tr>
                <td><a href="?page=rule&action=edit&domainid=' . $domainid . '&accountid=' . $accountid . '&ruleid=' . $ruleid . '">' . $rulename . '</a></td>
                <td><a href="#">' . $enabled . '</a></td>
				<td>';
				if($i>0)echo '<a href="?page=background_rule_save&action=moverule&savetype=moveup&domainid=' . $domainid . '&accountid=' . $accountid . '&ruleid=' . $ruleid . '">Up</a>';
				if($i < $Count-1)echo '<a href="?page=background_rule_save&action=moverule&savetype=movedown&domainid=' . $domainid . '&accountid=' . $accountid . '&ruleid=' . $ruleid . '">Down</a>';
				echo '</td>
                <td><a href="#" onclick="return Confirm(\'Confirm delete <b>' . $rulename . '</b>:\',\'Yes\',\'?page=background_rule_save&savetype=rule&action=delete&domainid=' . $domainid . '&accountid=' . $accountid . '&action=delete&ruleid=' . $ruleid . '\');" class="delete">Delete</a></td>
              </tr>' . PHP_EOL;
Change on line 19 in hm_rules.php

Code: Select all

<th style="width:65%;"><?php EchoTranslation("Name") ?></th>
              <th style="width:15%;"><?php EchoTranslation("Enabled") ?></th>
              <th style="width:15%;">Move rule</th>
              <th style="width:5%;" class="no-sort">&nbsp;</th>
Change on line 34 in hm_rules.php

Code: Select all

echo '            <tr>
              <td><a href="?page=rule&action=edit&domainid=0&accountid=0&ruleid=' . $ruleid . '">' . $rulename . '</a></td>
              <td>' . $enabled . '</td>';
			  if($i>0)echo '<a href="?page=background_rule_save&action=moverule&savetype=moveup&domainid=' . $domainid . '&accountid=' . $accountid . '&ruleid=' . $ruleid . '">Up</a>';
			  if($i < $Count-1)echo '<a href="?page=background_rule_save&action=moverule&savetype=movedown&domainid=' . $domainid . '&accountid=' . $accountid . '&ruleid=' . $ruleid . '">Down</a>';
              echo '<td><a href="#" onclick="return Confirm(\'Confirm delete <b>' . $rulename . '</b>:\',\'Yes\',\'?page=background_rule_save&savetype=rule&action=delete&domainid=0&accountid=0&action=delete&ruleid=' . $ruleid . '\');" class="delete">Delete</a></td>
            </tr>' . PHP_EOL;
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

tunis
Normal user
Normal user
Posts: 228
Joined: 2015-01-05 20:22
Location: Sweden

Re: hMailServer web-interface redesign

Post by tunis » 2017-01-10 16:49

Changes for move actions in rules.

Added on line 36 in backgrund_rule_save.php (if you added line from previous post)

Code: Select all

if ($action == "moveaction")
   {
	  if ($savetype == "moveup")
	   	 $rule->Actions->ItemByDBID($actionid)->MoveUp();
      else if ($savetype == "movedown")
         $rule->Actions->ItemByDBID($actionid)->MoveDown();
		 
	  header("Location: $rule_link");
		  
	  die;
   }
Change on line 101 in hm_rule.php

Code: Select all

<th style="width:70%;"><?php EchoTranslation("Action")?></th>
                <th style="width:20%;">Move action</th>
                <th style="width:10%;">&nbsp;</th>
Change on line 117 in hm_rule.php

Code: Select all

              <tr>
                <td><?php echo "<a href=\"?page=rule_action&action=edit&domainid=$domainid&accountid=$accountid&ruleid=$ruleid&actionid=$actionid\">$actionName</a>";?></td>
                <td>
                <?php if($i>0)echo "<a href=\"?page=background_rule_save&action=moveaction&savetype=moveup&domainid=$domainid&accountid=$accountid&ruleid=$ruleid&actionid=$actionid\">Up</a>";
			  	if($i < $count-1)echo "<a href=\"?page=background_rule_save&action=moveaction&savetype=movedown&domainid=$domainid&accountid=$accountid&ruleid=$ruleid&actionid=$actionid\">Down</a>";?>
                </td>
                <td><a href="#" onclick="return Confirm('Confirm delete <b><?php echo $actionName ?></b>:','Yes','?page=background_rule_save&savetype=action&action=delete&domainid=<?php echo $domainid ?>&accountid=<?php echo $accountid ?>&ruleid=<?php echo $ruleid ?>&actionid=<?php echo $actionid ?>');" class="delete">Delete</a></td>
              </tr>
HMS 5.6.8 B2437.17 on Windows Server 2019 Core VM.
HMS 5.6.8 B2451.21 on Windows Server 2016 Core VM.
HMS 5.6.7 B2425.16 on Windows Server 2012 R2 Core VM.

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-18 14:13

Hold tight people, @tunis and me are preparing new release for later today. Lots of bugfixes and new features.

There's just one request for the community - translations. We talked a bit about translations and I think it's best practice to use only 1 translation file (*.ini file from hMail root folder) for web interface, instead making separate translations for web.
The web interface uses EchoTranslation (function found in functions.php) that gets translation from .ini file. As there are lot's of new (mainly button) translations added, I'm wondering would someone be interested in adding these translations for english.ini file?

In example, this is english.ini file:

[Strings]
String_1=File
String_2=Exit
...
String_691=Are you sure you want to delete all messages in the folder?
String_692=Are you sure you want to delete the folder?

Add new translations after last line, but start with number 9000:

String_9001=Dashboard
String_9002=Check for updates
String_9003=Add new domain
...
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-18 20:10

Version 0.9.4 available for download. Thanks to contributor @tunis this project is getting better each week :)

What's new:
[fix] error in hm_status.php
[fix] server start/stop button
[tweak] CSS/HTML optimizations
[tweak] all words are now translatable (EchoTranslation)
[new] new chart on dashboard with sessions activity
[new] move rules up/down with arrows
[new] redesign of single account (non-admin) interface
[new] documentation link (on each page) points directly to online documentation reference
[new] several new icons
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

AndyW
New user
New user
Posts: 5
Joined: 2017-01-07 09:57

Re: hMailServer web-interface redesign

Post by AndyW » 2017-01-18 20:51

Nice work. I've just downloaded, unzipped, set config file, enabled php extension as instructed and uploaded to server and it worked first time. No messing, no fuss.

User avatar
RvdH
Senior user
Senior user
Posts: 817
Joined: 2008-06-27 14:42
Location: Netherlands

Re: hMailServer web-interface redesign

Post by RvdH » 2017-01-18 21:17

Small issue (remove the red backslash)

hm_rule.php


line: 122
<td><a href="?page=rule_action&action=edit&domainid=' . $domainid . '&accountid=' . $accountid . '&ruleid=' . $ruleid . '&actionid=' . $actionid . '\">' . $actionName . '</a></td>
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-18 21:30

RvdH wrote:Small issue (remove the red backslash)

hm_rule.php


line: 122
<td><a href="?page=rule_action&action=edit&domainid=' . $domainid . '&accountid=' . $accountid . '&ruleid=' . $ruleid . '&actionid=' . $actionid . '\">' . $actionName . '</a></td>
Thanks, fixed: https://github.com/coax/hmailserver-web ... 6e35631907
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tester02
Normal user
Normal user
Posts: 31
Joined: 2016-04-09 23:28

Re: hMailServer web-interface redesign

Post by tester02 » 2017-01-18 21:40

new line 124: echo $obLanguage->String("<br>domain active: ");
Please add the mentioned line, because else it displays only a yes after the domain name if someone with only the rights for this domain logs on.

hm_domain.php

Code: Select all

if ($admin_rights)
		PrintCheckboxRow("domainactive", "Enabled", $domainactive);
else {
       echo $obLanguage->String("<br>domain active: ");
	if ($domainactive == 1)
		echo $obLanguage->String("Yes");
	else
		echo $obLanguage->String("No");
	}

User avatar
RvdH
Senior user
Senior user
Posts: 817
Joined: 2008-06-27 14:42
Location: Netherlands

Re: hMailServer web-interface redesign

Post by RvdH » 2017-01-18 21:42

What exactly does the "Stop" button (on the left) do? ...on my installation is seems to do nothing
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-18 21:49

tester02 wrote:new line 124: echo $obLanguage->String("<br>domain active: ");
Please add the mentioned line, because else it displays only a yes after the domain name if someone with only the rights for this domain logs on.

hm_domain.php

Code: Select all

if ($admin_rights)
		PrintCheckboxRow("domainactive", "Enabled", $domainactive);
else {
       echo $obLanguage->String("<br>domain active: ");
	if ($domainactive == 1)
		echo $obLanguage->String("Yes");
	else
		echo $obLanguage->String("No");
	}
Thanks, fixed: https://github.com/coax/hmailserver-web ... 60c25d784a

I won't be updating master until next release, so just download single files.
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tester02
Normal user
Normal user
Posts: 31
Joined: 2016-04-09 23:28

Re: hMailServer web-interface redesign

Post by tester02 » 2017-01-18 21:54

Your version looks better but please make it translateable and add a ": "

Code: Select all

echo '<p>'.$obLanguage->String("Active").': </p>';

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-18 22:00

RvdH wrote:What exactly does the "Stop" button (on the left) do? ...on my installation is seems to do nothing
Fixed: https://github.com/coax/hmailserver-web ... 2743d9dffc

It works now, but when resuming server it returns error and you need to relogin. That issue is same in original PHPWebAdmin due to credentials/session.
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

tester02
Normal user
Normal user
Posts: 31
Joined: 2016-04-09 23:28

Re: hMailServer web-interface redesign

Post by tester02 » 2017-01-18 22:05

Which kind of versions do you add in the include_versioncheck.php?

Just the one I use:
define('REQUIRED_VERSION', '5.7.0-B2406');

User avatar
Dravion
Senior user
Senior user
Posts: 1489
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: hMailServer web-interface redesign

Post by Dravion » 2017-01-18 22:48

I recommend php gettext extension which is part of any php installation if you want to localize anything.There are alo pear extrapackages for i18n support but IMHO izs not necessary.

Gettext Language Translationfiles ar alo easier to maintain for less experienced developers wishing to contribute.

User avatar
mattg
Moderator
Moderator
Posts: 20302
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: hMailServer web-interface redesign

Post by mattg » 2017-01-19 00:19

tester02 wrote:Which kind of versions do you add in the include_versioncheck.php?

Just the one I use:
define('REQUIRED_VERSION', '5.7.0-B2406');
Use whatever your hMailserver version is

BTW 5.7 is not an official release yet, official builds of 5.7 are early ALPHA and really shouldn't be used.
There are a couple of 5.7 ports doing the rounds - but again not official.

EDIT - Are you sure that you didn't miss a digit. Mine is 5.6.7-B2405
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
jimimaseye
Moderator
Moderator
Posts: 8175
Joined: 2011-09-08 17:48

Re: hMailServer web-interface redesign

Post by jimimaseye » 2017-01-19 00:26

mattg wrote:
EDIT - Are you sure that you didn't miss a digit. Mine is 5.6.7-B2405
Matt, B2406 is available : https://build.hmailserver.com/viewType. ... ilServer57

I guess this is where he got it from.
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

User avatar
mattg
Moderator
Moderator
Posts: 20302
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: hMailServer web-interface redesign

Post by mattg » 2017-01-19 00:37

Yes but it is still an alpha build, not intended for live use

Looking at the build history, it still had compilation errors earlier this month
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
mattg
Moderator
Moderator
Posts: 20302
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: hMailServer web-interface redesign

Post by mattg » 2017-01-19 00:54

coax wrote:[new] new chart on dashboard with sessions activity
This needs some description about what it is, and perhaps a scale up the side to add some context.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
coax
Normal user
Normal user
Posts: 69
Joined: 2016-12-22 16:35
Location: Croatia
Contact:

Re: hMailServer web-interface redesign

Post by coax » 2017-01-19 13:40

mattg wrote:
coax wrote:[new] new chart on dashboard with sessions activity
This needs some description about what it is, and perhaps a scale up the side to add some context.
Total connections (SMTP+POP3+IMAP), pinged every 5 sec, graph shows last 5 minutes.
hMailServer web-interface redesign: https://www.hmailserver.com/forum/viewtopic.php?t=30713
Get alert when queue has 100+ messages: https://www.hmailserver.com/forum/viewtopic.php?t=31345

User avatar
mattg
Moderator
Moderator
Posts: 20302
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: hMailServer web-interface redesign

Post by mattg » 2017-01-20 01:24

Yes, I worked that out.

What I said is that the WebGUI display needs to show what this is, and perhaps show a scale
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply