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

Author Topic: Albums can be private only for admin  (Read 14166 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Albums can be private only for admin
« on: August 27, 2013, 06:01:44 pm »

I disabled from config :
Albums can be private (Note: if you switch from 'yes' to 'no' any current private albums will be visible)
no not want users do have private albums but how can I have private albums?
I tryed :

Password protect this album (Tick for yes)  ticked   
Album password (New password)    - 123456
Album password hint

update album

everybody can see the images from that album.they show in random files etc and can click to see thumb and full size.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #1 on: August 27, 2013, 06:24:47 pm »

if I enable Albums can be private under file settings and in Group manager:
Personal gallery - Allowed -no , Approval - yes
users have the option to make album private and only the admin can see the files in the album.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Albums can be private only for admin
« Reply #2 on: August 28, 2013, 11:09:36 am »

I don't understand why you set an album password or change anything in the groups manager, if you want to accomplish something different. Please describe what you actually want to do.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #3 on: August 28, 2013, 01:49:37 pm »

I just want the admin to be able to have albums in the gallery that nobody can see.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Albums can be private only for admin
« Reply #4 on: August 28, 2013, 02:10:50 pm »

Open modifyalb.php, find
Code: [Select]
$data = array($lang_modifyalb_php['general_settings'],
    array($icon_array['title'].$lang_modifyalb_php['alb_title'].$help['album_title'], 'title', 0),
    array($icon_array['album_category'].$lang_modifyalb_php['alb_cat'].$help['album_category'], 'category', 2),
    array($icon_array['description'].$captionLabel, 'description', 3),
    array($icon_array['keyword'].$lang_modifyalb_php['alb_keyword'].$help['album_keywords'], 'keyword', 0),
    array($lang_modifyalb_php['alb_thumb'], 'thumb', 4),
    $lang_modifyalb_php['alb_perm'],
    array($icon_array['view'].$lang_modifyalb_php['can_view'].$help['album_can_be_viewed_by'], 'visibility', 5),
    array($icon_array['password'].$lang_modifyalb_php['password_protect'].$help['album_password'], 'password_protect', 9),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password'], 'alb_password', 6),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password_hint'], 'alb_password_hint', 7),
    array($icon_array['upload'].$lang_modifyalb_php['can_upload'].$notice1.$help['can_upload'], 'uploads', 1),
    array($icon_array['comment'].$lang_modifyalb_php['can_post_comments'].$notice1.$help['can_post_comments'], 'comments', 1),
    array($icon_array['rate'].$lang_modifyalb_php['can_rate'].$notice1.$help['can_rate'], 'votes', 1),
);
and below, add
Code: [Select]
if (!GALLERY_ADMIN_MODE) {
    unset($data[7]);
    unset($data[8]);
    unset($data[9]);
    unset($data[10]);
}


open db_input.php, find
Code: [Select]
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = $visibility, alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword'";and replace with
Code: [Select]
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = '$visibility', alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword'";
« Last Edit: September 17, 2013, 10:23:19 am by Αndré »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #5 on: August 28, 2013, 03:10:44 pm »

I added the code. Albums can be private was not selected in config.the I tryed with Albums can be private was selected in config.


blank page when I click album propriety or 500 internal servor error.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #6 on: August 28, 2013, 03:19:35 pm »

no my mistake is working.probably a server error.

THANKS a lot.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Albums can be private only for admin
« Reply #7 on: August 28, 2013, 03:30:25 pm »

To be honest, I haven't checked for the regular user if it returns a database error when updating the album properties. Can you please confirm that updating the album properties also work for non-admins?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #8 on: September 16, 2013, 08:49:28 pm »

sorry did not see the post.

Yes updating the album properties also work for non-admins.

BUT users can password protect their albums.once passord is set only the admin can view the albums and files.
user do not see the new album or the new uploaded files.not even in Last additions .is like the album and his files are not existing.

only the option Album can be viewed by was removed.
thanks for posting.Checking make  be see a still have a problem.
don't know how I did not see that before.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #9 on: September 16, 2013, 08:50:43 pm »

please help if you can
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Albums can be private only for admin
« Reply #10 on: September 17, 2013, 09:42:34 am »

Not sure what you're currently asking for. Do you want to remove the password field for non-admins?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #11 on: September 17, 2013, 10:05:57 am »

yes
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Albums can be private only for admin
« Reply #12 on: September 17, 2013, 10:23:58 am »

I just updated the above code.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Albums can be private only for admin
« Reply #13 on: September 17, 2013, 10:55:32 am »



open db_input.php, find
Code: [Select]
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = $visibility, alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword'";and replace with
Code: [Select]
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = '$visibility', alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword'";[/quote]

code 1 is like code 2
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Albums can be private only for admin
« Reply #14 on: September 17, 2013, 10:56:56 am »

They aren't identical. Just replace it as described.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #15 on: September 17, 2013, 11:12:46 am »

I did but it did not worked.

I repalced  :

Code: [Select]

if (GALLERY_ADMIN_MODE) {
    $data[] = array($lang_modifyalb_php['can_moderate'].$help['can_moderate'], 'moderator_group', 8);
}


with:

Code: [Select]

if (!GALLERY_ADMIN_MODE) {
    unset($data[7]);
    unset($data[8]);
    unset($data[9]);
    unset($data[10]);
}


 tryed even :

Code: [Select]

if (!GALLERY_ADMIN_MODE) {
    unset($data[7]);
    unset($data[8]);
    unset($data[9]);
    unset($data[10]);
}
if (GALLERY_ADMIN_MODE) {
    $data[] = array($lang_modifyalb_php['can_moderate'].$help['can_moderate'], 'moderator_group', 8);
}

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Albums can be private only for admin
« Reply #16 on: September 17, 2013, 11:20:40 am »

Please read my instructions more careful.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Albums can be private only for admin
« Reply #17 on: September 17, 2013, 11:30:47 am »


open db_input.php, find
Code: [Select]
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = $visibility, alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword'";and replace with
Code: [Select]
$query = "UPDATE {$CONFIG['TABLE_ALBUMS']} SET title = '$title', description = '$description', category = $category, thumb = $thumb, comments = '$comments', votes = '$votes', visibility = '$visibility', alb_password = '$password', alb_password_hint = '$password_hint', keyword = '$keyword'";[/quote]

done
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #18 on: September 17, 2013, 11:34:39 am »

original modifyalb.php:

Code: [Select]

$data = array($lang_modifyalb_php['general_settings'],
    array($icon_array['title'].$lang_modifyalb_php['alb_title'].$help['album_title'], 'title', 0),
    array($icon_array['album_category'].$lang_modifyalb_php['alb_cat'].$help['album_category'], 'category', 2),
    array($icon_array['description'].$captionLabel, 'description', 3),
    array($icon_array['keyword'].$lang_modifyalb_php['alb_keyword'].$help['album_keywords'], 'keyword', 0),
    array($lang_modifyalb_php['alb_thumb'], 'thumb', 4),
    $lang_modifyalb_php['alb_perm'],
    (GALLERY_ADMIN_MODE ? array($icon_array['view'].$lang_modifyalb_php['can_view'].$help['album_can_be_viewed_by'], 'visibility', 5) : ''),
    array($icon_array['password'].$lang_modifyalb_php['password_protect'].$help['album_password'], 'password_protect', 9),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password'], 'alb_password', 6),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password_hint'], 'alb_password_hint', 7),
    array($icon_array['upload'].$lang_modifyalb_php['can_upload'].$notice1.$help['can_upload'], 'uploads', 1),
    array($icon_array['comment'].$lang_modifyalb_php['can_post_comments'].$notice1.$help['can_post_comments'], 'comments', 1),
    array($icon_array['rate'].$lang_modifyalb_php['can_rate'].$notice1.$help['can_rate'], 'votes', 1),
);

/* TODO: re-enable and test feature when it's clear how it should work (see http://forum.coppermine-gallery.net/index.php/topic,64408.0.html)
if (GALLERY_ADMIN_MODE) {
    $data[] = array($lang_modifyalb_php['can_moderate'].$help['can_moderate'], 'moderator_group', 8);
}
*/



first edit modifyalb.php:

Code: [Select]

$data = array($lang_modifyalb_php['general_settings'],
    array($icon_array['title'].$lang_modifyalb_php['alb_title'].$help['album_title'], 'title', 0),
    array($icon_array['album_category'].$lang_modifyalb_php['alb_cat'].$help['album_category'], 'category', 2),
    array($icon_array['description'].$captionLabel, 'description', 3),
    array($icon_array['keyword'].$lang_modifyalb_php['alb_keyword'].$help['album_keywords'], 'keyword', 0),
    array($lang_modifyalb_php['alb_thumb'], 'thumb', 4),
    $lang_modifyalb_php['alb_perm'],
    (GALLERY_ADMIN_MODE ? array($icon_array['view'].$lang_modifyalb_php['can_view'].$help['album_can_be_viewed_by'], 'visibility', 5) : ''),
    array($icon_array['password'].$lang_modifyalb_php['password_protect'].$help['album_password'], 'password_protect', 9),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password'], 'alb_password', 6),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password_hint'], 'alb_password_hint', 7),
    array($icon_array['upload'].$lang_modifyalb_php['can_upload'].$notice1.$help['can_upload'], 'uploads', 1),
    array($icon_array['comment'].$lang_modifyalb_php['can_post_comments'].$notice1.$help['can_post_comments'], 'comments', 1),
    array($icon_array['rate'].$lang_modifyalb_php['can_rate'].$notice1.$help['can_rate'], 'votes', 1),
);

/* TODO: re-enable and test feature when it's clear how it should work (see http://forum.coppermine-gallery.net/index.php/topic,64408.0.html)

if (!GALLERY_ADMIN_MODE) {
    unset($data[7]);
    unset($data[8]);
    unset($data[9]);
    unset($data[10]);
}
*/


second try:

Code: [Select]

$data = array($lang_modifyalb_php['general_settings'],
    array($icon_array['title'].$lang_modifyalb_php['alb_title'].$help['album_title'], 'title', 0),
    array($icon_array['album_category'].$lang_modifyalb_php['alb_cat'].$help['album_category'], 'category', 2),
    array($icon_array['description'].$captionLabel, 'description', 3),
    array($icon_array['keyword'].$lang_modifyalb_php['alb_keyword'].$help['album_keywords'], 'keyword', 0),
    array($lang_modifyalb_php['alb_thumb'], 'thumb', 4),
    $lang_modifyalb_php['alb_perm'],
    (GALLERY_ADMIN_MODE ? array($icon_array['view'].$lang_modifyalb_php['can_view'].$help['album_can_be_viewed_by'], 'visibility', 5) : ''),
    array($icon_array['password'].$lang_modifyalb_php['password_protect'].$help['album_password'], 'password_protect', 9),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password'], 'alb_password', 6),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password_hint'], 'alb_password_hint', 7),
    array($icon_array['upload'].$lang_modifyalb_php['can_upload'].$notice1.$help['can_upload'], 'uploads', 1),
    array($icon_array['comment'].$lang_modifyalb_php['can_post_comments'].$notice1.$help['can_post_comments'], 'comments', 1),
    array($icon_array['rate'].$lang_modifyalb_php['can_rate'].$notice1.$help['can_rate'], 'votes', 1),
);

/* TODO: re-enable and test feature when it's clear how it should work (see http://forum.coppermine-gallery.net/index.php/topic,64408.0.html)

if (!GALLERY_ADMIN_MODE) {
    unset($data[7]);
    unset($data[8]);
    unset($data[9]);
    unset($data[10]);
}
if (GALLERY_ADMIN_MODE) {
    $data[] = array($lang_modifyalb_php['can_moderate'].$help['can_moderate'], 'moderator_group', 8);
}
*/

Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Albums can be private only for admin
« Reply #19 on: September 17, 2013, 11:39:44 am »

sorry
this was the problem: */

works with this:

Code: [Select]


$data = array($lang_modifyalb_php['general_settings'],
    array($icon_array['title'].$lang_modifyalb_php['alb_title'].$help['album_title'], 'title', 0),
    array($icon_array['album_category'].$lang_modifyalb_php['alb_cat'].$help['album_category'], 'category', 2),
    array($icon_array['description'].$captionLabel, 'description', 3),
    array($icon_array['keyword'].$lang_modifyalb_php['alb_keyword'].$help['album_keywords'], 'keyword', 0),
    array($lang_modifyalb_php['alb_thumb'], 'thumb', 4),
    $lang_modifyalb_php['alb_perm'],
    (GALLERY_ADMIN_MODE ? array($icon_array['view'].$lang_modifyalb_php['can_view'].$help['album_can_be_viewed_by'], 'visibility', 5) : ''),
    array($icon_array['password'].$lang_modifyalb_php['password_protect'].$help['album_password'], 'password_protect', 9),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password'], 'alb_password', 6),
    array($icon_array['blank'].$lang_modifyalb_php['alb_password_hint'], 'alb_password_hint', 7),
    array($icon_array['upload'].$lang_modifyalb_php['can_upload'].$notice1.$help['can_upload'], 'uploads', 1),
    array($icon_array['comment'].$lang_modifyalb_php['can_post_comments'].$notice1.$help['can_post_comments'], 'comments', 1),
    array($icon_array['rate'].$lang_modifyalb_php['can_rate'].$notice1.$help['can_rate'], 'votes', 1),
);

/* TODO: re-enable and test feature when it's clear how it should work (see http://forum.coppermine-gallery.net/index.php/topic,64408.0.html)
*/


if (!GALLERY_ADMIN_MODE) {
    unset($data[7]);
    unset($data[8]);
    unset($data[9]);
    unset($data[10]);
}
}




Logged
Pages: [1] 2   Go Up
 

Page created in 0.04 seconds with 20 queries.