4 include_once
'Auth/Container.php';
43 if(!$PHPCAS_CLIENT->isAuthenticated())
45 $PHPCAS_CLIENT->forceAuthentication();
56 $ilLog->write(__METHOD__.
': Successful CAS login.');
58 include_once(
"./Services/CAS/lib/CAS.php");
60 if ($PHPCAS_CLIENT->getUser() !=
"")
62 $username = $PHPCAS_CLIENT->getUser();
63 $ilLog->write(__METHOD__.
': Username: '.$username);
66 include_once(
'./Services/User/classes/class.ilObjUser.php');
69 if ($local_user !=
"")
71 $a_auth->setAuth($local_user);
75 if (!$ilSetting->get(
"cas_create_users"))
86 $newUser[
"firstname"] = $local_user;
87 $newUser[
"lastname"] =
"";
89 $newUser[
"login"] = $local_user;
92 $newUser[
"passwd"] =
"";
96 $newUser[
"auth_mode"] =
"cas";
97 $newUser[
"ext_account"] = $username;
98 $newUser[
"profile_incomplete"] = 1;
101 $userObj->assignData($newUser);
102 $userObj->setTitle($userObj->getFullname());
103 $userObj->setDescription($userObj->getEmail());
106 $userObj->setLanguage($ilSetting->get(
"language"));
109 $userObj->setTimeLimitOwner(7);
110 $userObj->setTimeLimitUnlimited(1);
111 $userObj->setTimeLimitFrom(time());
112 $userObj->setTimeLimitUntil(time());
115 $userObj->setOwner(0);
117 $userObj->setActive(1);
119 $userObj->updateOwner();
122 $userObj->saveAsNew();
125 $userObj->writePrefs();
128 $rbacadmin->assignUser($ilSetting->get(
'cas_user_default_role'), $userObj->getId(),
true);
131 $a_auth->setAuth($local_user);
137 $ilLog->write(__METHOD__.
': Login failed.');
154 public function fetchData($a_username,$a_password,$isChallengeResponse =
false)
158 $ilLog->write(__METHOD__.
': Fetch Data called');
159 return $PHPCAS_CLIENT->isAuthenticated();
166 include_once(
"./Services/CAS/lib/CAS.php");
169 $this->server_hostname = $ilSetting->get(
'cas_server');
170 $this->server_port = (int) $ilSetting->get(
'cas_port');
171 $this->server_uri = (string) $ilSetting->get(
'cas_uri');
175 $this->server_version,
176 $this->server_hostname,