Class CASAuth.
More...
Class CASAuth.
CAS Authentication class.
Definition at line 37 of file class.ilCASAuth.php.
◆ __construct()
ilCASAuth::__construct |
( |
|
$a_params | ) |
|
Constructor public.
Definition at line 43 of file class.ilCASAuth.php.
References array, CAS_VERSION_2_0, and phpCAS\client().
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);
Create styles array
The data for the language used.
static client($server_version, $server_hostname, $server_port, $server_uri, $changeSessionID=true)
phpCAS client initializer.
◆ checkCASAuth()
ilCASAuth::checkCASAuth |
( |
| ) |
|
check cas autehntication
can be called before forceAuthentication, but forceAuthentication must be called afterwards
Definition at line 72 of file class.ilCASAuth.php.
74 global $PHPCAS_CLIENT;
76 return $PHPCAS_CLIENT->isAuthenticated();
◆ forceCASAuth()
ilCASAuth::forceCASAuth |
( |
| ) |
|
◆ getCASUser()
ilCASAuth::getCASUser |
( |
| ) |
|
◆ login()
Checks if the current user is authenticated yet public.
- Returns
- boolean true if user is authenticated Set the maximum idle time
- Parameters
-
integer | time in seconds |
bool | add time to current maximum idle time or not |
- Returns
- void public Set the maximum expire time
- Parameters
-
integer | time in seconds |
bool | add time to current expire time or not |
- Returns
- void public Checks if there is a session with valid auth information.
private
- Returns
- boolean Whether or not the user is authenticated. Start new auth session
public
- Returns
- void Login function
private
- Returns
- void
Definition at line 213 of file class.ilCASAuth.php.
References $ilSetting, ilObjUser\_checkExternalAuthAccount(), ilAuthUtils\_generateLogin(), AUTH_CAS_NO_ILIAS_USER, phpCAS\getUser(), IL_PASSWD_CRYPTED, logout(), and time.
222 include_once(
'./Services/User/classes/class.ilObjUser.php');
225 if ($local_user !=
"")
227 $this->setAuth($local_user);
231 if (!$ilSetting->get(
"cas_create_users"))
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;
logout()
Register variable in a session telling that the user has logged in successfully.
static getUser()
This method returns the CAS user's login name.
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
const AUTH_CAS_NO_ILIAS_USER
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.
◆ logout()
Register variable in a session telling that the user has logged in successfully.
public
- Parameters
-
- Returns
- void Logout function
This function clears any auth tokens in the currently active session and executes the logout callback function, if any
public
- Returns
- void
Definition at line 341 of file class.ilCASAuth.php.
Referenced by login().
The documentation for this class was generated from the following file: