Congigure UserService Instance
In Mouf, open the page for the userService instance:
loginPageUrl
: Path to the login page relative to the root URL of the applicationuserDao
: The Dao the userService must refers toauthenticationListener
: a list of object that will be notified when a user logs in or out. Used by RightService.redirectParameter
: Path to the page if a user tries to access a page that requires to be logged
Basic usage
Ok, the user service is now ready to be used.
Log a user in your application:
Mouf::getUserService()->login("email", "password");
Check if a user is logged:
$isLogged = Mouf::getUserService()->isLogged();
Get the current user:
$user = Mouf::getUserService()->getLoggedUser();
Logout a user:
$user = Mouf::getUserService()->logoff();
Now, you have to possibilities:
Make your own login page : Quick example
Use the SimpleLoginController : SimpleLogincontroller
Found a typo? Something is wrong in this documentation? Just fork and edit it!