Albums can be private only for admin Albums can be private only for admin
 

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

Albums can be private only for admin

Started by allvip, August 27, 2013, 06:01:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

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.

allvip

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.

Αndré

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.

allvip

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

Αndré

#4
Open modifyalb.php, find
$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
if (!GALLERY_ADMIN_MODE) {
    unset($data[7]);
    unset($data[8]);
    unset($data[9]);
    unset($data[10]);
}



open db_input.php, find
$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
$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'";

allvip

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.

allvip

no my mistake is working.probably a server error.

THANKS a lot.


Αndré

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?

allvip

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.

allvip


Αndré

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


Αndré


allvip



open db_input.php, find
$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
$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

Αndré

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

allvip

I did but it did not worked.

I repalced  :



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



with:



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



tryed even :



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);
}


Αndré

Please read my instructions more careful.

allvip


open db_input.php, find
$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
$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

allvip

original modifyalb.php:



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



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



$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);
}
*/


allvip

sorry
this was the problem: */

works with this:




$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]);
}
}