Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename config to cas_config in CasClientAuthBackend and CasStaffAuthBackend #36

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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