df4e2dddec
Portable occ-based config, OCS endpoints for APK registration, notification relay, and server-side push dispatch.
35 lines
883 B
PHP
35 lines
883 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\F7Push\Controller;
|
|
|
|
use OCA\F7Push\Service\ConfigService;
|
|
use OCP\AppFramework\Http;
|
|
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
|
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
|
use OCP\AppFramework\Http\DataResponse;
|
|
use OCP\AppFramework\OCSController;
|
|
use OCP\IRequest;
|
|
|
|
class ConfigApiController extends OCSController {
|
|
public function __construct(
|
|
string $appName,
|
|
IRequest $request,
|
|
private ConfigService $config,
|
|
) {
|
|
parent::__construct($appName, $request);
|
|
}
|
|
|
|
/** Public status for mobile clients (no secrets). */
|
|
#[NoAdminRequired]
|
|
#[NoCSRFRequired]
|
|
public function status(): DataResponse {
|
|
return new DataResponse([
|
|
'enabled' => $this->config->isEnabled(),
|
|
'firebaseConfigured' => $this->config->isFirebaseConfigured(),
|
|
'defaultClickUrl' => $this->config->getDefaultClickUrl(),
|
|
]);
|
|
}
|
|
}
|