ACK


----- Original Message -----
From: "Mohammed Morsi" <[email protected]>
To: [email protected]
Sent: Wednesday, May 19, 2010 8:04:05 PM GMT +01:00 Amsterdam / Berlin / Bern / 
Rome / Stockholm / Vienna
Subject: [deltacloud-devel] [PATCH aggregator 1/4] initial dashboard changes

   - require user to be logged in to view dashboard
   - redirect user to dashboard on login instead of accounts page
   - added dashboard helper shell
---
 src/app/controllers/dashboard_controller.rb     |    1 +
 src/app/controllers/user_sessions_controller.rb |    2 +-
 src/app/helpers/dashboard_helper.rb             |   22 ++++++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletions(-)
 create mode 100644 src/app/helpers/dashboard_helper.rb

diff --git a/src/app/controllers/dashboard_controller.rb 
b/src/app/controllers/dashboard_controller.rb
index afb88d1..eca0013 100644
--- a/src/app/controllers/dashboard_controller.rb
+++ b/src/app/controllers/dashboard_controller.rb
@@ -21,6 +21,7 @@
 
 class DashboardController < ApplicationController
   layout "dashboard"
+  before_filter :require_user
 
   def index
     render :action => :summary
diff --git a/src/app/controllers/user_sessions_controller.rb 
b/src/app/controllers/user_sessions_controller.rb
index d5dcfd2..e67cc1d 100644
--- a/src/app/controllers/user_sessions_controller.rb
+++ b/src/app/controllers/user_sessions_controller.rb
@@ -31,7 +31,7 @@ class UserSessionsController < ApplicationController
     @user_session = UserSession.new(params[:user_session])
     if @user_session.save
       flash[:notice] = "Login successful!"
-      redirect_back_or_default account_url
+      redirect_back_or_default :controller => 'dashboard'
     else
       render :action => :new
     end
diff --git a/src/app/helpers/dashboard_helper.rb 
b/src/app/helpers/dashboard_helper.rb
new file mode 100644
index 0000000..a56bad4
--- /dev/null
+++ b/src/app/helpers/dashboard_helper.rb
@@ -0,0 +1,22 @@
+# Copyright (C) 2010 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.  A copy of the GNU General Public License is
+# also available at http://www.gnu.org/copyleft/gpl.html.
+
+# Filters added to this controller apply to all controllers in the application.
+# Likewise, all the methods added will be available for all controllers.
+
+module DashboardHelper
+end
-- 
1.6.2.5

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to