Skip to content

Commit

Permalink
Code review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
plessbd committed Jan 17, 2019
1 parent 34a731f commit f9f3151
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
12 changes: 1 addition & 11 deletions classes/Authentication/SAML/XDSamlAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ class XDSamlAuthentication
*/
protected $_sources = null;

/**
* Whether or not SAML is configured. Defaults to false.
*
* @var boolean
*/
protected $_isConfigured = null;

const BASE_ADMIN_EMAIL = <<<EML
Person Details -----------------------------------
Expand Down Expand Up @@ -93,10 +86,7 @@ public function __construct()
*/
public function isSamlConfigured()
{
if($this->_isConfigured === null){
$this->_isConfigured = (count($this->_sources));
}
return $this->_isConfigured;
return !empty($this->_sources);
}

/**
Expand Down
5 changes: 4 additions & 1 deletion classes/XDSessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ public static function logoutUser($token = "")
$auth = new Authentication\SAML\XDSamlAuthentication();
$auth->logout();
} catch (InvalidArgumentException $ex) {
// This will catch when a configuration directory does not exist if it is set in the environment level
// This will catch when apache or nginx have been set up
// to to have an alternate saml configuration directory
// that does not exist, so we ignore it as saml isnt set
// up and we dont have to do anything with it
}
}

Expand Down
5 changes: 4 additions & 1 deletion html/gui/general/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
try {
$auth = new Authentication\SAML\XDSamlAuthentication();
} catch (InvalidArgumentException $ex) {
// This will catch when a configuration directory does not exist if it is set in the environment level
// This will catch when apache or nginx have been set up
// to to have an alternate saml configuration directory
// that does not exist, so we ignore it as saml isnt set
// up and we dont have to do anything with it
}
try {
if ($auth && $auth->isSamlConfigured()) {
Expand Down

0 comments on commit f9f3151

Please sign in to comment.