diff --git a/baseTemplate/static/baseTemplate/custom-js/system-status.js b/baseTemplate/static/baseTemplate/custom-js/system-status.js index 58b2c634e..0200129db 100644 --- a/baseTemplate/static/baseTemplate/custom-js/system-status.js +++ b/baseTemplate/static/baseTemplate/custom-js/system-status.js @@ -22,6 +22,16 @@ function getCookie(name) { return cookieValue; } +function randomPassword(length) { + var chars = "abcdefghijklmnopqrstuvwxyz!@#$%^*()-+<>ABCDEFGHIJKLMNOP1234567890"; + var pass = ""; + for (var x = 0; x < length; x++) { + var i = Math.floor(Math.random() * chars.length); + pass += chars.charAt(i); + } + return pass; +} + /* Utilities ends here */ diff --git a/databases/static/databases/databases.js b/databases/static/databases/databases.js index 15095effa..22f246d91 100644 --- a/databases/static/databases/databases.js +++ b/databases/static/databases/databases.js @@ -11,13 +11,13 @@ app.controller('createDatabase', function($scope,$http) { $scope.databaseCreationFailed = true; $scope.databaseCreated = true; $scope.couldNotConnect = true; + $scope.generatedPasswordView = true; $scope.showDetailsBoxes = function(){ $scope.dbDetails = false; }; - $scope.createDatabase = function(){ $scope.createDatabaseLoading = false; @@ -106,6 +106,15 @@ app.controller('createDatabase', function($scope,$http) { + }; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.dbPassword = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; }; }); @@ -365,8 +374,6 @@ app.controller('listDBs', function($scope,$http) { }; - - function populateCurrentRecords(){ $scope.recordsFetched = true; $scope.passwordChanged = true; @@ -442,7 +449,20 @@ app.controller('listDBs', function($scope,$http) { } - }; + } + + //// + + $scope.generatedPasswordView = true; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.dbPassword = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; + }; }); diff --git a/databases/templates/databases/createDatabase.html b/databases/templates/databases/createDatabase.html index 65586485b..ab809bba2 100644 --- a/databases/templates/databases/createDatabase.html +++ b/databases/templates/databases/createDatabase.html @@ -57,6 +57,19 @@
+
+ +
+ + +
+ +
+ +
+
+ +
@@ -64,7 +77,6 @@
-
diff --git a/databases/templates/databases/listDataBases.html b/databases/templates/databases/listDataBases.html index c51761a5f..8cfb6f880 100644 --- a/databases/templates/databases/listDataBases.html +++ b/databases/templates/databases/listDataBases.html @@ -3,118 +3,137 @@ {% block title %}{% trans "List Databases - CyberPanel" %}{% endblock %} {% block content %} -{% load static %} -{% get_current_language as LANGUAGE_CODE %} - - - -
-
-

{% trans "List Databases" %}

-

{% trans "List Databases or change their passwords." %}

-
-
-
-

- {% trans "List Databases" %} -

-
- -
- -
- -
- -
-
- - -
- - - -
- -
-

{% trans "Records successfully fetched for" %} {$ domainFeteched $}

-
- -
- {% trans "Password changed for: " %} {$ dbUsername $} -
- -
-

{% trans "Cannot change password for " %}{$ dbUsername $}, {% trans "Error message:" %} {$ errorMessage $}

-
- - -
-

{% trans "Could Not Connect to server. Please refresh this page" %}

-
- -
-
- - -
- -
- -
- -
- -
-
- - - - -
- -
- - - - - - - - - - - - - - - - - - -
{% trans "ID" %}{% trans "Database Name" %}{% trans "Database User" %}{% trans "Password" %}
-
-
- - - - - -
- - + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + +
+
+

{% trans "List Databases" %}

+

{% trans "List Databases or change their passwords." %}

+
+
+

+ {% trans "List Databases" %} +

+
+ +
+ +
+ +
+ +
+
+ + +
+ + + +
+ +
+

{% trans "Records successfully fetched for" %} {$ domainFeteched + $}

+
+ +
+ {% trans "Password changed for: " %} {$ dbUsername $} +
+ +
+

{% trans "Cannot change password for " %}{$ dbUsername + $}, {% trans "Error message:" %} {$ errorMessage $}

+
+ + +
+

{% trans "Could Not Connect to server. Please refresh this page" %}

+
+ +
+
+ + +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+
+ + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
{% trans "ID" %}{% trans "Database Name" %}{% trans "Database User" %}{% trans "Password" %}
+ +
+
+
+ + + + +
+ + +
+
+
+ +
-
- - -
{% endblock %} diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index afb122ece..7609d314d 100644 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -24,6 +24,10 @@ class FileManager: def changeOwner(self, path): domainName = self.data['domainName'] website = Websites.objects.get(domain=domainName) + + if path.find('..') > -1: + return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!') + command = "sudo chown -R " + website.externalApp + ':' + website.externalApp + ' ' + self.returnPathEnclosed(path) ProcessUtilities.executioner(command) @@ -99,6 +103,9 @@ class FileManager: finalData = {} finalData['status'] = 1 + if self.data['fileName'].find('..') > -1: + return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!') + command = "sudo touch " + self.returnPathEnclosed(self.data['fileName']) ProcessUtilities.executioner(command) @@ -195,6 +202,9 @@ class FileManager: finalData = {} finalData['status'] = 1 + if self.data['newFileName'].find('..') > -1: + return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!') + command = 'sudo mv ' + self.returnPathEnclosed(self.data['basePath'] + '/' + self.data['existingName']) + ' ' + self.returnPathEnclosed(self.data['basePath'] + '/' + self.data['newFileName']) ProcessUtilities.executioner(command) diff --git a/ftp/static/ftp/ftp.js b/ftp/static/ftp/ftp.js index 27b0e7c88..88a7c3806 100644 --- a/ftp/static/ftp/ftp.js +++ b/ftp/static/ftp/ftp.js @@ -23,8 +23,6 @@ app.controller('createFTPAccount', function($scope,$http) { }; - - $scope.createFTPAccount = function(){ $scope.ftpLoading = false; @@ -116,6 +114,19 @@ app.controller('createFTPAccount', function($scope,$http) { }; + /// + + $scope.generatedPasswordView = true; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.ftpPassword = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; + }; + }); /* Java script code to create account ends here */ @@ -142,8 +153,6 @@ app.controller('deleteFTPAccount', function($scope,$http) { $scope.deleteFTPButtonInit = true; - - var url = "/ftp/fetchFTPAccounts"; @@ -382,8 +391,6 @@ app.controller('listFTPAccounts', function($scope,$http) { }; - - function populateCurrentRecords(){ $scope.recordsFetched = true; $scope.passwordChanged = true; @@ -459,6 +466,19 @@ app.controller('listFTPAccounts', function($scope,$http) { } - }; + } + + //// + + $scope.generatedPasswordView = true; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.ftpPassword = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; + }; }); \ No newline at end of file diff --git a/ftp/templates/ftp/createFTPAccount.html b/ftp/templates/ftp/createFTPAccount.html index 78927cf7f..d82425c7b 100644 --- a/ftp/templates/ftp/createFTPAccount.html +++ b/ftp/templates/ftp/createFTPAccount.html @@ -68,6 +68,22 @@
+
+ +
+
+ +
+ +
+ +
+
+ +
diff --git a/ftp/templates/ftp/listFTPAccounts.html b/ftp/templates/ftp/listFTPAccounts.html index 7c72a9604..dae50eb87 100644 --- a/ftp/templates/ftp/listFTPAccounts.html +++ b/ftp/templates/ftp/listFTPAccounts.html @@ -87,6 +87,22 @@ required>
+
+ +
+ + +
+ +
+ +
+ +
+
diff --git a/loginSystem/static/loginSystem/login-systen.js b/loginSystem/static/loginSystem/login-systen.js index 30a56f0fe..6aad70b6f 100644 --- a/loginSystem/static/loginSystem/login-systen.js +++ b/loginSystem/static/loginSystem/login-systen.js @@ -39,9 +39,6 @@ application.config(['$interpolateProvider', } ]); - - - application.controller('loginSystem', function($scope,$http,$window) { @@ -98,4 +95,3 @@ application.controller('loginSystem', function($scope,$http,$window) { /* Java script code to to Check Login status ends here */ - diff --git a/mailServer/static/mailServer/mailServer.js b/mailServer/static/mailServer/mailServer.js index eabb4acf5..c5d8e512d 100644 --- a/mailServer/static/mailServer/mailServer.js +++ b/mailServer/static/mailServer/mailServer.js @@ -26,8 +26,6 @@ app.controller('createEmailAccount', function($scope,$http) { }; - - $scope.createEmailAccount = function(){ $scope.emailDetails = false; @@ -117,11 +115,21 @@ app.controller('createEmailAccount', function($scope,$http) { }; + $scope.generatedPasswordView = true; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.emailPassword = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; + }; + }); /* Java script code to create account ends here */ - /* Java script code to create account */ app.controller('deleteEmailAccount', function($scope,$http) { @@ -318,7 +326,6 @@ app.controller('deleteEmailAccount', function($scope,$http) { /* Java script code to create account ends here */ - /* Java script code to create account */ app.controller('changeEmailPassword', function($scope,$http) { @@ -408,7 +415,6 @@ app.controller('changeEmailPassword', function($scope,$http) { }; - $scope.changePassword = function(){ $scope.emailLoading = false; @@ -493,8 +499,6 @@ app.controller('changeEmailPassword', function($scope,$http) { }; - - $scope.deleteEmailAccount = function(){ var domain = $scope.selectedEmail; @@ -505,6 +509,21 @@ app.controller('changeEmailPassword', function($scope,$http) { }; + /// + + $scope.generatedPasswordView = true; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.emailPassword = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; + }; + + + }); /* Java script code to create account ends here */ diff --git a/mailServer/templates/mailServer/changeEmailPassword.html b/mailServer/templates/mailServer/changeEmailPassword.html index d2edebb3b..dc7eb3bb6 100644 --- a/mailServer/templates/mailServer/changeEmailPassword.html +++ b/mailServer/templates/mailServer/changeEmailPassword.html @@ -69,6 +69,22 @@
+
+ +
+
+ +
+ +
+ +
+
+ +
diff --git a/mailServer/templates/mailServer/createEmailAccount.html b/mailServer/templates/mailServer/createEmailAccount.html index 7884ea363..36aa26162 100644 --- a/mailServer/templates/mailServer/createEmailAccount.html +++ b/mailServer/templates/mailServer/createEmailAccount.html @@ -69,6 +69,22 @@
+
+ +
+
+ +
+ +
+ +
+
+ +
diff --git a/plogical/website.py b/plogical/website.py index 5823dbe5b..7fcf72a3b 100644 --- a/plogical/website.py +++ b/plogical/website.py @@ -144,7 +144,8 @@ class WebsiteManager: if ACLManager.currentContextPermission(currentACL, 'createWebsite') == 0: return ACLManager.loadErrorJson('createWebSiteStatus', 0) - domain = data['domainName'].lstrip('http://').lstrip('https://').rstrip('/') + domain = data['domainName'] + #logging.CyberCPLogFileWriter.writeToFile(domain) adminEmail = data['adminEmail'] phpSelection = data['phpSelection'] packageName = data['package'] @@ -186,7 +187,7 @@ class WebsiteManager: admin = Administrator.objects.get(pk=userID) masterDomain = data['masterDomain'] - domain = data['domainName'].lstrip('http://').lstrip('https://').rstrip('/') + domain = data['domainName'] phpSelection = data['phpSelection'] path = data['path'] tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999)) diff --git a/userManagment/static/userManagment/userManagment.js b/userManagment/static/userManagment/userManagment.js index 9b47283a5..e2685095e 100644 --- a/userManagment/static/userManagment/userManagment.js +++ b/userManagment/static/userManagment/userManagment.js @@ -108,7 +108,6 @@ app.controller('createUserCtr', function($scope,$http) { }; - $scope.hideSomeThings = function(){ $scope.userCreated = true; @@ -117,6 +116,19 @@ app.controller('createUserCtr', function($scope,$http) { }; + /// + + $scope.generatedPasswordView = true; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.password = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; + }; + }); /* Java script code to create account ends here */ @@ -333,7 +345,6 @@ app.controller('modifyUser', function($scope,$http) { }; - $scope.showLimitsBox = function () { if ($scope.accountType == "Normal User"){ @@ -353,6 +364,19 @@ app.controller('modifyUser', function($scope,$http) { }; + /// + + $scope.generatedPasswordView = true; + + $scope.generatePassword = function () { + $scope.generatedPasswordView = false; + $scope.password = randomPassword(12); + }; + + $scope.usePassword = function () { + $scope.generatedPasswordView = true; + }; + }); /* Java script code to modify user account ends here */ diff --git a/userManagment/templates/userManagment/createUser.html b/userManagment/templates/userManagment/createUser.html index 6aa591dd4..17c0008b3 100644 --- a/userManagment/templates/userManagment/createUser.html +++ b/userManagment/templates/userManagment/createUser.html @@ -85,6 +85,21 @@ +
+ +
+ + +
+ +
+ +
+
+ +
diff --git a/userManagment/templates/userManagment/modifyUser.html b/userManagment/templates/userManagment/modifyUser.html index 8616c6975..40f564df0 100644 --- a/userManagment/templates/userManagment/modifyUser.html +++ b/userManagment/templates/userManagment/modifyUser.html @@ -3,26 +3,27 @@ {% block title %}{% trans "Modify User - CyberPanel" %}{% endblock %} {% block content %} -{% load static %} -{% get_current_language as LANGUAGE_CODE %} - + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + -
-
-

{% trans "Modify User" %}

-

{% trans "Modify existing user settings on this page." %}

-
+
+
+

{% trans "Modify User" %}

+

{% trans "Modify existing user settings on this page." %}

+
-
-
-

- {% trans "Details" %} -

-
+
+
+

+ {% trans "Details" %} +

+
-
+ -
+
-
+
-
- -
- -
-
- -
- -
- -
-
- - -
- -
- -
-
- - -
- -
- -
-
- - - -
- -
- - -
-
- - - -
- -
-
-

{% trans "Account with username:" %} {$ userName $}{% trans " is successfully modified." %}

+
+ +
+
+
-
-

{% trans "Cannot modify user. Error message:" %} {$ errorMessage $}

+
+ +
+
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+ +
+ + +
+
+ + +
+ +
+
+

{% trans "Account with username:" %} {$ userName + $}{% trans " is successfully modified." %}

+
+ +
+

{% trans "Cannot modify user. Error message:" %} {$ errorMessage $}

+
+ +
+

{% trans "Could not connect to server. Please refresh this page." %}

+
+ + +
+

{% trans "Cannot fetch details. Error message:" %} {$ errorMessage $}

+
+ +
+

{% trans "Details fetched." %}

+
+ -
-

{% trans "Could not connect to server. Please refresh this page." %}

-
-

{% trans "Cannot fetch details. Error message:" %} {$ errorMessage $}

-
- -
-

{% trans "Details fetched." %}

-
+
- -
- +
- - - - - - - +
+ +
-
- - - -
{% endblock %}