Skip to content

Commit

Permalink
Merge pull request #39 from nextcloud/fix/user-script
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Jun 14, 2023
2 parents 7652e1a + 3511768 commit b85729e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Preferred Providers</name>
<summary>Allow nextcloud to request user accounts</summary>
<description><![CDATA[Allow nextcloud to request user accounts]]></description>
<version>1.13.0</version>
<version>1.13.1</version>
<licence>agpl</licence>
<author>John Molakvoæ</author>
<namespace>Preferred_Providers</namespace>
Expand Down
1 change: 0 additions & 1 deletion js/users-management.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$(document).ready(function() {

sendEmail = function(event) {
var userId = event.target.closest('div[data-id]').dataset.id;
var button = event.target.parentElement;
Expand Down
16 changes: 11 additions & 5 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use OCA\Preferred_Providers\Hook\LoginHook;
use OCA\Preferred_Providers\Notification\Notifier;
use OCP\AppFramework\App;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IServerContainer;
use OCP\Util;

Expand All @@ -36,13 +37,18 @@ class Application extends App {

public function __construct() {
parent::__construct(self::APP_ID);
}

public function register() {
$this->registerNotifier($this->getContainer()->getServer());
$this->getContainer()->query(LoginHook::class)->register();
$container = $this->getContainer();
$server = $container->query(IServerContainer::class);

$this->registerNotifier($server);

/** @var LoginHook */
$loginHook = $container->query(LoginHook::class);
$loginHook->register();

$eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
/** @var IEventDispatcher */
$eventDispatcher = $server->query(IEventDispatcher::class);
$eventDispatcher->addListener('OC\Settings\Users::loadAdditionalScripts',
function () {
Util::addScript(self::APP_ID, 'users-management');
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function resetToken(): DataResponse {
* @return DataResponse
* @throws OCSNotFoundException
*/
public function setGroups(array $groups, string $for = 'all'): DataResponse {
public function setGroups(array $groups = [], string $for = 'all'): DataResponse {
foreach ($groups as $groupId) {
if (!$this->groupManager->groupExists($groupId)) {
throw new OCSNotFoundException($groupId . ' does not exists');
Expand Down

0 comments on commit b85729e

Please sign in to comment.