Browse Source

First user is super admin, rewrite active and admin fields

Vova Tkach 6 years ago
parent
commit
3079fb9329
1 changed files with 7 additions and 0 deletions
  1. 7 0
      modules/module_users.go

+ 7 - 0
modules/module_users.go

@@ -241,6 +241,13 @@ func (this *Modules) RegisterAction_UsersModify() *Action {
 			return
 			return
 		}
 		}
 
 
+		// First user always super admin
+		// Rewrite active and admin status
+		if pf_id == "1" {
+			pf_admin = "1"
+			pf_active = "1"
+		}
+
 		if pf_id == "0" {
 		if pf_id == "0" {
 			// Add new user
 			// Add new user
 			if pf_password == "" {
 			if pf_password == "" {