Merge branch 'v2.3.5-dev' into v2.3.5-dev

This commit is contained in:
Master3395
2023-11-11 01:15:13 +01:00
committed by GitHub
5 changed files with 26 additions and 14 deletions

View File

@@ -19,7 +19,7 @@ from plogical.httpProc import httpProc
# Create your views here.
VERSION = '2.3'
BUILD = 4
BUILD = 3
@ensure_csrf_cookie

View File

@@ -58,7 +58,7 @@ class cliParser:
### Additional Arguments for user manager
parser.add_argument('--firstName', help='First name while creating user.')
parser.add_argument('--lastName', help='First name while creating user.')
parser.add_argument('--lastName', help='Last name while creating user.')
parser.add_argument('--websitesLimit', help='Website limit while creating user.')
parser.add_argument('--selectedACL', help='Select ACL while creating user.')
parser.add_argument('--securityLevel', help='Set security level while creating user.')

View File

@@ -257,6 +257,10 @@ class DNSManager:
recordType = data['recordType']
recordName = data['recordName']
ttl = int(data['ttl'])
if ttl < 0:
raise ValueError("TTL: The item must be greater than 0")
elif ttl > 86400:
raise ValueError("TTL: The item must be lesser than 86401")
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnershipZone(zoneDomain, admin, currentACL) == 1:
@@ -444,6 +448,10 @@ class DNSManager:
if data['ttlNow'] != None:
record.ttl = int(data['ttlNow'])
if record.ttl < 0:
raise ValueError("TTL: The item must be greater than 0")
elif record.ttl > 86400:
raise ValueError("TTL: The item must be lesser than 86401")
if data['priorityNow'] != None:
record.prio = int(data['priorityNow'])
@@ -826,6 +834,10 @@ class DNSManager:
recordType = data['recordType']
recordName = data['recordName']
ttl = int(data['ttl'])
if ttl < 0:
raise ValueError("TTL: The item must be greater than 0")
elif ttl > 86400:
raise ValueError("TTL: The item must be lesser than 86401")
admin = Administrator.objects.get(pk=userID)
self.admin = admin

View File

@@ -88,7 +88,7 @@
</div>
<div class="col-sm-3 aRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -114,7 +114,7 @@
</div>
<div class="col-sm-3 aaaaRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -141,7 +141,7 @@
</div>
<div class="col-sm-3 cNameRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -167,7 +167,7 @@
</div>
<div class="col-sm-2 mxRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -199,7 +199,7 @@
</div>
<div class="col-sm-3 spfRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -226,7 +226,7 @@
</div>
<div class="col-sm-3 txtRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -253,7 +253,7 @@
</div>
<div class="col-sm-3 soaRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -280,7 +280,7 @@
</div>
<div class="col-sm-3 nsRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -307,7 +307,7 @@
</div>
<div class="col-sm-2 srvRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
@@ -337,7 +337,7 @@
ng-model="recordName">
</div>
<div class="col-sm-3 caaRecord">
<input placeholder="{% trans 'TTL' %}" type="number" class="form-control"
<input placeholder="{% trans 'TTL' %}" type="number" min="0" max="86400" class="form-control"
ng-model="ttl" required>
</div>
<div class="col-sm-3 caaRecord">

View File

@@ -135,12 +135,12 @@ def submitUserCreation(request):
selectedACL = data['selectedACL']
if ACLManager.CheckRegEx("^[\w'\-,.][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*(){}|~<>;:[\]]{2,}$", firstName) == 0:
data_ret = {'status': 0, 'createStatus': 0, 'error_message': 'First Name can only contain Alphabets and should be more then 2 characters..'}
data_ret = {'status': 0, 'createStatus': 0, 'error_message': 'First Name can only contain alphabetic characters, and should be more than 2 characters long...'}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
if ACLManager.CheckRegEx("^[\w'\-,.][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*(){}|~<>;:[\]]{2,}$", lastName) == 0:
data_ret = {'status': 0, 'createStatus': 0, 'error_message': 'First Name can only contain Alphabets and should be more then 2 characters..'}
data_ret = {'status': 0, 'createStatus': 0, 'error_message': 'Last Name can only contain alphabetic characters, and should be more than 2 characters long...'}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)