mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
Pre release fixes and improvements
This commit is contained in:
parent
67c5e31e58
commit
abddb3d828
61 changed files with 378 additions and 57 deletions
|
|
@ -2085,6 +2085,18 @@ class Actions
|
|||
public function DoFilters()
|
||||
{
|
||||
$oAccount = $this->getAccountFromToken();
|
||||
|
||||
$aFakeFilters = null;
|
||||
|
||||
$this->Plugins()
|
||||
->RunHook('filter.filters-fake', array($oAccount, &$aFakeFilters))
|
||||
;
|
||||
|
||||
if ($aFakeFilters)
|
||||
{
|
||||
return $this->DefaultResponse(__FUNCTION__, $aFakeFilters);
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__,
|
||||
$this->FiltersProvider()->Load($oAccount, $oAccount->DomainSieveAllowRaw()));
|
||||
}
|
||||
|
|
@ -2116,6 +2128,10 @@ class Actions
|
|||
}
|
||||
}
|
||||
|
||||
$this->Plugins()
|
||||
->RunHook('filter.filters-save', array($oAccount, &$aFilters, &$sRaw, &$bRawIsActive))
|
||||
;
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, $this->FiltersProvider()->Save($oAccount,
|
||||
$aFilters, $sRaw, $bRawIsActive));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class Domain
|
|||
$bSieveAllowRaw = isset($aDomain['sieve_allow_raw']) ? (bool) $aDomain['sieve_allow_raw'] : false;
|
||||
|
||||
$sSieveHost = empty($aDomain['sieve_host']) ? '' : (string) $aDomain['sieve_host'];
|
||||
$iSievePort = empty($aDomain['sieve_port']) ? 2000 : (int) $aDomain['sieve_port'];
|
||||
$iSievePort = empty($aDomain['sieve_port']) ? 4190 : (int) $aDomain['sieve_port'];
|
||||
$iSieveSecure = self::StrConnectionSecurityTypeToCons(
|
||||
!empty($aDomain['sieve_secure']) ? $aDomain['sieve_secure'] : '');
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ class Domain
|
|||
|
||||
if ($this->iSievePort <= 0)
|
||||
{
|
||||
$this->iSievePort = 2000;
|
||||
$this->iSievePort = 4190;
|
||||
}
|
||||
|
||||
if ($this->iOutPort <= 0)
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ class Notifications
|
|||
const LicensingBanned = 712;
|
||||
|
||||
const DemoSendMessageError = 750;
|
||||
const DemoAccountError = 751;
|
||||
|
||||
const AccountAlreadyExists = 801;
|
||||
const AccountDoesNotExist = 802;
|
||||
|
|
@ -132,6 +133,7 @@ class Notifications
|
|||
self::LicensingExpired => 'LicensingExpired',
|
||||
self::LicensingBanned => 'LicensingBanned',
|
||||
self::DemoSendMessageError => 'DemoSendMessageError',
|
||||
self::DemoAccountError => 'DemoAccountError',
|
||||
self::AccountAlreadyExists => 'AccountAlreadyExists',
|
||||
self::AccountDoesNotExist => 'AccountDoesNotExist',
|
||||
self::MailServerError => 'MailServerError',
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class Domain extends \RainLoop\Providers\AbstractProvider
|
|||
$bUseSieve = '1' === (string) $oActions->GetActionParam('UseSieve', '0');
|
||||
$bSieveAllowRaw = '1' === (string) $oActions->GetActionParam('SieveAllowRaw', '0');
|
||||
$sSieveHost = (string) $oActions->GetActionParam('SieveHost', '');
|
||||
$iSievePort = (int) $oActions->GetActionParam('SievePort', 2000);
|
||||
$iSievePort = (int) $oActions->GetActionParam('SievePort', 4190);
|
||||
$iSieveSecure = (int) $oActions->GetActionParam('SieveSecure', \MailSo\Net\Enumerations\ConnectionSecurityType::NONE);
|
||||
$sOutHost = (string) $oActions->GetActionParam('OutHost', '');
|
||||
$iOutPort = (int) $oActions->GetActionParam('OutPort', 25);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,11 @@ class Filter
|
|||
*/
|
||||
private $sActionValueSecond;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sActionValueThird;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
|
|
@ -59,6 +64,11 @@ class Filter
|
|||
*/
|
||||
private $bKeep;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $bStop;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->Clear();
|
||||
|
|
@ -78,10 +88,11 @@ class Filter
|
|||
$this->sActionType = \RainLoop\Providers\Filters\Enumerations\ActionType::MOVE_TO;
|
||||
$this->sActionValue = '';
|
||||
$this->sActionValueSecond = '';
|
||||
$this->sActionValueThird = '';
|
||||
|
||||
$this->bMarkAsRead = false;
|
||||
$this->bSkipOthers = false;
|
||||
$this->bKeep = true;
|
||||
$this->bStop = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -148,6 +159,14 @@ class Filter
|
|||
return $this->sActionValueSecond;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ActionValueThird()
|
||||
{
|
||||
return $this->sActionValueThird;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
|
@ -159,9 +178,9 @@ class Filter
|
|||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function SkipOthers()
|
||||
public function Stop()
|
||||
{
|
||||
return $this->bSkipOthers;
|
||||
return $this->bStop;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -216,10 +235,11 @@ class Filter
|
|||
|
||||
$this->sActionValue = isset($aFilter['ActionValue']) ? $aFilter['ActionValue'] : '';
|
||||
$this->sActionValueSecond = isset($aFilter['ActionValueSecond']) ? $aFilter['ActionValueSecond'] : '';
|
||||
$this->sActionValueThird = isset($aFilter['ActionValueThird']) ? $aFilter['ActionValueThird'] : '';
|
||||
|
||||
$this->bKeep = isset($aFilter['Keep']) ? '1' === (string) $aFilter['Keep'] : true;
|
||||
$this->bStop = isset($aFilter['Stop']) ? '1' === (string) $aFilter['Stop'] : true;
|
||||
$this->bMarkAsRead = isset($aFilter['MarkAsRead']) ? '1' === (string) $aFilter['MarkAsRead'] : false;
|
||||
$this->bSkipOthers = isset($aFilter['SkipOthers']) ? '1' === (string) $aFilter['SkipOthers'] : false;
|
||||
|
||||
$this->aConditions = \RainLoop\Providers\Filters\Classes\FilterCondition::CollectionFromJSON(
|
||||
isset($aFilter['Conditions']) ? $aFilter['Conditions'] : array());
|
||||
|
|
@ -255,9 +275,10 @@ class Filter
|
|||
'ActionType' => $this->ActionType(),
|
||||
'ActionValue' => $this->ActionValue(),
|
||||
'ActionValueSecond' => $this->ActionValueSecond(),
|
||||
'ActionValueThird' => $this->ActionValueThird(),
|
||||
'Keep' => $this->Keep(),
|
||||
'MarkAsRead' => $this->MarkAsRead(),
|
||||
'SkipOthers' => $this->SkipOthers()
|
||||
'Stop' => $this->Stop(),
|
||||
'MarkAsRead' => $this->MarkAsRead()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
|||
{
|
||||
const NEW_LINE = "\r\n";
|
||||
|
||||
const SIEVE_FILE_NAME = 'rainloop.sieve.user';
|
||||
const SIEVE_FILE_NAME_RAW = 'rainloop.sieve.raw';
|
||||
const SIEVE_FILE_NAME = 'rainloop.user';
|
||||
const SIEVE_FILE_NAME_RAW = 'rainloop.user.raw';
|
||||
|
||||
/**
|
||||
* @var \MailSo\Log\Logger
|
||||
|
|
@ -317,10 +317,12 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
|||
case \RainLoop\Providers\Filters\Enumerations\ActionType::VACATION:
|
||||
$sValue = \trim($oFilter->ActionValue());
|
||||
$sValueSecond = \trim($oFilter->ActionValueSecond());
|
||||
$sValueThird = \trim($oFilter->ActionValueThird());
|
||||
if (0 < \strlen($sValue))
|
||||
{
|
||||
$aCapa['vacation'] = true;
|
||||
|
||||
$iDays = 1;
|
||||
$sSubject = '';
|
||||
if (0 < \strlen($sValueSecond))
|
||||
{
|
||||
|
|
@ -328,8 +330,17 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
|||
\preg_replace('/[\s]+/u', ' ', $sValueSecond)).'" ';
|
||||
}
|
||||
|
||||
$aResult[] = $sTab.'vacation :days 1 '.$sSubject.'"'.$this->quote($sValue).'";';
|
||||
$aResult[] = $sTab.'stop;';
|
||||
if (0 < \strlen($sValueThird) && \is_numeric($sValueThird) && 1 < (int) $sValueThird)
|
||||
{
|
||||
$iDays = (int) $sValueThird;
|
||||
}
|
||||
|
||||
$aResult[] = $sTab.'vacation :days '.$iDays.' '.$sSubject.'"'.$this->quote($sValue).'";';
|
||||
|
||||
if ($oFilter->Stop())
|
||||
{
|
||||
$aResult[] = $sTab.'stop;';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="controls">
|
||||
<div data-bind="component: {
|
||||
name: 'Checkbox',
|
||||
params: { value: capaTwoFactorAuth, label: 'Allow 2-Step Verification (Google Authenticator)' }
|
||||
params: { value: capaTwoFactorAuth, label: 'Allow 2-Step Verification' }
|
||||
}"></div>
|
||||
<div data-bind="component: {
|
||||
name: 'Checkbox',
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
<!-- ko if: preLabeled -->
|
||||
<span class="i18n" data-bind="attr: {'data-i18n-text': preLabel}"></span>
|
||||
|
||||
<!-- /ko -->
|
||||
<select data-bind="options: options, value: value, optionsText: optionsText, optionsValue: optionsValue,
|
||||
css: className, optionsAfterRender: defautOptionsAfterRender"></select>
|
||||
<!-- ko if: labeled -->
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
<tr class="account-item">
|
||||
<td class="e-action" data-bind="css: {'e-action': canBeEdit}">
|
||||
<span class="account-img icon-user"></span>
|
||||
<i class="icon-braille drag-handle"></i>
|
||||
|
||||
<span class="account-name" data-bind="text: email"></span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row" data-bind="visible: inited() && !serverError()">
|
||||
<div class="span8">
|
||||
<div class="span4">
|
||||
<a class="btn" data-bind="click: addFilter">
|
||||
<i class="icon-plus"></i>
|
||||
|
||||
|
|
@ -22,7 +22,8 @@
|
|||
|
||||
<span class="i18n" data-i18n-text="SETTINGS_FILTERS/BUTTON_SAVE"></span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="span4" style="margin-left: 0;">
|
||||
<span data-bind="text: saveErrorText"style="color:red"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -66,20 +67,24 @@
|
|||
data-bind="visible: inited() && (!filterRaw.active() || !filterRaw.active()), i18nUpdate: filters">
|
||||
<colgroup>
|
||||
<col style="width: 30px" />
|
||||
<col style="width: 16px" />
|
||||
<col />
|
||||
<col style="width: 140px" />
|
||||
<col style="width: 1%" />
|
||||
</colgroup>
|
||||
<tbody data-bind="sortable: {data: filters, options: scrollableOptions()}">
|
||||
<tbody data-bind="sortable: {data: filters, options: scrollableOptions()}" style="width: 600px">
|
||||
<tr class="filter-item">
|
||||
<td>
|
||||
<span class="disabled-filter" data-bind="click: function () { $root.haveChanges(true); enabled(!enabled()); }">
|
||||
<i data-bind="css: {'icon-checkbox-checked': enabled, 'icon-checkbox-unchecked': !enabled()}"></i>
|
||||
</span>
|
||||
</td>
|
||||
<td class="drag-wrapper">
|
||||
<i class="icon-braille drag-handle"></i>
|
||||
</td>
|
||||
<td class="e-action">
|
||||
<span class="filter-name" data-bind="text: name()"></span>
|
||||
|
||||
|
||||
<span class="filter-sub-name" data-bind="text: nameSub()"></span>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
<div class="control-group" style="margin-bottom: 0">
|
||||
<div class="controls">
|
||||
<div data-bind="component: {
|
||||
name: 'Select',
|
||||
params: {
|
||||
options: [1, 2, 3, 7, 30],
|
||||
label: 'POPUPS_FILTER/REPLY_INTERVAL_LABEL',
|
||||
value: actionValueThird,
|
||||
size: 1
|
||||
}
|
||||
}"></div>
|
||||
<input type="text" class="span5 i18n" data-bind="value: actionValueSecond" placeholder=""
|
||||
data-i18n-placeholder="POPUPS_FILTER/VACATION_SUBJECT_LABEL" />
|
||||
</div>
|
||||
|
|
@ -9,4 +18,15 @@
|
|||
<textarea class="span5 i18n" data-bind="value: actionValue" style="height: 100px;"
|
||||
placeholder="" data-i18n-placeholder="POPUPS_FILTER/VACATION_MESSAGE_LABEL"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<div data-bind="component: {
|
||||
name: 'Checkbox',
|
||||
params: {
|
||||
label: 'POPUPS_FILTER/STOP_LABEL',
|
||||
value: actionNoStop
|
||||
}
|
||||
}"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue