modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php
\SugarAuthenticate
This file is used to control the authentication process.
It will call on the user authenticate and controll redirection based on the users validation
Properties
Methods

SugarAuthenticate(
)
:
\SugarAuthenticateConstructs SugarAuthenticate This will load the user authentication class
| Type | Description |
|---|---|
| \SugarAuthenticate |

encodePassword(
STRING $password
)
:
STRINGEncodes a users password. This is a static function and can be called at any time.
| Name | Type | Description |
|---|---|---|
| $password | STRING |
| Type | Description |
|---|---|
| STRING | $encoded_password |

loginAuthenticate(
string $username, string $password, $fallback
=
false, $PARAMS
=
array ()
)
:
booleanAuthenticates a user based on the username and password returns true if the user was authenticated false otherwise it also will load the user into current user if he was authenticated
| Name | Type | Description |
|---|---|---|
| $username | string | |
| $password | string | |
| $fallback | ||
| $PARAMS |
| Type | Description |
|---|---|
| boolean |

postLoginAuthenticate(
)
:
voidOnce a user is authenticated on login this function will be called. Populate the session with what is needed and log anything that needs to be logged

postSessionAuthenticate(
)
:
booleanCalled after a session is authenticated - if this returns false the sessionAuthenticate will return false and destroy the session and it will load the current user
| Type | Description |
|---|---|
| boolean |

pre_login(
)
:
voidpre_login
This function allows the SugarAuthenticate subclasses to perform some pre login initialization as needed

sessionAuthenticate(
)
:
booleanOn every page hit this will be called to ensure a user is authenticated
| Type | Description |
|---|---|
| boolean |