mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
PHRAS-3789 add auto-connect-idp-name option (#4194)
patch to add missing options to conf
This commit is contained in:
74
lib/classes/patch/417RC2PHRAS2995.php
Normal file
74
lib/classes/patch/417RC2PHRAS2995.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||
|
||||
|
||||
class patch_417RC2PHRAS2995 implements patchInterface
|
||||
{
|
||||
/** @var string */
|
||||
private $release = '4.1.7-rc2';
|
||||
|
||||
/** @var array */
|
||||
private $concern = [base::APPLICATION_BOX];
|
||||
|
||||
/**
|
||||
* Returns the release version.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_release()
|
||||
{
|
||||
return $this->release;
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function concern()
|
||||
{
|
||||
return $this->concern;
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function require_all_upgrades()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDoctrineMigrations()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function apply(base $appbox, Application $app)
|
||||
{
|
||||
/** @var PropertyAccess $conf */
|
||||
$conf = $app['conf'];
|
||||
$newProviders = [];
|
||||
$psFixed = false;
|
||||
foreach ($app['conf']->get(['authentication', 'providers'], []) as $providerId => $data) {
|
||||
if($data['type'] === "ps-auth") {
|
||||
if(!isset($data['options']['debug'])) {
|
||||
$data['options']['debug'] = false;
|
||||
}
|
||||
if(!isset($data['options']['auto-connect-idp-name'])) {
|
||||
$data['options']['auto-connect-idp-name'] = null;
|
||||
}
|
||||
$psFixed = true;
|
||||
}
|
||||
$newProviders[$providerId] = $data;
|
||||
}
|
||||
|
||||
// add ps
|
||||
if($psFixed) {
|
||||
$conf->set(['authentication', 'providers'], $newProviders);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user