25include_once(
"Auth/Auth.php");
45 if ($a_params[
"sessionName"] !=
"") {
46 parent::__construct(
"", array(
"sessionName" => $a_params[
"sessionName"]));
48 parent::__construct(
"");
51 include_once(
"./Services/CAS/lib/CAS.php");
53 $this->server_hostname = $a_params[
"server_hostname"];
54 $this->server_port = (int) $a_params[
"server_port"];
55 $this->server_uri = $a_params[
"server_uri"];
60 $this->server_version,
61 $this->server_hostname,
63 (
string) $this->server_uri
75 global $PHPCAS_CLIENT;
77 return $PHPCAS_CLIENT->isAuthenticated();
222 include_once(
'./Services/User/classes/class.ilObjUser.php');
225 if ($local_user !=
"") {
226 $this->setAuth($local_user);
238 $newUser[
"firstname"] = $local_user;
239 $newUser[
"lastname"] =
"";
241 $newUser[
"login"] = $local_user;
244 $newUser[
"passwd"] =
"";
248 $newUser[
"auth_mode"] =
"cas";
249 $newUser[
"ext_account"] = $username;
250 $newUser[
"profile_incomplete"] = 1;
253 $userObj->assignData($newUser);
254 $userObj->setTitle($userObj->getFullname());
255 $userObj->setDescription($userObj->getEmail());
258 $userObj->setLanguage(
$ilSetting->get(
"language"));
261 $userObj->setTimeLimitOwner(7);
262 $userObj->setTimeLimitUnlimited(1);
263 $userObj->setTimeLimitFrom(time());
264 $userObj->setTimeLimitUntil(time());
267 $userObj->setOwner(0);
269 $userObj->setActive(1);
271 $userObj->updateOwner();
274 $userObj->saveAsNew();
277 $userObj->writePrefs();
280 $rbacadmin->assignUser(
$ilSetting->get(
'cas_user_default_role'), $userObj->getId(),
true);
284 $this->setAuth($local_user);
288 $this->status = AUTH_WRONG_LOGIN;
An exception for terminatinating execution or to throw for unit testing.
const AUTH_CAS_NO_ILIAS_USER
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
__construct($a_params)
Constructor @access public.
checkCASAuth()
check cas autehntication
logout()
Register variable in a session telling that the user has logged in successfully.
login()
Checks if the current user is authenticated yet @access public.
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
static getUser()
This method returns the CAS user's login name.
static forceAuthentication()
This method is called to force authentication if the user was not already authenticated.
static client( $server_version, $server_hostname, $server_port, $server_uri, $changeSessionID=true)
phpCAS client initializer.