Hi everyone,
I have tried everything I know to get the bypass to work but I am really having a hard time. What I usually write is this : http://www.mydomain.com/mydrupal/myforum/ucp.php?bypass=true. That brings me to the phpbb login page but as soon as I am done entering my username and password and pressing LOGIN, I am sent back to drupal. What I have in my .htaccess for the login is this :
RewriteCond %{QUERY_STRING} ^mode=login(.*)$
RewriteCond %{QUERY_STRING} !^bypass=true(.*)$
RewriteRule ^ucp.php(.*)$ ../user/login [L]
Please note that the RewriteRule that comes with the package (RewriteRule ^ucp.php(.*)$ ../phpbb/login [L]) does not work for me. I don't see how this can work anyways since if we don't have bypass, we want DRUPAL to take us to the login page.
Is there a way with the .htaccess language to do an AND? Or to look if we dont have bypass to move on to the next step in the login process?? I don't see how this can work. I tried this on both a linux and windows system and its not really because of mistake in the way I write my paths.
The only way I have found to really bypass this is by uncommenting the rewritecond for the login that is the only true BYPASS I have managed to get working.
If some of you experienced similar problems and found solutions, please let me know because I am really out of ideas.
Thanks
Comments
I think I have explained
I think I have explained this already:
It wont work when you go to the ucp.php, because that file generate a
<
form> that posts to a url WITHOUT bypass=true.
You click submit -> webbrowser requests POST to url without bypass=true -> webserver answers : redirect /user/login
You HAVE to use /phpbb/bypass , and enter the correct username / password on the first attempt. I agree this could be improved upon, maybe using a referer check, but that's not reliable either.
Remove the .htaccess file, ensure your username / password is correct, enable .htaccess file, go back to /phpbb/bypass and try again.
Tried this already
Unless I missed a step in the installation process, using www.mydomain.com/phpbb/bypass (where phpbb is my forum) doesn't work. In my case that would be www.mydomain.com/drupal/phpbb/bypass. This will, of course, report that the pase does not exist. So either I'm missing something that I didnt install or I didnt do something somewhere.
I knew about the problem with the LOGIN button generating mode=login which is the reason taking me back to drupal. I understand the theory but, the practice doesn't work. So I must be missing something. If I have ../phpbb/bypass, those 2 dots take me back to the main drupal site so, all I can think of is that I need to create a node? I don't know, I am just speculating since obviously I am out of solutions...
This is weird, I could swear
This is weird, I could swear I replied to this post yesterday, but anyway:
You cannot name your phpBB installation directory 'phpbb', just like if you create a directory named "user" and then put a file called "login" into it, all of Drupal's login functionality will seize to function.
I strongly encourage you to follow the installation instructions to the letter if you run into problems.
did follow the instructions
Hi,
Just to make sure I did everything as specified in the instructions, I went to check it up. There is nothing that I havent done. Neither I have named my directory for the forums PHPBB. Its named FORUM. In your instruction, you access a diagnostic page here : http://drupal.i1media.no/phpbb/diagnostic. So while my installation is http://mydomain.org/phpbb/diagnostic wont work since I dont have a phpbb folder which means I don't have the diagnostic folder, assuming that its a folder and that you are loading index.php as a default from your webserver's config.
Unless I am blind, I haven't seen anywhere in the instructions where we should create those 2 directories for instance and neither are the files provided. All that to say, this is related to the same problem I have with the login/bypass. Where did you get those files from? I'll try what you are suggesting, will create a phpbb directory with a login file into it that wont do anything except being a blank file and see what happens. This way I will be redirected to nothing. So by pressing login from the PHPBB's login page then, I assume it will process the login and try to send me to something that wont do anything, hence, the phpbb/login...
Anyways, I assure you, I followed the instructions to the letter but NOWHERE did you mention the creation of the directories. Even if it might seem obvious just by saying to access those folders, one would think that prior to that there must have been something I have done to create those directories or else it needs to be specified. Again, I might be blind.. And where did you get the diagnostics from? You must have built that yourself?
Regards
As I suspected
I have done what you asked for by as I suspected it would not work just because I am asking to redirect to ../phpbb/login and there is nothing there. Something is missing. If not, shed some light because I really don't know how you have done it.
Yeah, we're really not
Yeah, we're really not connecting over this one. I'll try to explain how Drupal functions, and that should explain why you MUST NOT have a directory named phpbb nor any files called "diagnostic" or "login.
Start by looking into /.htaccess. NOTE that this file ONLY applies if you have Clean URLs enabled, as I have stated explicitly as a prerequisite for using the module.
Regardless, in the .htaccess file you will find
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Ok, so the first two lines are conditions for the third. I.e. if the first or second line are false, then the RewriteRule should be ignored.
Now the first RewriteCond checks that {REQUEST_FILENAME} is NOT a file.
The second RewriteCond checks that {REQUEST_FILENAME} is NOT a directory
The third one, provided the request is not for a valid file or directory, says turn "path" into index.php?=path
I.e. , if you ask for phpbb/diagnostic, and phpbb/diagnostic is not a valid file or directory, then the request is transformed into
index.php?=phpbb/diagnostic
Now the phpbb module, just like almost every other module in Drupal, registers paths. When the phpbb module is loaded, on running index.php, Drupal learns that the phpbb_view() function exists. After that point, if there is a request for phpbb/(.*) , Drupal will forward it to the phpbb_view() function.
Inside phpbb.module there is logic to detect requests for phpbb/login, phpbb/diagnostic and phpbb/bypass, and the correct page will be returned depending on what you asked for.
Based on what you wrote above I assumed you had installed phpBB into a directory named "phpbb", in which cased phpBB's .htaccess file would apply and nothing would ever get routed to Drupal's index.php, hence it would not find "bypass" or "login".
Thanks for the explanation
Hi again,
I tested my clear URL and it works if I do admin/settings for example. This is one of the tests they have you do from one of the drupal's tutorials : http://drupal.org/node/15365. It seems that the problem is somewhere else. I tried putting traces in phpbb_view and its never called. Everytime I try to access one of the functions you setted, it doesn't work anymore. Mind you, this is drupal 6 so, it is possible that something is missing. Have you tried a site with Drupal 6 and PHPBB3 with the changes I have made? Would be nice for someone else to confirm it this works or if I am doing something wrong. Then again, if I am, the test suggested in the TUTORIAL wouldn't work either.
BTW : It seems that even though I thought I did everything right, I was missing the clear URL. Must be very tired from overtime so my apologies. In the end, looks like the changes I made might have broken something or something else is missing that I need to do with drupal 6..
Please be very specific if
Please be very specific if you're using something other than the download from drupal.i1media. Not even once did you mention this is in Drupal 6.x, and I'm sure I've wasted more than an hour on this now.
To upgrade to Drupal 6.x you need to update the module according to http://drupal.org/node/114774
That's a lot of steps, not all apply, but stuff like the menu system (= path registration) is certainly broken.
Fixed
Hello again,
again sorry for that. Its hard to be specific when you think you have all the pieces of the puzzle. But then again, thats why we are a community and help each other and make things move forward. All this has some good after all. The code that I have submitted to you had some bugs. The hook menu needs to be modified with the following code :
Mind you, the access callback allows everyone to access this. In the future, user_access will need to be defined if you don't want everyone to access this, like the diagnostic page. So you would have this instead :
Then you need to define your access, etc.
Anyways, with 'access callback' => TRUE, it fixes the problem.
Thanks again.. I know it can be frustrating to lose some time but, it has to be expected since not everyone is at the same level. I am a coder, and while I can code very well in C++, understand PHP is easy, that doesn'T mean I'll know everything about DRUPAL or web stuff.. Takes time and you can expect you will run into people with even less knowledge. But take a look at it this way, things are moving forward and the time needed to have an official phpbb3 module for Drupal 6 will not be as much as it would have been before.
Cheers.