forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: tanfwc on August 18, 2004, 12:43:23 pm

Title: Version Check
Post by: tanfwc on August 18, 2004, 12:43:23 pm
It seem that version check file has some problem. It can't defined the ocrrect file after i make sure that the file on the server is up to date and cpg server is online too. Please check and feedback ;)
Title: Re: Version Check
Post by: Joachim Müller on August 19, 2004, 08:50:40 am
post a screenshot.

GauGau
Title: Re: Version Check
Post by: tanfwc on August 19, 2004, 03:49:54 pm
(http://img46.exs.cx/img46/8884/versioncheck.png)
Title: Re: Version Check
Post by: Nibbler on August 19, 2004, 10:30:03 pm
Ouch, version check does not like coppermine installs to the root of the site. I only tested it in a subfolder.  :-[

Code: [Select]
$dir = ''; // this is the place to start browsing
got it working for me though.
Title: Re: Version Check
Post by: tanfwc on August 20, 2004, 07:09:14 am
Ok. I will play around with those coding when i get home. Thank you for the advice.
Title: Re: Version Check
Post by: Joachim Müller on August 20, 2004, 09:03:34 am
@Nibbler: will look into this as well. Do you have a good idea how to efficiently check if coppermine is installed in the webroot? The only thing that comes to mind is checking the url, but this might cause problems, since urls are not directly related to file structure (e.g. when having subdomains that are actually sub-folders). Checking if php can access files one level up the current dir won't work as well, since the webroot doesn't necesarily have to be the top level folder (in fact, good webhosts will let you have one level up to be able to hide files from being accessible over the web).

GauGau
Title: Re: Version Check
Post by: Nibbler on August 25, 2004, 07:34:22 pm
Having it set to
Code: [Select]
$dir = ''; // this is the place to start browsingworks for me in a webroot, subdomain, and subfolder. I'd suggest simply setting it to that unless that causes other issues.
Title: Re: Version Check
Post by: Joachim Müller on August 25, 2004, 09:12:39 pm
I added this as an option, please check out the devel version.

Joachim
Title: Re: Version Check
Post by: Nibbler on August 25, 2004, 09:22:30 pm
I already tried the dev version (v1.11), it doesn't work.
Title: Re: Version Check
Post by: Joachim Müller on August 25, 2004, 11:09:36 pm
hm, as I'm webhosted with the webroot not being my doc root I can not test this easily. Could you look into this a bit more, or PM me FTP and coppermine admin access data to some webspace with a coppermine install in the webroot? Thanks.

GauGau
Title: Re: Version Check
Post by: Nibbler on August 26, 2004, 01:50:41 am
OK, if you don't like my suggested fix, here is the reason why the current dev version fails :

We tick the special webroot box, sending us to this bit

Code: [Select]
$dir = cpg_get_coppermine_path().'/'; // this is the place to start browsing
cpg_get_coppermine_path returns an empty string

so we have $dir = '/';

versioncheck looks for file at the absolute path '/file.php' - not there, (it is really at /home/nibbler2/public_html/file.php)

if we ignore the $dir by making it an empty string,

versioncheck looks for: 'file.php'  - *in the current directory*, and finds it.

Everything is fine.

so the fix is to set the $dir to '' or phase it out completely.
Title: Re: Version Check
Post by: Joachim Müller on August 26, 2004, 06:47:17 am
k, I got you wrong then. I changed
Code: [Select]
// step three: go through all files that exist in the repository and check if they're on the webserver as well
if ($webroot == 1) {
$dir = cpg_get_coppermine_path().'/'; // this is the place to start browsing
} else {
$dir = '../'.cpg_get_coppermine_path().'/'; // this is the place to start browsing
}
to
Code: [Select]
// step three: go through all files that exist in the repository and check if they're on the webserver as well
if ($webroot == 1) {
$dir = ''; // this is the place to start browsing for root folders
} else {
$dir = '../'.cpg_get_coppermine_path().'/'; // this is the place to start browsing
}
(this is what I committed to devel. Please confirm.

GauGau
Title: Re: Version Check
Post by: Nibbler on August 26, 2004, 05:21:33 pm
Confirmed.
Title: Re: Version Check
Post by: Joachim Müller on August 26, 2004, 09:48:35 pm
Does this fix all issues?

Joachim
Title: Re: Version Check
Post by: groentebroer on August 14, 2006, 08:44:38 pm
I have the same problem, after I updated from 1.4.3 to 1.4.8 .

The issue is that:

Code: [Select]
// step three: go through all files that exist in the repository and check if they're on the webserver as well
if ($webroot == 1) {
$dir = ''; // this is the place to start browsing for root folders
} else {
$dir = '../'.cpg_get_coppermine_path().'/'; // this is the place to start browsing
}

Does not work for my installation.
I installed coppermine directly in the webroot. When running versioncheck.php the "$dir" variable looks in "..//" as a result of $webroot not being "1".

$webroot is 0 as a result of:

Code: [Select]
if (!$_REQUEST['changes']) { // set default settings for options
.....
$webroot = 0;
.....

When it looks for files in "..//" it will not find anything correctly and everything turns red.
Setting the $dir hard to './' works and everything turns green. There is probably something wrong with the path detection, or is this a configuration issue?

Gijs
Title: Re: Version Check
Post by: Joachim Müller on August 15, 2006, 12:30:16 am
I have the same problem, after I updated from 1.4.3 to 1.4.8 .
Then you shouldn't have posted on the cpg1.3.x board. Locking.