Added ability to add public key to account.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
5
db/migrate/20171013001146_add_public_key_to_users.rb
Normal file
5
db/migrate/20171013001146_add_public_key_to_users.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddPublicKeyToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :public_key, :text
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user