Version Check Version Check
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Version Check

Started by tanfwc, August 18, 2004, 12:43:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tanfwc

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 ;)
tanfwc
[ + ] My HomePage
[ + ] GuestBook
[ + ] Photo Gallery
[ + ] Free Image Hosting

Joachim Müller

post a screenshot.

GauGau

tanfwc

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg46.exs.cx%2Fimg46%2F8884%2Fversioncheck.png&hash=27bf20e7ebdc7d06d186dbf1dd6c31bb098529e7)
tanfwc
[ + ] My HomePage
[ + ] GuestBook
[ + ] Photo Gallery
[ + ] Free Image Hosting

Nibbler

#3
Ouch, version check does not like coppermine installs to the root of the site. I only tested it in a subfolder.  :-[

$dir = ''; // this is the place to start browsing

got it working for me though.

tanfwc

Ok. I will play around with those coding when i get home. Thank you for the advice.
tanfwc
[ + ] My HomePage
[ + ] GuestBook
[ + ] Photo Gallery
[ + ] Free Image Hosting

Joachim Müller

@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

Nibbler

Having it set to
$dir = ''; // this is the place to start browsing
works for me in a webroot, subdomain, and subfolder. I'd suggest simply setting it to that unless that causes other issues.

Joachim Müller

I added this as an option, please check out the devel version.

Joachim

Nibbler

I already tried the dev version (v1.11), it doesn't work.

Joachim Müller

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

Nibbler

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

$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.

Joachim Müller

k, I got you wrong then. I changed // 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// 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

Nibbler


Joachim Müller

Does this fix all issues?

Joachim

groentebroer

I have the same problem, after I updated from 1.4.3 to 1.4.8 .

The issue is that:


// 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:


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

Joachim Müller

Quote from: 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 .
Then you shouldn't have posted on the cpg1.3.x board. Locking.