Skip to content

Commit

Permalink
Merge pull request #483 from nextcloud/feat/noid/show-current-user-info
Browse files Browse the repository at this point in the history
Show current user info
  • Loading branch information
nickvergessen authored Aug 23, 2023
2 parents 9dc337a + 0593df5 commit c46be6a
Show file tree
Hide file tree
Showing 9 changed files with 2,670 additions and 1,013 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/js/*.js binary
/js/*.js.map binary
4 changes: 2 additions & 2 deletions js/bruteforcesettings-main.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions js/bruteforcesettings-main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
* Released under the MIT License.
*/

/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/

/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */

/*! For license information please see NcButton.js.LICENSE.txt */

/*! For license information please see NcNoteCard.js.LICENSE.txt */

/*! For license information please see NcSettingsSection.js.LICENSE.txt */

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/**
Expand Down
2 changes: 1 addition & 1 deletion js/bruteforcesettings-main.js.map

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion lib/Settings/IPWhitelist.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,24 @@
namespace OCA\BruteForceSettings\Settings;

use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\IRequest;
use OCP\Security\Bruteforce\IThrottler;
use OCP\Settings\ISettings;

class IPWhitelist implements ISettings {
public function __construct(
protected IRequest $request,
protected IInitialState $initialState,
protected IThrottler $throttler,
) {
}

public function getForm(): TemplateResponse {
$this->initialState->provideInitialState('remote-address', $this->request->getRemoteAddress());
$this->initialState->provideInitialState('bypass-listed', $this->throttler->isBypassListed($this->request->getRemoteAddress()));
$this->initialState->provideInitialState('delay', $this->throttler->getDelay($this->request->getRemoteAddress()));

return new TemplateResponse('bruteforcesettings', 'ipwhitelist');
}

Expand All @@ -39,6 +53,6 @@ public function getSection(): string {
}

public function getPriority(): int {
return 50;
return 5;
}
}
Loading

0 comments on commit c46be6a

Please sign in to comment.