Upgraded to latest aero version
This commit is contained in:
assets
auth
config.jsondocs
go.modgo.sumlayout
main.gomain_test.gomakefilemiddleware
pages
activity
admin
amv
amvs
anime
animeimport
animelist
animelistitem
apiview
calendar
character
characters
charge
companies
company
compare
editlog
editor
editor.go
filteranime
all.goanilist.gocharacters.goduplicatemappings.goepisodelength.gogenres.golicensors.golowresimages.gomal.goproducers.gorelations.goshoboi.gosource.gostartdate.gostudios.gosynopsis.gotrailers.goutils.go
filtercompanies
filtersoundtracks
jobs
kitsu.gomal.goembed
episode
explore
forum
frontpage
genre
genres
group
groups
home
index/staffroutes
inventory
listimport
login
me
newthread
notifications
paypal
popular
post
profile
quote
quotes
recommended
search
settings
shop
soundtrack
soundtracks
sse
statistics
support
terms
thread
upload
user
users
welcome
scripts/Actions
tools
utils
@ -1,6 +1,7 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
@ -14,11 +15,11 @@ import (
|
||||
)
|
||||
|
||||
// Get admin page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
func Get(ctx aero.Context) error {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil || (user.Role != "admin" && user.Role != "editor") {
|
||||
return ctx.Redirect("/")
|
||||
return ctx.Redirect(http.StatusFound, "/")
|
||||
}
|
||||
|
||||
// // CPU
|
||||
|
Reference in New Issue
Block a user