Commit fe4be69e authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Possibilité de modifier les paramètres SSO en les spécifiant directement dans le modèle

parent b113a6a1
......@@ -86,9 +86,9 @@ class KsupService
include_once(KPHPLIB_PATH_INCLUDE . "params.php");
define("SSO_URL_SERVER", $this->getConfig('sso_url_server'));
define("SSO_HOST_SERVER", $this->getConfig('sso_host_server'));
define("SSO_PORT_SERVER", $this->getConfig('sso_port_server'));
define("SSO_URL_SERVER", $this->getModel()->getSsoUrlServer() ?: $this->getConfig('sso_url_server'));
define("SSO_HOST_SERVER", $this->getModel()->getSsoHostServer() ?: $this->getConfig('sso_host_server'));
define("SSO_PORT_SERVER", $this->getModel()->getSsoPortServer() ?: $this->getConfig('sso_port_server'));
return $this;
}
......@@ -106,7 +106,6 @@ class KsupService
$GLOBALS["objRequete"] = new \requete($this->getModel()->getRubrique(), $this->getModel()->getStructure());
if ($langue = $this->getConfig('langue')) $GLOBALS["objRequete"]->setLangue($langue);
if ($secure = $this->getConfig('https')) $GLOBALS["objRequete"]->setSecure($secure);
}
return $GLOBALS["objRequete"];
......@@ -186,7 +185,9 @@ class KsupService
throw new \Exception('Pas de modèle transmis!!');
}
$this->initVars();
$this->getRequete();
/* Contrôle de session! */
$bean = new \sso();
......@@ -201,8 +202,8 @@ class KsupService
$haut = $this->lireTemplate('haut');
$bodyPos = strpos($haut, '<body');
$insert = $this->traiterDonneesSpecifiques() . '</head>'."\r\n";
$bodyPos = strpos($haut, '</head>');
$insert = $this->traiterDonneesSpecifiques() . "\r\n";
$haut = substr($haut, 0, $bodyPos) . $insert . substr($haut, $bodyPos);
$bas = $this->lireTemplate('bas');
......
......@@ -35,6 +35,21 @@ class KsupModel extends ViewModel
*/
protected $links;
/**
* @var string
*/
protected $ssoUrlServer;
/**
* @var string
*/
protected $ssoHostServer;
/**
* @var string
*/
protected $ssoPortServer;
/**
* Is this a standalone, or terminal, model?
*
......@@ -160,4 +175,77 @@ class KsupModel extends ViewModel
{
return $this->links;
}
/**
* @return string
*/
public function getSsoUrlServer()
{
return $this->ssoUrlServer;
}
/**
* @param string $ssoUrlServer
*
* @return KsupModel
*/
public function setSsoUrlServer($ssoUrlServer)
{
$this->ssoUrlServer = $ssoUrlServer;
return $this;
}
/**
* @return string
*/
public function getSsoHostServer()
{
return $this->ssoHostServer;
}
/**
* @param string $ssoHostServer
*
* @return KsupModel
*/
public function setSsoHostServer($ssoHostServer)
{
$this->ssoHostServer = $ssoHostServer;
return $this;
}
/**
* @return string
*/
public function getSsoPortServer()
{
return $this->ssoPortServer;
}
/**
* @param string $ssoPortServer
*
* @return KsupModel
*/
public function setSsoPortServer($ssoPortServer)
{
$this->ssoPortServer = $ssoPortServer;
return $this;
}
}
\ No newline at end of file
Supports Markdown
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