• http://ww.wp.xz.cn/extend/plugins/wp-addonchat/

    This plugin works in recent previous versions, but not in 3+…

    It receives the error “invalid username or password” when trying to login.

    I believe its the variables that are different in latest wordpress version?:

    <?php
    
    // Include the WordPress bootstrap
    include_once(dirname( __FILE__ ) . '/../../../wp-config.php');
    
    $using_ras = ( get_option( 'addonchat_use_ras' ) == 'yes' );
    
    // Start printing
    print "scras.version = 2.0\n";
    
    if( $using_ras ) {
    
    	// Decode the username and password
    	$username = urldecode( $_GET[ 'username' ] );
    	$password = urldecode( $_GET[ 'password' ] );
    
    	// See if it is possible for these credentials to login
    	$login = wp_login( $username, $password );
    	$user = get_userdatabylogin( $username );
    	if( $login ) { // The credentials are valid
    
    		if( $user->user_level >= 8 ) { // User is an administrator
    			print "user.usergroup.id = 2\n";
    			print "user.usergroup.can_login = 1\n";
    			print "user.usergroup.is_admin = 1\n";
    			print "user.usergroup.mark_as_guest = 0\n";
    			print "user.usergroup.post_delay = 0\n";
    			print "user.usergroup.allow_pm = 1\n";
    			print "user.usergroup.allow_room_create = 1\n";
    			print "user.usergroup.idle_kick = 0\n";
    			print "user.usergroup.can_kick = 1\n";
    			print "user.usergroup.can_grant = 1\n";
    			print "user.usergroup.can_cloack = 1\n";
    			print "user.usergroup.can_see_cloak = 1\n";
    			print "user.usergroup.can_ban = 1\n";
    			print "user.usergroup.can_enable_moderation = 1\n";
    			print "user.usergroup.can_system_speak = 1\n";
    			print "user.usergroup.can_silence = 1\n";
    			print "user.usergroup.allow_bbcode = 1\n";
    			print "user.usergroup.max_msg_length = 2048\n";
    			print "user.usergroup.filter_shout = 1\n";
    			print "user.usergroup.filter_word_replace = 0\n";
    			print "user.usergroup.can_launch_websites = 1\n";
    			print "user.uid = {$user->ID}\n"; 
    
    		} else { // non-admin but credentials are valid
    			print "user.usergroup.id = 1\n";
    			print "user.usergroup.can_login = 1\n";
    			print "user.usergroup.is_admin = 0\n";
    			print "user.usergroup.mark_as_guest = 0\n";
    			print "user.uid = {$user->ID}\n"; 
    
    		}
    
    	} else if( !$login && !$user && get_option( 'addonchat_enable_guest' ) == 'yes' ) {
    		// Login guest users if their username is not in the system (prevents the wrong
    		// password with valid username bug)
    		print "user.usergroup.id = 3\n";
    		print "user.usergroup.can_login = 1\n";
    		print "user.usergroup.mark_as_guest = 1\n";
    
    	} else {
    		print_cannot_login();
    
    	}
    
    } else {
    	print_cannot_login();
    
    }
    
    /**
     * Utility function to print data when credentials are not valid.
     *
     */
    function print_cannot_login() {
    	print "user.usergroup.id = 1000\n";
    	print "user.uid = -1\n";
    	print "user.usergroup.can_login = 0\n";
    }
    
    ?>

    I think its related to this section in particular:

    // Decode the username and password
    	$username = urldecode( $_GET[ 'username' ] );
    	$password = urldecode( $_GET[ 'password' ] );
    
    	// See if it is possible for these credentials to login
    	$login = wp_login( $username, $password );
    	$user = get_userdatabylogin( $username );
    	if( $login ) { // The credentials are valid

    Please advise!

The topic ‘User variables same in 3.0.1??? – AddonChat Plugin’ is closed to new replies.