forced whitelabel
This commit is contained in:
parent
799e6b3389
commit
1433521855
@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/TicketsBot/GoPanel/config"
|
||||
dbclient "github.com/TicketsBot/GoPanel/database"
|
||||
"github.com/TicketsBot/GoPanel/messagequeue"
|
||||
"github.com/TicketsBot/GoPanel/rpc"
|
||||
@ -16,12 +17,22 @@ func WhitelabelHandler(ctx *gin.Context) {
|
||||
|
||||
premiumTier := rpc.PremiumClient.GetTierByUser(userId, false)
|
||||
if premiumTier < premium.Whitelabel {
|
||||
var isForced bool
|
||||
for _, forced := range config.Conf.ForceWhitelabel {
|
||||
if forced == userId {
|
||||
isForced = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !isForced {
|
||||
ctx.JSON(402, gin.H{
|
||||
"success": false,
|
||||
"error": "You must have the whitelabel premium tier",
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Get token
|
||||
var data map[string]interface{}
|
||||
|
@ -20,9 +20,19 @@ func WhitelabelHandler(ctx *gin.Context) {
|
||||
|
||||
premiumTier := rpc.PremiumClient.GetTierByUser(userId, false)
|
||||
if premiumTier < premium.Whitelabel {
|
||||
var isForced bool
|
||||
for _, forced := range config.Conf.ForceWhitelabel {
|
||||
if forced == userId {
|
||||
isForced = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !isForced {
|
||||
ctx.Redirect(302, fmt.Sprintf("%s/premium", config.Conf.Server.MainSite))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ctx.HTML(200, "main/whitelabel", gin.H{
|
||||
"name": store.Get("name").(string),
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
type (
|
||||
Config struct {
|
||||
Admins []uint64
|
||||
ForceWhitelabel []uint64
|
||||
Server Server
|
||||
Oauth Oauth
|
||||
Database Database
|
||||
|
Loading…
x
Reference in New Issue
Block a user