Read-only email field for LDAP user
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
44c55307a0
commit
b2e4664cc7
2 changed files with 14 additions and 6 deletions
|
@ -13,6 +13,8 @@ class ProfilesController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
params[:user].delete(:email) if @user.ldap_user?
|
||||
|
||||
if @user.update_attributes(params[:user])
|
||||
flash[:notice] = "Profile was successfully updated"
|
||||
else
|
||||
|
|
|
@ -21,9 +21,15 @@
|
|||
.controls
|
||||
= f.text_field :name, class: "input-xlarge", required: true
|
||||
%span.help-block Enter your name, so people you know can recognize you.
|
||||
|
||||
.control-group
|
||||
= f.label :email, class: "control-label"
|
||||
.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
|
||||
- if @user.unconfirmed_email.present?
|
||||
%span.help-block
|
||||
|
|
Loading…
Reference in a new issue