BigW Consortium Gitlab

Read-only email field for LDAP user

parent 44c55307
...@@ -13,6 +13,8 @@ class ProfilesController < ApplicationController ...@@ -13,6 +13,8 @@ class ProfilesController < ApplicationController
end end
def update def update
params[:user].delete(:email) if @user.ldap_user?
if @user.update_attributes(params[:user]) if @user.update_attributes(params[:user])
flash[:notice] = "Profile was successfully updated" flash[:notice] = "Profile was successfully updated"
else else
......
...@@ -21,16 +21,22 @@ ...@@ -21,16 +21,22 @@
.controls .controls
= f.text_field :name, class: "input-xlarge", required: true = f.text_field :name, class: "input-xlarge", required: true
%span.help-block Enter your name, so people you know can recognize you. %span.help-block Enter your name, so people you know can recognize you.
.control-group .control-group
= f.label :email, class: "control-label" = f.label :email, class: "control-label"
.controls .controls
= f.text_field :email, class: "input-xlarge", required: true - if @user.ldap_user?
- if @user.unconfirmed_email.present? = f.text_field :email, class: "input-xlarge", required: true, readonly: true
%span.help-block %span.help-block.light
We sent confirmation email to Email is read-only for LDAP user
%strong #{@user.unconfirmed_email}
- else - else
%span.help-block We also use email for avatar detection if no avatar is uploaded. = f.text_field :email, class: "input-xlarge", required: true
- if @user.unconfirmed_email.present?
%span.help-block
We sent confirmation email to
%strong #{@user.unconfirmed_email}
- else
%span.help-block We also use email for avatar detection if no avatar is uploaded.
.control-group .control-group
= f.label :skype, class: "control-label" = f.label :skype, class: "control-label"
.controls= f.text_field :skype, class: "input-xlarge" .controls= f.text_field :skype, class: "input-xlarge"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment