-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to disable system addressbook sync
On some instances, users don't know each other and it doesn't makes sense to expose users as contacts (through Contacts Menu, Calendar Attendees,…) to everyone. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
- Loading branch information
Showing
9 changed files
with
178 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @copyright 2019, Thomas Citharel <tcit@tcit.fr> | ||
* | ||
* @author Thomas Citharel <tcit@tcit.fr> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
"use strict"; | ||
|
||
$('#carddavSyncSystemAddressbook').change(function () { | ||
var val = $(this)[0].checked; | ||
|
||
OCP.AppConfig.setValue('dav', 'syncSystemAddressbook', val ? 'yes' : 'no'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* @copyright 2019, Thomas Citharel <tcit@tcit.fr> | ||
* | ||
* @author Thomas Citharel <tcit@tcit.fr> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
namespace OCA\DAV\Settings; | ||
|
||
use OCP\AppFramework\Http\TemplateResponse; | ||
use OCP\IConfig; | ||
use OCP\Settings\ISettings; | ||
|
||
class CardDAVSettings implements ISettings { | ||
|
||
/** @var IConfig */ | ||
private $config; | ||
|
||
/** | ||
* CardDAVSettings constructor. | ||
* | ||
* @param IConfig $config | ||
*/ | ||
public function __construct(IConfig $config) { | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* @return TemplateResponse | ||
*/ | ||
public function getForm() { | ||
$parameters = [ | ||
'sync_system_addressbook' => $this->config->getAppValue('dav', 'syncSystemAddressbook', 'yes'), | ||
]; | ||
|
||
return new TemplateResponse('dav', 'settings-admin-carddav', $parameters); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getSection() { | ||
return 'groupware'; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getPriority() { | ||
return 10; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* @copyright 2019, Thomas Citharel <tcit@tcit.fr> | ||
* | ||
* @author Thomas Citharel <tcit@tcit.fr> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
script('dav', [ | ||
'settings-admin-carddav' | ||
]); | ||
|
||
/** @var \OCP\IL10N $l */ | ||
/** @var array $_ */ | ||
?> | ||
<form id="CardDAV" class="section"> | ||
<h2><?php p($l->t('Contacts server')); ?></h2> | ||
<p> | ||
<input type="checkbox" name="carddavSyncSystemAddressbook" id="carddavSyncSystemAddressbook" class="checkbox" | ||
<?php ($_['sync_system_addressbook'] === 'yes') ? print_unescaped('checked="checked"') : null ?>/> | ||
<label for="carddavSyncSystemAddressbook"><?php p($l->t('Sync the system addressbook')); ?></label> | ||
<br> | ||
<em><?php p($l->t('Syncs the instance users as contacts in a global system addressbook')); ?></em> | ||
</p> | ||
</form> |