-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose system address book #23199
Closed
Closed
Expose system address book #23199
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f48ca20
expose system address book
schiessle 5f1e7c6
add setting to expose system address book
schiessle 0f5f4cd
only expose system address book, if it is enabled by the admin. By de…
schiessle 0ee6634
switch to pure js
schiessle 14587d4
Watch the chnage event to update the settings
schiessle File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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,26 @@ | ||
/** | ||
* @copyright 2017, Bjoern Schiessle <bjoern@schiessle.org> | ||
* | ||
* @author Bjoern Schiessle <bjoern@schiessle.org> | ||
* | ||
* @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"; | ||
|
||
document.getElementById('carddavExposeSystemAddressBook').addEventListener('change', function(e) { | ||
OCP.AppConfig.setValue('dav', 'exposeSystemAddressBook', e.target.checked ? '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* @copyright 2020, Bjoern Schiessle <bjoern@schiessle.org> | ||
* | ||
* @author Bjoern Schiessle <bjoern@schiessle.org> | ||
* | ||
* @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; | ||
|
||
/** | ||
* CalDAVSettings constructor. | ||
* | ||
* @param IConfig $config | ||
*/ | ||
public function __construct(IConfig $config) { | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* @return TemplateResponse | ||
*/ | ||
public function getForm() { | ||
$parameters = [ | ||
'expose_system_address_book' => $this->config->getAppValue('dav', 'exposeSystemAddressBook', 'no'), | ||
]; | ||
|
||
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,42 @@ | ||
<?php | ||
/** | ||
* @copyright 2020, Bjoern Schiessle <bjoern@schiessle.org> | ||
* | ||
* @author Bjoern Schiessle <bjoern@schiessle.org> | ||
* | ||
* @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('Addressbook server')); ?></h2> | ||
<p> | ||
<input type="checkbox" name="carddav_expose_system-address-book" id="carddavExposeSystemAddressBook" class="checkbox" | ||
<?php ($_['expose_system_address_book'] === 'yes') ? print_unescaped('checked="checked"') : null ?>/> | ||
<label for="carddavExposeSystemAddressBook"><?php p($l->t('Expose system address book')); ?></label> | ||
<br> | ||
<em> | ||
<?php print_unescaped($l->t('Only information set to "Public" or "Trusted" in the user\'s personal settings will be exposed.')); ?> | ||
</em> | ||
</p> | ||
</form> |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true? Because it shouldn't as per the privacy description on the fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the system address book was introduced explicitly for the trusted servers implementation and doesn't contain information set to "private". Just double checked it, to make sure it is still this way