Commit b2e4664c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Read-only email field for LDAP user

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
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,9 +21,15 @@ ...@@ -21,9 +21,15 @@
.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
- if @user.ldap_user?
= f.text_field :email, class: "input-xlarge", required: true, readonly: true
%span.help-block.light
Email is read-only for LDAP user
- else
= f.text_field :email, class: "input-xlarge", required: true = f.text_field :email, class: "input-xlarge", required: true
- if @user.unconfirmed_email.present? - if @user.unconfirmed_email.present?
%span.help-block %span.help-block
......
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