• maxminzer

    (@maxminzer)


    Hey, so I have my PHPBB forum as a link on one of the pages of my WordPress based website.
    And use WP-Members and PHPBB Single Sign On plugins to connect WP and PHPBB users.
    Updated to WordPress 3.1 today (I don’t know if that’s the reason – but most probably).

    Now noone can login or register on PHPBB forum.
    Whenever I try to access https://teensatsalvation.com/forum/ucp.php?mode=login or https://teensatsalvation.com/forum/ucp.php?mode=register I get a window saying “Oops! This link appears to be broken.”

    However, I can login on WP side and then access the forum (logged in automatically to the forum). But if I click logout on PHPBB forum – same problem happens.

    There seems to be something wrong going on with ucp.php

    Please help

Viewing 15 replies - 16 through 30 (of 47 total)
  • Thread Starter maxminzer

    (@maxminzer)

    I did the above. It’s not plugins

    Thread Starter maxminzer

    (@maxminzer)

    Had a working WP, deactivated plugins, upgraded WP = can’t login or register

    Still need help.

    szawil

    (@szawil)

    My code is failing to line 18 of ucp.php (ucp.php is a phpBB file) at any time the ucp.php file is accessed:

    require($phpbb_root_path . 'includes/functions_user.' . $phpEx);

    I’m using Netbeans to debug. When I “step into” line 18 of ucp.php, it instantly jumps to function __destruct() of wp-db.php. The path and filename appears to be correct. Line 17 of ucp.php is:

    require($phpbb_root_path . 'common.' . $phpEx);

    which runs like a normal require statement. If I comment out line 18 of ucp.php, I can access the log-in page, and it works fine. I can also access the register page, but it fails when I go to register a user, as it requires functions that are part of functions_user.php.

    What could be causing wordpress to go jump to the __destruct() function when using the require statement?

    Thanks for any help!

    szawil

    (@szawil)

    Maxminzer, I may have found the solution.

    There appears to be a conflict for the name of the function ‘ validate_username’. It is a function that exists in both the latest versions of phpBB and WordPress 3.1. What I did is simply rename the function in phpBB.

    There were 3 files, and 3 total lines of code that I needed to edit, in your phpBB directory.

    First, in the /includes directory, functions_user.php contains the definition for ‘validate_username’. Find the following line of code:

    function validate_username($username, $allowed_username = false)

    and change it to:

    function validate_username_phpbb($username, $allowed_username = false)

    This will rename the function. Next, you have to change any place in your phpBB code that references this function. For me, this was posting.php and posting.orig.php (found in the root directory of phpBB).

    Search for the following line of code in both posting.php and posting.orig.php:

    if (($result = validate_username($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false)

    and replace it with:

    if (($result = validate_username_phpbb($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false)

    Hopefully that works for you!

    Thread Starter maxminzer

    (@maxminzer)

    THANK YOU SOOOOO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!

    It fixed the problem!

    I didn’t have posting.orig.php but that doesn’t matter I guess.

    I really appreciate your help!

    Next time I’ll be backing up my stuff, updating WP, then looking for solutions, while older version will be restored and working
    ??

    Chad Butler

    (@cbutlerjr)

    I have been following the thread, but I didn’t really have anything to offer, since I don’t use phpBB, and I couldn’t really see where it would have been WP-Members. Glad to hear this is resolved!

    Thread Starter maxminzer

    (@maxminzer)

    Yep – it wasn’t plugins as PHPBB and WP “experts” suggested

    szawil

    (@szawil)

    Glad that worked!

    I’m having one further minor issue. When I go to log-out of phpBB, I am receiving this message in Firefox:

    “Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”

    or this message in Chrome:

    “The web page … has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.”

    It ends up logging out successfully, but I’d appreciate help or suggestions from anybody with knowledge of these error messages. Thanks!

    One more comment regarding szawil’s helpful fix above:

    I was having issues allowing users to register on the phpbb side as it was trying to call wordpress’s validate_username function. To fix this, you have to edit the includes/ucp_register.php file, and change the line
    array('username', '')),
    to
    array('username_phpbb', '')),

    It was line 203 for my install (phpbb 3.0.8)

    szawil

    (@szawil)

    jwhatt,

    I seem to be having the same problem. Unfortunately, that fix didn’t work for me.

    I want to make sure I’m making the fix in the right place. Is this where you made the change? This begins on around line 200 of ucp_register.php for me.

    if ($submit)
    		{
    			$error = validate_data($data, array(
    				'username'			=> array(
    					array('string', false, $config['min_name_chars'], $config['max_name_chars']),
    					array('username', '')),
    				'new_password'		=> array(
    					array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
    					array('password')),
    				'password_confirm'	=> array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
    				'email'				=> array(
    					array('string', false, 6, 60),
    					array('email')),
    				'email_confirm'		=> array('string', false, 6, 60),
    				'tz'				=> array('num', false, -14, 14),
    				'lang'				=> array('match', false, '#^[a-z_\-]{2,}$#i'),
    			));

    Was it only in one line of code?

    szawil

    (@szawil)

    In fact, I get this error message in my error log, regardless of whether it is ‘username’ or ‘username_phpbb’

    PHP Fatal error: Call to undefined function validate_data() in /var/www/html/site/forum/includes/ucp/ucp_register.php on line 202, referer: https://www.site.com/forum/ucp.php?mode=register

    Is this the same error message you were getting before your fix jwhyatt?

    Thanks!

    szawil

    (@szawil)

    I think your fix worked! Thanks…

    For some reason, my ucp_register.php file was missing an include statement for functions_user.php.

    Thread Starter maxminzer

    (@maxminzer)

    Hey, I just found out that there is another piece to the problem – users can’t register (login works fine for me as well as logout).

    The go to register, write down their username, email, password, captcha – click Submit and same form with info appears(without captcha this time) with red color “1” on top and submit and it does nothing.

    Any help on that?

    Thread Starter maxminzer

    (@maxminzer)

    <form name="register" method="post" action="./ucp.php?mode=register">
    
    <table class="tablebg" width="100%" cellspacing="1">
    <tr>
    	<th colspan="2" valign="middle">Registration</th>
    </tr>
    
    	<tr>
    		<td class="row3" colspan="2" align="center"><span class="gensmall error">1</span></td>
    	</tr>
    
    <tr>
    	<td class="row1" width="38%"><b class="genmed">Username: </b><br /><span class="gensmall">Length must be between 3 and 20 characters.</span></td>
    	<td class="row2"><input class="post" type="text" name="username" size="25" value="Testing2" /></td>
    </tr>
    ...and so on

    Maxminzer,

    I think I experienced the same problem… for some reason, I needed to put the following line of code in many of the files in my /phpBB/includes/ucp directory.

    For example, what might solve your problem is to edit the /phpBB/includes/ucp/ucp_register.php file.

    Somewhere near the beginning of the function main($id, $mode), try inserting the following line of code:

    include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

    If that works, there are probably several other files you need to insert this code into to get your UCP panel functioning correctly.

Viewing 15 replies - 16 through 30 (of 47 total)
  • The topic ‘Can't login or register to forum’ is closed to new replies.