Commit da6fec43ce1666f60ebf64e8c5c48da495931b63
Exists in
master
Fixed permissions
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
controllers/email_article_plugin_myprofile_controller.rb
1 | 1 | class EmailArticlePluginMyprofileController < MyProfileController |
2 | 2 | |
3 | 3 | needs_profile |
4 | - | |
5 | 4 | # before_filter :check_access_to_profile, :except => [:join, :join_not_logged, :index, :add] |
6 | 5 | # before_filter :store_location, :only => [:join, :join_not_logged, :report_abuse, :send_mail] |
7 | 6 | # before_filter :login_required, :only => [:add, :join, :join_not_logged, :leave, :unblock, :leave_scrap, :remove_scrap, :remove_activity, :view_more_activities, :view_more_network_activities, :report_abuse, :register_report, :leave_comment_on_activity, :send_mail] | ... | ... |
lib/email_article_plugin.rb
... | ... | @@ -12,8 +12,9 @@ class EmailArticlePlugin < Noosfero::Plugin |
12 | 12 | label = _("Send article to members") |
13 | 13 | htmlclass = _("button with-text icon-menu-mail") |
14 | 14 | title = _("Email article to all community members") |
15 | + | |
15 | 16 | lambda { |
16 | - if user.is_admin?(profile) and @page.kind_of?(TextArticle) | |
17 | + if !profile.blank? and !user.blank? and user.is_admin?(profile) and @page.kind_of?(TextArticle) | |
17 | 18 | link_to_remote( |
18 | 19 | label, |
19 | 20 | { |
... | ... | @@ -26,7 +27,7 @@ class EmailArticlePlugin < Noosfero::Plugin |
26 | 27 | :class => htmlclass, |
27 | 28 | :title => title |
28 | 29 | ) |
29 | - end | |
30 | + end | |
30 | 31 | } |
31 | 32 | end |
32 | 33 | end | ... | ... |