56 $ilLog->write(__METHOD__.
': Successful CAS login.');
59 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
65 include_once(
"./Services/CAS/lib/CAS.php");
66 if ($PHPCAS_CLIENT->getUser() !=
"")
68 $username = $PHPCAS_CLIENT->getUser();
69 $ilLog->write(__METHOD__.
': Username: '.$username);
72 include_once(
'./Services/User/classes/class.ilObjUser.php');
75 if ($local_user !=
"")
77 $a_auth->setAuth($local_user);
81 if (!$ilSetting->get(
"cas_create_users"))
92 $newUser[
"firstname"] = $local_user;
93 $newUser[
"lastname"] =
"";
95 $newUser[
"login"] = $local_user;
98 $newUser[
"passwd"] =
"";
102 $newUser[
"auth_mode"] =
"cas";
103 $newUser[
"ext_account"] = $username;
104 $newUser[
"profile_incomplete"] = 1;
107 $userObj->assignData($newUser);
108 $userObj->setTitle($userObj->getFullname());
109 $userObj->setDescription($userObj->getEmail());
112 $userObj->setLanguage($ilSetting->get(
"language"));
115 $userObj->setTimeLimitOwner(7);
116 $userObj->setTimeLimitUnlimited(1);
117 $userObj->setTimeLimitFrom(
time());
118 $userObj->setTimeLimitUntil(
time());
121 $userObj->setOwner(0);
123 $userObj->setActive(1);
125 $userObj->updateOwner();
128 $userObj->saveAsNew();
131 $userObj->writePrefs();
134 $rbacadmin->assignUser($ilSetting->get(
'cas_user_default_role'), $userObj->getId(),
true);
137 $a_auth->setAuth($local_user);
143 $ilLog->write(__METHOD__.
': Login failed.');
146 $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)
check whether external account and authentication method matches with a user
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.