Commit 84fee048d23444771ef349b5d8ab7887582f9aa0

Authored by Antonio Terceiro
1 parent 32baafc9

Check for current user for "unblock" button

app/views/blocks/disabled_enterprise_message.rhtml
1 <div id='enterprise-disabled'> 1 <div id='enterprise-disabled'>
2 <%= message %> 2 <%= message %>
3 - <% if profile.blocked? && user.is_admin?(profile.environment) %> 3 + <% if profile.blocked? && user && user.is_admin?(profile.environment) %>
4 <div class='unlock-button'> 4 <div class='unlock-button'>
5 <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %> 5 <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %>
6 </div> 6 </div>
app/views/shared/_disabled_enterprise.rhtml
1 <% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %> 1 <% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>
2 <div id='profile-disabled'> 2 <div id='profile-disabled'>
3 <%= environment.message_for_disabled_enterprise %> 3 <%= environment.message_for_disabled_enterprise %>
4 - <% if profile.blocked? && user.is_admin?(profile.environment) %> 4 + <% if profile.blocked? && user && user.is_admin?(profile.environment) %>
5 <div class='unlock-button'> 5 <div class='unlock-button'>
6 <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %> 6 <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %>
7 </div> 7 </div>