Advanced search  

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]

Pages: 1 [2] 3   Go Down

Author Topic: Browsable interface for batch add files  (Read 20124 times)

0 Members and 1 Guest are viewing this topic.

tutone

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 64
Re: Browsable interface for batch add files
« Reply #20 on: May 29, 2005, 08:50:37 am »

kegobeer,

that didn't work either.  I made the change in functions.inc.php that you said... still says "There are no folders inside the "albums" folder yet. Make sure to create at least one custom folder within "albums" folder and ftp-upload your files there. You mustn't upload to the "userpics" nor "edit" folders, they are reserved for http uploads and internal purposes." But it works fine in non browsable mode.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Browsable interface for batch add files
« Reply #21 on: May 29, 2005, 10:06:19 am »

The function cpg_get_webroot_path()  was introduced by me as a cheap workaround to catch the webroot path on as many server setups as possible. I tested in on all servers I could (which are not that many though ;)). The function is still "experimental". Feel free to add whatever you could come up with that will improve the probability to catch the correct path even on exocit server setups.
This issue is tricky however: I had a look into many other openSource apps that need to have the webroot path: they all have some way of workaround and fallback option that should catch the path for most server setups, but not all.
In the particular case of tutone I recommend just switching to the "traditional" batch-add interface that displays all folders on one screen at once, i.e. skip the "browsable batch-add" interface feature.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #22 on: May 29, 2005, 01:52:18 pm »

Hmm.  I'll also do some looking and playing around with this.  Joachim, I also noticed when I "fixed" my browsasble interface problem that limits were ignored.  Started at /albums/, navigated one deep to /albums/uploads/, navigated back to /albums/, and I get the go up link.  I could then browse my entire root directory.

What do you think about a link tree type display - the initial browse will grab all valid directories and display them as clickable links.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Browsable interface for batch add files
« Reply #23 on: May 29, 2005, 04:53:03 pm »

link tree would be another option imo that should rather replace the first screen of the "traditional" batch-add interface in the future. The reason why I created the browsable batch-add interface was that I didn't want all sub-folders to be expanded in the first place. If you could come up with a good mixture (i.e. a linktree where only the first level is displayed by default and all sub-level are only visisble if the particular branch is clicked; similar to Windows Explorer) this would be a big plus imo. I'm not sure though if this should go into cpg1.4, as it would be an additional feature, not a fix for an existing one.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #24 on: May 30, 2005, 03:52:29 am »

I was thinking more of a left/right window division, with a linktree in the left pane, and when a link is clicked, the files will display in the right pane.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

tutone

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 64
Re: Browsable interface for batch add files
« Reply #25 on: May 30, 2005, 09:09:07 pm »

GauGau,

Are you implying that there is something incompatible with my server?  It appears that some people have had this same problem... is this a feature that when released will work for some and not for others?  Let me know if you need more info or if it is not worth pursuing any further.

Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #26 on: May 30, 2005, 09:31:12 pm »

@tutone:  Not all servers are the same - depending on how an administrator wants to set up the server is how that server will function and what $_SERVER variables will be available.  Writing an interface that works with all servers is hard, and quite often a particular setup will not work with the code.  We will do our best to achieve the most compatibility, but there is always a chance that someone won't be able to use the browsable interface.

Let's see if this works for you.  Make a new php file called testroot.php with this in it:

Code: [Select]
<?php
function cpg_get_webroot_path() {
    
$rootpath __FILE__;
    
$strloc strrpos($rootpath'/include/');
    return 
substr($rootpath0$strloc-8);
}
echo 
cpg_get_webroot_path();
?>

Put it in your Coppermine's /include/ directory.  Execute the file and post your results.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #27 on: May 31, 2005, 12:03:18 am »

The code in my previous post is incorrect.  Use this instead:

Code: [Select]
<?php
// Let's see what's enabled!

$path= (__FILE__);
echo 
$path.'<br>';

if (
eregi("win",getenv('OS'))) {
  
$schstr chr(92);
} else {
  
$schstr '/';
}

$loc strrpos($path$schstr);

if (
$loc 0) {
  
$testpath substr($path0$loc-8);
  echo 
$testpath;
}

?>
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

tutone

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 64
Re: Browsable interface for batch add files
« Reply #28 on: May 31, 2005, 03:57:33 am »

kegobeer,

I totally understand.  I am just trying to be helpful and test it out and report back to you guys.  I just wanted to know if you guys wanted me to try anything else.  I was not implying, nor was I intending anything negative.  I have not seen the browsable interface... i am actually happy with the current meathod.  But if i can be of help to you guys to improve the code i am willing to be of assistance (especially since i am out of law school for the summer).  If my setup just won't work (or would take to much work) please let me know... it is by no means a big deal.

I put the code you indicated in a file called testroot.php

testroot.php has the following in it:

Quote
<?php
// Let's see what's enabled!

$path= (__FILE__);
echo $path.'<br>';

if (eregi("win",getenv('OS'))) {
  $schstr = chr(92);
} else {
  $schstr = '/';
}

$loc = strrpos($path, $schstr);

if ($loc > 0) {
  $testpath = substr($path, 0, $loc-8);
  echo $testpath;
}

?>

The following appeared when i browsed to the file:

/home/content/w/e/b/website/html/portal/gallery/include/testroot.php
/home/content/w/e/b/website/html/portal/gallery


I have a hunch you were looking for something more (so i must have done something wrong).  Either way... let me know what you would like me to do next. Even if it is to take a flying leep or stick something somewhere...  ;)
« Last Edit: July 28, 2005, 03:21:13 am by tutone »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Browsable interface for batch add files
« Reply #29 on: May 31, 2005, 05:04:08 am »

@tutone: don't get me wrong, I appreciate your readiness to help and improve coppermine. What kegobeer said is right: server setups differ, that's all. The "traditional" batch-add uses relative paths, that's why it works on all server setup. The browsable interface has the option to go down in the tree, but to go up as well. That's why we have to take care that the user doesn't go up the tree too much. To do this, we have to determine the webroot. This is hard to accomplish, as there is no server var that reliably holds this piece of information on all setups. Windows servers cause most troubles in this aspect: the server sided vars are nearly the same on most Lunix systems, but somehow the IIS versions as well as the apache installs on Windows differ very much.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #30 on: May 31, 2005, 05:27:23 am »

@tutone:  That's exactly what I was looking for.  That script should spit out the Coppermine root directory, which is what happened.  I'm working on a slightly different browser interface that will hopefully eliminate this issue.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

tutone

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 64
Re: Browsable interface for batch add files
« Reply #31 on: May 31, 2005, 05:43:04 am »

GauGau,

I totally understand how difficult it is.  I apologize if i gave the impression that i didn't think that or i was trying to rush you guys. Previous to Law School i worked as a program/project manager working with developers... they were always getting pissed at me thinking that i was rushing them... when i was really just trying to figure out what the problem was... just because i am curious by nature.  You guys have created an awesome piece of work.  Whatever little help i can do... please let me know.

Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #32 on: June 01, 2005, 11:26:38 pm »

@tutone:  Make a small change to your init.inc.php file and upload the attached file (rename it to path.php) to your Coppermine root directory.  See if you get a browsable listing.  You should get a list of valid directories on the left (indented entries mean subdirectories), and a list of files on the right when you click one of the directories on the left.  All files except directories are listed as there is no filter set up.

In init.inc.php, after

Code: [Select]
// Check for GD GIF Create support
if ($CONFIG['thumb_method'] == 'im' || function_exists('imagecreatefromgif'))
  $CONFIG['GIF_support'] = 1;
else
  $CONFIG['GIF_support'] = 0;

add

Code: [Select]
// Windows or *nix? keg
if (eregi("win",getenv('OS'))) {
  $CONFIG['filesep'] = chr(92);
} else {
  $CONFIG['filesep'] = '/';
}

$tmppath = (__FILE__);

$tmploc = strrpos($tmppath, $CONFIG['filesep']);

if ($tmploc > 0) {
  $CONFIG['rootpath'] = substr($tmppath, 0, $tmploc-7);
}

Tested on Linux/Apache 1.3.33/PHP 4.3.11 and Windows XP Pro/Apache 2.0.54/PHP 5.0.4
« Last Edit: June 02, 2005, 05:06:19 am by kegobeer »
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

tutone

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 64
Re: Browsable interface for batch add files
« Reply #33 on: June 02, 2005, 04:08:29 am »

still get the same message:

There are no folders inside the "albums" folder yet. Make sure to create at least one custom folder within "albums" folder and ftp-upload your files there. You mustn't upload to the "userpics" nor "edit" folders, they are reserved for http uploads and internal purposes.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #34 on: June 02, 2005, 04:24:30 am »

Uhhh, just point your browser to path.php and see what happens.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #35 on: June 02, 2005, 05:05:08 am »

Found an error in my previous code.  I corrected my previous post, tutone, so copy and paste the init.inc.php code again.
« Last Edit: June 02, 2005, 05:15:13 am by kegobeer »
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

tutone

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 64
Re: Browsable interface for batch add files
« Reply #36 on: June 02, 2005, 08:04:48 am »

Sorry... i didn't know i was supposed to point to path.php.  When i point to path.php i can see the folders on the left and then when i click on a folder it shows the files in that folder on the right.  All of the folders under albums/ appear on the left.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #37 on: June 02, 2005, 12:29:43 pm »

Good, I was hoping it would work for you.  I'll work on a better interface and incorporate it into Coppermine for further testing.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

tutone

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 64
Re: Browsable interface for batch add files
« Reply #38 on: July 04, 2005, 10:46:47 pm »

kegobeer,

Anything new with this?  Do you need help testing anything?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Browsable interface for batch add files
« Reply #39 on: July 05, 2005, 12:57:10 am »

Things are progressing nicely - seems to be working for nix and windows without any errors.  The code is pretty different from what I've posted here, and it works better.

I haven't integrated it with 1.4.1 yet, so nothing to be tested.  I'm working on other things that are directly related, so everything will be rolled up into one update.  I'll post when it's done.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots
Pages: 1 [2] 3   Go Up
 

Page created in 0.036 seconds with 19 queries.