Skip to content
Browse files

Merge pull request #5 from siran/master

improving readme.md
  • Loading branch information...
2 parents 71b0f5b + 7822b92 commit 9741d7319063a153f66e5811e47ab1fd78aa2ada @lorenzo lorenzo committed
Showing with 22 additions and 4 deletions.
  1. +22 −4 readme.md
View
26 readme.md
@@ -16,15 +16,33 @@ or
You will also need the [CakeDC Search plugin](http://github.com/CakeDC/search), just grab it and put it into your application's plugin folder.
-## How to use it ##
+Activate some necessary core components:
+
+ public $components = array('RequestHandler', 'Session', 'Auth');
+
+Add some lines to your `beforeFilter` and configure at your taste:
+
+ $this->Auth->authorize = 'controller';
+ $this->Auth->fields = array('username' => 'email', 'password' => 'passwd');
+ $this->Auth->loginAction = array('plugin' => 'users', 'controller' => 'users', 'action' => 'login', 'admin' => false);
+ $this->Auth->loginRedirect = '/';
+ $this->Auth->logoutRedirect = '/';
+ $this->Auth->authError = __('Sorry, but you need to login to access this location.', true);
+ $this->Auth->loginError = __('Invalid e-mail / password combination. Please try again', true);
+ $this->Auth->autoRedirect = true;
+ $this->Auth->userModel = 'User';
+ $this->Auth->userScope = array('User.active' => 1);
+ $this->Auth->allowedActions = array('index');
+
+## What it is capable of ##
You can use the plugin as it comes if you're happy with it or, more common, extend your app specific user implementation from the plugin.
The plugin itself is already capable of:
-* User registration
+* User registration (http://localhost/users/users/register)
* Account verification by a token sent via email
-* User login (email / password)
+* User login (email / password) (http://localhost/users/users/login)
* Password reset based on requesting a token by email and entering a new password
* Simple profiles for users
* User search
@@ -60,7 +78,7 @@ You can overwrite the render() method to fall back to the plugin views in the ca
### Extending the model ###
-Declare the model
+Declare the model
App::import('Model', 'Users.User');
AppUser extends User {

0 comments on commit 9741d73

Please sign in to comment.
Something went wrong with that request. Please try again.