summaryrefslogtreecommitdiffstats
path: root/apps/oauth2/l10n/fr.json
blob: 303cd0de5b1baa26309cf2646f09930ec718bf6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ "translations": {
    "Your client is not authorized to connect. Please inform the administrator of your client." : "Votre client n'est pas autoriser à se connecter. Veuillez informer l'administrateur de votre client.",
    "Your redirect URL needs to be a full URL for example: https://yourdomain.com/path" : "Votre adresse de redirection doit être une URL complète, par exemple: https://example.com/chemin",
    "OAuth 2.0" : "OAuth 2.0",
    "Allows OAuth2 compatible authentication from other web applications." : "Autoriser l'authentification compatible OAuth2 depuis d'autres applications web.",
    "The OAuth2 app allows administrators to configure the built-in authentication workflow to also allow OAuth2 compatible authentication from other web applications." : "L'application OAuth2 permet aux administrateurs de configurer l'authentification intégrée afin d'autoriser l'authentification compatible OAuth2 depuis d'autres applications web.",
    "OAuth 2.0 clients" : "Clients OAuth 2.0",
    "OAuth 2.0 allows external services to request access to {instanceName}." : "OAuth 2.0 permet à des services externes de demander l'accès à {instanceName}.",
    "Add client" : "Ajouter un client",
    "Name" : "Nom",
    "Redirection URI" : "URI de redirection",
    "Add" : "Ajouter",
    "Client Identifier" : "Identifiant du client",
    "Secret" : "Secret",
    "Show client secret" : "Afficher client secret",
    "Delete" : "Supprimer"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
}
n class="sd"> * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ namespace OCA\LookupServerConnector; use OC\Accounts\AccountManager; use OC\Security\IdentityProof\Manager; use OC\Security\IdentityProof\Signer; use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\IUser; use OCP\Security\ISecureRandom; /** * Class UpdateLookupServer * * @package OCA\LookupServerConnector */ class UpdateLookupServer { /** @var AccountManager */ private $accountManager; /** @var IConfig */ private $config; /** @var ISecureRandom */ private $secureRandom; /** @var IClientService */ private $clientService; /** @var Manager */ private $keyManager; /** @var Signer */ private $signer; /** @var string URL point to lookup server */ private $lookupServer = 'https://lookup.nextcloud.com/users'; /** * @param AccountManager $accountManager * @param IConfig $config * @param ISecureRandom $secureRandom * @param IClientService $clientService * @param Manager $manager * @param Signer $signer */ public function __construct(AccountManager $accountManager, IConfig $config, ISecureRandom $secureRandom, IClientService $clientService, Manager $manager, Signer $signer) { $this->accountManager = $accountManager; $this->config = $config; $this->secureRandom = $secureRandom; $this->clientService = $clientService; $this->keyManager = $manager; $this->signer = $signer; } /** * @param IUser $user */ public function userUpdated(IUser $user) { $userData = $this->accountManager->getUser($user); $publicData = []; foreach ($userData as $key => $data) { if ($data['scope'] === AccountManager::VISIBILITY_PUBLIC) { $publicData[$key] = $data; } } if (empty($publicData) && !empty($authKey)) { $this->removeFromLookupServer($user); } else { $this->sendToLookupServer($user, $publicData); } } /** * TODO: FIXME. Implement removal from lookup server. * * remove user from lookup server * * @param IUser $user */ protected function removeFromLookupServer(IUser $user) { $this->config->deleteUserValue($user->getUID(), 'lookup_server_connector', 'authKey'); } /** * send public user data to the lookup server * * @param IUser $user * @param array $publicData */ protected function sendToLookupServer(IUser $user, array $publicData) { $dataArray = [ 'federationId' => $user->getCloudId(), 'name' => isset($publicData[AccountManager::PROPERTY_DISPLAYNAME]) ? $publicData[AccountManager::PROPERTY_DISPLAYNAME]['value'] : '', 'email' => isset($publicData[AccountManager::PROPERTY_EMAIL]) ? $publicData[AccountManager::PROPERTY_EMAIL]['value'] : '', 'address' => isset($publicData[AccountManager::PROPERTY_ADDRESS]) ? $publicData[AccountManager::PROPERTY_ADDRESS]['value'] : '', 'website' => isset($publicData[AccountManager::PROPERTY_WEBSITE]) ? $publicData[AccountManager::PROPERTY_WEBSITE]['value'] : '', 'twitter' => isset($publicData[AccountManager::PROPERTY_TWITTER]) ? $publicData[AccountManager::PROPERTY_TWITTER]['value'] : '', 'phone' => isset($publicData[AccountManager::PROPERTY_PHONE]) ? $publicData[AccountManager::PROPERTY_PHONE]['value'] : '', ]; $dataArray = $this->signer->sign('lookupserver', $dataArray, $user); $httpClient = $this->clientService->newClient(); $httpClient->post($this->lookupServer, [ 'body' => json_encode($dataArray), 'timeout' => 10, 'connect_timeout' => 3, ] ); } }