mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-10-09 16:53:59 +02:00
add preemtive permission handlers
Signed-off-by: RonniSkansing <rskansing@gmail.com>
This commit is contained in:
3 files changed
+40
-5
No files matched your search
@@ -12,10 +12,13 @@ type GeoIP struct {
|
||||
|
||||
// GetMetadata returns the available country codes for the filter UI
|
||||
func (c *GeoIP) GetMetadata(g *gin.Context) {
|
||||
_, _, ok := c.handleSession(g)
|
||||
session, _, ok := c.handleSession(g)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
if !c.handleGlobalAuthorization(g, session) {
|
||||
return
|
||||
}
|
||||
|
||||
codes := ipdata.Get().CountryCodes()
|
||||
|
||||
@@ -28,10 +31,13 @@ func (c *GeoIP) GetMetadata(g *gin.Context) {
|
||||
|
||||
// Lookup performs a country lookup for the provided IP address
|
||||
func (c *GeoIP) Lookup(g *gin.Context) {
|
||||
_, _, ok := c.handleSession(g)
|
||||
session, _, ok := c.handleSession(g)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
if !c.handleGlobalAuthorization(g, session) {
|
||||
return
|
||||
}
|
||||
|
||||
ip := g.Query("ip")
|
||||
if ip == "" {
|
||||
|
||||
Reference in new issue
Block a user