ref: refs/heads/use-activeresource commit 31649daa7195f514a8474e81bb983ed8500173e7 Author: Josef Reidinger <jreidinger@suse.cz> Date: Mon Aug 17 11:35:26 2009 +0200 add redirect to control panel to controller specified by base system settings --- .../app/controllers/controlpanel_controller.rb | 25 +++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/webclient/app/controllers/controlpanel_controller.rb b/webclient/app/controllers/controlpanel_controller.rb index f7d67df..d6676ed 100644 --- a/webclient/app/controllers/controlpanel_controller.rb +++ b/webclient/app/controllers/controlpanel_controller.rb @@ -7,10 +7,12 @@ require 'yaml' class ControlpanelController < ApplicationController - + include ProxyLoader before_filter :ensure_login def index + return false if need_redirect + session[:wizard_mode] = nil #clean wizard mode request from session @shortcuts = shortcuts_data end @@ -72,4 +74,25 @@ class ControlpanelController < ApplicationController end s end + + # Constant that signalize, that all steps from base system settings is done + # +warn+: must be synchronized with same constant in base system module + FINAL_STEP = "FINISH" + # Checks if basic system modul need show another module instead control panel + def need_redirect + basesystem = load_proxy 'org.opensuse.yast.modules.basesystem' + unless basesystem + erase_redirect_results #reset all error redirects + erase_render_results #erase all error render + flash.clear #no error flash from load_proxy + logger.warn "Error occure during loading basesystem information" + return false + end + + return false if basesystem.current == FINAL_STEP + + session[:wizard_mode] = "true" + redirect_to :controller => basesystem.current + return true + end end -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org