WordPress.org

Ready to get started?Download WordPress

Forums

phpBB user allow comment (2 posts)

  1. benzin
    Member
    Posted 7 years ago #

    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: tuxrulez@gmail.com
    // URL: http://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>";
    }
    ?>

  2. benzin
    Member
    Posted 7 years ago #

    Im not sure all code followed..

    You can grab it here: http://www.northpower.nu/kent/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags