53 $ilLog->write(__METHOD__ .
': Successful CAS login.');
56 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
61 include_once(
"./Services/CAS/lib/CAS.php");
62 if ($PHPCAS_CLIENT->getUser() !=
"") {
63 $username = $PHPCAS_CLIENT->getUser();
64 $ilLog->write(__METHOD__ .
': Username: ' . $username);
67 include_once(
'./Services/User/classes/class.ilObjUser.php');
70 if ($local_user !=
"") {
71 $a_auth->setAuth($local_user);
73 if (!$ilSetting->get(
"cas_create_users")) {
83 $newUser[
"firstname"] = $local_user;
84 $newUser[
"lastname"] =
"";
86 $newUser[
"login"] = $local_user;
89 $newUser[
"passwd"] =
"";
93 $newUser[
"auth_mode"] =
"cas";
94 $newUser[
"ext_account"] = $username;
95 $newUser[
"profile_incomplete"] = 1;
98 $userObj->assignData($newUser);
99 $userObj->setTitle($userObj->getFullname());
100 $userObj->setDescription($userObj->getEmail());
103 $userObj->setLanguage($ilSetting->get(
"language"));
106 $userObj->setTimeLimitOwner(7);
107 $userObj->setTimeLimitUnlimited(1);
108 $userObj->setTimeLimitFrom(time());
109 $userObj->setTimeLimitUntil(time());
112 $userObj->setOwner(0);
114 $userObj->setActive(1);
116 $userObj->updateOwner();
119 $userObj->saveAsNew();
122 $userObj->writePrefs();
125 $rbacadmin->assignUser($ilSetting->get(
'cas_user_default_role'), $userObj->getId(),
true);
128 $a_auth->setAuth($local_user);
132 $ilLog->write(__METHOD__ .
': Login failed.');
135 $a_auth->status = AUTH_WRONG_LOGIN;
handleLDAPDataSource($a_auth, $ext_account)
Handle ldap as data source.
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
const AUTH_CAS_NO_ILIAS_USER
static isDataSourceActive($a_auth_mode)
Check if a data source is active for a specific auth mode ilDB $ilDB.
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user