WP log in/out plugin question
-
I need a plug in that can check a user account against a database to see if a user is allowed to still log in based on criteria outside WordPress. I tried writing it this way, but it doesn’t work. Any suggestions?
function testTransaction () { global $current_user; get_currentuserinfo(); //if is admin if ( $current_user->user_level >= 4 ) { return; } else { $c = mysql_connect(/*login stuff*/); mysql_select_db(/*blah blah*/,$c); $query = "query"; $result = mysql_query($query,$c) or die (mysql_error($c)); $row = mysql_fetch_assoc($result); //Testing code left out here// if(test) { return; } else { wp_logout(); return; } } } add_action('wp_head', 'testTransaction');Thing is when I run this nothing happens. No test is run, and everyone logs in fine, regardless of whether or not they should pass the test. Thoughts?
The topic ‘WP log in/out plugin question’ is closed to new replies.