[PATCH 3/4] redmine #3452: verify value of template to render in realms and provider_realms controller

Mo Morsi mmorsi at redhat.com
Wed Aug 8 15:51:26 UTC 2012


On 08/07/2012 01:55 PM, Jozef Zigmund wrote:
> On Tue, 2012-07-31 at 16:03 -0400, Mo Morsi wrote:
>> ---
>>  src/app/controllers/provider_realms_controller.rb |    1 +
>>  src/app/controllers/realms_controller.rb          |    1 +
>>  2 files changed, 2 insertions(+)
>>
>> diff --git a/src/app/controllers/provider_realms_controller.rb b/src/app/controllers/provider_realms_controller.rb
>> index f4ad966..9c9d48c 100644
>> --- a/src/app/controllers/provider_realms_controller.rb
>> +++ b/src/app/controllers/provider_realms_controller.rb
>> @@ -34,6 +34,7 @@ class ProviderRealmsController < ApplicationController
>>  
>>      @tab_captions = [t('realms.tab_captions.properties'), t('realms.tab_captions.mapping')]
>>      @details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
>> +    @details_tab = 'properties' unless ['properties', 'mapping'].include?(@details_tab)
>>  
>>      @frontend_realms_for_provider = @realm.provider.frontend_realms
>>      @frontend_realms = @realm.frontend_realms
>> diff --git a/src/app/controllers/realms_controller.rb b/src/app/controllers/realms_controller.rb
>> index 695f1e2..f908e43 100644
>> --- a/src/app/controllers/realms_controller.rb
>> +++ b/src/app/controllers/realms_controller.rb
>> @@ -113,6 +113,7 @@ class RealmsController < ApplicationController
>>      @title = @realm.name
>>      @tab_captions = [t('realms.tab_captions.properties'), t('realms.tab_captions.mapping')]
>>      @details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
>> +    @details_tab = 'properties' unless ['properties', 'mapping'].include?(@details_tab)
>>  
>>      @backend_realm_targets = @realm.realm_backend_targets.select { |x| x.realm_or_provider_type == 'Realm' }
>>      @backend_provider_targets = @realm.realm_backend_targets.select { |x| x.realm_or_provider_type == 'Provider' }
> In both show actions aren't tabs .. so you could remove that lines.. pls
> verify it before pushing.
>

The details_tab parameter isn't used for the main html interface but if
the user specifies 'details_tab' when requesting the json format /
response type, they may view a realm's properties or it's mappings. We
still need to verify the details_tab parameter is one of those two
values (and any more we decide to add in the future).

So unless there are any further objections, will leave this in and push
the patchset as is.

  -Mo



More information about the aeolus-devel mailing list