Browse Source

Added owner always open their own file feature

Toby Chui 3 years ago
parent
commit
a689653a57
2 changed files with 3 additions and 4 deletions
  1. 1 2
      mod/share/share.go
  2. 2 2
      web/SystemAO/file_system/file_share.html

+ 1 - 2
mod/share/share.go

@@ -222,8 +222,7 @@ func (s *Manager) HandleShareAccess(w http.ResponseWriter, r *http.Request) {
 			}
 
 			//Check if username in the allowed user list
-			if !inArray(shareOption.Accessibles, thisuserinfo.Username) {
-				//Serve permission denied page
+			if !inArray(shareOption.Accessibles, thisuserinfo.Username) && shareOption.Owner != thisuserinfo.Username {
 				//Serve permission denied page
 				if directDownload || directServe {
 					w.WriteHeader(http.StatusForbidden)

+ 2 - 2
web/SystemAO/file_system/file_share.html

@@ -59,7 +59,7 @@
                             <h1><br><i class="ui loading spinner icon"></i><br></h1>
                         </div>
                     </div>
-                    <div style="width: 70%; text-align: center;">
+                    <div style="width: 80%; text-align: center;">
                     <a id="sharelink" href="" target="_blank" style="margin-top:8px; font-size: 120%; padding-left: 20px; padding-right: 20px; word-break: break-all; overflow-wrap: anywhere;"></a>
                     </div>
                     
@@ -293,7 +293,7 @@
                         }else{
                             //Default: show the setting to allow user adjustment
                             $("#main").css({
-                                "padding-top":"1em",
+                                "margin-top":"0em",
                                 "padding": "4px"
                             });
                             $("#shareSettingOptions").show();