-

question about 'Force https ACP' v1.0.3

General phpBB3 Discussion
Forum rules
Support is not provided in this forum. Support topics will be locked on sight.

question about 'Force https ACP' v1.0.3

Postby eko4v » Fri Oct 08, 2010 10:57 am

Dear EXreaction,

First off, thanks for this great MOD, the mod v1.0.3 works great in my localhost testing forum under 3.0.7pl1.

However, I found that when I use 'ACP logout' or 'admin logout' the URL connection is still staying with HTTPS, so I replaced the code of 'U_LOGOUT' and 'U_ADM_LOGOUT' with the code below,
Code: Select all
//      'U_LOGOUT'         => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
//      'U_ADM_LOGOUT'         => append_sid("{$phpbb_admin_path}index.$phpEx", 'action=admlogout'),
      'U_LOGOUT'         => append_sid(str_replace('https://', 'http://', generate_board_url()) . "/ucp.$phpEx", 'mode=logout'),
      'U_ADM_LOGOUT'         => append_sid(str_replace('https://', 'http://', generate_board_url()) . "/{$phpbb_admin_path}index.$phpEx", 'action=admlogout'),

After then I use another local forum built with 3.0.7pl1 without any mod to make a comparing test and I found the behavior of 'ACP logout' of my code is incorrect a bit. As after 'ACP logout', I can click the link of 'Administration Control Panel' at the page bottom to get into ACP panel without another password input for self-authorization.

Since I am just an amateur programmer of C/C++ and my PHP capability is still very poor, please advice the correct code for the above change.

Btw, once after using 'Force https ACP', if the web server can not handle SSL request then besides stare at 4o4 page, can you please suggest a way to handle it? I would like to try to code that solution as my PHP practicing homework myself. :D

Thanks in advance for any help,

Hunt Chang
eko4v
Member
Member
 
Posts: 2
Joined: Fri Oct 08, 2010 10:50 am
Blog: View Blog (0)

Re: question about 'Force https ACP' v1.0.3

Postby EXreaction » Fri Oct 08, 2010 6:45 pm

Maybe you need to put str_replace on the outside of append_sid?

If the server cannot handle SSL then there is nothing you can do but setup the server to allow SSL.
Grateful for the mods I've built? Then donate!
User avatar
EXreaction
Site Owner
Site Owner
 
Posts: 4988
Joined: Wed Jun 28, 2006 5:08 pm
Blog: View Blog (53)

Re: question about 'Force https ACP' v1.0.3

Postby eko4v » Sat Oct 09, 2010 1:10 am

Dear Exreaction,

Thanks for your fast reply. I tried your suggestion but it did not work.

After then, I managed to dig out the string output of "$template->_rootref['U_ADM_LOGOUT']" and I found the problem. So I have changed the code as below,
Code: Select all
      'U_ADM_LOGOUT'         => append_sid(str_replace('https://', 'http://', generate_board_url()) . "/adm/index.$phpEx", 'action=admlogout'),

However, after a few further test, I found the change on 'U_ADM_LOGOUT' did not bring me back to HTTP connection that I mean to go. So I did some more study and trace, finally I reached my goal as below,

1. First leave the code of 'U_ADM_LOGOUT' untouched as its original:
Code: Select all
      'U_ADM_LOGOUT'         => append_sid("{$phpbb_admin_path}index.$phpEx", 'action=admlogout'),

2. Open the file root/includes/acp/acp_main.php, find the code "if ($action === 'admlogout')"
inside it make a replacement as below,
Code: Select all
//            $redirect_url = append_sid("{$phpbb_root_path}index.$phpEx");
            $redirect_url = append_sid(str_replace('https://', 'http://', generate_board_url()) . "/index.$phpEx");

Last, as I told I am still quite new on PHP and phpBB. It would be very appreciated If you can help to check and polish the code I did. Thnaks again in advance,

Hunt :mrgreen:
eko4v
Member
Member
 
Posts: 2
Joined: Fri Oct 08, 2010 10:50 am
Blog: View Blog (0)

Re: question about 'Force https ACP' v1.0.3

Postby EXreaction » Sat Oct 09, 2010 4:26 pm

That looks good :)
Grateful for the mods I've built? Then donate!
User avatar
EXreaction
Site Owner
Site Owner
 
Posts: 4988
Joined: Wed Jun 28, 2006 5:08 pm
Blog: View Blog (53)


Return to phpBB3



Who is online

Users browsing this forum: No registered users and 1 guest

cron