Added full support for groups managment

Bugfix in users.php: wrong sql query syntax