Problem wit redirect

2008-01-03 Thread kgrimm

Hello,

I'm having the following problem:

I want to redirect to the login page (root) when the session has timed
out. I'm checking this in AppController each time a controller is
called. The problem is, that the login page is being rendered into the
old layout. I'm calling exit() after the redirect action just like it
should be. This problem only occurs, if a controller is called via
AJAX. If I reload the whole page or click an ajax-free-link,
everything is working fine.

Ideas, anyone?

Thanks in advance,
Kirsten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Problem wit redirect

2008-01-03 Thread kgrimm

well, but how should that help me with my problem?
I want the session to time out, not extend its lifetime.



On Jan 3, 11:38 am, Adam Royle [EMAIL PROTECTED] wrote:
 To keepalive a session, I often doing a ping ajax request every 5
 minutes, just for good measure. This keeps the session alive as long
 as the user is on that page. Easily done using something like this
 with prototype. Could even use to ajax helper to do something similar.

 script type=text/javascript
 // ping server every 5 minutes
 new Ajax.PeriodicalUpdater('', '/admin/users/ping', {method: 'get',
 frequency: 300} );
 /script

 Adam

 On Jan 3, 8:06 pm, kgrimm [EMAIL PROTECTED] wrote:

  Hello,

  I'm having the following problem:

  I want to redirect to the login page (root) when the session has timed
  out. I'm checking this in AppController each time a controller is
  called. The problem is, that the login page is being rendered into the
  old layout. I'm calling exit() after the redirect action just like it
  should be. This problem only occurs, if a controller is called via
  AJAX. If I reload the whole page or click an ajax-free-link,
  everything is working fine.

  Ideas, anyone?

  Thanks in advance,
  Kirsten
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Problem wit redirect

2008-01-03 Thread kgrimm

I will check out this, thx for your help!

On Jan 3, 3:18 pm, Pablo Viojo [EMAIL PROTECTED] wrote:
 Anyway, that's something non trivial, you can do it using headers,
 status-code, content comparison (search for some string fore example) but
 you may consider some cross-browser issues.

 --
 Pablo Viojo
 [EMAIL PROTECTED]://pviojo.net

 On Jan 3, 2008 11:17 AM, Pablo Viojo [EMAIL PROTECTED] wrote:



  Yes, that's the way it's supposed to work. You're requesting something
  (content, login page, error page) and then painting it somewhere. I don't
  know if there are any way to check for the session expiration using the ajax
  helper, but you should have some code on the client-side (javascript) to
  check if session is alive. If not just do a redirect to the login url.

  Regards,
  --
  Pablo Viojo
  [EMAIL PROTECTED]
 http://pviojo.net
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Problem with model inheritance

2007-11-21 Thread kgrimm

I'm inheriting from my own model class which itself is inherited from
AppModel.

Adding a require statement doesn't work (Cannot redeclare class ...).
With the inheritance itself everything works fine, the problem lies in
the Cake function loadModels() in basics.php.


On Nov 20, 8:04 pm, francky06l [EMAIL PROTECTED] wrote:
 What do you mean by inheritance ? I mean inheriting from a cake core
 class (ie : Appmodel etc ..) or one of your own class ?
 If it's you own class, you need a require statement before your class
 declaration, then it should not be a problem.

 Sorry if I misunderstood the problem

 On Nov 20, 5:57 pm, kgrimm [EMAIL PROTECTED] wrote:

  Hi,

  I'm using inheritance for my own models and controllers. On my local
  machine everything works fine.

  When installing in another environment (from SVN or a tar archive for
  example) I have the problem, that the model classes are not loaded in
  the same order, so it happens that a child class is loaded before its
  parent which leads to error messages. It seems they are loaded in
  alphabetical order, which is not the case locally.

  Does anybody have an idea for a clean solution without for example
  adding absolute paths in cake's code?
  Isn't it just usual to use inheritance for your own models? Why
  doesn't Cake check for it?

  I'm using Cake 1.1.8.3544

  Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Problem with model inheritance

2007-11-21 Thread kgrimm

I have solved the problem now by putting the derivated model classes
in subdirectories, letting the loadModels() function load first the
models of the current directory, then of subdirectories.

On Nov 21, 9:56 am, francky06l [EMAIL PROTECTED] wrote:
 I had this problem a while ago, and I have seen a correction about
 this in loadModels(). This was failing because of the parent class
 that was expected to be appModel.
 Maybe this has changed, I haven't tried this application for few
 month.. I will check

 On Nov 21, 9:15 am, kgrimm [EMAIL PROTECTED] wrote:

  I'm inheriting from my own model class which itself is inherited from
  AppModel.

  Adding a require statement doesn't work (Cannot redeclare class ...).
  With the inheritance itself everything works fine, the problem lies in
  the Cake function loadModels() in basics.php.

  On Nov 20, 8:04 pm, francky06l [EMAIL PROTECTED] wrote:

   What do you mean by inheritance ? I mean inheriting from a cake core
   class (ie : Appmodel etc ..) or one of your own class ?
   If it's you own class, you need a require statement before your class
   declaration, then it should not be a problem.

   Sorry if I misunderstood the problem

   On Nov 20, 5:57 pm, kgrimm [EMAIL PROTECTED] wrote:

Hi,

I'm using inheritance for my own models and controllers. On my local
machine everything works fine.

When installing in another environment (from SVN or a tar archive for
example) I have the problem, that the model classes are not loaded in
the same order, so it happens that a child class is loaded before its
parent which leads to error messages. It seems they are loaded in
alphabetical order, which is not the case locally.

Does anybody have an idea for a clean solution without for example
adding absolute paths in cake's code?
Isn't it just usual to use inheritance for your own models? Why
doesn't Cake check for it?

I'm using Cake 1.1.8.3544

Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Problem with model inheritance

2007-11-20 Thread kgrimm

Hi,

I'm using inheritance for my own models and controllers. On my local
machine everything works fine.

When installing in another environment (from SVN or a tar archive for
example) I have the problem, that the model classes are not loaded in
the same order, so it happens that a child class is loaded before its
parent which leads to error messages. It seems they are loaded in
alphabetical order, which is not the case locally.

Does anybody have an idea for a clean solution without for example
adding absolute paths in cake's code?
Isn't it just usual to use inheritance for your own models? Why
doesn't Cake check for it?

I'm using Cake 1.1.8.3544

Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Null values in Controller URL

2007-11-14 Thread kgrimm

Hi,

how can I pass null values to a controller function using its URL?

for example: controller/function/par1/par2, how can I make par1
null?

Thanks in advance!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Null values in Controller URL

2007-11-14 Thread kgrimm

thanks for your help, then I will change the order of the parameters.
I had this idea too, but it means I'll have to change quite a few
pieces of existing code, and I'm always afraid of missing some.

On Nov 14, 5:40 pm, francky06l [EMAIL PROTECTED] wrote:
 Pass this as the second parameter of your url, then you can default
 your second parameter to null in the controller. Of course this if you
 are not doing the same for the $part2 already ..
 Otherwise create another method in controller that calls an internal
 method (to handle both cases).

 On Nov 14, 5:37 pm, kgrimm [EMAIL PROTECTED] wrote:

  actually that won't help, because I need to make a difference between
  null and 0 (0 in this case means to create a new table row). My
  current solution is to pass a fixed value that has no other meaning,
  e.g. -1, and set the parameter to null in the controller function if
  it equals it. But I don't like it that way, so I just wondered if
  there's a possibility to pass 'null'.

  On Nov 14, 5:31 pm, francky06l [EMAIL PROTECTED] wrote:

   you can pass 0, in your controller you can check if($part1) for
   example

   On Nov 14, 5:28 pm, kgrimm [EMAIL PROTECTED] wrote:

Hi,

how can I pass null values to a controller function using its URL?

for example: controller/function/par1/par2, how can I make par1
null?

Thanks in advance!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Calling Controller from Controller

2007-09-26 Thread kgrimm

Hello,

I need to make a controller call from within another controller. The
controller I want to call has a render command. I tried to use
requestAction, but as I'm using ajax for displaying the content in my
layout all the layout is getting mixed up. Redirect isn't working
either. Are there any other alternatives?

Many thanks,

kgrimm


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Calling Controller from Controller

2007-09-26 Thread kgrimm

I have just solved it myself, I don't understand the solution but it
works. (I needed to call redirect without appending 'index' as
controller action)

On Sep 26, 5:44 pm, kgrimm [EMAIL PROTECTED] wrote:
 Hello,

 I need to make a controller call from within another controller. The
 controller I want to call has a render command. I tried to use
 requestAction, but as I'm using ajax for displaying the content in my
 layout all the layout is getting mixed up. Redirect isn't working
 either. Are there any other alternatives?

 Many thanks,

 kgrimm


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---