WIP: ownership management. Some empty functions.
This commit is contained in:
parent
a888551bbc
commit
8cafca13be
61
src/requests/ownership.cr
Normal file
61
src/requests/ownership.cr
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
class DNSManager::Request
|
||||||
|
IPC::JSON.message AskShareToken, 20 do
|
||||||
|
property domain : String
|
||||||
|
|
||||||
|
def initialize(@domain)
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
|
||||||
|
user = dnsmanagerd.get_logged_user event
|
||||||
|
return Response::ErrorUserNotLogged.new unless user
|
||||||
|
|
||||||
|
Response::Error.new "Not implemented."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
DNSManager.requests << AskShareToken
|
||||||
|
|
||||||
|
IPC::JSON.message AskTransferToken, 21 do
|
||||||
|
property domain : String
|
||||||
|
|
||||||
|
def initialize(@domain)
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
|
||||||
|
user = dnsmanagerd.get_logged_user event
|
||||||
|
return Response::ErrorUserNotLogged.new unless user
|
||||||
|
|
||||||
|
Response::Error.new "Not implemented."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
DNSManager.requests << AskTransferToken
|
||||||
|
|
||||||
|
IPC::JSON.message AskUnShareDomain, 22 do
|
||||||
|
property domain : String
|
||||||
|
|
||||||
|
def initialize(@domain)
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
|
||||||
|
user = dnsmanagerd.get_logged_user event
|
||||||
|
return Response::ErrorUserNotLogged.new unless user
|
||||||
|
|
||||||
|
Response::Error.new "Not implemented."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
DNSManager.requests << AskUnShareDomain
|
||||||
|
|
||||||
|
IPC::JSON.message GainOwnership, 23 do
|
||||||
|
property uuid : String
|
||||||
|
|
||||||
|
def initialize(@uuid)
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event)
|
||||||
|
user = dnsmanagerd.get_logged_user event
|
||||||
|
return Response::ErrorUserNotLogged.new unless user
|
||||||
|
|
||||||
|
Response::Error.new "Not implemented."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
DNSManager.requests << GainOwnership
|
||||||
|
end
|
@ -14,9 +14,9 @@ class DNSManager::Response
|
|||||||
end
|
end
|
||||||
DNSManager.responses << InvalidZone
|
DNSManager.responses << InvalidZone
|
||||||
|
|
||||||
# Domain of a zone cannot change, for security reasons.
|
|
||||||
IPC::JSON.message DomainChanged, 11 do
|
IPC::JSON.message DomainChanged, 11 do
|
||||||
def initialize
|
property domain : DNSManager::Storage::Domain
|
||||||
|
def initialize(@domain)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
DNSManager.responses << DomainChanged
|
DNSManager.responses << DomainChanged
|
||||||
|
Loading…
Reference in New Issue
Block a user