Re: login attempts limit and auth

2009-09-26 Thread midas

I would put it into login() function. After each unsuccessful login
attempt, I would increment a variable, like $login_attempts, save it
into user session table and maybe log last unsuccessful login attempt,
too. Just my quick thought.

On 26. Sep., 14:45 h., rrd...@gmail.com rrd...@gmail.com wrote:
 Hari,

 I use auth component to do the login. I want to limit login attempts
 like for 3 attempts. Where should I put my code? UserController login
 ()? beforeFilter?
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Database structure and json_encode()

2009-09-25 Thread midas

I am creating an itinerary system where user will be able to record
his trips, add one starting point where his journey begins, unknown
number of stops on his way and finally one ending point. Now I am
wondering how to create a meaningful database structure so one will be
able to search every group of points: starting, trip stops and ending
point.

I am unsure how to model my database but I have two ideas I cannot
decide between:

A)
Table TRIPS which will contain columns:
start (one starting point)
via (x trip stops)
end (one ending point)

OR

B) (my preferred one) - one only column:
waypoints

My idea is to serialize array containing all trip points using
json_encode() and save it into waypoints column in json format,
because I have read it is quite faster than serialize() and I would be
able to use it in my jquery scripts. What bothers me though is how can
I search in those waypoints then? They will be mixed together - start,
stops and end.

What idea do you like most? Thanks for your comments guys.
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How setting htaccess for redirect http://example.com to http://www.example.com

2009-09-20 Thread midas

Try this:

Non-www to www:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

www to non-www:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]

Bonus tip: Remove trailing slash from address line

RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

more here:http://planetcakephp.org/aggregator/items/271-generic-non-
www-to-www-and-vice-versa-301-redirect-using-htaccess

On Sep 20, 12:24 pm, Petr Vytlačil petr.vytla...@gmail.com wrote:
 How setting htaccess for redirecthttp://example.comtohttp://www.example.com
 and where in dir structure cakephp.

 THX

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---