Start integrating Hugo in the new plugin

This commit is contained in:
Henrique Dias committed 2017-07-11 16:58:18 +01:00
1 parent 465b10a02a
commit 8b1d36dfb9
26 files changed
+837 -2497

No files matched your search

+3 -3
View File
@@ -43,7 +43,7 @@ func parseSearch(value string) *searchOptions {
}
// search searches for a file or directory.
func search(c *requestContext, w http.ResponseWriter, r *http.Request) (int, error) {
func search(c *RequestContext, w http.ResponseWriter, r *http.Request) (int, error) {
// Upgrades the connection to a websocket and checks for errors.
conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
@@ -73,7 +73,7 @@ func search(c *requestContext, w http.ResponseWriter, r *http.Request) (int, err
search = parseSearch(value)
scope := strings.TrimPrefix(r.URL.Path, "/")
scope = "/" + scope
scope = string(c.us.FileSystem) + scope
scope = string(c.User.FileSystem) + scope
scope = strings.Replace(scope, "\\", "/", -1)
scope = filepath.Clean(scope)
@@ -93,7 +93,7 @@ func search(c *requestContext, w http.ResponseWriter, r *http.Request) (int, err
}
if strings.Contains(path, term) {
if !c.us.Allowed(path) {
if !c.User.Allowed(path) {
return nil
}