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]   Go Down

Author Topic: how can users use xp_publish to upload to public albums?  (Read 8154 times)

0 Members and 1 Guest are viewing this topic.

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
how can users use xp_publish to upload to public albums?
« on: December 21, 2003, 01:38:32 pm »

My registered users cannot upload to the public, admin owned albums from xp_publish.  As admin, all albums are shown to me when testing xp_publish (I use ftp to upload), but users are only shown albums they have created in the private members category.

I want them to be able to use xp_publish to upload to all albums they have permissions for, and can using the normal upload feature.

Is this possible.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
how can users use xp_publish to upload to public albums?
« Reply #1 on: December 21, 2003, 06:16:35 pm »

are you sure?
Make sure they have upload rights.
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
how can users use xp_publish to upload to public albums?
« Reply #2 on: December 21, 2003, 07:15:05 pm »

Yes, I'm sure.

hers is a screenshot of a registered user, upoading via the normal upload facility;
(http://www.langportrd.f2s.com/images/upload.jpg)

as you can see, he has several albums to choose from.(note, the private album hadn't been created at this point)

Now the same user trying to use xp_publish;
(http://www.langportrd.f2s.com/images/upload2.jpg)

now he can only upload to his own album, or create a new one.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
how can users use xp_publish to upload to public albums?
« Reply #3 on: December 21, 2003, 07:36:28 pm »

hmm... I was 60% sure (OK 59.9%) that this wasn't the case in 1.1..
but anyway, try this:

in xp_publish.php change
Code: [Select]
   if (USER_IS_ADMIN) {
        $public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
        if (mysql_num_rows($public_albums)) {
            $public_albums_list = db_fetch_rowset($public_albums);
        } else {
            $public_albums_list = array();
        }
    } else {
        $public_albums_list = array();
    }


to
Code: [Select]
  if (USER_IS_ADMIN) {
    $public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
} else {
    $public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " AND uploads='YES' ORDER BY title");
}

if (mysql_num_rows($public_albums)) {
    $public_albums_list = db_fetch_rowset($public_albums);
} else {
    $public_albums_list = array();
}


Please report if it works
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
how can users use xp_publish to upload to public albums?
« Reply #4 on: December 21, 2003, 08:06:25 pm »

ok, the user now sees all albums.
But I am unable to upload at all using xp publish now.  It tells me I have been successful, but when I return to the gallery, it's not there. :?

Could this be a registry problem on my pc, as I have been using it for both admin and user uploads.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
how can users use xp_publish to upload to public albums?
« Reply #5 on: December 21, 2003, 08:12:50 pm »

did you check whether they are awaiting approval?
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
how can users use xp_publish to upload to public albums?
« Reply #6 on: December 21, 2003, 08:39:30 pm »

OK,

the first problem is fixed, but I have found the sencond problem seems to be with new registered users, trying to upload to thier own albums.

I tried to upload as a registered user, to that users private gallery, and got this warning
Quote
Impossible to move shanks.jpg to albums/userpics/10044/ !

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 10295 is not allowed to access /home/httpd/vhosts/hsocuk.com/httpdocs/galleries/albums/userpics/10044 owned by uid 48 in /home/httpd/vhosts/hsocuk.com/httpdocs/galleries/db_input.php on line 258


It seems the user has been allocated a different user id ( 48 ) to the corresponding album (10044), even though this album was set up by that user.
Is this because I had deleted a few users.  If so, this could be a bug.

edit;  just realised I amended db_input.php 2 days ago.  maybe I caused this myself, will go and check.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
how can users use xp_publish to upload to public albums?
« Reply #7 on: December 21, 2003, 09:04:43 pm »

this second problem you are talking about... is it related to the xp_publish problem or is it a totally different topic?
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
how can users use xp_publish to upload to public albums?
« Reply #8 on: December 21, 2003, 09:10:31 pm »

Hi Oasis,

it seems not to be related to the xp publish problem, which you kindly sorted for me.

However, that was how I found it, and I thought it was related, which is why it was posted on the same thread.

When I find the cause, and if I need more help, I will find a relevent thread, or post a new one.

Sorry for any confusion caused, but you're not as confused as me.  :?
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

gijs_schouten

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: how can users use xp_publish to upload to public albums?
« Reply #9 on: April 26, 2004, 05:29:43 pm »

hmm... I was 60% sure (OK 59.9%) that this wasn't the case in 1.1..
but anyway, try this:

in xp_publish.php change
Code: [Select]
   if (USER_IS_ADMIN) {
        $public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
        if (mysql_num_rows($public_albums)) {
            $public_albums_list = db_fetch_rowset($public_albums);
        } else {
            $public_albums_list = array();
        }
    } else {
        $public_albums_list = array();
    }

to
Code: [Select]
  if (USER_IS_ADMIN) {
    $public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
} else {
    $public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " AND uploads='YES' ORDER BY title");
}

if (mysql_num_rows($public_albums)) {
    $public_albums_list = db_fetch_rowset($public_albums);
} else {
    $public_albums_list = array();
}

I had the same problem.... I tried this to solve it... and indeed it works for me now....
but when a registred user wants to upload to a public album i don't get the pictures there... when he uploads to his private album there's no problem....
could anyone help with this?
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.