Browse Source

Additional check for login action

Vova Tkach 6 years ago
parent
commit
4b96085418
1 changed files with 5 additions and 0 deletions
  1. 5 0
      engine/actions/action_signin.go

+ 5 - 0
engine/actions/action_signin.go

@@ -33,6 +33,11 @@ func (this *Action) Action_signin() {
 		return
 	}
 
+	if this.wrapper.Session.GetIntDef("UserId", 0) > 0 {
+		this.msg_error(`You already logined`)
+		return
+	}
+
 	var user_id int
 	err := this.db.QueryRow(
 		"SELECT `id` FROM `users` WHERE `email` = ? and `password` = MD5(?) LIMIT 1;",