Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Security API > Methods

Security API: loginAs

Scroll Prev Next More

 

Logs a user in, no redirects.

 
AftersuccessfulLogin event is called if the second parameter is set to true.

 

This function does not work with Active Directory or Facebook login.

Syntax

Security::loginAs($username, $callEvent = true)

Arguments

$username

name of the user to be logged in.

$callEvent

 

optional. AftersuccessfulLogin event will be called if the second parameter is set to true or omitted.

Return value

No return value.

Example

Authorize the current user:

 

$username = "User";
Security::loginAs($username);

See also:

Security API: logout

Active Directory

Security: Facebook connect

About Security API

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software