Re: Auth Component - I'm going crazy

2008-08-27 Thread shabba

I also had this problem its caused because your not allowing a certain
page. Action, my problem was that I had a element that was dynamically
loading data. Instead I created a new layout just for the login that
solved the problem. Here is what my app controller looks like.

class AppController extends Controller {

var $components = array('Auth');
/**
 * Load the Authentication
 *
 * @access public
 */
function beforeFilter(){
$this->layout = 'login';
$this->Auth->loginAction = array('controller' => 'users', 
'action'
=> 'login');
$this->Auth->loginRedirect = array('controller' => 'pages', 
'action'
=> 'home');
$this->Auth->logoutRedirect = '/users/login';
$this->Auth->allow('login');
$this->Auth->authorize = 'controller';
}

function isAuthorized() {
return true;
   }
}

On Aug 25, 8:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
> Ola, everyone...
>
> //Using RC2 version of CakePHP
>
> I'm building simple application that allows users to write articles.
> So there are their corresponding models and controllers.
>
> Few days ago I made custom Login/register part of application that
> writes username to session etc. but now I decided to use Auth
> component for this purpose.
> As soon as I define:
> var $components = array('Auth');
> in my users_controller or app_controller, application stops working.
> Firefox gives following error: "Firefox has detected that the server
> is redirecting the request for this address in a way that will never
> complete." So, some infinite loop occured definitely and I'm quite
> sure that I didn't cause it :)
>
> I found few posts about this problem but none of them resolves my
> problem.
>
> The weirdest thing,to me, is that error occurs as soon as I include
> Auth component; I don't even use one method of that class ?!?
> Also another confusing part with this problem is that my other
> controllers also stop working with same output eventhough component
> Auth is included only in users_controller. User model is in
> association with articles model but I think that articles_controller
> shoud with or without component Auth included in users_controller. Am
> I wrong?
>
> My database is USERS and has fields username and password and also
> there is a model for users table.
>
> Thanks in advance
>
> Luka

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread RichardAtHome

Sounds like the Auth component is redirecting you away from a
protected page, to another protected page - hence the loop.

In your Users controller do you have a login action?

On Aug 26, 9:19 am, luigi7up <[EMAIL PROTECTED]> wrote:
> I'll try this. I read about this but I thought they were talking about
> other databases and not MySql.
> thx...
>
> On Aug 26, 8:57 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > I have had situations in which I was unable to use a column named
> > "password" and had to instead use something like "passwd".  I believe
> > it is a reserved keyword issue with MySQL?  Not sure if it was just
> > related to an older version, but you might at least try changing the
> > column name.
>
> > -Aran
>
> > On Aug 25, 12:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
>
> > > Ola, everyone...
>
> > > //Using RC2 version of CakePHP
>
> > > I'm building simple application that allows users to write articles.
> > > So there are their corresponding models and controllers.
>
> > > Few days ago I made custom Login/register part of application that
> > > writes username to session etc. but now I decided to use Auth
> > > component for this purpose.
> > > As soon as I define:
> > > var $components = array('Auth');
> > > in my users_controller or app_controller, application stops working.
> > > Firefox gives following error: "Firefox has detected that the server
> > > is redirecting the request for this address in a way that will never
> > > complete." So, some infinite loop occured definitely and I'm quite
> > > sure that I didn't cause it :)
>
> > > I found few posts about this problem but none of them resolves my
> > > problem.
>
> > > The weirdest thing,to me, is that error occurs as soon as I include
> > > Auth component; I don't even use one method of that class ?!?
> > > Also another confusing part with this problem is that my other
> > > controllers also stop working with same output eventhough component
> > > Auth is included only in users_controller. User model is in
> > > association with articles model but I think that articles_controller
> > > shoud with or without component Auth included in users_controller. Am
> > > I wrong?
>
> > > My database is USERS and has fields username and password and also
> > > there is a model for users table.
>
> > > Thanks in advance
>
> > > Luka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

I think I know what's causing the problem.

I have a ELEMENT that is calling index() action of users_controller to
get some data from users model and in index() function I have:

$users = $this->paginate();

if(isset($this->params['requested'])) {
return $users;
}
$this->set('users', $users);

If I comment this there are no errors?!?

My element looks like this:

$users = $this->requestAction('users/index/sort:id/direction:desc/
limit:5');

foreach($users as $user):
echo $user['User']['username'];
echo '';
endforeach;


Hope this helps...

Luka




In my users_controller I have index() action

On Aug 25, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> Really hard to diagnose without seeing any code.  Have you tried
> looking at this fantastic tutorial on using the Auth component?
>
> http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful...
>
> There are some other links there that deal with the Auth component as well.
>
> --
> Chris Hartjes
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

What about this:

Also another confusing part with this problem is that my other
controllers also stop working with same output eventhough component
Auth is included only in users_controller. User model is in
association with articles model but I think that articles_controller
shoud with or without component Auth included in users_controller. Am
I wrong?




On Aug 25, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> Really hard to diagnose without seeing any code.  Have you tried
> looking at this fantastic tutorial on using the Auth component?
>
> http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful...
>
> There are some other links there that deal with the Auth component as well.
>
> --
> Chris Hartjes
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

I'll try this. I read about this but I thought they were talking about
other databases and not MySql.
thx...

On Aug 26, 8:57 am, aranworld <[EMAIL PROTECTED]> wrote:
> I have had situations in which I was unable to use a column named
> "password" and had to instead use something like "passwd".  I believe
> it is a reserved keyword issue with MySQL?  Not sure if it was just
> related to an older version, but you might at least try changing the
> column name.
>
> -Aran
>
> On Aug 25, 12:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
>
> > Ola, everyone...
>
> > //Using RC2 version of CakePHP
>
> > I'm building simple application that allows users to write articles.
> > So there are their corresponding models and controllers.
>
> > Few days ago I made custom Login/register part of application that
> > writes username to session etc. but now I decided to use Auth
> > component for this purpose.
> > As soon as I define:
> > var $components = array('Auth');
> > in my users_controller or app_controller, application stops working.
> > Firefox gives following error: "Firefox has detected that the server
> > is redirecting the request for this address in a way that will never
> > complete." So, some infinite loop occured definitely and I'm quite
> > sure that I didn't cause it :)
>
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> > The weirdest thing,to me, is that error occurs as soon as I include
> > Auth component; I don't even use one method of that class ?!?
> > Also another confusing part with this problem is that my other
> > controllers also stop working with same output eventhough component
> > Auth is included only in users_controller. User model is in
> > association with articles model but I think that articles_controller
> > shoud with or without component Auth included in users_controller. Am
> > I wrong?
>
> > My database is USERS and has fields username and password and also
> > there is a model for users table.
>
> > Thanks in advance
>
> > Luka
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-26 Thread luigi7up

I tried few great tutorials but I'll try this one too.

thanx

On Aug 25, 9:36 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> > I found few posts about this problem but none of them resolves my
> > problem.
>
> Really hard to diagnose without seeing any code.  Have you tried
> looking at this fantastic tutorial on using the Auth component?
>
> http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful...
>
> There are some other links there that deal with the Auth component as well.
>
> --
> Chris Hartjes
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-25 Thread aranworld

I have had situations in which I was unable to use a column named
"password" and had to instead use something like "passwd".  I believe
it is a reserved keyword issue with MySQL?  Not sure if it was just
related to an older version, but you might at least try changing the
column name.

-Aran

On Aug 25, 12:32 pm, luigi7up <[EMAIL PROTECTED]> wrote:
> Ola, everyone...
>
> //Using RC2 version of CakePHP
>
> I'm building simple application that allows users to write articles.
> So there are their corresponding models and controllers.
>
> Few days ago I made custom Login/register part of application that
> writes username to session etc. but now I decided to use Auth
> component for this purpose.
> As soon as I define:
> var $components = array('Auth');
> in my users_controller or app_controller, application stops working.
> Firefox gives following error: "Firefox has detected that the server
> is redirecting the request for this address in a way that will never
> complete." So, some infinite loop occured definitely and I'm quite
> sure that I didn't cause it :)
>
> I found few posts about this problem but none of them resolves my
> problem.
>
> The weirdest thing,to me, is that error occurs as soon as I include
> Auth component; I don't even use one method of that class ?!?
> Also another confusing part with this problem is that my other
> controllers also stop working with same output eventhough component
> Auth is included only in users_controller. User model is in
> association with articles model but I think that articles_controller
> shoud with or without component Auth included in users_controller. Am
> I wrong?
>
> My database is USERS and has fields username and password and also
> there is a model for users table.
>
> Thanks in advance
>
> Luka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - I'm going crazy

2008-08-25 Thread Chris Hartjes

On Mon, Aug 25, 2008 at 3:32 PM, luigi7up <[EMAIL PROTECTED]> wrote:
> I found few posts about this problem but none of them resolves my
> problem.

Really hard to diagnose without seeing any code.  Have you tried
looking at this fantastic tutorial on using the Auth component?

http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/

There are some other links there that deal with the Auth component as well.

-- 
Chris Hartjes
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth Component - I'm going crazy

2008-08-25 Thread luigi7up

Ola, everyone...

//Using RC2 version of CakePHP

I'm building simple application that allows users to write articles.
So there are their corresponding models and controllers.

Few days ago I made custom Login/register part of application that
writes username to session etc. but now I decided to use Auth
component for this purpose.
As soon as I define:
var $components = array('Auth');
in my users_controller or app_controller, application stops working.
Firefox gives following error: "Firefox has detected that the server
is redirecting the request for this address in a way that will never
complete." So, some infinite loop occured definitely and I'm quite
sure that I didn't cause it :)

I found few posts about this problem but none of them resolves my
problem.

The weirdest thing,to me, is that error occurs as soon as I include
Auth component; I don't even use one method of that class ?!?
Also another confusing part with this problem is that my other
controllers also stop working with same output eventhough component
Auth is included only in users_controller. User model is in
association with articles model but I think that articles_controller
shoud with or without component Auth included in users_controller. Am
I wrong?

My database is USERS and has fields username and password and also
there is a model for users table.

Thanks in advance

Luka

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---