mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Merge branch 'master' into plugin-hooks
# Conflicts: # dev/View/User/Login.js
This commit is contained in:
commit
2ab42b1f03
547 changed files with 29045 additions and 52993 deletions
345
plugins/README.md
Normal file
345
plugins/README.md
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
|
||||
class Plugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
|
||||
# Hooks
|
||||
|
||||
$Plugin->addHook('hook.name', 'functionName');
|
||||
|
||||
## Login
|
||||
|
||||
### login.credentials.step-1
|
||||
params:
|
||||
string &$sEmail
|
||||
|
||||
### login.credentials.step-2
|
||||
params:
|
||||
string &$sEmail
|
||||
string &$sPassword
|
||||
|
||||
### login.credentials
|
||||
params:
|
||||
string &$sEmail
|
||||
string &$sLogin
|
||||
string &$sPassword
|
||||
|
||||
### login.success
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
|
||||
## IMAP
|
||||
|
||||
### imap.credentials
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
array &$aCredentials
|
||||
|
||||
### imap.before-connect
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mail\MailClient $oMailClient
|
||||
array $aCredentials
|
||||
|
||||
### imap.after-connect
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mail\MailClient $oMailClient
|
||||
array $aCredentials
|
||||
|
||||
### imap.before-login
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mail\MailClient $oMailClient
|
||||
array $aCredentials
|
||||
|
||||
### imap.after-login
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mail\MailClient $oMailClient
|
||||
bool $bSuccess
|
||||
array $aCredentials
|
||||
|
||||
## Sieve
|
||||
|
||||
### sieve.credentials
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
array &$aCredentials
|
||||
|
||||
### sieve.before-connect
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Sieve\ManageSieveClient $oSieveClient
|
||||
array $aCredentials
|
||||
|
||||
### sieve.after-connect
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Sieve\ManageSieveClient $oSieveClient
|
||||
array $aCredentials
|
||||
|
||||
### sieve.before-login
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Sieve\ManageSieveClient $oSieveClient
|
||||
bool $bSuccess
|
||||
array $aCredentials
|
||||
|
||||
### sieve.after-login
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Sieve\ManageSieveClient $oSieveClient
|
||||
array $aCredentials
|
||||
|
||||
## SMTP
|
||||
|
||||
### smtp.credentials
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
array &$aCredentials
|
||||
|
||||
### smtp.before-connect
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Smtp\SmtpClient $oSmtpClient
|
||||
array $aCredentials
|
||||
|
||||
### smtp.after-connect
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Smtp\SmtpClient $oSmtpClient
|
||||
array $aCredentials
|
||||
|
||||
### smtp.before-login
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Smtp\SmtpClient $oSmtpClient
|
||||
array $aCredentials
|
||||
|
||||
### smtp.after-login
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Smtp\SmtpClient $oSmtpClient
|
||||
bool $bSuccess
|
||||
array $aCredentials
|
||||
|
||||
## Folders
|
||||
|
||||
### filter.folders-post
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mail\FolderCollection $oFolderCollection
|
||||
|
||||
### filter.folders-complete
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mail\FolderCollection $oFolderCollection
|
||||
|
||||
### filter.folders-system-types
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
array &$aList
|
||||
|
||||
### filter.system-folders-names
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
array &$aCache
|
||||
|
||||
## Others
|
||||
|
||||
### filter.account
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
|
||||
### filter.action-params
|
||||
params:
|
||||
string $sMethodName
|
||||
array &$aCurrentActionParams
|
||||
|
||||
### filter.app-data
|
||||
params:
|
||||
bool $bAdmin
|
||||
array &$aAppData
|
||||
|
||||
### filter.application-config
|
||||
params:
|
||||
\RainLoop\Config\Application $oConfig
|
||||
|
||||
### filter.build-message
|
||||
params:
|
||||
\MailSo\Mime\Message $oMessage
|
||||
|
||||
### filter.build-read-receipt-message
|
||||
params:
|
||||
\MailSo\Mime\Message $oMessage
|
||||
\RainLoop\Model\Account $oAccount
|
||||
|
||||
### filter.domain
|
||||
params:
|
||||
\RainLoop\Model\Domain &$oDomain
|
||||
|
||||
### filter.fabrica
|
||||
params:
|
||||
string $sName
|
||||
mixed &$mResult
|
||||
\RainLoop\Model\Account $oAccount
|
||||
|
||||
### filter.http-paths
|
||||
params:
|
||||
array &$aPaths
|
||||
|
||||
### filter.http-query
|
||||
params:
|
||||
string &$sQuery
|
||||
|
||||
### filter.json-response
|
||||
params:
|
||||
string $sAction
|
||||
array &$aResponseItem
|
||||
|
||||
### filter.message-html'
|
||||
### filter.message-plain
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mime\Message $oMessage
|
||||
string &$sTextConverted
|
||||
|
||||
### filter.message-rcpt
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mime\EmailCollection $oRcpt
|
||||
|
||||
### filter.read-receipt-message-plain
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mime\Message $oMessage
|
||||
string &$sText
|
||||
|
||||
### filter.result-message
|
||||
params:
|
||||
\MailSo\Mime\Message $oMessage
|
||||
|
||||
### filter.save-message
|
||||
params:
|
||||
\MailSo\Mime\Message $oMessage
|
||||
|
||||
### filter.send-message
|
||||
params:
|
||||
\MailSo\Mime\Message $oMessage
|
||||
|
||||
### filter.send-message-stream
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
resource &$rMessageStream
|
||||
int &$iMessageStreamSize
|
||||
|
||||
### filter.send-read-receipt-message
|
||||
params:
|
||||
\MailSo\Mime\Message $oMessage
|
||||
\RainLoop\Model\Account $oAccount
|
||||
|
||||
### filter.smtp-from
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mime\Message $oMessage
|
||||
string &$sFrom
|
||||
|
||||
### filter.smtp-hidden-rcpt
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
\MailSo\Mime\Message $oMessage
|
||||
array &$aHiddenRcpt
|
||||
|
||||
### filter.smtp-message-stream
|
||||
params:
|
||||
\RainLoop\Model\Account $oAccount
|
||||
resource &$rMessageStream
|
||||
int &$iMessageStreamSize
|
||||
|
||||
### filter.upload-response
|
||||
params:
|
||||
array &$aResponseItem
|
||||
|
||||
### json.action-post-call
|
||||
params:
|
||||
string $sAction
|
||||
array &$aResponseItem
|
||||
|
||||
### json.action-post-call
|
||||
params:
|
||||
string $sAction
|
||||
array &$aResponseItem
|
||||
|
||||
### json.action-pre-call
|
||||
params:
|
||||
string $sAction
|
||||
|
||||
### json.action-pre-call
|
||||
params:
|
||||
string $sAction
|
||||
|
||||
### json.suggestions-input-parameters
|
||||
params:
|
||||
string &$sQuery
|
||||
int &$iLimit
|
||||
\RainLoop\Model\Account $oAccount
|
||||
|
||||
### json.suggestions-post
|
||||
params:
|
||||
array &$aResult
|
||||
string $sQuery
|
||||
\RainLoop\Model\Account $oAccount
|
||||
int $iLimit
|
||||
|
||||
### json.suggestions-pre
|
||||
params:
|
||||
array &$aResult
|
||||
string $sQuery
|
||||
\RainLoop\Model\Account $oAccount
|
||||
int $iLimit
|
||||
|
||||
### main.default-response
|
||||
params:
|
||||
string $sActionName
|
||||
array &$aResponseItem
|
||||
|
||||
### main.default-response
|
||||
params:
|
||||
string $sActionName
|
||||
array &$aResponseItem
|
||||
|
||||
### main.default-response
|
||||
params:
|
||||
string $sActionName
|
||||
array &$aResponseItem
|
||||
|
||||
### main.default-response-data
|
||||
params:
|
||||
string $sActionName
|
||||
mixed &$mResult
|
||||
|
||||
### main.default-response-data
|
||||
params:
|
||||
string $sActionName
|
||||
mixed &$mResult
|
||||
|
||||
### main.default-response-data
|
||||
params:
|
||||
string $sActionName
|
||||
mixed &$mResult
|
||||
|
||||
### main.default-response-error-data
|
||||
params:
|
||||
string $sActionName
|
||||
int &$iErrorCode
|
||||
string &$sErrorMessage
|
||||
|
||||
### main.fabrica
|
||||
params:
|
||||
string $sName
|
||||
mixed &$mResult
|
||||
|
||||
### service.app-delay-start-begin
|
||||
no params
|
||||
|
||||
### service.app-delay-start-end
|
||||
no params
|
||||
|
|
@ -22,8 +22,8 @@ class AutoDomainGrabPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('filter.smtp-credentials', 'FilterSmtpCredentials');
|
||||
$this->addHook('filter.imap-credentials', 'FilterImapCredentials');
|
||||
$this->addHook('smtp.credentials', 'FilterSmtpCredentials');
|
||||
$this->addHook('imap.credentials', 'FilterImapCredentials');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class BlackListPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('filter.login-credentials', 'FilterLoginCredentials');
|
||||
$this->addHook('login.credentials', 'FilterLoginCredentials');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class ChangeSmtpEhloMessagePlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('filter.smtp-credentials', 'FilterSmtpCredentials');
|
||||
$this->addHook('smtp.credentials', 'FilterSmtpCredentials');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
213
plugins/ckeditor/ckeditor.less
Normal file
213
plugins/ckeditor/ckeditor.less
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
/*.cke_button__sourcedialog_label {
|
||||
display: none !important;
|
||||
}*/
|
||||
|
||||
.cke_chrome {
|
||||
border: 1px solid #ccc !important;
|
||||
}
|
||||
|
||||
.cke_toolgroup {
|
||||
padding-right: 0 !important;
|
||||
background: #FBFBFB !important;
|
||||
}
|
||||
|
||||
.cke_toolgroup, .cke_combo_button {
|
||||
border: 1px solid #A6A6A6 !important;
|
||||
}
|
||||
|
||||
.cke_top {
|
||||
padding: 2px;
|
||||
box-shadow: none !important;
|
||||
border-bottom: 1px solid #b6b6b6 !important;
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.cke_combo_on a.cke_combo_button,
|
||||
.cke_combo_off a.cke_combo_button:hover,
|
||||
.cke_combo_off a.cke_combo_button:focus,
|
||||
.cke_combo_off a.cke_combo_button:active {
|
||||
padding: 1px !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.cke_toolgroup a.cke_button:last-child:after,
|
||||
.cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after {
|
||||
border: none !important;
|
||||
height: 0 !important;
|
||||
width: 0 !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.cke_button_on {
|
||||
background: #ddd !important;
|
||||
}
|
||||
|
||||
.cke_combo {
|
||||
margin-top: 1px !important;
|
||||
}
|
||||
|
||||
.cke_combo__fontsize {
|
||||
margin-left: 3px !important;
|
||||
.cke_combo_text {
|
||||
width: 40px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.cke_combo_text {
|
||||
line-height: 24px !important;
|
||||
padding-left: 8px !important;
|
||||
}
|
||||
|
||||
.cke_combo_button {
|
||||
background: #FBFBFB !important;
|
||||
}
|
||||
|
||||
.cke_source {
|
||||
font-family: var(--fontMono) !important;
|
||||
padding: 10px !important;
|
||||
padding-right: 0 !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.cke_plain {
|
||||
|
||||
background-color: #fff;
|
||||
outline: none;
|
||||
overflow: auto;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
|
||||
padding: 10px;
|
||||
padding-right: 0;
|
||||
white-space: pre-wrap;
|
||||
font-family: var(--fontMono), monospace;
|
||||
font-size: 13px;
|
||||
line-height: 16px;
|
||||
color: #333;
|
||||
resize: none;
|
||||
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.cke_plain:focus, .cke_source:focus {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.b-compose .cke_chrome {
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
border-bottom: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.cke_wysiwyg_div {
|
||||
|
||||
padding: 10px !important;
|
||||
font-family: var(--fontSans);
|
||||
font-size: 13px;
|
||||
line-height: 16px;
|
||||
color: #333;
|
||||
|
||||
ul {
|
||||
padding-left: 40px;
|
||||
li {
|
||||
list-style-type: disc !important;
|
||||
}
|
||||
}
|
||||
|
||||
ol {
|
||||
padding-left: 40px;
|
||||
li {
|
||||
list-style-type: decimal !important;
|
||||
}
|
||||
}
|
||||
|
||||
pre, code {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #fff;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: var(--fontMono);
|
||||
display: block;
|
||||
word-break: normal;
|
||||
word-wrap: break-word;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
code {
|
||||
display: inline;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
pre > code {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border: 0;
|
||||
border-left: solid 2px #444;
|
||||
margin: 5px 0 5px 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
blockquote p {
|
||||
margin: 0 0 10px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
a {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
|
||||
&:visited {
|
||||
color: #609;
|
||||
}
|
||||
&:active {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cke_dialog {
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.cke_dialog_ui_labeled_content {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.cke_dialog_ui_input_select, .cke_dialog_ui_input_text, .cke_dialog_ui_input_textarea {
|
||||
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
}
|
||||
|
||||
.cke_dialog_ui_input_select, .cke_dialog_ui_input_text {
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,9 +4,9 @@ class CKEditorPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
const
|
||||
NAME = 'CKEditor',
|
||||
VERSION = '2.0',
|
||||
RELEASE = '2021-03-25',
|
||||
REQUIRED = '2.4.2',
|
||||
VERSION = '2.1',
|
||||
RELEASE = '2021-04-01',
|
||||
REQUIRED = '2.5.0',
|
||||
DESCRIPTION = 'Use CKEditor instead of Squire as WYSIWYG';
|
||||
|
||||
public function Init() : void
|
||||
|
|
@ -32,6 +32,7 @@ class CKEditorPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
}
|
||||
|
||||
if (\is_file("{$path}/ckeditor.js")) {
|
||||
$this->addCss('ckeditor.less');
|
||||
$this->addJs('ckeditor.js');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class CustomAuthExamplePlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('filter.login-credentials', 'FilterLoginСredentials');
|
||||
$this->addHook('login.credentials', 'FilterLoginCredentials');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -19,7 +19,7 @@ class CustomAuthExamplePlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
*
|
||||
* @throws \RainLoop\Exceptions\ClientException
|
||||
*/
|
||||
public function FilterLoginСredentials(&$sEmail, &$sLogin, &$sPassword)
|
||||
public function FilterLoginCredentials(&$sEmail, &$sLogin, &$sPassword)
|
||||
{
|
||||
// Your custom php logic
|
||||
// You may change login credentials
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class CustomLoginMappingPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('filter.login-credentials', 'FilterLoginСredentials');
|
||||
$this->addHook('login.credentials', 'FilterLoginCredentials');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -20,7 +20,7 @@ class CustomLoginMappingPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
*
|
||||
* @throws \RainLoop\Exceptions\ClientException
|
||||
*/
|
||||
public function FilterLoginСredentials(&$sEmail, &$sLogin, &$sPassword)
|
||||
public function FilterLoginCredentials(&$sEmail, &$sLogin, &$sPassword)
|
||||
{
|
||||
$sMapping = \trim($this->Config()->Get('plugin', 'mapping', ''));
|
||||
if (!empty($sMapping))
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class OverrideSmtpCredentialsPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('filter.smtp-credentials', 'FilterSmtpCredentials');
|
||||
$this->addHook('smtp.credentials', 'FilterSmtpCredentials');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class ProxyauthLoginExamplePlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('event.login-post-login-provide', 'EventLoginPostLoginProvide');
|
||||
$this->addHook('login.success', 'EventLoginPostLoginProvide');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class WhiteListPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
|
||||
public function Init() : void
|
||||
{
|
||||
$this->addHook('filter.login-credentials', 'FilterLoginCredentials');
|
||||
$this->addHook('login.credentials', 'FilterLoginCredentials');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue