mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
minor changes to backup manager
This commit is contained in:
@@ -74,12 +74,12 @@
|
|||||||
class="btn btn-primary">{% trans "Generate" %}</button>
|
class="btn btn-primary">{% trans "Generate" %}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label style="margin-top: 1%" class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
<label ng-hide="generatedPasswordView" style="margin-top: 1%" class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
||||||
<div style="margin-top: 1%" class="col-sm-6">
|
<div ng-hide="generatedPasswordView" style="margin-top: 1%" class="col-sm-6">
|
||||||
<input name="dom" type="text" class="form-control" ng-model="dbPassword" required>
|
<input name="dom" type="text" class="form-control" ng-model="dbPassword" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 1%" class="col-sm-3">
|
<div ng-hide="generatedPasswordView" style="margin-top: 1%" class="col-sm-3">
|
||||||
<button type="button" ng-click="usePassword()"
|
<button type="button" ng-click="usePassword()"
|
||||||
class="btn btn-primary">{% trans "Use" %}</button>
|
class="btn btn-primary">{% trans "Use" %}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -92,13 +92,13 @@
|
|||||||
class="btn btn-primary">{% trans "Generate" %}</button>
|
class="btn btn-primary">{% trans "Generate" %}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label style="margin-top: 1%"
|
<label ng-hide="generatedPasswordView" style="margin-top: 1%"
|
||||||
class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
||||||
<div style="margin-top: 1%" class="col-sm-6">
|
<div ng-hide="generatedPasswordView" style="margin-top: 1%" class="col-sm-6">
|
||||||
<input name="dom" type="text" class="form-control" ng-model="ftpPassword" required>
|
<input name="dom" type="text" class="form-control" ng-model="ftpPassword" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 1%" class="col-sm-3">
|
<div ng-hide="generatedPasswordView" style="margin-top: 1%" class="col-sm-3">
|
||||||
<button type="button" ng-click="usePassword()"
|
<button type="button" ng-click="usePassword()"
|
||||||
class="btn btn-primary">{% trans "Use" %}</button>
|
class="btn btn-primary">{% trans "Use" %}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -207,10 +207,12 @@ class BackupManager:
|
|||||||
try:
|
try:
|
||||||
command = 'sudo rm -f ' + status
|
command = 'sudo rm -f ' + status
|
||||||
cmd = shlex.split(command)
|
cmd = shlex.split(command)
|
||||||
res = subprocess.call(cmd)
|
subprocess.call(cmd)
|
||||||
|
|
||||||
|
backupObs = Backups.objects.filter(fileName=fileName)
|
||||||
|
for items in backupObs:
|
||||||
|
items.delete()
|
||||||
|
|
||||||
backupOb = Backups.objects.get(fileName=fileName)
|
|
||||||
backupOb.delete()
|
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [backupStatus]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [backupStatus]")
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class backupSchedule:
|
|||||||
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException,msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [createBackup]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [backupSchedule.createBackup]")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def sendBackup(backupPath, IPAddress, backupLogPath , port):
|
def sendBackup(backupPath, IPAddress, backupLogPath , port):
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ class backupUtilities:
|
|||||||
## DNS Records XML
|
## DNS Records XML
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
dnsRecordsXML = Element("dnsrecords")
|
dnsRecordsXML = Element("dnsrecords")
|
||||||
dnsRecords = DNS.getDNSRecords(backupDomain)
|
dnsRecords = DNS.getDNSRecords(backupDomain)
|
||||||
|
|
||||||
@@ -144,8 +145,8 @@ class backupUtilities:
|
|||||||
|
|
||||||
metaFileXML.append(dnsRecordsXML)
|
metaFileXML.append(dnsRecordsXML)
|
||||||
|
|
||||||
except BaseException, msg:
|
except:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
pass
|
||||||
|
|
||||||
## Email accounts XML
|
## Email accounts XML
|
||||||
|
|
||||||
@@ -166,8 +167,8 @@ class backupUtilities:
|
|||||||
|
|
||||||
metaFileXML.append(emailRecordsXML)
|
metaFileXML.append(emailRecordsXML)
|
||||||
|
|
||||||
except BaseException, msg:
|
except:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
pass
|
||||||
|
|
||||||
## Email meta generated!
|
## Email meta generated!
|
||||||
|
|
||||||
@@ -309,8 +310,8 @@ class backupUtilities:
|
|||||||
except:
|
except:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")
|
||||||
|
|
||||||
status = open(os.path.join(backupPath,'status'), "w")
|
status = os.path.join(backupPath,'status'), "w"
|
||||||
logging.CyberCPLogFileWriter.statusWriter(status, "Aborted, please check CyberPanel main log file. [5009]")
|
logging.CyberCPLogFileWriter.statusWriter(status, "Aborted, "+ str(msg) + ". [5009]")
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -624,6 +625,7 @@ class backupUtilities:
|
|||||||
subprocess.call(cmd)
|
subprocess.call(cmd)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException, msg:
|
||||||
|
status = os.path.join(completPath, 'status')
|
||||||
logging.CyberCPLogFileWriter.statusWriter(status, str(msg) + " [5009]")
|
logging.CyberCPLogFileWriter.statusWriter(status, str(msg) + " [5009]")
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startRestore]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startRestore]")
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,16 @@ function getCookie(name) {
|
|||||||
return cookieValue;
|
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 */
|
/* Utilities ends here */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ app.controller('createDatabase', function($scope,$http) {
|
|||||||
$scope.databaseCreationFailed = true;
|
$scope.databaseCreationFailed = true;
|
||||||
$scope.databaseCreated = true;
|
$scope.databaseCreated = true;
|
||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
|
$scope.generatedPasswordView = true;
|
||||||
|
|
||||||
|
|
||||||
$scope.showDetailsBoxes = function(){
|
$scope.showDetailsBoxes = function(){
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.createDatabase = function(){
|
$scope.createDatabase = function(){
|
||||||
|
|
||||||
$scope.createDatabaseLoading = false;
|
$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(){
|
function populateCurrentRecords(){
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.passwordChanged = true;
|
$scope.passwordChanged = true;
|
||||||
@@ -442,6 +449,19 @@ 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;
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ app.controller('createFTPAccount', function($scope,$http) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.createFTPAccount = function(){
|
$scope.createFTPAccount = function(){
|
||||||
|
|
||||||
$scope.ftpLoading = false;
|
$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 */
|
/* Java script code to create account ends here */
|
||||||
|
|
||||||
@@ -142,8 +153,6 @@ app.controller('deleteFTPAccount', function($scope,$http) {
|
|||||||
$scope.deleteFTPButtonInit = true;
|
$scope.deleteFTPButtonInit = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var url = "/ftp/fetchFTPAccounts";
|
var url = "/ftp/fetchFTPAccounts";
|
||||||
|
|
||||||
|
|
||||||
@@ -382,8 +391,6 @@ app.controller('listFTPAccounts', function($scope,$http) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function populateCurrentRecords(){
|
function populateCurrentRecords(){
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.passwordChanged = 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;
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -39,9 +39,6 @@ application.config(['$interpolateProvider',
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
application.controller('loginSystem', function($scope,$http,$window) {
|
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 */
|
/* Java script code to to Check Login status ends here */
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ app.controller('createEmailAccount', function($scope,$http) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.createEmailAccount = function(){
|
$scope.createEmailAccount = function(){
|
||||||
|
|
||||||
$scope.emailDetails = false;
|
$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 ends here */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Java script code to create account */
|
/* Java script code to create account */
|
||||||
app.controller('deleteEmailAccount', function($scope,$http) {
|
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 ends here */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Java script code to create account */
|
/* Java script code to create account */
|
||||||
app.controller('changeEmailPassword', function($scope,$http) {
|
app.controller('changeEmailPassword', function($scope,$http) {
|
||||||
|
|
||||||
@@ -408,7 +415,6 @@ app.controller('changeEmailPassword', function($scope,$http) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.changePassword = function(){
|
$scope.changePassword = function(){
|
||||||
|
|
||||||
$scope.emailLoading = false;
|
$scope.emailLoading = false;
|
||||||
@@ -493,8 +499,6 @@ app.controller('changeEmailPassword', function($scope,$http) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.deleteEmailAccount = function(){
|
$scope.deleteEmailAccount = function(){
|
||||||
|
|
||||||
var domain = $scope.selectedEmail;
|
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 */
|
/* Java script code to create account ends here */
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ app.controller('createUserCtr', function($scope,$http) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.hideSomeThings = function(){
|
$scope.hideSomeThings = function(){
|
||||||
|
|
||||||
$scope.userCreated = true;
|
$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 */
|
/* Java script code to create account ends here */
|
||||||
|
|
||||||
@@ -333,7 +345,6 @@ app.controller('modifyUser', function($scope,$http) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.showLimitsBox = function () {
|
$scope.showLimitsBox = function () {
|
||||||
|
|
||||||
if ($scope.accountType == "Normal User"){
|
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 */
|
/* Java script code to modify user account ends here */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user