public
Description: HomeMarks is a web based GUI to build HTML start pages.
Homepage: http://www.homemarks.com/
Clone URL: git://github.com/metaskills/homemarks.git
Search Repo:
Click here to lend your support to: homemarks and make a donation at www.pledgie.com !
Starting work on forgot password feature. Will take a modal tangent 
instead
metaskills (author)
Tue May 13 19:08:03 -0700 2008
commit  5e0a0fc476f3b84fe4a4c63724ceff5d29887cb2
tree    a7f338acde2543877a00cfc8972e65c9d76878fa
parent  b95435740a6410e82e42f8e6981fdbc80d31da4f
...
1
2
3
4
5
 
6
7
8
...
1
2
 
 
 
3
4
5
6
0
@@ -1,8 +1,6 @@
0
 class ApplicationController < ActionController::Base
0
   
0
- include ERB::Util
0
- include AuthenticatedSystem
0
- include RenderInvalidRecord
0
+ include ERB::Util, AuthenticatedSystem, RenderInvalidRecord
0
   
0
   protect_from_forgery
0
   
...
13
14
15
16
17
18
19
20
21
...
25
26
27
 
 
 
 
 
 
 
 
 
28
 
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
...
13
14
15
 
16
17
18
19
20
...
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
43
44
0
@@ -13,7 +13,6 @@
0
   def create
0
     self.current_user = User.authenticate(params[:email], params[:password])
0
     if logged_in?
0
- flash[:good] = 'Login Successful!'
0
       head :ok
0
     else
0
       render :json => login_failures, :status => :unauthorized, :content_type => 'application/json'
0
0
0
@@ -25,25 +24,21 @@
0
     redirect_to destination
0
   end
0
   
0
+ def forgot_password
0
+ unless @user = User.find_by_email(params[:user][:email])
0
+ render(:update) { |page| page.complete_forgotpw_form('bad') }
0
+ else
0
+ @user.generate_security_token && @user.save!
0
+ UserNotify.deliver_forgot_password(@user)
0
+ render(:update) { |page| page.complete_forgotpw_form('good') }
0
+ end
0
+ end
0
   
0
+
0
   # def jumpin
0
   # redirect_to eval(params[:redirect]+'_url')
0
   # end
0
   
0
-
0
- # def forgot_password
0
- # return redirect_to(myaccount_url) if user?
0
- # if request.post?
0
- # unless @user = User.find_by_email(params[:user][:email])
0
- # render(:update) { |page| page.complete_forgotpw_form('bad') }
0
- # else
0
- # @user.generate_security_token && @user.save!
0
- # UserNotify.deliver_forgot_password(@user)
0
- # render(:update) { |page| page.complete_forgotpw_form('good') }
0
- # end
0
- # end
0
- # end
0
- #
0
   # def destroy
0
   # reset_session
0
   # flash[:notice] = "You have been logged out."
...
23
24
25
26
27
28
29
...
23
24
25
 
26
27
28
0
@@ -23,7 +23,6 @@
0
   
0
   
0
   
0
-
0
   # def home
0
   # @trashbox = @user.trashbox
0
   # render :layout => 'application'
...
1
2
3
4
 
 
 
5
6
7
8
9
 
 
 
 
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
 
4
5
6
7
 
 
 
 
8
9
10
11
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
0
@@ -1,31 +1,64 @@
0
 
0
 <% title 'My HomeMarks Login' %>
0
 
0
-<h1><%= yield(:title) %></h1>
0
+<div id="login_area">
0
+
0
+ <h1><%= yield(:title) %></h1>
0
 
0
-<p class="mb30">
0
- Login into your HomeMarks start page or, signup now and <%= link_to 'create your own', new_user_path %>. If you have any
0
- problems please use our <%= link_to 'online support form', new_support_request_path(:show_form => true) %>.
0
-</p>
0
+ <p class="mb20">
0
+ Login into your HomeMarks start page or, signup now and <%= link_to 'create your own', new_user_path %>. If you have any
0
+ problems please use our <%= link_to 'online support form', new_support_request_path(:show_form => true) %>.
0
+ </p>
0
 
0
-<% form_tag session_path, :id => 'login_form' do %>
0
- <table class="ajaxform">
0
- <tr>
0
- <th><label>Email:</label></th>
0
- <td><%= text_field_tag 'email', params[:email] %></td>
0
- </tr>
0
- <tr>
0
- <th><label>Password:</label></th>
0
- <td><%= password_field_tag 'password', params[:password] %></td>
0
- </tr>
0
- <tr>
0
- <td></td>
0
- <td class="vmiddle_all">
0
- <input class="forgotpw_link" type="button" value="Forgot password" />
0
- <%= submit_tag 'Login' %>
0
- <span id="form_loading"></span>
0
- </td>
0
- </tr>
0
- </table>
0
-<% end %>
0
+ <% form_tag session_path, :id => 'login_form' do %>
0
+ <table class="ajaxform">
0
+ <tr>
0
+ <th><label>Email:</label></th>
0
+ <td><%= text_field_tag 'email', params[:email] %></td>
0
+ </tr>
0
+ <tr>
0
+ <th><label>Password:</label></th>
0
+ <td><%= password_field_tag 'password', params[:password] %></td>
0
+ </tr>
0
+ <tr>
0
+ <td></td>
0
+ <td class="vmiddle_all">
0
+ <input class="forgotpw_link" type="button" value="Forgot password" />
0
+ <%= submit_tag 'Login' %>
0
+ <span id="form_loading"></span>
0
+ </td>
0
+ </tr>
0
+ </table>
0
+ <% end %>
0
+
0
+</div>
0
+
0
+
0
+<div id="forgotpw_area">
0
+
0
+ <h1>Forgot Password</h1>
0
+
0
+ <p class="mb20">
0
+ Enter your email address in the field below and click 'Reset Password' to have instructions on how
0
+ to reset your password emailed to you.
0
+ </p>
0
+
0
+ <% form_tag forgot_password_session_path, :id => 'forgotpw_form' do %>
0
+ <table class="ajaxform">
0
+ <tr>
0
+ <th>Email:</th>
0
+ <td><%= text_field_tag :email, nil, :size => 30, :id => 'forgotpw_email' %></td>
0
+ </tr>
0
+ <tr>
0
+ <td></td>
0
+ <td class="vmiddle_all">
0
+ <input class="forgotpw_cancel" type="button" value="« Cancel" />
0
+ <%= submit_tag 'Reset Password' %>
0
+ <span id="form_loading"></span>
0
+ </td>
0
+ </tr>
0
+ </table>
0
+ <% end %>
0
+
0
+</div>
...
3
4
5
6
7
 
 
8
9
10
...
3
4
5
 
 
6
7
8
9
10
0
@@ -3,8 +3,8 @@
0
   map.root :controller => 'site'
0
   
0
   map.resources :support_requests
0
- map.resource :session, :member => { :jumpin => :get }
0
- map.resources :users
0
+ map.resource :session, :member => { :jumpin => :get, :forgot_password => :post }
0
+ map.resources :users#, :member => { }
0
   
0
   map.myhome 'myhome', :controller => 'user', :action => 'home', :method => :get
0
   map.site ':page', :controller => 'site', :action => 'show'
...
107
108
109
110
 
111
112
113
...
107
108
109
 
110
111
112
113
0
@@ -107,7 +107,7 @@
0
   },
0
   
0
   completeSignupForm: function(request) {
0
- var flashHtml = DIV([H2('Signup Complete:'),P('You can not login unless you verify your email address. We have sent an email with a link to verify and activate your account.')]);
0
+ var flashHtml = DIV([H2('Signup Complete:'),P('We have sent an email with a link to verify and activate your account. You can not login unless you verify your email address.')]);
0
     this.flash('good',flashHtml);
0
   },
0
   
...
19
20
21
 
22
23
24
...
19
20
21
22
23
24
25
0
@@ -19,6 +19,7 @@
0
       assert_equal [@user.email], @email.to
0
       assert_match 'Welcome to HomeMarks', @email.subject
0
       assert_equal [HmConfig.app[:email_from]], @email.from
0
+ assert_match 'homemarks.com/session/jumpin?token=', @email.body
0
     end
0
 
0
   end

Comments

    No one has commented yet.