summaryrefslogtreecommitdiff
path: root/app/controllers/profiles
diff options
context:
space:
mode:
authorSenorsen <sen@senorsen.com>2015-04-14 00:28:49 +0800
committerSenorsen <sen@senorsen.com>2015-04-14 19:42:48 +0800
commit7b28218f96d14c9650484a183ffab3b2132b05db (patch)
treea79cbd394f52a00ba69b1d9b9f192d7ce0b35082 /app/controllers/profiles
parentae6d0aaae0d8f6251b30a8e5243a98f083f0cac9 (diff)
downloadgitlab-ce-7b28218f96d14c9650484a183ffab3b2132b05db.tar.gz
Allow user to choose which email to be public
This commit allows user to show one of their emails in profile page, or don't show email in this page.
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r--app/controllers/profiles/emails_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/profiles/emails_controller.rb b/app/controllers/profiles/emails_controller.rb
index 4a65c978e5c..954c98c0d9f 100644
--- a/app/controllers/profiles/emails_controller.rb
+++ b/app/controllers/profiles/emails_controller.rb
@@ -3,6 +3,7 @@ class Profiles::EmailsController < ApplicationController
def index
@primary = current_user.email
+ @public_email = current_user.public_email
@emails = current_user.emails
end
@@ -19,7 +20,8 @@ class Profiles::EmailsController < ApplicationController
@email.destroy
current_user.set_notification_email
- current_user.save if current_user.notification_email_changed?
+ current_user.set_public_email
+ current_user.save if current_user.notification_email_changed? or current_user.public_email_changed?
respond_to do |format|
format.html { redirect_to profile_emails_url }