Commit 8fbf9e0a authored by Patrick Barroca's avatar Patrick Barroca 🐧

dev #106075 : fix RT

parent b716410d
Pipeline #9673 canceled with stage
in 26 minutes and 13 seconds
'106075' =>
['Label' => $this->_('[Explo] France Connect avec identifiant GPSEA'),
'Desc' => '',
['Label' => $this->_('Serveurs d\'identité tiers'),
'Desc' => $this->_('Bokeh permet aux abonnés d\'associer leurs comptes FranceConnect, Google et plus généralement OpenId à leur compte Bokeh.'),
'Image' => '',
'Video' => '',
'Category' => '',
'Video' => 'https://youtu.be/sRC3dO70ezI',
'Category' => $this->_('Compte lecteur'),
'Right' => function($feature_description, $user) {return true;},
'Wiki' => '',
'Wiki' => 'http://wiki.bokeh-library-portal.org/index.php?title=FranceConnect_OpenId',
'Test' => '',
'Date' => '2020-02-27'],
\ No newline at end of file
- ticket #106075 : [Explo] France Connect avec identifiant GPSEA
\ No newline at end of file
- ticket #106075 : Compte lecteur : Ajout de la prise en charge de serveurs d'identité tiers France Connect, Google et plus généralement OpenId
\ No newline at end of file
- ticket #79874 : [Explo] [contractuel Chambéry] Connecteur France Connect
\ No newline at end of file
......@@ -1239,7 +1239,7 @@ class AbonneController extends ZendAfi_Controller_Action {
}
$identity->dissociate();
$this->_helper->notify($this->_('Votre compte a été dissocié de "%s"',
$this->_helper->notify($this->_('Votre compte a été dissocié de %s',
$identity->getProviderLabel()));
$this->_redirectToUrlOrReferer('/');
}
......
......@@ -31,7 +31,7 @@ class IdentityProvidersController extends ZendAfi_Controller_Action {
}
if (!$url = $provider->loginUrl($this->_getParam('redirect', ''))) {
$this->_helper->notify($this->_('Impossible de déterminer l\'url de login pour "%s"',
$this->_helper->notify($this->_('Impossible de déterminer l\'url de login pour %s',
$provider->getLabel()));
return $this->_redirectToReferer();
}
......
<?php
$this->openBoite($this->titre);
echo '<section>';
echo $this->tag('h2', $this->_('Fournisseur(s) d\'identité(s) associé(s) à votre compte'));
$description = (new Class_TableDescription('active_identities'))
->addColumn($this->_('Nom du fournisseur d\'identité'),
function($model)
{
return $model->getProvider()
? $model->getProvider()->getLibelle()
: null;
})
->addColumn($this->_('Dissocier'),
function($model)
{
return $this->tagAnchor(['controller' => 'abonne',
'action' => 'dissociate-provider',
'id' => $model->getId()
],
$this->_('Dissocier votre compte'));
});
echo empty($this->identities)
? $this->tag('p', $this->_('Votre compte n\'est pas associé à un fournisseur d\'identité'))
: $this->renderTable($description, $this->identities);
echo $this->tag('h2', 'Fournisseurs d\'identités disponibles');
echo $this->identityProviders('<br/>');
echo '</section>';
echo $this->abonne_AssociatedProvidersBoard($this->identities);
$this->closeBoite();
echo $this->abonne_RetourFiche();
......@@ -97,12 +97,12 @@ class Class_Auth_IdentityProviderNotLogged extends Class_Auth_NotLogged {
}
if (!$provider->associate(Class_Users::getIdentity())) {
$this->controller->notify($this->_('L\'association de votre compte à "%s" a échoué',
$this->controller->notify($this->_('L\'association de votre compte à %s a échoué',
$provider->getLabel()));
return parent::_doOnLoginSuccess();
}
$this->controller->notify($this->_('L\'association de votre compte à "%s" a réussi',
$this->controller->notify($this->_('L\'association de votre compte à %s a réussi',
$provider->getLabel()));
if ($url = $provider->loginSuccessRedirectUrl())
......
......@@ -22,6 +22,8 @@
class Class_Auth_Logged extends Class_Auth_Strategy {
public function getPageTitle($view) {
return $view->preferences['titre_connecte'];
return isset($view->preferences['titre_connecte'])
? $view->preferences['titre_connecte']
: '';
}
}
......@@ -59,6 +59,7 @@ class Class_IdentityProvider extends Storm_Model_Abstract{
'button_logout',
'prod_url' ],
$_config_as_array,
$_context;
......@@ -213,6 +214,8 @@ class Class_IdentityProvider extends Storm_Model_Abstract{
$config = $this->getConfigAsArray();
$config[$key] = $value;
$this->setConfig(json_encode($config));
$this->_config_as_array = $config;
return $this;
}
......@@ -226,10 +229,11 @@ class Class_IdentityProvider extends Storm_Model_Abstract{
public function getConfigAsArray() {
$config = json_decode($this->getConfig(),true);
return $config ?
$config
: [];
if (null !== $this->_config_as_array)
return $this->_config_as_array;
$config = json_decode($this->getConfig(), true);
return $this->_config_as_array = $config ? $config : [];
}
......
......@@ -28,9 +28,9 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_IdentityProvider
'name' => 'provider',
'order' => 'label'],
'messages' => ['successful_save' => $this->_('Fournisseur d\'identité "%s" sauvegardé'),
'successful_add' => $this->_('Le fournisseur d\'identité "%s" a été sauvegardé'),
'successful_delete' => $this->_('Fournisseur d\'identité "%s" supprimé')],
'messages' => ['successful_save' => $this->_('Fournisseur d\'identité %s sauvegardé'),
'successful_add' => $this->_('Le fournisseur d\'identité %s a été sauvegardé'),
'successful_delete' => $this->_('Fournisseur d\'identité %s supprimé')],
'actions' => ['add' => ['title' => $this->_('Ajouter un fournisseur d\'identité')],
'edit' => ['title' => $this->_('Modifier le fournisseur d\'identité: %s')]],
......
<?php
/**
* Copyright (c) 2012-2020, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Abonne_AssociatedProvidersBoard extends ZendAfi_View_Helper_BaseHelper {
protected $_identities;
public function abonne_associatedProvidersBoard($identities) {
$this->_identities = $identities;
return $this->_tag('section',
$this->_renderCurrent() . $this->_renderAvailable());
}
protected function _renderCurrent() {
return $this->_tag('h2',
$this->_('Fournisseur(s) d\'identité(s) associé(s) à votre compte'))
. $this->_renderIdentities();
}
protected function _renderIdentities() {
if (empty($this->_identities))
return $this->_tag('p', $this->_('Votre compte n\'est pas associé à un fournisseur d\'identité'));
$description = (new Class_TableDescription('active_identities'))
->addColumn($this->_('Nom du fournisseur d\'identité'),
function($model)
{
return $model->getProvider()
? $model->getProvider()->getLibelle()
: null;
})
->addColumn($this->_('Dissocier'),
function($model)
{
return $this->_tagAnchor(['controller' => 'abonne',
'action' => 'dissociate-provider',
'id' => $model->getId()
],
$this->_('Dissocier votre compte'));
});
return $this->view->renderTable($description, $this->_identities);
}
protected function _renderAvailable() {
return $this->_tag('h2', 'Fournisseurs d\'identités disponibles')
. $this->view->identityProviders('<br/>');
}
}
......@@ -200,7 +200,7 @@ class IdentityProviderAuthenticationOpenIdCertificatesTest extends ModelTestCase
class IdentityProviderControllerErrorsTest extends AbstractControllerTestCase {
class IdentityProviderControllerAuthenticationErrorsTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
/**
......@@ -235,7 +235,7 @@ class IdentityProviderControllerErrorsTest extends AbstractControllerTestCase {
$this->dispatch('/identity-providers/authenticate/id/12/redirect/myredirect');
$this->assertRedirectTo($_SERVER['HTTP_REFERER']);
$this->assertFlashMessengerContentContains('url de login pour "MyProvider"');
$this->assertFlashMessengerContentContains('url de login pour MyProvider');
}
}
......@@ -1032,7 +1032,7 @@ class IdentityProviderAuthenticationAuthLoginPostRemotelyLoggedAchetezaTest
/** @test */
public function shouldNotifyAssociationComplete() {
$this->assertFlashMessengerContentContains('L\'association de votre compte à "Acheteza" a réussi');
$this->assertFlashMessengerContentContains('L\'association de votre compte à Acheteza a réussi');
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment