I know that. I was wondering if cakephp has any automagically with this issue.. but thanks anyway.
-- Renato de Freitas Freire [email protected] On Mon, Feb 8, 2010 at 12:45 PM, John Andersen <[email protected]>wrote: > Look in the PHP manual for the predefined variable $_SERVER! > It has an index named 'REMOTE_ADDR', which gives you the IP address > that the user is located at. > Enjoy, > John > > On Feb 8, 3:20 pm, Renato de Freitas Freire <[email protected]> > wrote: > > can you help me with almost same question? > > i need to update lastIP when user log in my system.. > > how can i do that in cakephp? > > > > tnx > > > > -- > > Renato de Freitas Freire > > [email protected] > > > > On Sun, Feb 7, 2010 at 5:57 AM, John Andersen <[email protected] > >wrote: > > > > > You are welcome :) > > > Joh > > > > > On 7 February 2010 06:24, Hussain <[email protected]> wrote: > > > > Thanks for you solution! It helps me a lot. > > > > here is my solution: > > > > function login() { > > > > //-- code inside this function will execute only when > > > autoRedirect > > > > was set to false (i.e. in a beforeFilter). > > > > if ($this->Auth->user()) { > > > > if( !(empty($this->data)) ){ > > > > $this->User->id = > $this->Auth->user('id'); > > > > $this->User->saveField('last_login', > > > date('Y-m-d H:i:s') ); // > > > > updating last_login field. > > > > > //$this->redirect($this->Auth->redirect()); > > > > } > > > > > > $this->redirect($this->Auth->redirect()); > > > > } > > > > > > } > > > > Thanks again. > > > [snip] > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help > others > > > with their CakePHP related questions. > > > > > You received this message because you are subscribed to the Google > Groups > > > "CakePHP" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<cake-php%[email protected]> > <cake-php%[email protected]<cake-php%[email protected]>>For > more options, visit this group at > > >http://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] 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
