diff --git a/backup/templates/backup/OneClickBackupSchedule.html b/backup/templates/backup/OneClickBackupSchedule.html index 65e5cad33..4997146ca 100644 --- a/backup/templates/backup/OneClickBackupSchedule.html +++ b/backup/templates/backup/OneClickBackupSchedule.html @@ -4,306 +4,611 @@ {% block content %} {% load static %} - - {% get_current_language as LANGUAGE_CODE %} -
-
-

{% trans "Schedule Backup" %} - {% trans "Remote Backups" %} -

-

{% trans "On this page you can schedule Backups to localhost or remote server (If you have added one)" %}

-
+ -
-
-

- {% trans "Create New Backup Schedule" %} cyberPanelLoading -

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

- {% trans "Manage Existing Backup Schedules" %} cyberPanelLoading -

-
+
+ +
+
+

+ + {% trans "Create New Backup Schedule" %} + +

+
+
+
+
+ +
+
+ + +
- +
+ + +
-
- -
- +
+ +
+ + {% trans "days (0 for no limit)" %}
-
- -
+
+ +
+ +
+
+ + +
+
+

+ + {% trans "Manage Existing Backup Schedules" %} + +

+
+
+
+
+ + +
+ +
+ +
+
-
-
- -
+
+ +
-
- - -
- -
-
- - - - - - - - - - - - - - - - - - - -
Last RunAll SitesFrequency ({$ currently $})Retention ({$ currently $})Current Status
{$ lastRun $}{$ allSites $} - - {$ currentStatus $}
+ +
-
-
-
- - + +
+
+
+ {% trans "Last Run" %} + {$ lastRun $}
-
+
+ {% trans "All Sites" %} + {$ allSites $}
-
-
- -
+
+ {% trans "Frequency" %} ({$ currently $}) + +
+
+ {% trans "Current Status" %} + {$ currentStatus $} +
+
+
+ + +
+
+

+ + {% trans "Backed Up Sites" %} +

+
+ +
- +
- - - - + + + + - - - - + + + +
SitesAction
{% trans "Sites" %}{% trans "Actions" %}
- -
+ +
-
-
-
-
-
-
-
- -
-
-
+
+
+ {% trans "Page" %} +
- +
+
+ +
- -
- -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/backup/templates/backup/restoreOCBackups.html b/backup/templates/backup/restoreOCBackups.html index c244abe79..7fefda429 100644 --- a/backup/templates/backup/restoreOCBackups.html +++ b/backup/templates/backup/restoreOCBackups.html @@ -4,111 +4,413 @@ {% block content %} {% load static %} - {% get_current_language as LANGUAGE_CODE %} + -
-
-

{% trans "Restore Website" %} - {% trans "Backup Docs" %} -

-

{% trans "This page can be used to restore your websites, Backup should be generated from CyberPanel Backup generation tool, it will detect all Backups under /home/backup." %}

-
- -
-
-

- {% trans "Restore Website" %} -

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

{$ currentStatus $}

-
- -
-
- 70% Complete -
-
- -
-

{% trans "Error message:" %} {$ errorMessage $}

-
- -
-

{% trans "Backup restored successfully." %}

-
- - -
-

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

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

+ + {% trans "Select Backup to Restore" %} + +

+
+
+
+
+ + +
+
+ + +
+ +
+ +
+ + +
+
+ + {$ currentStatus $} +
+ +
+
+ {$ installPercentage $}% +
+
+ +
+ +
+ {% trans "Error occurred:" %}
+ {$ errorMessage $} +
+
+ +
+ +
+ {% trans "Success!" %}
+ {% trans "Backup has been restored successfully." %} +
+
+ +
+ +
+ {% trans "Connection Error" %}
+ {% trans "Could not connect to server. Please refresh this page and try again." %} +
+
+ +
+ +
+
+
+
+
+
- {% endblock %} \ No newline at end of file diff --git a/baseTemplate/views.py b/baseTemplate/views.py index 182565fe4..953935ce5 100644 --- a/baseTemplate/views.py +++ b/baseTemplate/views.py @@ -131,6 +131,11 @@ def getSystemStatus(request): try: val = request.session['userID'] currentACL = ACLManager.loadedACL(val) + + # Only admins should see system-wide information + if not currentACL.get('admin', 0): + return HttpResponse(json.dumps({'status': 0, 'error_message': 'Admin access required'}), content_type='application/json', status=403) + HTTPData = SystemInformation.getSystemInformation() json_data = json.dumps(HTTPData) return HttpResponse(json_data) @@ -142,6 +147,11 @@ def getLoadAverage(request): try: val = request.session['userID'] currentACL = ACLManager.loadedACL(val) + + # Only admins should see system load averages + if not currentACL.get('admin', 0): + return HttpResponse(json.dumps({'status': 0, 'error_message': 'Admin access required'}), content_type='application/json', status=403) + loadAverage = SystemInformation.cpuLoad() loadAverage = list(loadAverage) one = loadAverage[0] @@ -495,6 +505,11 @@ def getTrafficStats(request): try: val = request.session['userID'] currentACL = ACLManager.loadedACL(val) + + # Only admins should see system-wide network stats + if not currentACL.get('admin', 0): + return HttpResponse(json.dumps({'status': 0, 'error_message': 'Admin access required'}), content_type='application/json', status=403) + # Get network stats from /proc/net/dev (Linux) rx = tx = 0 with open('/proc/net/dev', 'r') as f: @@ -518,6 +533,11 @@ def getDiskIOStats(request): try: val = request.session['userID'] currentACL = ACLManager.loadedACL(val) + + # Only admins should see system-wide disk I/O stats + if not currentACL.get('admin', 0): + return HttpResponse(json.dumps({'status': 0, 'error_message': 'Admin access required'}), content_type='application/json', status=403) + # Parse /proc/diskstats for all disks read_sectors = 0 write_sectors = 0 @@ -547,6 +567,11 @@ def getCPULoadGraph(request): try: val = request.session['userID'] currentACL = ACLManager.loadedACL(val) + + # Only admins should see system-wide CPU stats + if not currentACL.get('admin', 0): + return HttpResponse(json.dumps({'status': 0, 'error_message': 'Admin access required'}), content_type='application/json', status=403) + # Parse /proc/stat for the 'cpu' line with open('/proc/stat', 'r') as f: for line in f: diff --git a/websiteFunctions/templates/websiteFunctions/website.html b/websiteFunctions/templates/websiteFunctions/website.html index ebfa3e824..cb57fa099 100644 --- a/websiteFunctions/templates/websiteFunctions/website.html +++ b/websiteFunctions/templates/websiteFunctions/website.html @@ -1245,7 +1245,7 @@ {% trans "Preview Website" %} - + {% trans "File Manager" %}