Commit b2e4664cc78d61ec058e81f37cdff11636b02967
1 parent
44c55307
Exists in
master
and in
4 other branches
Read-only email field for LDAP user
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
14 additions
and
6 deletions
Show diff stats
app/controllers/profiles_controller.rb
app/views/profiles/show.html.haml
... | ... | @@ -21,16 +21,22 @@ |
21 | 21 | .controls |
22 | 22 | = f.text_field :name, class: "input-xlarge", required: true |
23 | 23 | %span.help-block Enter your name, so people you know can recognize you. |
24 | + | |
24 | 25 | .control-group |
25 | 26 | = f.label :email, class: "control-label" |
26 | 27 | .controls |
27 | - = f.text_field :email, class: "input-xlarge", required: true | |
28 | - - if @user.unconfirmed_email.present? | |
29 | - %span.help-block | |
30 | - We sent confirmation email to | |
31 | - %strong #{@user.unconfirmed_email} | |
28 | + - if @user.ldap_user? | |
29 | + = f.text_field :email, class: "input-xlarge", required: true, readonly: true | |
30 | + %span.help-block.light | |
31 | + Email is read-only for LDAP user | |
32 | 32 | - else |
33 | - %span.help-block We also use email for avatar detection if no avatar is uploaded. | |
33 | + = f.text_field :email, class: "input-xlarge", required: true | |
34 | + - if @user.unconfirmed_email.present? | |
35 | + %span.help-block | |
36 | + We sent confirmation email to | |
37 | + %strong #{@user.unconfirmed_email} | |
38 | + - else | |
39 | + %span.help-block We also use email for avatar detection if no avatar is uploaded. | |
34 | 40 | .control-group |
35 | 41 | = f.label :skype, class: "control-label" |
36 | 42 | .controls= f.text_field :skype, class: "input-xlarge" | ... | ... |