phpBB user allow comment
-
Hi there.. ive just made a really fast hack, but dont how secure it would be, what do you think ?
<?php
// My really fast phpBB-user–>WP comment hack
// Kent F?llman
// Email: [email protected]
// URL: https://www.northpower.nu/kent/define(“PHPBB_2_WP”, false);
define(“PHPBB_2_WP_USER”, false);if (isset($_COOKIE[‘phpbb2mysql_data’])) {
$session_id = isset($_COOKIE[‘phpbb2mysql_sid’]) ? $_COOKIE[‘phpbb2mysql_sid’] : ”;
$sessiondata = isset($_COOKIE[‘phpbb2mysql_data’]) ? unserialize(stripslashes($_COOKIE[‘phpbb2mysql_data’])) : array();// Just for testing…
// echo $session_id.”
“;
// echo $sessiondata[‘autologinid’].”
“;
// echo $sessiondata[‘userid’].”
“;$check_session = mysql_query(“SELECT u.*, s.* FROM phpbb_sessions s, phpbb_users u WHERE s.session_id = ‘”.$session_id.”‘ AND u.user_id = s.session_user_id”);
if (mysql_num_rows($check_session) > 0) {
$get_user_data = mysql_query(“SELECT user_id, username FROM phpbb_users WHERE user_id = ‘”.$sessiondata[‘userid’].”‘”);
while($the_user = mysql_fetch_array($get_user_data))
{
// echo $the_user[‘user_id’].” – “.$the_user[‘username’].”
“;$check_ban = mysql_query(“SELECT ban_userid FROM phpbb_banlist WHERE ban_userid = ‘”.$the_user[‘user_id’].”‘”);
if (mysql_num_rows($check_ban) < 1) {
define(“PHPBB_2_WP”, “I love you”);
define(“PHPBB_2_WP_USER”, $the_user[‘username’]);
}
}
}
}// Example use ?
if (PHPBB_2_WP == “I love you”) {
echo “<input type=\”hidden\” name=\”author\” id=\”author\” value=\””.PHPBB_2_WP_USER.”\” size=\”22\” tabindex=\”1\” />”;
echo “<small>”.PHPBB_2_WP_USER.”</small></label>”;
}
?>
- The topic ‘phpBB user allow comment’ is closed to new replies.