Adding/removing user role on his login - based on non-Drupal table
Hello Chris and fellow Drupal users,
I've discovered your site yesterday while searching for my Drupal problem and the videos are awesome!
I have recently transferred a Flash/Perl card game with about 4000 users from using phpBB 3 as backend to Drupal 7 and it has worked well, but I'm hesitant to enable the forum - because some users at my old site had been freaking me out.
I would like to offer a forum at my site again, but only to the users who are playing long enough at my site and have a good enough reputation. Both informations (how many games played + reputation) are maintained by my Perl-game and are kept in non-Drupal tables (but in the same database as the Drupal tables). And I have created a Drupal user role of "trusted users".
I could modify 2 spots in my game - where the games are counted and where reputation is being changed - and then call 'insert/delete from users_roles where uid=?', but maybe there is a better spot in Drupal, where I could change a user role on his login?
I.e. a user visits my site, his reputation and number of games are checked by 2 quick select queries against my non-Drupal tables and then he's added (or removed - if his reputation has decreased) to the "trusted users" role and can write in forum + blog.