Skip to content

Commit 56094da

Browse files
committed
Get "" through injection.
1 parent b6bbf3c commit 56094da

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/Controller/PersonalSettingsController.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use OCP\IConfig;
2929
use OCP\IL10N;
3030
use OCP\IRequest;
31-
use OCP\IUserSession;
3231

3332
class PersonalSettingsController extends Controller {
3433

@@ -37,26 +36,26 @@ class PersonalSettingsController extends Controller {
3736
/** @var IConfig */
3837
private $config;
3938
/**
40-
* @var bool|IUser
39+
* @var string
4140
*/
42-
private $user;
41+
private $userId;
4342

4443
/**
4544
* @param string $appName
4645
* @param IRequest $request
4746
* @param IL10N $l10n
4847
* @param IConfig $config
49-
* @param IUserSession $userSession
48+
* @param string $userId
5049
*/
5150
public function __construct($appName,
5251
IRequest $request,
5352
IL10N $l10n,
5453
IConfig $config,
55-
IUserSession $userSession) {
54+
$userId) {
5655
parent::__construct($appName, $request);
5756
$this->l10n = $l10n;
5857
$this->config = $config;
59-
$this->user = $userSession && $userSession->isLoggedIn() ? $userSession->getUser() : false;
58+
$this->userId = $userId;
6059
}
6160

6261
/**
@@ -65,7 +64,7 @@ public function __construct($appName,
6564
* @return TemplateResponse
6665
*/
6766
public function displayPanel() {
68-
$settings = Util::getTurnSettings($this->config, $this->user->getUID());
67+
$settings = Util::getTurnSettings($this->config, $this->userId);
6968
return new TemplateResponse('spreed', 'settings-personal', [
7069
'turnSettings' => $settings,
7170
], '');
@@ -82,7 +81,7 @@ public function displayPanel() {
8281
* @param string $turn_protocols
8382
*/
8483
public function setSpreedSettings($turn_server, $turn_username, $turn_password, $turn_protocols) {
85-
if (!$this->user) {
84+
if (!$this->userId) {
8685
return array('data' =>
8786
array('message' =>
8887
(string) $this->l10n->t('Not logged in.')
@@ -136,7 +135,7 @@ public function setSpreedSettings($turn_server, $turn_username, $turn_password,
136135
'protocols' => $turn_protocols
137136
);
138137

139-
$this->config->setUserValue($this->user->getUID(),
138+
$this->config->setUserValue($this->userId,
140139
'spreed',
141140
'turn_settings',
142141
json_encode($turn_settings));

0 commit comments

Comments
 (0)