some mod for user registeration
This commit is contained in:
parent
ce3230f21a
commit
4fa49d0b1b
|
@ -15,6 +15,14 @@ class Admin::RegisterApiController < ApplicationController
|
||||||
site.title_translations = title
|
site.title_translations = title
|
||||||
site.generate_confirmation_token
|
site.generate_confirmation_token
|
||||||
site.save
|
site.save
|
||||||
|
cp = CPanelUser.where(:email => email).first rescue nil
|
||||||
|
if cp.nil?
|
||||||
|
cp = CPanelUser.new(:email => email, :password => SecureRandom.hex(5))
|
||||||
|
end
|
||||||
|
if !cp.first_time_run
|
||||||
|
cp.registered_site_ids << site.id.to_s
|
||||||
|
end
|
||||||
|
cp.save
|
||||||
response["success"] = true
|
response["success"] = true
|
||||||
else
|
else
|
||||||
response["message"] = "Site already registered."
|
response["message"] = "Site already registered."
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td><%= site.admin_email %></td>
|
<td><%= site.admin_email %></td>
|
||||||
<td>
|
<td>
|
||||||
<% if !site.site_confirmed %>
|
<% if !site.site_confirmed %>
|
||||||
<span class="badge badge-important"><%= t("registered_sites.site_inactive") %></span><br />
|
<span class="badge badge-important"><%= t("registered_sites.site_inactive") %></span><br />
|
||||||
<%= t("registered_sites.email_not_confirmed") %>
|
<%= t("registered_sites.email_not_confirmed") %>
|
||||||
<% elsif !site.access_granted %>
|
<% elsif !site.access_granted %>
|
||||||
|
|
Loading…
Reference in New Issue