(c *gin.Context)
| 154 | } |
| 155 | |
| 156 | func FsArchiveListSplit(c *gin.Context) { |
| 157 | var req ArchiveListReq |
| 158 | if err := c.ShouldBind(&req); err != nil { |
| 159 | common.ErrorResp(c, err, 400) |
| 160 | return |
| 161 | } |
| 162 | req.Validate() |
| 163 | if strings.HasPrefix(req.Path, "/@s") { |
| 164 | req.Path = strings.TrimPrefix(req.Path, "/@s") |
| 165 | SharingArchiveList(c, &req) |
| 166 | return |
| 167 | } |
| 168 | user := c.Request.Context().Value(conf.UserKey).(*model.User) |
| 169 | if user.IsGuest() && user.Disabled { |
| 170 | common.ErrorStrResp(c, "Guest user is disabled, login please", 401) |
| 171 | return |
| 172 | } |
| 173 | FsArchiveList(c, &req, user) |
| 174 | } |
| 175 | |
| 176 | func FsArchiveList(c *gin.Context, req *ArchiveListReq, user *model.User) { |
| 177 | if !user.CanReadArchives() { |
nothing calls this directly
no test coverage detected