diff --git a/app/views/shared/user_menu.rhtml b/app/views/shared/user_menu.rhtml
index 65f861d..c912ffe 100644
--- a/app/views/shared/user_menu.rhtml
+++ b/app/views/shared/user_menu.rhtml
@@ -21,6 +21,12 @@
+ <% if MailConf.enabled? && current_user.enable_email %>
+
+ <%= link_to '' + _('Webmail'), MailConf.webmail_url %>
+
+ <% end %>
+
<%= link_to_myprofile( ''+ _('Control panel'),
{}, nil, :id => 'link_edit_profile',
:help => _('Control panel: change your picture, edit your personal information, create content or change the way your home page looks.')
diff --git a/public/designs/icons/default/mail-HC.gif b/public/designs/icons/default/mail-HC.gif
new file mode 100644
index 0000000..df6f9a1
Binary files /dev/null and b/public/designs/icons/default/mail-HC.gif differ
diff --git a/public/designs/icons/default/style.css b/public/designs/icons/default/style.css
index 248ae49..1bc5bba 100644
--- a/public/designs/icons/default/style.css
+++ b/public/designs/icons/default/style.css
@@ -42,3 +42,4 @@
.icon-menu-articles { background-image: url(edit-HC.gif) }
.icon-menu-comments { background-image: url(blog-HC.gif) }
.icon-menu-people { background-image: url(album-HC.gif) }
+.icon-menu-mail { background-image: url(mail-HC.gif) }
diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb
index eac848d..1d14ffb 100644
--- a/test/functional/application_controller_test.rb
+++ b/test/functional/application_controller_test.rb
@@ -160,4 +160,31 @@ class ApplicationControllerTest < Test::Unit::TestCase
assert_tag :tag => 'a', :attributes => { :href => /\?lang=it/ }, :content => 'Italiano'
end
+ should 'display link to webmail if enabled for system and for user' do
+ login_as('ze')
+ MailConf.expects(:enabled?).returns(true)
+ MailConf.expects(:webmail_url).returns('http://web.mail/')
+ User.any_instance.expects(:enable_email).returns(true)
+
+ get :index
+ assert_tag :tag => 'div', :attributes => { :id => 'user_box' }, :descendant => { :tag => 'a', :attributes => { :href => 'http://web.mail/' } }
+ end
+
+ should 'not display link to webmail if not enabled for system' do
+ login_as('ze')
+ MailConf.expects(:enabled?).returns(false)
+
+ get :index
+ assert_no_tag :tag => 'div', :attributes => { :id => 'user_box' }, :descendant => { :tag => 'a', :attributes => { :href => 'http://web.mail/' } }
+ end
+
+ should 'not display link in menu to webmail if not enabled for user' do
+ login_as('ze')
+ MailConf.expects(:enabled?).returns(true)
+ User.any_instance.expects(:enable_email).returns(false)
+
+ get :index
+ assert_no_tag :tag => 'div', :attributes => { :id => 'user_box' }, :descendant => { :tag => 'a', :attributes => { :href => 'http://web.mail/' } }
+ end
+
end
--
libgit2 0.21.2