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.generate_confirmation_token
|
||||
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
|
||||
else
|
||||
response["message"] = "Site already registered."
|
||||
|
|
Loading…
Reference in New Issue