Added ability to add public key to account.

This commit is contained in:
Logan Fick
2017-10-12 20:46:23 -04:00
parent 611c52223a
commit 3e7a0e550f
3 changed files with 10 additions and 2 deletions

View File

@@ -352,7 +352,7 @@ class UsersController < ApplicationController
end
def user_params(add = [])
a = [:ign, :email, :password, :password_confirmation, :mail_own_thread_reply, :mail_other_thread_reply, :mail_own_blogpost_comment, :mail_other_blogpost_comment, :mail_mention] + add
a = [:ign, :email, :password, :password_confirmation, :mail_own_thread_reply, :mail_other_thread_reply, :mail_own_blogpost_comment, :mail_other_blogpost_comment, :mail_mention, :public_key] + add
params.require(:user).permit(a)
end
end

View File

@@ -45,6 +45,9 @@
</tr>
</tbody>
</table>
<h3>Public Key</h1>
<p>All notification emails, including password resets, will be encrypted with this key if you supply it. <b>Do not lose your private key, otherwise you won't be able to easily recover your account.</b></p>
<%= f.text_area :public_key, placeholder: "-----BEGIN PGP PUBLIC KEY BLOCK-----" %>
<p><%= f.submit "Save changes", class: "btn blue left" %></p>
<div class="clear"></div>
<% end %>
<% end %>

View File

@@ -0,0 +1,5 @@
class AddPublicKeyToUsers < ActiveRecord::Migration
def change
add_column :users, :public_key, :text
end
end