|
|
@@ -27,6 +27,7 @@ type User struct { // User
|
|
|
Username string
|
|
|
Password string
|
|
|
Mail string
|
|
|
+ Admin bool
|
|
|
}
|
|
|
|
|
|
type pageParams struct{
|
|
|
@@ -63,6 +64,11 @@ func (user *User) Login(username string, password string) (string, error) {
|
|
|
user.ID, _ = strconv.Atoi(row[0])
|
|
|
user.Username = row[1]
|
|
|
user.Mail = row[3]
|
|
|
+ user.Admin, err = strconv.ParseBool(row[4])
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ fmt.Printf("Error: ", err.Error())
|
|
|
+ }
|
|
|
|
|
|
*Users = append(*Users, *user) // store user in logged-in-users list
|
|
|
|