2019-02-11 17:18:08 -05:00
|
|
|
<?php
|
|
|
|
|
/**
|
2024-06-06 03:55:47 -04:00
|
|
|
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-02-11 17:18:08 -05:00
|
|
|
*/
|
|
|
|
|
namespace OCA\Files_External\Config;
|
|
|
|
|
|
2019-07-24 05:53:53 -04:00
|
|
|
class UserPlaceholderHandler extends UserContext implements IConfigHandler {
|
2019-02-11 17:18:08 -05:00
|
|
|
use SimpleSubstitutionTrait;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param mixed $optionValue
|
|
|
|
|
* @return mixed the same type as $optionValue
|
|
|
|
|
* @since 16.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function handle($optionValue) {
|
2019-07-24 05:53:53 -04:00
|
|
|
$this->placeholder = 'user';
|
|
|
|
|
$uid = $this->getUserId();
|
|
|
|
|
if ($uid === null) {
|
2019-02-11 17:18:08 -05:00
|
|
|
return $optionValue;
|
|
|
|
|
}
|
|
|
|
|
return $this->processInput($optionValue, $uid);
|
|
|
|
|
}
|
|
|
|
|
}
|