Public Member Functions | Public Attributes | Protected Member Functions

BeAuthComponent Class Reference

User/group/authorization component:

More...

Inheritance diagram for BeAuthComponent:
BeAuthFacebookComponent BeAuthGoogleComponent BeAuthTwitterComponent

List of all members.

Public Member Functions

 initialize (&$controller)
 Set current user, if already logged in and/or valid.
 startSession ($sessionId=null)
 Start session if it isn't already started else check if it's valid.
 getExternalServices ()
 Get external auth services list.
 externalLogin ($extAuthType, $extAuthOptions=array())
 User authentication on external service (OpenID.
 login ($userid, $password, $policy=null, $auth_group_name=array(), $authType= 'bedita', $extAuthOptions=array())
 User authentication.
 responseLogin ($userid, $password, $policy=null, $auth_group_name=array())
 Http code response for login attempt.
 changePassword ($userid, $password)
 Change password for user and set num_login_err to 0.
 logout ()
 User logout: remove session data for the user.
 isLogged ()
 Check whether current user is logged in.
 getAuthComponent ()
 Get the current used component for the authentication.
 getUser ()
 Get the current logged user.
 userid ()
 Get the current logged userid or empty string if no user is logged.
 isUserGroupAuthorized ($groups=array())
 Check whether user group is authorized.
 createUser ($userData, $groups=NULL, $notify=true)
 Create new user.
 checkConfirmPassword ($password, $confirmedPassword)
 Check confirm password.
 updateUser ($userData, $groups=NULL)
 Update user data.
 removeGroup ($groupName)
 Remove group.
 saveGroup ($groupData)
 Save group.
 removeUser ($userId)
 Remove user.
 connectedUser ()
 Get users whose sessions are still active (not expired).
 unserializesession ($data)
 Unserialize session data.
 getUserSession ()
 Get user session data if present, false otherwise.
 setSessionVars ()
 Set session variables (i.e.
 updateSessionHistory ($historyItem, $historyConf)
 Update session history.

Public Attributes

 $controller = null
 $extAuthComponents = array()
 $Session = null
 $user = null
 $isValid = true
 $changePasswd = false
 $sessionKey = "BEAuthUser"
const SESSION_INFO_KEY = "BESession"
 $authResult = 'OK'
 $userAuth = 'bedita'

Protected Member Functions

 initExternalServices ()
 Init external auth services components, reading 'extAuthParams' config Create components without components startup.
 startupExternalServices ()
 Startup external auth service components.
 checkSessionKey ()
 Check whether session key is valid.
 loginPolicy ($userid, $u, $policy=null, $auth_group_name=array())
 Check policy using $policy array or config if null.
 userGroupModel (&$userData, $groups)
 Fill group data for user (set group data in $userData).

Detailed Description

User/group/authorization component:

Definition at line 26 of file be_auth.php.


Member Function Documentation

BeAuthComponent::changePassword ( userid,
password 
)

Change password for user and set num_login_err to 0.

Parameters:
string $userid
string $password
Returns:
boolean

Definition at line 419 of file be_auth.php.

BeAuthComponent::checkConfirmPassword ( password,
confirmedPassword 
)

Check confirm password.

Parameters:
string $password
string $confirmedPassword
Returns:
boolean

Definition at line 597 of file be_auth.php.

BeAuthComponent::connectedUser (  ) 

Get users whose sessions are still active (not expired).

Returns:
array

Definition at line 726 of file be_auth.php.

References unserializesession().

BeAuthComponent::createUser ( userData,
groups = NULL,
notify = true 
)

Create new user.

Parameters:
array $userData
array $groups (contains groups names)
boolean $notify (send newUser backend notify)
Returns:
int id of user created
Exceptions:
BeditaException 

Reimplemented in BeAuthFacebookComponent, BeAuthGoogleComponent, and BeAuthTwitterComponent.

Definition at line 552 of file be_auth.php.

References userGroupModel().

BeAuthComponent::externalLogin ( extAuthType,
extAuthOptions = array() 
)

User authentication on external service (OpenID.

LDAP, Shibbolet...)

Parameters:
string $userid
string $extAuthType
array $extAuthOptions
Returns:
boolean
Exceptions:
BeditaException 

Definition at line 211 of file be_auth.php.

Referenced by login().

BeAuthComponent::getUserSession (  ) 

Get user session data if present, false otherwise.

Returns:
mixed string|boolean

Definition at line 773 of file be_auth.php.

References checkSessionKey().

BeAuthComponent::initialize ( &$  controller  ) 

Set current user, if already logged in and/or valid.

Parameters:
object $controller

Definition at line 43 of file be_auth.php.

References initExternalServices(), and startSession().

BeAuthComponent::isLogged (  ) 

Check whether current user is logged in.

Returns:
boolean

Definition at line 468 of file be_auth.php.

References checkSessionKey(), and startSession().

Referenced by isUserGroupAuthorized().

BeAuthComponent::isUserGroupAuthorized ( groups = array()  ) 

Check whether user group is authorized.

Parameters:
array $groups
Returns:
boolean

Definition at line 524 of file be_auth.php.

References isLogged().

BeAuthComponent::login ( userid,
password,
policy = null,
auth_group_name = array(),
authType = 'bedita',
extAuthOptions = array() 
)

User authentication.

Parameters:
string $userid
string $password
array $policy (could contain parameters like maxLoginAttempts,maxNumDaysInactivity,maxNumDaysValidity)
array $auth_group_name
string $authType
array $extAuthOptions
Returns:
boolean

Definition at line 236 of file be_auth.php.

References externalLogin(), loginPolicy(), and startSession().

BeAuthComponent::loginPolicy ( userid,
u,
policy = null,
auth_group_name = array() 
) [protected]

Check policy using $policy array or config if null.

Parameters:
string $userid
array $u
array $policy (could contain parameters like maxLoginAttempts,maxNumDaysInactivity,maxNumDaysValidity)
array $auth_group_name
Returns:
boolean

Definition at line 319 of file be_auth.php.

References logout(), setSessionVars(), and startSession().

Referenced by login().

BeAuthComponent::logout (  ) 

User logout: remove session data for the user.

Returns:
boolean

Reimplemented in BeAuthGoogleComponent, and BeAuthTwitterComponent.

Definition at line 443 of file be_auth.php.

Referenced by loginPolicy().

BeAuthComponent::removeGroup ( groupName  ) 

Remove group.

Parameters:
string $groupName
Returns:
boolean
Exceptions:
BeditaException 

Definition at line 660 of file be_auth.php.

BeAuthComponent::removeUser ( userId  ) 

Remove user.

Parameters:
string $userId
Exceptions:
BeditaException 
Returns:
boolean

Definition at line 710 of file be_auth.php.

BeAuthComponent::responseLogin ( userid,
password,
policy = null,
auth_group_name = array() 
)

Http code response for login attempt.

Parameters:
string $userid
string $password
array $policy (could contain parameters like maxLoginAttempts,maxNumDaysInactivity,maxNumDaysValidity)
array $auth_group_name
Returns:
number (can be 200 'ok' 401 'unauthorized' 403 'forbidden'

Definition at line 268 of file be_auth.php.

BeAuthComponent::saveGroup ( groupData  ) 

Save group.

Parameters:
array $groupData
Returns:
int group id
Exceptions:
BeditaException 

Definition at line 682 of file be_auth.php.

BeAuthComponent::setSessionVars (  ) 

Set session variables (i.e.

userAgent, ipNumber, time, Config.language)

Definition at line 783 of file be_auth.php.

References startSession().

Referenced by loginPolicy().

BeAuthComponent::startSession ( sessionId = null  ) 

Start session if it isn't already started else check if it's valid.

Parameters:
string $sessionId the session id with which the session try to start (if not already started)
Returns:
boolean true if session started and valid

Definition at line 65 of file be_auth.php.

References checkSessionKey(), and startupExternalServices().

Referenced by initialize(), isLogged(), login(), loginPolicy(), and setSessionVars().

BeAuthComponent::unserializesession ( data  ) 

Unserialize session data.

Parameters:
array $data
Returns:
array

Definition at line 759 of file be_auth.php.

Referenced by connectedUser().

BeAuthComponent::updateSessionHistory ( historyItem,
historyConf 
)

Update session history.

Parameters:
array $historyItem
array $historyConf

Definition at line 812 of file be_auth.php.

BeAuthComponent::updateUser ( userData,
groups = NULL 
)

Update user data.

Parameters:
array $userData
array $groups
Returns:
boolean
Exceptions:
BeditaException 

Definition at line 634 of file be_auth.php.

References userGroupModel().

BeAuthComponent::userGroupModel ( &$  userData,
groups 
) [protected]

Fill group data for user (set group data in $userData).

Parameters:
array $userData
array $groups

Definition at line 610 of file be_auth.php.

Referenced by BeAuthTwitterComponent::createUser(), BeAuthGoogleComponent::createUser(), BeAuthFacebookComponent::createUser(), createUser(), and updateUser().


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus