nur-sery/nur_src/b/authnz/CasAuthzManager.php

32 lines
749 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?php
namespace nur\b\authnz;
use nur\config;
use nur\func;
/**
* Class CasAuthzManager: un utilisateur authentifié par CAS v3
*/
class CasAuthzManager extends AuthzManager {
const USER_MANAGER_CLASS = CasUserManager::class;
const APPCODE = null;
function __construct(?string $appcode=null) {
if ($appcode === null) $appcode = static::APPCODE;
if ($appcode === null) $appcode = config::get_appcode();
$this->appcode = $appcode;
}
protected $appcode;
protected $userManager;
protected function getUserManager(): IUserManager {
if ($this->userManager === null) {
$class = static::USER_MANAGER_CLASS;
$this->userManager = func::cons($class, $this->appcode);
}
return $this->userManager;
}
}