diff --git a/firewall/templates/firewall/modSecurity.html b/firewall/templates/firewall/modSecurity.html index c5cb679aa..e0476e917 100644 --- a/firewall/templates/firewall/modSecurity.html +++ b/firewall/templates/firewall/modSecurity.html @@ -104,6 +104,7 @@
{$ SecDebugLogLevel $} - - - - - - - - - -
+
diff --git a/install/install.py b/install/install.py index 13bfbc057..e4285521b 100644 --- a/install/install.py +++ b/install/install.py @@ -687,8 +687,8 @@ class preFlightsChecks: count = 0 while (1): - #command = "wget http://cyberpanel.net/CyberPanel.1.7.0.tar.gz" - command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz" + command = "wget http://cyberpanel.net/CyberPanel.1.7.1.tar.gz" + #command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz" res = subprocess.call(shlex.split(command)) if res == 1: @@ -707,8 +707,8 @@ class preFlightsChecks: count = 0 while(1): - #command = "tar zxf CyberPanel.1.7.0.tar.gz" - command = "tar zxf CyberPanelTemp.tar.gz" + command = "tar zxf CyberPanel.1.7.1.tar.gz" + #command = "tar zxf CyberPanelTemp.tar.gz" res = subprocess.call(shlex.split(command)) diff --git a/loginSystem/templates/loginSystem/login.html b/loginSystem/templates/loginSystem/login.html index 7f3328b31..9a1fee8e7 100755 --- a/loginSystem/templates/loginSystem/login.html +++ b/loginSystem/templates/loginSystem/login.html @@ -67,7 +67,7 @@
-

CyberPanel Entv 1.7

+

CyberPanel v 1.7

Web Hosting Control Panel

    diff --git a/loginSystem/views.py b/loginSystem/views.py index 50a774f85..439328d14 100644 --- a/loginSystem/views.py +++ b/loginSystem/views.py @@ -148,7 +148,7 @@ def loadLoginPage(request): firstName="Cyber",lastName="Panel", acl=acl) admin.save() - vers = version(currentVersion="1.7",build=0) + vers = version(currentVersion="1.7",build=1) vers.save() package = Package(admin=admin, packageName="Default", diskSpace=1000, diff --git a/plogical/modSec.py b/plogical/modSec.py index d6ecbeb9d..0ab8d6dd6 100644 --- a/plogical/modSec.py +++ b/plogical/modSec.py @@ -57,11 +57,11 @@ class modSec: module mod_security { modsecurity on modsecurity_rules ` -SecDebugLogLevel 9 +SecDebugLogLevel 0 SecDebugLog /usr/local/lsws/logs/modsec.log SecAuditEngine on SecAuditLogRelevantStatus "^(?:5|4(?!04))" -SecAuditLogParts ABIJDEFHZ +SecAuditLogParts AFH SecAuditLogType Serial SecAuditLog /usr/local/lsws/logs/auditmodsec.log SecRuleEngine On diff --git a/plogical/upgrade.py b/plogical/upgrade.py index d53785f84..43d6b4e84 100644 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -32,7 +32,7 @@ class Upgrade: r = requests.get(url, verify=True) data = json.loads(r.text) version_number = str(data['version']) - version_build = str(data['build']) + version_build = str(0) return (version_number + "." + version_build + ".tar.gz") except BaseException, msg: Upgrade.stdOut(str(msg) + ' [downloadLink]') @@ -126,8 +126,6 @@ class Upgrade: command = "virtualenv --system-site-packages /usr/local/CyberCP" res = subprocess.call(shlex.split(command)) - - except OSError, msg: Upgrade.stdOut(str(msg) + " [setupVirtualEnv]") os._exit(0) @@ -308,7 +306,65 @@ WantedBy=multi-user.target""" vers.build = latest['build'] vers.save() + @staticmethod + def applyLoginSystemMigrations(): + try: + cwd = os.getcwd() + os.chdir('/usr/local/CyberCP') + + try: + ## + command = "python manage.py makemigrations loginSystem" + res = subprocess.call(shlex.split(command)) + + command = "python manage.py migrate loginSystem" + res = subprocess.call(shlex.split(command)) + except: + pass + + from loginSystem.models import Administrator, ACL + + adminACL = ACL(name='admin', adminStatus=1) + adminACL.save() + + ## Reseller ACL + + resellerACL = ACL(name='reseller', + createNewUser=1, + deleteUser=1, + createWebsite=1, + resellerCenter=1, + modifyWebsite=1, + suspendWebsite=1, + deleteWebsite=1, + createPackage=1, + deletePackage=1, + modifyPackage=1, + createNameServer=1, + restoreBackup=1, + ) + resellerACL.save() + + ## User ACL + + userACL = ACL(name='user') + userACL.save() + + allUsers = Administrator.objects.all() + + for items in allUsers: + + if items.userName == 'admin': + items.acl = adminACL + else: + items.acl = userACL + + os.chdir(cwd) + + except OSError, msg: + Upgrade.stdOut(str(msg) + " [applyLoginSystemMigrations]") + os._exit(0) @staticmethod def upgrade(): @@ -316,16 +372,19 @@ WantedBy=multi-user.target""" os.chdir("/usr/local") - ## Current Version Version = version.objects.get(pk=1) + if Version.currentVersion == '1.7' and Version.build == 0: + Upgrade.stdOut('You can not upgrade to v1.7.1 via automatic upgrade.') + os._exit(0) ## versionNumbring = Upgrade.downloadLink() + if os.path.exists('/usr/local/CyberPanel.' + versionNumbring): os.remove('/usr/local/CyberPanel.' + versionNumbring) @@ -366,24 +425,6 @@ WantedBy=multi-user.target""" Upgrade.stdOut("Settings file backed up.") - ## Remove Core Files - - count = 1 - while (1): - command = "rm -rf /usr/local/CyberCP" - res = subprocess.call(shlex.split(command)) - - if res == 1: - count = count + 1 - Upgrade.stdOut( - "Trying to remove old version, trying again, try number: " + str(count)) - if count == 3: - Upgrade.stdOut("Failed to remove old version! [upgrade]") - os._exit(0) - else: - Upgrade.stdOut("Old version successfully removed!") - break - ## Extract Latest files count = 1 @@ -525,6 +566,10 @@ WantedBy=multi-user.target""" subprocess.call(shlex.split(command)) + #if Version.currentVersion == '1.7' and Version.build == 0: + # Upgrade.applyLoginSystemMigrations() + + ## Upgrade OpenLiteSpeed Upgrade.upgradeOpenLiteSpeed() diff --git a/userManagment/views.py b/userManagment/views.py index bc21b0371..e325e9c3b 100644 --- a/userManagment/views.py +++ b/userManagment/views.py @@ -622,6 +622,20 @@ def submitACLModifications(request): acl.save() + if int(data['adminStatus']) == 1: + allUsers = acl.administrator_set.all() + + for items in allUsers: + items.type = 1 + items.save() + else: + allUsers = acl.administrator_set.all() + + for items in allUsers: + items.type = 3 + items.save() + + finalResponse = { 'status': 1} else: finalResponse = ACLManager.loadErrorJson()