Description:
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@244 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r118:fc6cd4c8e4bf - - 3 files changed: 5 inserted, 3 deleted

@@ -1,27 +1,29
1 class UsersController < ApplicationController
1 class UsersController < ApplicationController
2
2
3 before_filter :authenticate
3 before_filter :authenticate
4
4
5 verify :method => :post, :only => [:chg_passwd],
5 verify :method => :post, :only => [:chg_passwd],
6 :redirect_to => { :action => :index }
6 :redirect_to => { :action => :index }
7
7
8 in_place_edit_for :user, :alias_for_editing
8 in_place_edit_for :user, :alias_for_editing
9 in_place_edit_for :user, :email_for_editing
9 in_place_edit_for :user, :email_for_editing
10
10
11 def index
11 def index
12 - @user = User.find(session[:user_id])
12 + # ... disable in this contest ...
13 + # @user = User.find(session[:user_id])
14 + redirect_to :controller => 'main', :action => 'list'
13 end
15 end
14
16
15 def chg_passwd
17 def chg_passwd
16 user = User.find(session[:user_id])
18 user = User.find(session[:user_id])
17 user.password = params[:passwd]
19 user.password = params[:passwd]
18 user.password_confirmation = params[:passwd_verify]
20 user.password_confirmation = params[:passwd_verify]
19 if user.save
21 if user.save
20 flash[:notice] = 'password changed'
22 flash[:notice] = 'password changed'
21 else
23 else
22 flash[:notice] = 'Error: password changing failed'
24 flash[:notice] = 'Error: password changing failed'
23 end
25 end
24 redirect_to :action => 'index'
26 redirect_to :action => 'index'
25 end
27 end
26
28
27 end
29 end
@@ -1,22 +1,22
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
3
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
5 <head>
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7 - <title>Grader!</title>
7 + <title>APIO'08</title>
8 <%= stylesheet_link_tag 'application' %>
8 <%= stylesheet_link_tag 'application' %>
9 <%= yield :head %>
9 <%= yield :head %>
10 </head>
10 </head>
11 <body>
11 <body>
12
12
13 <div class="userbar">
13 <div class="userbar">
14 <%= user_header %>
14 <%= user_header %>
15 </div>
15 </div>
16
16
17 <%= content_tag(:p,flash[:notice],:style => "color:green") if flash[:notice]!=nil %>
17 <%= content_tag(:p,flash[:notice],:style => "color:green") if flash[:notice]!=nil %>
18
18
19 <%= yield %>
19 <%= yield %>
20
20
21 </body>
21 </body>
22 </html>
22 </html>
@@ -1,15 +1,15
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
3
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
5 <head>
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
6 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7 - <title>Grader!</title>
7 + <title>APIO'08</title>
8 <%= stylesheet_link_tag 'application' %>
8 <%= stylesheet_link_tag 'application' %>
9 </head>
9 </head>
10 <body>
10 <body>
11
11
12 <%= yield %>
12 <%= yield %>
13
13
14 </body>
14 </body>
15 </html>
15 </html>
You need to be logged in to leave comments. Login now