updated mailer urls
This commit is contained in:
@@ -4,6 +4,10 @@ class UserPasswordResetNonce < ActiveRecord::Base
|
||||
before_validation :initialize_key, :on => :create
|
||||
after_create :deliver_notice
|
||||
|
||||
def self.prune!
|
||||
destroy_all(["created_at < ?"], 1.week.ago)
|
||||
end
|
||||
|
||||
def deliver_notice
|
||||
Maintenance::User::PasswordResetMailer.reset_request(user, self).deliver
|
||||
end
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
<p>The password for the user "<%= @user.name %>" for the website <%= Danbooru.config.app_name %> has been reset. It is now <code><%= @new_password %></code>.</p>
|
||||
|
||||
<p>Please log in to the website and <%= link_to "change your password", edit_user_path(@user, :host => Danbooru.config.hostname) %> as soon as possible.</p>
|
||||
<p>Please log in to the website and <%= link_to "change your password", edit_user_path(@user) %> as soon as possible.</p>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h1>Password Reset Request</h1>
|
||||
|
||||
<p>Someone has requested that the password for "<%= @user.name %>" for the website <%= Danbooru.config.app_name %> be reset. If you did not request this, then you can ignore this email.</p>
|
||||
<p>To reset your password, please visit <%= link_to "this link", edit_maintenance_user_password_reset_path(:host => Danbooru.config.hostname, :key => @nonce.key, :email => @nonce.email) %>.</p>
|
||||
<p>To reset your password, please visit <%= link_to "this link", edit_maintenance_user_password_reset_path(:key => @nonce.key, :email => @nonce.email) %>.</p>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<tbody>
|
||||
<% User.find(:all, :conditions => ["level >= ?", CONFIG["user_levels"]["Test Janitor"]], :order => "level, name").each do |user| %>
|
||||
<tr>
|
||||
<td><%= link_to user.name, user_path(user, :host => Danbooru.config.hostname) %></td>
|
||||
<td><%= link_to user.name, user_path(user) %></td>
|
||||
<td><%= user.pretty_level %></td>
|
||||
<td style="text-align: right;"><%= Post.count(:conditions => ["created_at >= ? AND approver_id = ?", 1.days.ago, user.id]) %>/<%= Post.count(:conditions => ["created_at >= ? AND (approver_id IS NOT NULL OR status = 'pending')", 1.days.ago]) %></td>
|
||||
<td style="text-align: right;"><%= Post.count(:conditions => ["created_at >= ? AND approver_id = ?", 7.days.ago, user.id]) %>/<%= Post.count(:conditions => ["created_at >= ? AND (approver_id IS NOT NULL OR status = 'pending')", 7.days.ago]) %></td>
|
||||
|
||||
@@ -19,5 +19,6 @@ module Danbooru
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.smtp_settings = {:enable_starttls_auto => false}
|
||||
config.action_mailer.perform_deliveries = true
|
||||
config.action_mailer.default_url_options = {:host => Danbooru.config.hostname, :only_path => false}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,4 +8,8 @@ if environment == "production"
|
||||
every 1.hour do
|
||||
runner "AmazonBackup.execute"
|
||||
end
|
||||
|
||||
every 1.week do
|
||||
runner "UserPasswordResetNonce.prune!"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user