مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-17 13:39:46 +00:00
UI for admins to assign ip pools to servers
هذا الالتزام موجود في:
@@ -1,9 +1,16 @@
|
||||
class OrganizationIPPoolsController < ApplicationController
|
||||
|
||||
include WithinOrganization
|
||||
before_action :admin_required, :only => [:assignments]
|
||||
|
||||
def index
|
||||
@ip_pools = organization.ip_pools.dedicated.order(:name)
|
||||
end
|
||||
|
||||
def assignments
|
||||
organization.ip_pool_ids = params[:ip_pools]
|
||||
organization.save!
|
||||
redirect_to [organization, :ip_pools], :notice => "Organization IP pools have been updated successfully"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -42,7 +42,7 @@ class ServersController < ApplicationController
|
||||
|
||||
def update
|
||||
extra_params = [:spam_threshold, :spam_failure_threshold, :postmaster_address]
|
||||
extra_params += [:send_limit, :allow_sender, :log_smtp_data, :outbound_spam_threshold, :message_retention_days, :raw_message_retention_days, :raw_message_retention_size, :ip_pool_id] if current_user.admin?
|
||||
extra_params += [:send_limit, :allow_sender, :log_smtp_data, :outbound_spam_threshold, :message_retention_days, :raw_message_retention_days, :raw_message_retention_size] if current_user.admin?
|
||||
if @server.update(safe_params(*extra_params))
|
||||
redirect_to_with_json organization_server_path(organization, @server), :notice => "Server settings have been updated"
|
||||
else
|
||||
@@ -84,7 +84,7 @@ class ServersController < ApplicationController
|
||||
private
|
||||
|
||||
def safe_params(*extras)
|
||||
params.require(:server).permit(:name, :mode, :ip_pool_id, *extras)
|
||||
params.require(:server).permit(:name, :mode, *extras)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم