Skip to content

Commit

Permalink
fix: rename config to cas_config in CasClientAuthBackend and CasStaff…
Browse files Browse the repository at this point in the history
…AuthBackend
  • Loading branch information
larueli authored and kevinoconnor7 committed Nov 29, 2022
1 parent 8da2efe commit 4fe353d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions auth-cas/cas.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,22 @@ class CasStaffAuthBackend extends ExternalStaffAuthenticationBackend {

static $service_name = "CAS";

private static $config;
private static $cas_config;

function __construct() {
$this->cas = new CasAuth(self::$config);
$customLabel = self::$config->get('cas-service-label');
$this->cas = new CasAuth(self::$cas_config);
$customLabel = self::$cas_config->get('cas-service-label');
if (!empty($customLabel)) {
self::$service_name = $customLabel;
}
}

public static function bootstrap($config) {
self::$config = $config;
self::$cas_config = $config;
}

function getName() {
$config = self::$config;
$config = self::$cas_config;
list($__, $_N) = $config::translate();
return $__(static::$name);
}
Expand Down Expand Up @@ -223,7 +223,7 @@ static function signOut($user) {
if ($cfg != null && !empty(trim($cfg->getUrl()))) {
$return_url = $cfg->getUrl() . "scp/login.php";
}
CasAuth::signOut(self::$config, $return_url);
CasAuth::signOut(self::$cas_config, $return_url);
}

function getServiceUrl() {
Expand All @@ -248,23 +248,23 @@ class CasClientAuthBackend extends ExternalUserAuthenticationBackend {

static $service_name = "CAS";

private static $config;
private static $cas_config;

function __construct() {
$this->cas = new CasAuth(self::$config);
$this->cas = new CasAuth(self::$cas_config);

$customLabel = self::$config->get('cas-service-label');
$customLabel = self::$cas_config->get('cas-service-label');
if (!empty($customLabel)) {
self::$service_name = $customLabel;
}
}

public static function bootstrap($config) {
self::$config = $config;
self::$cas_config = $config;
}

function getName() {
$config = self::$config;
$config = self::$cas_config;
list($__, $_N) = $config::translate();
return $__(static::$name);
}
Expand All @@ -287,7 +287,7 @@ function signOn() {
if (!$client) {
$client = new ClientCreateRequest(
$this, $username, $this->cas->getProfile());
if (!$cfg || !$cfg->isClientRegistrationEnabled() && self::$config->get('cas-force-register')) {
if (!$cfg || !$cfg->isClientRegistrationEnabled() && self::$cas_config->get('cas-force-register')) {
$client = $client->attemptAutoRegister();
}
}
Expand All @@ -304,7 +304,7 @@ static function signOut($user) {
if ($cfg != null && !empty(trim($cfg->getUrl()))) {
$return_url = $cfg->getUrl() . "login.php";
}
CasAuth::signOut(self::$config, $return_url);
CasAuth::signOut(self::$cas_config, $return_url);
}

function getServiceUrl() {
Expand Down

0 comments on commit 4fe353d

Please sign in to comment.