Re: Software design question regarding the classic login page ...

2007-07-29 Thread chess64

From a search-engine optimization standpoint, the first option is
better, otherwise when the search engine tries to access any of the
private pages, it will get the login form, which is probably not what
you want. By using the first option, the search engine will simply not
index the private page.

-Adeel

On Jul 29, 2:22 pm, Gonzalo Servat [EMAIL PROTECTED] wrote:
 Hi All,

 I'm working on a private site (ie. all pages are only accessible to logged
 in users) and I'm trying to figure out if it's best to redirect the user to
 a login URL or keep the URL as is and display the login form. Here are the 2
 scenarios:

 1) User requests /resources/list (since it is in the user's history.. maybe
 bookmarked?). app_controller.php checks that the session variable
 User.iddoesn't exist so Cake redirects the user to /users/login (ie.
 URL in the
 Address/Location bar has now changed to /users/login). This would mean that
 I'd store all the user validation code inside the users_controller and the
 User model and I'd have to keep track of what URL was originally requested.

 OR

 2) User requests /resources/list. URL stays as is, but app_controller.php
 dispatches /users/login and the form action tag points to /resources/list.
 User enters their login/pass, clicks submit (which points to /resources/list
 .. as per the form tag) so app_controller.php sees that the user is not
 logged in but $this-data has a username/password set so app_controller does
 the validating and sets the right Session variables. The user gets to see
 the /resources/list page. Also, if the user was entering some data on a page
 and their session times out, I thought that maybe I could also keep
 $this-data in memory when the user clicks submit, and set it back to
 $this-data when they've logged in successfully.

 I personally like 2) best since I don't have to worry about which page the
 user requested (as the URL doesn't change), but before I change my code
 (currently using option 1), I'd like to hear other's opinions on this.

 Thanks in advance!

 - Gonzalo


--~--~-~--~~~---~--~~
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: Software design question regarding the classic login page ...

2007-07-29 Thread Gonzalo Servat
On 7/29/07, chess64 [EMAIL PROTECTED] wrote:


 From a search-engine optimization standpoint, the first option is
 better, otherwise when the search engine tries to access any of the
 private pages, it will get the login form, which is probably not what
 you want. By using the first option, the search engine will simply not
 index the private page.


True, someone brought this up in #cakephp, however, since this is a private
site and the search engine is one that doesn't just recursively get all the
pages, it's probably not an issue.

- Gonzalo

--~--~-~--~~~---~--~~
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: Software design question regarding the classic login page ...

2007-07-29 Thread Geoff Ford

As long as the login page redirects back to the requested url after
successful login in I don't see the difference, and it is probably
easier and cleaner in my opinion to redirect.

Geoff
--
http://lemoncake.wordpress.com

On Jul 30, 5:30 am, Gonzalo Servat [EMAIL PROTECTED] wrote:
 On 7/29/07, chess64 [EMAIL PROTECTED] wrote:



  From a search-engine optimization standpoint, the first option is
  better, otherwise when the search engine tries to access any of the
  private pages, it will get the login form, which is probably not what
  you want. By using the first option, the search engine will simply not
  index the private page.

 True, someone brought this up in #cakephp, however, since this is a private
 site and the search engine is one that doesn't just recursively get all the
 pages, it's probably not an issue.

 - Gonzalo


--~--~-~--~~~---~--~~
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: Software design question regarding the classic login page ...

2007-07-29 Thread Dr. Tarique Sani
On 7/30/07, Geoff Ford [EMAIL PROTECTED] wrote:


 As long as the login page redirects back to the requested url after
 successful login in I don't see the difference, and it is probably
 easier and cleaner in my opinion to redirect.


Well rendering a view instead of redirecting is just as simple - one line
each :)

Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---