1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Added locking

This commit is contained in:
Zack Scholl
2016-02-08 08:00:07 -05:00
parent 4d1de7a891
commit d8052bdb7a
2 changed files with 49 additions and 6 deletions

View File

@@ -25,10 +25,15 @@ func editNote(c *gin.Context) {
} else if strings.ToLower(title) == "about" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true {
c.Redirect(302, "/about/view")
} else {
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"Title": title,
"ExternalIP": RuntimeArgs.ExternalIP,
})
locked, _ := hasPassword(title)
if locked {
c.Redirect(302, "/"+title+"/view")
} else {
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"Title": title,
"ExternalIP": RuntimeArgs.ExternalIP,
})
}
}
}