forked from ProjectSegfault/publapi
switch to toml
This commit is contained in:
parent
bf3812b790
commit
06ec369843
@ -52,11 +52,11 @@ func userdata(username, usersonline, ops string) Userinfo {
|
|||||||
}
|
}
|
||||||
crdstr := string(crd)
|
crdstr := string(crd)
|
||||||
crdstr = strings.TrimSuffix(crdstr, "\n")
|
crdstr = strings.TrimSuffix(crdstr, "\n")
|
||||||
filename := "/home/" + username + "/meta-info.env"
|
filename := "/home/" + username + "/meta-info.toml"
|
||||||
_, error := os.Stat(filename)
|
_, error := os.Stat(filename)
|
||||||
if error != nil {
|
if error != nil {
|
||||||
if os.IsNotExist(error) {
|
if os.IsNotExist(error) {
|
||||||
log.Error(username + " does not have a meta-info.env")
|
log.Error(username + " does not have a meta-info.toml")
|
||||||
var user Userinfo
|
var user Userinfo
|
||||||
user.Name = username
|
user.Name = username
|
||||||
user.Created, _ = strconv.Atoi(crdstr)
|
user.Created, _ = strconv.Atoi(crdstr)
|
||||||
@ -78,14 +78,14 @@ func userdata(username, usersonline, ops string) Userinfo {
|
|||||||
var user Userinfo
|
var user Userinfo
|
||||||
user.Name = username
|
user.Name = username
|
||||||
user.Created, _ = strconv.Atoi(crdstr)
|
user.Created, _ = strconv.Atoi(crdstr)
|
||||||
user.FullName = viper.GetString("FULL_NAME")
|
user.FullName = viper.GetString("fullname")
|
||||||
user.Capsule = viper.GetString("GEMINI_CAPSULE")
|
user.Capsule = viper.GetString("gemini")
|
||||||
user.Website = viper.GetString("WEBSITE")
|
user.Website = viper.GetString("website")
|
||||||
user.Desc = viper.GetString("DESCRIPTION")
|
user.Desc = viper.GetString("description")
|
||||||
user.Email = viper.GetString("EMAIL")
|
user.Email = viper.GetString("email")
|
||||||
user.Matrix = viper.GetString("MATRIX")
|
user.Matrix = viper.GetString("matrix")
|
||||||
user.Fediverse = viper.GetString("FEDIVERSE")
|
user.Fediverse = viper.GetString("fediverse")
|
||||||
user.Loc = viper.GetString("LOCATION")
|
user.Loc = viper.GetString("location")
|
||||||
if isop == true {
|
if isop == true {
|
||||||
user.Op = true
|
user.Op = true
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user