mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-28 08:44:02 +08:00
CardDAV (beta/unstable)
This commit is contained in:
parent
248aab17c2
commit
fb54efe922
25 changed files with 133 additions and 26 deletions
65
build/configs/nginx.domain.example.conf
Normal file
65
build/configs/nginx.domain.example.conf
Normal file
|
@ -0,0 +1,65 @@
|
|||
|
||||
server {
|
||||
listen 80;
|
||||
server_name domain.com;
|
||||
|
||||
root /var/www/domain.com;
|
||||
index index.php index.html;
|
||||
|
||||
log_not_found off;
|
||||
charset utf-8;
|
||||
|
||||
error_log /var/log/nginx/domain.com-error.log;
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
location ~ /\.ht { deny all; }
|
||||
|
||||
location ^~ /data {
|
||||
deny all;
|
||||
return 404;
|
||||
}
|
||||
|
||||
rewrite ^/.well-known/carddav /index.php/dav/ redirect;
|
||||
|
||||
location ~ ^(.+\.php)(.*)$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
# fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
}
|
||||
|
||||
# optional
|
||||
server {
|
||||
listen 80;
|
||||
server_name dav.domain.com;
|
||||
|
||||
rewrite ^/.well-known/carddav / redirect;
|
||||
|
||||
root /var/www/domain.com;
|
||||
index index.php index.html;
|
||||
|
||||
log_not_found off;
|
||||
charset utf-8;
|
||||
|
||||
error_log /var/log/nginx/dav.domain.com-error.log;
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
location ~ /\.ht { deny all; }
|
||||
|
||||
rewrite ^/.well-known/carddav / redirect;
|
||||
rewrite ^(.*)$ /index.php/dav$1 last;
|
||||
|
||||
location ~ ^(.+\.php)(.*)$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
# fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
}
|
|
@ -559,10 +559,18 @@ PopupsContactsViewModel.prototype.onBuild = function (oDom)
|
|||
|
||||
$window.on('keydown', function (oEvent) {
|
||||
var bResult = true;
|
||||
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
|
||||
if (oEvent && self.modalVisibility())
|
||||
{
|
||||
kn.delegateRun(self, 'closeCommand');
|
||||
bResult = false;
|
||||
if (Enums.EventKeyCode.Esc === oEvent.keyCode)
|
||||
{
|
||||
kn.delegateRun(self, 'closeCommand');
|
||||
bResult = false;
|
||||
}
|
||||
else if (oEvent.ctrlKey && Enums.EventKeyCode.S === oEvent.keyCode)
|
||||
{
|
||||
self.saveCommand();
|
||||
bResult = false;
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
|
|
|
@ -573,7 +573,7 @@ class Http
|
|||
*/
|
||||
public function GetUrl()
|
||||
{
|
||||
return '/'.$this->GetServer('REQUEST_URI', '');
|
||||
return $this->GetServer('REQUEST_URI', '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -583,12 +583,4 @@ class Http
|
|||
{
|
||||
return $this->GetScheme().'://'.$this->GetHost(true, false).$this->GetPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function GetFullUrlWithQuery()
|
||||
{
|
||||
return $this->GetScheme().'://'.$this->GetHost(true, false).$this->GetUrl();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1878,7 +1878,7 @@ class Actions
|
|||
|
||||
$this->setConfigFromParams($oConfig, 'ContactsEnable', 'contacts', 'enable', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsSharing', 'contacts', 'allow_sharing', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsSync', 'contacts', 'allow_carddav_sync', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsSync', 'contacts', 'allow_sync', 'bool');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy');
|
||||
|
|
|
@ -202,6 +202,7 @@ Enables caching in the system'),
|
|||
'Experimental settings. Handle with care.
|
||||
'),
|
||||
'sync_dav_digest_auth' => array(false),
|
||||
'sync_use_dav_browser' => array(true),
|
||||
'allow_message_append' => array(false),
|
||||
'date_from_headers' => array(false),
|
||||
'cache_system_data' => array(true),
|
||||
|
|
|
@ -745,16 +745,30 @@ class ServiceActions
|
|||
$oPrincipalCollection, $oAddressBookRoot
|
||||
));
|
||||
|
||||
$aPath = \trim($this->oHttp->GetPath(), '/\\ ');
|
||||
$oServer->setBaseUri((0 < \strlen($aPath) ? '/'.$aPath : '').'/index.php/dav/');
|
||||
// $oServer->setBaseUri('/');
|
||||
if (false === \strpos($this->oHttp->GetUrl(), '/index.php/dav/'))
|
||||
{
|
||||
$oServer->setBaseUri('/');
|
||||
}
|
||||
else
|
||||
{
|
||||
$aPath = \trim($this->oHttp->GetPath(), '/\\ ');
|
||||
$oServer->setBaseUri((0 < \strlen($aPath) ? '/'.$aPath : '').'/index.php/dav/');
|
||||
}
|
||||
|
||||
// Plugins
|
||||
$oServer->addPlugin(new \Sabre\DAV\Auth\Plugin($oAuthBackend, 'RainLoop'));
|
||||
$oServer->addPlugin(new \Sabre\DAV\Browser\Plugin());
|
||||
$oServer->addPlugin(new \Sabre\CardDAV\Plugin());
|
||||
$oServer->addPlugin(new \Sabre\DAVACL\Plugin());
|
||||
$oServer->addPlugin(new \Sabre\CardDAV\VCFExportPlugin());
|
||||
$oServer->addPlugin(new \RainLoop\SabreDAV\Logger($this->Logger()));
|
||||
$oServer->addPlugin(new \RainLoop\SabreDAV\Logger($this->Logger()));
|
||||
|
||||
if ($this->Config()->Get('labs', 'sync_use_dav_browser', false))
|
||||
{
|
||||
$oServer->addPlugin(new \Sabre\DAV\Browser\Plugin());
|
||||
}
|
||||
|
||||
$this->Plugins()->RunHook('filter.sabre-dav-before-exec', array(&$oServer));
|
||||
|
||||
$oServer->exec();
|
||||
}
|
||||
|
|
|
@ -63,7 +63,12 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: allowContacts">
|
||||
</div>
|
||||
<div class="form-horizontal" data-bind="visible: allowContacts">
|
||||
<div class="legend">
|
||||
<span class="i18n" data-i18n-text="SETTINGS_GENERAL/LEGEND_CONTACTS"></span>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label data-bind="click: function () { contactsAutosave(!contactsAutosave()); }">
|
||||
<i data-bind="css: contactsAutosave() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Signatur"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Allgemein"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Sprache"
|
||||
LABEL_EDITOR = "Standard-Text-Editor"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "HTML"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Signature"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "General"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Language"
|
||||
LABEL_EDITOR = "Default text editor"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Firma"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "General"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Idioma"
|
||||
LABEL_EDITOR = "Editor de texto predeterminado"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Signature"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Général"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Langue"
|
||||
LABEL_EDITOR = "Éditeur de texte par défaut"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Undirskrift"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Almennt"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Tungumál"
|
||||
LABEL_EDITOR = "Sjálfgefinn textaritill"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -283,6 +283,7 @@ LABEL_SIGNATURE = "서명"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "일반"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "언어"
|
||||
LABEL_EDITOR = "기본 본문 편집 도구"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html 편집기"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Paraksts"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Vispārējie"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Valoda"
|
||||
LABEL_EDITOR = "Galvenais teksta editors"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Handtekening"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Algemeen"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Taal"
|
||||
LABEL_EDITOR = "Standaard tekst editor"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Signatur"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Generelt"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Språk"
|
||||
LABEL_EDITOR = "Standard teksteditor"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Sygnatura"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Ogólne"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Język"
|
||||
LABEL_EDITOR = "Domyślny edytor tekstu"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Assinatura"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Geral"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Linguagem"
|
||||
LABEL_EDITOR = "Editor de texto padrão"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Assinatura"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Geral"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "Linguagem"
|
||||
LABEL_EDITOR = "Editor de texto padrão"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "Подпись"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "Основные Настройки"
|
||||
LEGEND_CONTACTS = "Контакты"
|
||||
LABEL_LANGUAGE = "Язык"
|
||||
LABEL_EDITOR = "Редактор текста по умолчанию"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Форматированный"
|
||||
|
|
|
@ -286,6 +286,7 @@ LABEL_SIGNATURE = "签名"
|
|||
|
||||
[SETTINGS_GENERAL]
|
||||
LEGEND_GENERAL = "一般设置"
|
||||
LEGEND_CONTACTS = "Contacts"
|
||||
LABEL_LANGUAGE = "语言"
|
||||
LABEL_EDITOR = "默认格式"
|
||||
LABEL_EDITOR_HTML_AS_DEFAULT = "Html"
|
||||
|
|
2
rainloop/v/0.0.0/static/css/app.min.css
vendored
2
rainloop/v/0.0.0/static/css/app.min.css
vendored
File diff suppressed because one or more lines are too long
4
rainloop/v/0.0.0/static/js/admin.min.js
vendored
4
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -9858,10 +9858,18 @@ PopupsContactsViewModel.prototype.onBuild = function (oDom)
|
|||
|
||||
$window.on('keydown', function (oEvent) {
|
||||
var bResult = true;
|
||||
if (oEvent && Enums.EventKeyCode.Esc === oEvent.keyCode && self.modalVisibility())
|
||||
if (oEvent && self.modalVisibility())
|
||||
{
|
||||
kn.delegateRun(self, 'closeCommand');
|
||||
bResult = false;
|
||||
if (Enums.EventKeyCode.Esc === oEvent.keyCode)
|
||||
{
|
||||
kn.delegateRun(self, 'closeCommand');
|
||||
bResult = false;
|
||||
}
|
||||
else if (oEvent.ctrlKey && Enums.EventKeyCode.S === oEvent.keyCode)
|
||||
{
|
||||
self.saveCommand();
|
||||
bResult = false;
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
|
|
4
rainloop/v/0.0.0/static/js/app.min.js
vendored
4
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue