[add] added maximum client and demo client protection
- default demo clients can no longer be modified/deleted when in demo mode - increased default demo reset to 60 minutes
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
class Client < ApplicationRecord
|
||||
|
||||
def self.new_client(params)
|
||||
return nil if count >= RynDNS::Application::MAX_CLIENTS
|
||||
|
||||
perm_string = params[:permission] || 'w' # create write client by default
|
||||
perm_rwx = Client.parse_perm_string(perm_string)
|
||||
|
||||
@@ -28,7 +30,7 @@ class Client < ApplicationRecord
|
||||
def gen_api_key
|
||||
api_key = SecureRandom.hex(32)
|
||||
self.api_key = api_key
|
||||
"#{RynDNS::Application::API_KEY_PREFIX}.#{self.name_id}.#{api_key}"
|
||||
"#{RynDNS::Application::API_KEY_PREFIX}.#{name_id}.#{api_key}"
|
||||
end
|
||||
|
||||
def api_key
|
||||
|
||||
Reference in New Issue
Block a user