Re: my own controller instead of user_controller login problem

2011-11-14 Thread danswater
thank you for your quick response sir.  i will remember your tip and
try to understand more cakephp

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: my own controller instead of user_controller login problem

2011-11-14 Thread danswater
thank you for your quick response sir. I will try to read your links
that you posted.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: my own controller instead of user_controller login problem

2011-11-14 Thread euromark
you should also be aware of uppercase and lowercase naming of your
objects


On 14 Nov., 15:46, phpMagpie  wrote:
> From page:http://book.cakephp.org/view/1250/Authentication
>
> "Now, there are a few conventions to think about when using AuthComponent.
> By default, the AuthComponent expects you to have a table called 'users'
> with fields called 'username' and 'password' to be used."
>
> So if you insist on using a model other than users for logins you need to
> tell the auth component 
> this:http://book.cakephp.org/view/1251/Setting-Auth-Component-Variableshttp://book.cakephp.org/view/1265/AuthComponent-Variables
>
> $this->Auth->userModel = 'Student';
>
> However, I would recommend against this as I am sure if your app has
> students it will have teachers, or other types of users which would be
> better managed from a User model with those users having roles.
>
> HTH, Paul.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: my own controller instead of user_controller login problem

2011-11-14 Thread phpMagpie
>From page:
http://book.cakephp.org/view/1250/Authentication

"Now, there are a few conventions to think about when using AuthComponent. 
By default, the AuthComponent expects you to have a table called 'users' 
with fields called 'username' and 'password' to be used."

So if you insist on using a model other than users for logins you need to 
tell the auth component this:
http://book.cakephp.org/view/1251/Setting-Auth-Component-Variables
http://book.cakephp.org/view/1265/AuthComponent-Variables

$this->Auth->userModel = 'Student';

However, I would recommend against this as I am sure if your app has 
students it will have teachers, or other types of users which would be 
better managed from a User model with those users having roles.

HTH, Paul.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


my own controller instead of user_controller login problem

2011-11-14 Thread danswater
Hi all! I am new in cakephp and i just downloaded cakephp ver. 1.3.13
and give it a try.
I made a simple login/logout application using the auth component.
I have a students and profiles tables in my database and i bake it
using "cake bake all" so that it generates CRUD function.

And i made an app_controller where i set the var $components =
array("Auth") and after that i made  a beforeFilter function where i
set
$this->auth->allow(...),
$this->auth->loginError,
$this->auth->authError,
$this->auth->loginRedirect,
$this->auth->logoutRedirect.

In student_controller i put the login and logout function. and after
that i create the login.ctp.
My problem is when i try to access localhost/.../students/login, it
will give me an error of

Missing Controller
Error: UsersController could not be found.
Error: Create the class UsersController below in file: app\controllers
\users_controller.php

Notice: If you want to customize this error message, create app\views
\errors\missing_controller.ctp.

can somebody help me about this issue? thanks..

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php