matthusby / brewcompetitiononlineentry

Automatically exported from code.google.com/p/brewcompetitiononlineentry
0 stars 0 forks source link

Calls to file_exists fail when using a subdomain #400

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure a subdomain on your server
2. Install BCOEM in the subdomain's folder
3. Access BCOE&M via the subdomain.
4. Upload and set images for competition and sponsor logos

What is the expected output? What do you see instead?
Expect to see proper logos displayed. Instead, no competition logo is display 
and "no image available" image is displayed for sponsors.

What version of the product are you using? On what operating system?
V1.3.0.4 running on a linux server hosted by godaddy.

Please provide any additional information below.

Because I am using a subdomain to access the software, 
$_SERVER['DOCUMENT_ROOT'] does not return the correct path for the subdomain's 
folder. As such, all calls to file_exists() fail.  Instead, 
$_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] needs to be used. 

A possible solution would be to put a flag in the config file to indicate that 
a subdomain is being used so that SUBDOMAIN_SERVER_ROOT would be used in that 
case instead of SERVER_ROOT.

Note that this problem also affects update.php in that it does not find an 
existing update file.

Also note that this issue is slightly different from Issue 373 due to the fact 
that when a subdomain is being used, the sub-directory that contains BCOE&M is 
not used when accessing files via subdomain.domain.com so the sub_directory 
value in config.php must be set to "".

Original issue reported on code.google.com by almontebrew on 4 Apr 2014 at 1:18