25include_once(
"Auth/Auth.php");
45 if ($a_params[
"sessionName"] !=
"")
47 parent::__construct(
"", array(
"sessionName" => $a_params[
"sessionName"]));
51 parent::__construct(
"");
54 include_once(
"./Services/CAS/lib/CAS.php");
56 $this->server_hostname = $a_params[
"server_hostname"];
57 $this->server_port = (int) $a_params[
"server_port"];
58 $this->server_uri = $a_params[
"server_uri"];
63 $this->server_port, (
string) $this->server_uri);
74 global $PHPCAS_CLIENT;
76 return $PHPCAS_CLIENT->isAuthenticated();
222 include_once(
'./Services/User/classes/class.ilObjUser.php');
225 if ($local_user !=
"")
227 $this->setAuth($local_user);
242 $newUser[
"firstname"] = $local_user;
243 $newUser[
"lastname"] =
"";
245 $newUser[
"login"] = $local_user;
248 $newUser[
"passwd"] =
"";
252 $newUser[
"auth_mode"] =
"cas";
253 $newUser[
"ext_account"] = $username;
254 $newUser[
"profile_incomplete"] = 1;
257 $userObj->assignData($newUser);
258 $userObj->setTitle($userObj->getFullname());
259 $userObj->setDescription($userObj->getEmail());
262 $userObj->setLanguage(
$ilSetting->get(
"language"));
265 $userObj->setTimeLimitOwner(7);
266 $userObj->setTimeLimitUnlimited(1);
267 $userObj->setTimeLimitFrom(time());
268 $userObj->setTimeLimitUntil(time());
271 $userObj->setOwner(0);
273 $userObj->setActive(1);
275 $userObj->updateOwner();
278 $userObj->saveAsNew();
281 $userObj->writePrefs();
284 $rbacadmin->assignUser(
$ilSetting->get(
'cas_user_default_role'), $userObj->getId(),
true);
288 $this->setAuth($local_user);
295 $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)
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.