diff options
author | spag <spag@golwen.net> | 2013-01-16 09:28:55 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-01-16 09:28:55 +0100 |
commit | 3880e410353f1e80a938e110c04c2b3629ab5eb6 (patch) | |
tree | 793d44cfafcc3925684309c1650b922842828a01 /app/controllers | |
parent | 1debae060b1c4a816f4565ad55490fee61c6472b (diff) | |
parent | 6635621faeebbc8dd744e0ad71741f9e82aed1f8 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/gemeinschaft_setups_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/gs_parameters_controller.rb | 13 | ||||
-rw-r--r-- | app/controllers/gui_functions_controller.rb | 12 | ||||
-rw-r--r-- | app/controllers/page_controller.rb | 7 |
4 files changed, 27 insertions, 11 deletions
diff --git a/app/controllers/gemeinschaft_setups_controller.rb b/app/controllers/gemeinschaft_setups_controller.rb index 7205a86..dbe8ff5 100644 --- a/app/controllers/gemeinschaft_setups_controller.rb +++ b/app/controllers/gemeinschaft_setups_controller.rb @@ -47,8 +47,10 @@ class GemeinschaftSetupsController < ApplicationController GsParameter.where(:name => 'user_image_url').first.update_attributes(:value => "http://#{@gemeinschaft_setup.sip_domain.host}/uploads/user/image") # Restart FreeSWITCH - require 'freeswitch_event' - FreeswitchAPI.execute('fsctl', 'shutdown restart') + if Rails.env.production? + require 'freeswitch_event' + FreeswitchAPI.execute('fsctl', 'shutdown restart') + end # Auto-Login: session[:user_id] = user.id diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb index a7813dc..7ca4e8e 100644 --- a/app/controllers/gs_parameters_controller.rb +++ b/app/controllers/gs_parameters_controller.rb @@ -1,6 +1,10 @@ class GsParametersController < ApplicationController + load_resource :gs_parameter + + before_filter :spread_breadcrumbs + def index - @ps_parameters_unordered = GsParameter.scoped + @gs_parameters_unordered = GsParameter.scoped @gs_parameters = GsParameter.order([:section, :name]) @sections = @gs_parameters.pluck(:section).uniq.sort end @@ -30,4 +34,11 @@ class GsParametersController < ApplicationController def gs_parameter_params params.require(:gs_parameter).permit(:value, :class_type, :description) end + + def spread_breadcrumbs + add_breadcrumb t("gs_parameters.index.page_title"), gs_parameters_path + if @gs_parameter && !@gs_parameter.new_record? + add_breadcrumb @gs_parameter, gs_parameter_path(@gs_parameter) + end + end end diff --git a/app/controllers/gui_functions_controller.rb b/app/controllers/gui_functions_controller.rb index 2ab2c5e..0cb7898 100644 --- a/app/controllers/gui_functions_controller.rb +++ b/app/controllers/gui_functions_controller.rb @@ -1,4 +1,6 @@ class GuiFunctionsController < ApplicationController + load_resource :gui_function + before_filter :load_user_groups before_filter :spread_breadcrumbs @@ -60,14 +62,10 @@ class GuiFunctionsController < ApplicationController end def spread_breadcrumbs - if @tenant - add_breadcrumb t("user_groups.index.page_title"), tenant_user_groups_path(@tenant) - if @user_group && !@user_group.new_record? - add_breadcrumb @user_group, tenant_user_group_path(@tenant, @user_group) - end - end - add_breadcrumb t("gui_functions.index.page_title"), gui_functions_path + if @gui_function && !@gui_function.new_record? + add_breadcrumb @gui_function, gui_function_path(@gui_function) + end end end diff --git a/app/controllers/page_controller.rb b/app/controllers/page_controller.rb index 4ea4d25..dc5f57b 100644 --- a/app/controllers/page_controller.rb +++ b/app/controllers/page_controller.rb @@ -5,7 +5,12 @@ class PageController < ApplicationController before_filter :if_fresh_system_then_go_to_wizard skip_before_filter :home_breadcrumb, :only => [:index] - def index;end + def index + if current_user + redirect_to [current_user.current_tenant, current_user] + end + end + def conference;end def beginners_intro;end |