Skip to content

Commit

Permalink
[stable10] better handling of hosts and do not inject trusted domains…
Browse files Browse the repository at this point in the history
… from outside

delete from routes and fixed docblock

delte the security controller and the test for it
  • Loading branch information
peterprochaska authored and DeepDiver1975 committed Jul 18, 2017
1 parent e0769aa commit a7b2d12
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 167 deletions.
8 changes: 0 additions & 8 deletions core/templates/untrustedDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@

<p class='hint'>
<?php p($l->t('Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domains" setting in config/config.php. An example configuration is provided in config/config.sample.php.')); ?>
<br>
<?php p($l->t('Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain.')); ?>
<br><br>
<p style="text-align:center;">
<a href="<?php print_unescaped(\OC::$server->getURLGenerator()->getAbsoluteURL(\OCP\Util::linkToRoute('settings.SettingsPage.getAdmin'))); ?>?trustDomain=<?php p($_['domain']); ?>" class="button">
<?php p($l->t('Add "%s" as trusted domain', [$_['domain']])); ?>
</a>
</p>
</p>
</li>
</ul>
2 changes: 1 addition & 1 deletion lib/private/AppFramework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ public function getServerHost() {
return $host;
} else {
$trustedList = $this->config->getSystemValue('trusted_domains', []);
if(!empty($trustedList)) {
if (!empty($trustedList)) {
return $trustedList[0];
} else {
return '';
Expand Down
71 changes: 0 additions & 71 deletions settings/Controller/SecuritySettingsController.php

This file was deleted.

18 changes: 0 additions & 18 deletions settings/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
$(document).ready(function(){
var params = OC.Util.History.parseUrlQuery();

// Hack to add a trusted domain
if (params.trustDomain) {
OC.dialogs.confirm(t('settings', 'Are you really sure you want add "{domain}" as trusted domain?',
{domain: params.trustDomain}),
t('settings', 'Add trusted domain'), function(answer) {
if(answer) {
$.ajax({
type: 'POST',
url: OC.generateUrl('settings/admin/security/trustedDomains'),
data: { newTrustedDomain: params.trustDomain }
}).done(function() {
window.location.replace(OC.generateUrl('settings/admin/security'));
});
}
});
}


$('#excludedGroups').each(function (index, element) {
OC.Settings.setupGroupsSelect($(element));
$(element).change(function(ev) {
Expand Down
1 change: 0 additions & 1 deletion settings/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'],
['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'],
['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'],
['name' => 'SecuritySettings#trustedDomains', 'url' => '/settings/admin/security/trustedDomains', 'verb' => 'POST'],
['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'],
['name' => 'Users#setMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'],
['name' => 'Users#setEmailAddress', 'url' => '/settings/admin/{id}/mailAddress', 'verb' => 'PUT'],
Expand Down
68 changes: 0 additions & 68 deletions tests/Settings/Controller/SecuritySettingsControllerTest.php

This file was deleted.

0 comments on commit a7b2d12

Please sign in to comment.