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."
|
||||||
|
|
Loading…
Reference in New Issue