@@ -1183,7 +1183,7 @@ func system_fs_handleWebSocketOpr(w http.ResponseWriter, r *http.Request) {
//Permission checking
if !userinfo.CanWrite(vdestFile) {
- log.Println(vdestFile)
+ log.Println("Access denied for " + userinfo.Username + " try to access " + vdestFile)
w.WriteHeader(http.StatusForbidden)
w.Write([]byte("403 - Access Denied"))
return
@@ -579,7 +579,18 @@ mainloop:
if (location.protocol !== 'https:') {
protocol = "ws://";
}
- wsControlEndpoint = (protocol + window.location.hostname + ":" + window.location.port + "/system/file_system/ws/fileOpr");
+
+ var port = window.location.port;
+ if (window.location.port == ""){
+ if (location.protocol !== 'https:') {
+ port = "80";
+ }else{
+ port = "443";
+ }
+ wsControlEndpoint = (protocol + window.location.hostname + ":" + port + "/system/file_system/ws/fileOpr");
return wsControlEndpoint;
@@ -209,7 +209,18 @@
- wsControlEndpoint = (protocol + window.location.hostname + ":" + window.location.port);
+ wsControlEndpoint = (protocol + window.location.hostname + ":" + port);
@@ -5500,7 +5500,12 @@
var port = window.location.port;
if (window.location.port == ""){
- port = "80";
let uploadDir = "user:/Desktop";
@@ -883,6 +883,24 @@ class ao_module_utils{
var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;
return time;
+ static getWebSocketEndpoint(){
+ let protocol = "wss://";
+ protocol = "ws://";
+ wsept = (protocol + window.location.hostname + ":" + port);
+ return wsept;
static formatBytes(a,b=2){if(0===a)return"0 Bytes";const c=0>b?0:b,d=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,d)).toFixed(c))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][d]}