Replace hardcoded domains with primary domain setting
This commit is contained in:
parent
34e4cec503
commit
589e46bc63
@ -4,7 +4,7 @@ class Admin::UsersController < Admin::BaseController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
ldap = LdapService.new
|
ldap = LdapService.new
|
||||||
@ou = params[:ou] || "kosmos.org"
|
@ou = params[:ou] || Setting.primary_domain
|
||||||
@orgs = ldap.fetch_organizations
|
@orgs = ldap.fetch_organizations
|
||||||
@pagy, @users = pagy(User.where(ou: @ou).order(cn: :asc))
|
@pagy, @users = pagy(User.where(ou: @ou).order(cn: :asc))
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class SignupController < ApplicationController
|
|||||||
if session[:new_user].present?
|
if session[:new_user].present?
|
||||||
@user = User.new(session[:new_user])
|
@user = User.new(session[:new_user])
|
||||||
else
|
else
|
||||||
@user = User.new(ou: "kosmos.org")
|
@user = User.new(ou: Setting.primary_domain)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ class SignupController < ApplicationController
|
|||||||
|
|
||||||
CreateAccount.call(
|
CreateAccount.call(
|
||||||
username: @user.cn,
|
username: @user.cn,
|
||||||
domain: "kosmos.org",
|
domain: Setting.primary_domain,
|
||||||
email: @user.email,
|
email: @user.email,
|
||||||
password: @user.password,
|
password: @user.password,
|
||||||
invitation: @invitation
|
invitation: @invitation
|
||||||
|
@ -30,7 +30,7 @@ class WebhooksController < ApplicationController
|
|||||||
def notify_xmpp(address, amt_sats, memo)
|
def notify_xmpp(address, amt_sats, memo)
|
||||||
payload = {
|
payload = {
|
||||||
type: "normal",
|
type: "normal",
|
||||||
from: "kosmos.org", # TODO domain config
|
from: Setting.primary_domain,
|
||||||
to: address,
|
to: address,
|
||||||
subject: "Sats received!",
|
subject: "Sats received!",
|
||||||
body: "#{helpers.number_with_delimiter amt_sats} sats received in your Lightning wallet:\n> #{memo}"
|
body: "#{helpers.number_with_delimiter amt_sats} sats received in your Lightning wallet:\n> #{memo}"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
class CreateAccount < ApplicationService
|
class CreateAccount < ApplicationService
|
||||||
def initialize(args)
|
def initialize(args)
|
||||||
@username = args[:username]
|
@username = args[:username]
|
||||||
@domain = args[:ou] || "kosmos.org"
|
@domain = args[:ou] || Setting.primary_domain
|
||||||
@email = args[:email]
|
@email = args[:email]
|
||||||
@password = args[:password]
|
@password = args[:password]
|
||||||
@invitation = args[:invitation]
|
@invitation = args[:invitation]
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<section class="sm:w-1/2 grid grid-cols-2 items-center gap-y-2">
|
<section class="sm:w-1/2 grid grid-cols-2 items-center gap-y-2">
|
||||||
<%= form.label :user_id %>
|
<%= form.label :user_id %>
|
||||||
<%= form.collection_select :user_id, User.where(ou: "kosmos.org").order(:cn), :id, :cn, {} %>
|
<%= form.collection_select :user_id, User.where(ou: Setting.primary_domain).order(:cn), :id, :cn, {} %>
|
||||||
|
|
||||||
<%= form.label :amount_sats, "Amount BTC (sats)" %>
|
<%= form.label :amount_sats, "Amount BTC (sats)" %>
|
||||||
<%= form.number_field :amount_sats %>
|
<%= form.number_field :amount_sats %>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<p class="flex gap-2 items-center">
|
<p class="flex gap-2 items-center">
|
||||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
||||||
required: true, class: "relative grow"%>
|
required: true, class: "relative grow"%>
|
||||||
<span class="relative shrink-0 text-gray-500">@ kosmos.org</span>
|
<span class="relative shrink-0 text-gray-500">@ <%= Setting.primary_domain %></span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<p class="flex gap-2 items-center">
|
<p class="flex gap-2 items-center">
|
||||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
||||||
required: true, class: "relative grow", tabindex: "1" %>
|
required: true, class: "relative grow", tabindex: "1" %>
|
||||||
<span class="relative shrink-0 text-gray-500">@ kosmos.org</span>
|
<span class="relative shrink-0 text-gray-500">@ <%= Setting.primary_domain %></span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="mb-8">
|
<p class="mb-8">
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
<%= f.text_field :cn, autofocus: true, autocomplete: "username",
|
||||||
required: true, class: "relative grow text-xl"%>
|
required: true, class: "relative grow text-xl"%>
|
||||||
<span class="relative shrink-0 text-gray-500 md:text-xl">
|
<span class="relative shrink-0 text-gray-500 md:text-xl">
|
||||||
@ kosmos.org
|
@ <%= Setting.primary_domain %>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user