Warnings and bans: how to do it?

Create a DB for your Warning and Ban-System.

-warnings
-bans
-user-ID
-expiration-date of ban

Generate a function in your login, which will check for example for setted bans and their expiration-date for every single user.

If an an active ban exist for the user who tries to log-in, the login automaticaly denies the login.

Perhaps you also take a look here, and read LMayer suggestion, could also be helpful in your case.