Skip to content

Commit

Permalink
v0.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
coax committed Jan 20, 2017
1 parent 7d0e9a5 commit 8c58ad6
Show file tree
Hide file tree
Showing 78 changed files with 483 additions and 1,869 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ How to use

Changelog
-----
Version 0.9.5 beta (20.01.2017)
- [fix] server start/stop button
- [fix] minor typos in pages
- [fix] invisible checkboxes
- [fix] some mobile submenus unresponsive to click
- [tweak] XHTML to HTML5 declaration
- [tweak] more things translated
- [new] removed all old JS and CSS
- [new] count TCP/IP ports in menu
- [new] define webmail link in config.php
- [new] external accounts inside account

Version 0.9.4 beta (18.01.2017)
- [fix] error in hm_status.php
- [fix] server start/stop button
Expand Down
133 changes: 65 additions & 68 deletions WebAdmin/background_account_externalaccount_save.php
Original file line number Diff line number Diff line change
@@ -1,73 +1,70 @@
<?php
if (!defined('IN_WEBADMIN'))
exit();
if (!defined('IN_WEBADMIN'))
exit();

$domainid = hmailGetVar("domainid",0);
$accountid = hmailGetVar("accountid",0);
$faid = hmailGetVar("faid",0);
$action = hmailGetVar("action","");

if (hmailGetAdminLevel() == 0 && ($accountid != hmailGetAccountID() || $domainid != hmailGetDomainID()))
hmailHackingAttemp();
$domainid = hmailGetVar("domainid",0);
$accountid = hmailGetVar("accountid",0);
$faid = hmailGetVar("faid",0);
$action = hmailGetVar("action","");

if (hmailGetAdminLevel() == 1 && $domainid != hmailGetDomainID())
hmailHackingAttemp(); // Domain admin but not for this domain.

$obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
$obAccount = $obDomain->Accounts->ItemByDBID($accountid);
$obFetchAccounts = $obAccount->FetchAccounts();
if (hmailGetAdminLevel() == 0 && ($accountid != hmailGetAccountID() || $domainid != hmailGetDomainID()))
hmailHackingAttemp();

if ($action == "edit")
$obFA = $obFetchAccounts->ItemByDBID($faid);
elseif ($action == "add")
$obFA = $obFetchAccounts->Add();
elseif ($action == "delete")
{
$obFetchAccounts->DeleteByDBID($faid);
header("Location: index.php?page=account_externalaccounts&domainid=$domainid&accountid=$accountid");
exit();
}
elseif ($action == "downloadnow")
{
$obFA = $obFetchAccounts->ItemByDBID($faid);
$obFA->DownloadNow();
header("Location: index.php?page=account_externalaccounts&domainid=$domainid&accountid=$accountid");
exit();
}

$DaysToKeepMessages = hmailGetVar("DaysToKeepMessages",0);
$DaysToKeepMessagesValue = hmailGetVar("DaysToKeepMessagesValue",0);

$obFA->Enabled = hmailGetVar("Enabled",0);
$obFA->Name = hmailGetVar("Name",0);;
$obFA->MinutesBetweenFetch = hmailGetVar("MinutesBetweenFetch",0);
$obFA->Port = hmailGetVar("Port",0);
$obFA->ProcessMIMERecipients = hmailGetVar("ProcessMIMERecipients",0);
$obFA->ProcessMIMEDate = hmailGetVar("ProcessMIMEDate",0);
$obFA->ServerAddress = hmailGetVar("ServerAddress",0);
$obFA->ServerType = hmailGetVar("ServerType",0);
$obFA->Username = hmailGetVar("Username",0);
$obFA->UseAntiVirus = hmailGetVar("UseAntiVirus",0);
$obFA->UseAntiSpam = hmailGetVar("UseAntiSpam",0);
$obFA->EnableRouteRecipients = hmailGetVar("EnableRouteRecipients",0);
$obFA->ConnectionSecurity = hmailGetVar("ConnectionSecurity",0);

if (strlen($DaysToKeepMessages) > 0 && $DaysToKeepMessages <= 0)
$obFA->DaysToKeepMessages = $DaysToKeepMessages;
else
$obFA->DaysToKeepMessages = $DaysToKeepMessagesValue;

$Password = hmailGetVar("Password",0);

if (strlen($Password) > 0)
$obFA->Password = $Password;

$obFA->Save();

$faid = $obFA->ID;



header("Location: index.php?page=account_externalaccount&action=edit&domainid=$domainid&accountid=$accountid&faid=$faid");
?>
//not domain admin for this domain
if (hmailGetAdminLevel() == 1 && $domainid != hmailGetDomainID())
hmailHackingAttemp();

$obDomain = $obBaseApp->Domains->ItemByDBID($domainid);
$obAccount = $obDomain->Accounts->ItemByDBID($accountid);
$obFetchAccounts = $obAccount->FetchAccounts();

if ($action == "edit")
$obFA = $obFetchAccounts->ItemByDBID($faid);
elseif ($action == "add")
$obFA = $obFetchAccounts->Add();
elseif ($action == "delete") {
$obFetchAccounts->DeleteByDBID($faid);
//header("Location: index.php?page=account_externalaccounts&domainid=$domainid&accountid=$accountid");
header("Location: index.php?page=account&action=edit&domainid=$domainid&accountid=$accountid");
exit();
} elseif ($action == "downloadnow") {
$obFA = $obFetchAccounts->ItemByDBID($faid);
$obFA->DownloadNow();
//header("Location: index.php?page=account_externalaccounts&domainid=$domainid&accountid=$accountid");
header("Location: index.php?page=account&action=edit&domainid=$domainid&accountid=$accountid");
exit();
}

$DaysToKeepMessages = hmailGetVar("DaysToKeepMessages",0);
$DaysToKeepMessagesValue = hmailGetVar("DaysToKeepMessagesValue",0);

$obFA->Enabled = hmailGetVar("Enabled",0);
$obFA->Name = hmailGetVar("Name",0);
$obFA->MinutesBetweenFetch = hmailGetVar("MinutesBetweenFetch",0);
$obFA->Port = hmailGetVar("Port",0);
$obFA->ProcessMIMERecipients = hmailGetVar("ProcessMIMERecipients",0);
$obFA->ProcessMIMEDate = hmailGetVar("ProcessMIMEDate",0);
$obFA->ServerAddress = hmailGetVar("ServerAddress",0);
$obFA->ServerType = hmailGetVar("ServerType",0);
$obFA->Username = hmailGetVar("Username",0);
$obFA->UseAntiVirus = hmailGetVar("UseAntiVirus",0);
$obFA->UseAntiSpam = hmailGetVar("UseAntiSpam",0);
$obFA->EnableRouteRecipients = hmailGetVar("EnableRouteRecipients",0);
$obFA->ConnectionSecurity = hmailGetVar("ConnectionSecurity",0);

if (strlen($DaysToKeepMessages) > 0 && $DaysToKeepMessages <= 0)
$obFA->DaysToKeepMessages = $DaysToKeepMessages;
else
$obFA->DaysToKeepMessages = $DaysToKeepMessagesValue;

$Password = hmailGetVar("Password",0);

if (strlen($Password) > 0)
$obFA->Password = $Password;

$obFA->Save();

$faid = $obFA->ID;

header("Location: index.php?page=account_externalaccount&action=edit&domainid=$domainid&accountid=$accountid&faid=$faid");
?>
18 changes: 15 additions & 3 deletions WebAdmin/config-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$hmail_config['rooturl'] = "http://www.mydomain.com/PHPWebAdmin/";
*/

$hmail_config['rooturl'] = "http://localhost/";
$hmail_config['rooturl'] = "http://localhost/";

/*
The user interface language for PHPWebAdmin. Note that this language
Expand All @@ -32,7 +32,7 @@
$hmail_config['defaultlanguage'] = "english";
*/

$hmail_config['defaultlanguage'] = "english";
$hmail_config['defaultlanguage'] = "english";

/*
Expand Down Expand Up @@ -62,6 +62,18 @@
2 - Only server administrators should be allowed access.
*/

$hmail_config['rule_editing_level'] = 2;
$hmail_config['rule_editing_level'] = 2;

/*
Added in web interface redesign to show webmail links to logged in users.
[domain] is needed if you want the script to dynamically change domains.
If not set (delete or comment the line), the webmail link will not be shown.
Example:
http://webmail.[domain]
http://[domain]/webmail
*/
$hmail_config['webmail'] = "http://webmail.[domain]";
?>
2 changes: 1 addition & 1 deletion WebAdmin/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
?>
<div class="warning">
Operation failed<br />
Description: <?php echo $errstr?><br />
Description: <?php echo $errstr?><br>
Script: <?php echo $errfile?>
</div>
44 changes: 41 additions & 3 deletions WebAdmin/hm_account.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@
if ($admin_rights)
echo '<input type="text" name="accountmaxsize" value="' . $accountmaxsize . '" checktype="number" size="5" checkallownull="false" checkmessage="' . $str_mailboxsize . '" class="req number small">';
else
echo $accountmaxsize;
echo '<b>' . $accountmaxsize . '</b>' . PHP_EOL;

PrintPropertyRow("Size (MB)", Round($accountsize,3));
PrintPropertyRow("Last logon time", $accountlastlogontime);
PrintPropertyRow("Size (MB)", Round($accountsize,3));
PrintPropertyRow("Last logon time", $accountlastlogontime);
?>
<p><?php EchoTranslation("Administration level")?></p>
<select name="accountadminlevel" <?php if ($admin_rights == 0) echo " disabled ";?> class="medium">
Expand Down Expand Up @@ -260,6 +260,44 @@
PrintPropertyEditRow("PersonLastName", "Last name", $PersonLastName);
?>
</div>
<h3><a href="#"><?php EchoTranslation("External accounts") ?></a></h3>
<div class="hidden">
<table>
<thead>
<tr>
<th><?php EchoTranslation("Name")?></th>
<th style="width:40%;"><?php EchoTranslation("Server address")?></th>
<th style="width:32px;">&nbsp;</th>
<th style="width:32px;">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$obFetchAccounts = $obAccount->FetchAccounts();
$Count = $obFetchAccounts->Count();

$str_delete = $obLanguage->String("Remove");
$str_downloadnow = $obLanguage->String("Download now");

for ($i = 0; $i < $Count; $i++) {
$obFetchAccount = $obFetchAccounts->Item($i);

$FAID = $obFetchAccount->ID;
$Name = $obFetchAccount->Name;
$ServerAddress = $obFetchAccount->ServerAddress;

echo ' <tr>
<td><a href="?page=account_externalaccount&action=edit&domainid=' . $domainid . '&accountid=' . $accountid . '&faid=' . $FAID . '">' . $Name . '</a></td>
<td><a href="?page=account_externalaccount&action=edit&domainid=' . $domainid . '&accountid=' . $accountid . '&faid=' . $FAID . '">' . $ServerAddress . '</a></td>
<td><a href="?page=background_account_externalaccount_save&action=downloadnow&domainid=' . $domainid . '&accountid=' . $accountid . '&faid=' . $FAID . '" class="download">' . $str_downloadnow . '</a></td>
<td><a href="#" onclick="return Confirm(\'Confirm delete <b>' . $Name . '</b>:\',\'Yes\',\'?page=background_account_externalaccount_save&action=delete&domainid=' . $domainid . '&accountid=' . $accountid . '&faid=' . $FAID . '\');" class="delete">' . $str_delete . '</a></td>
</tr>' . PHP_EOL;
}
?>
</tbody>
</table>
<div class="buttons center"><a href="?page=account_externalaccount&action=add&domainid=<?php echo $domainid ?>&accountid=<?php echo $accountid ?>" class="button"><?php EchoTranslation("Add new external account") ?></a></div>
</div>
<?php
PrintSaveButton();
?>
Expand Down
4 changes: 2 additions & 2 deletions WebAdmin/hm_alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
PrintHidden("aliasid", $aliasid);
?>
<p><?php EchoTranslation("Redirect from") ?></p>
<input type="text" name="aliasname" value="<?php echo PreprocessOutput($aliasname)?>" checkallownull="false" checkmessage="<?php EchoTranslation("Redirect from")?>" class="req medium">@<?php echo $domainname ?>
<input type="text" name="aliasname" value="<?php echo PreprocessOutput($aliasname)?>" maxlength="100" checkallownull="false" checkmessage="<?php EchoTranslation("Redirect from")?>" class="req medium">@<?php echo $domainname ?>
<?php
PrintPropertyEditRow("aliasvalue", "To", $aliasvalue);
PrintPropertyEditRow("aliasvalue", "To", $aliasvalue, 100);
PrintCheckboxRow("aliasactive", "Enabled", $aliasactive);

PrintSaveButton();
Expand Down
Loading

0 comments on commit 8c58ad6

Please sign in to comment.