Unable to login to Admin Console, when web-server is installed on non-default port

7 views
Skip to first unread message

Alexander Obuhovich

unread,
Feb 2, 2011, 10:57:57 AM2/2/11
to In-Portal Bugs
I have In-Portal installation on 8080 port instead of 80 port, which is default.

Because of that I have to specify port each time I visit website like this: http://www.site-name.com:8080/admin/

Unfortunate effect of that is that $_SERVER['HTTP_HOST'] variable also contains that port, but since it's used for cookie setting no cookies are set at the end.


I propose to strip value of PORT constant from end of SERVER_NAME constant (which is set to $_SERVER['HTTP_HOST'] by default). It's also safe for IPv6 protocol.

Unfortunate side effect is inability to login to Admin Console, since it's uses cookie-based session.

Dmitry A.

unread,
Feb 2, 2011, 8:29:18 PM2/2/11
to in-port...@googlegroups.com
Hi Alex,


Thanks for noticing. I have some questions here.

I can specify the Port number in config.php or am I wrong here?


Are we going to have that side-effect if we are going to do what you have proposed (strip the port from server_name) or it will fix it?


DA

Alexander Obuhovich

unread,
Feb 3, 2011, 2:35:03 AM2/3/11
to in-port...@googlegroups.com
No, port number isn't specified in config.php, since http(-s) port number is only the way to reach proper webserver where In-Portal is located.


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Dmitry A.

unread,
Feb 3, 2011, 10:09:21 PM2/3/11
to in-port...@googlegroups.com
I guess, all the URL automatically build with correct port which comes from $_SERVER['HTTP_HOST'], OR it's a browser does for us?

I have no issues with removing PORT from SERVER_NAME constant! My main question is whether side-affect you described happens now or will take place once we implement the change.


Thanks for clarifications.

DA

Alexander Obuhovich

unread,
Feb 4, 2011, 2:44:03 AM2/4/11
to in-port...@googlegroups.com
It was build with correct port 4 years ago and no one has tested it ever since :)

Today $_SERVER['HTTP_PORT'] is not even available (based on PHP documentation and phpinfo I used).

Here is the patch that removes port (from SERVER_NAME constant), when present and adds it to PORT constant, when it's not default for the protocol being used (e.g. don't add :80, when http is used).




DA

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.
non_standart_http_port_issue.patch

Dmitry A.

unread,
Feb 4, 2011, 8:45:57 AM2/4/11
to in-port...@googlegroups.com
Hi Alex,

Yes it all makes sense now thank you for the patch

DA

Alexander Obuhovich

unread,
Feb 4, 2011, 9:38:37 AM2/4/11
to in-port...@googlegroups.com
Same problem detected in debugger. Patch attached.

Can you please create 1 task for both patches and test them.



DA

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

non_standart_http_port_issue_in_debugger.patch

Alexander Obuhovich

unread,
Feb 5, 2011, 9:27:01 AM2/5/11
to in-port...@googlegroups.com
Here is the task: http://tracker.in-portal.org/view.php?id=993

Ready for testing.

Dmitry A.

unread,
Mar 8, 2011, 7:18:00 PM3/8/11
to in-port...@googlegroups.com
Tested good!

Ready for commit.


DA
Reply all
Reply to author
Forward
0 new messages