diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index affcb63c8..d2e002104 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -249,7 +249,7 @@ class backupSchedule: pass for virtualHost in os.listdir("/home"): - if match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', virtualHost, M | I): + if match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', virtualHost, M | I): backupSchedule.createBackup(virtualHost, ipAddress, backupLogPath, port) diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 5c3693d51..2e1bb3cc7 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -39,7 +39,7 @@ class backupScheduleLocal: backupSchedule.remoteBackupLogging(backupLogPath, "") for virtualHost in os.listdir("/home"): - if match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', virtualHost, M | I): + if match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', virtualHost, M | I): try: retValues = backupSchedule.createLocalBackup(virtualHost, backupLogPath) diff --git a/plogical/website.py b/plogical/website.py index 18d702af4..674c9975f 100755 --- a/plogical/website.py +++ b/plogical/website.py @@ -159,7 +159,7 @@ class WebsiteManager: packageName = data['package'] websiteOwner = data['websiteOwner'] - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, M | I): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) @@ -229,7 +229,7 @@ class WebsiteManager: path = data['path'] tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999)) - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, M | I): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) @@ -1349,7 +1349,7 @@ class WebsiteManager: aliasDomain = data['aliasDomain'] ssl = data['ssl'] - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', aliasDomain, + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', aliasDomain, M | I): data_ret = {'status': 0, 'createAliasStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index b78f9aae6..4d2299a8a 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -180,7 +180,7 @@ class WebsiteManager: return ACLManager.loadErrorJson('createWebSiteStatus', 0) - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, M | I): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) @@ -260,7 +260,7 @@ class WebsiteManager: path = data['path'] tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999)) - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', domain, M | I): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) @@ -1607,7 +1607,7 @@ class WebsiteManager: aliasDomain = data['aliasDomain'] ssl = data['ssl'] - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', aliasDomain, + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', aliasDomain, M | I): data_ret = {'status': 0, 'createAliasStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) @@ -2697,13 +2697,13 @@ StrictHostKeyChecking no self.domain = data['masterDomain'] - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', self.domain, + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', self.domain, M | I): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) return HttpResponse(json_data) - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', data['domainName'], + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', data['domainName'], M | I): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) @@ -2770,7 +2770,7 @@ StrictHostKeyChecking no currentACL = ACLManager.loadedACL(userID) admin = Administrator.objects.get(pk=userID) - if not match(r'^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', data['childDomain'], + if not match(r'^[a-zA-Z0-9]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$', data['childDomain'], M | I): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret)