for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Analytics
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the LICENSE.md file.
* @author Marcel Scherello <[email protected]>
* @author Arthur Schiwon <[email protected]>
* @author Christoph Wurst <[email protected]>
* @copyright 2020 Marcel Scherello
*/
namespace OCA\Analytics\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IUserSession;
class WizzardController extends Controller
{
/** @var IConfig */
protected $config;
/** @var IUserSession */
private $userSession;
private $AppName;
public function __construct(
string $AppName,
IRequest $request,
IUserSession $userSession,
IConfig $config
)
parent::__construct($AppName, $request);
$this->AppName = $AppName;
$this->config = $config;
$this->userSession = $userSession;
}
* @NoAdminRequired
* @return DataResponse
* @throws \OCP\PreConditionNotMetException
public function dismiss(): DataResponse
$user = $this->userSession->getUser();
if ($user === null) {
throw new \RuntimeException("Acting user cannot be resolved");
$this->config->setUserValue($user->getUID(), $this->AppName, 'wizzard', 1);
return new DataResponse();