forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 permissions => Topic started by: allvip on August 27, 2013, 06:01:44 pm

Title: Albums can be private only for admin
Post by: allvip 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.
Title: Re: Albums can be private only for admin
Post by: allvip 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.
Title: Re: Albums can be private only for admin
Post by: Αndré 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.
Title: Re: Albums can be private only for admin
Post by: allvip 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.
Title: Re: Albums can be private only for admin
Post by: Αndré 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'";
Title: Re: Albums can be private only for admin
Post by: allvip 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.
Title: Re: Albums can be private only for admin
Post by: allvip on August 28, 2013, 03:19:35 pm
no my mistake is working.probably a server error.

THANKS a lot.

Title: Re: Albums can be private only for admin
Post by: Αndré 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?
Title: Re: Albums can be private only for admin
Post by: allvip 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.
Title: Re: Albums can be private only for admin
Post by: allvip on September 16, 2013, 08:50:43 pm
please help if you can
Title: Re: Albums can be private only for admin
Post by: Αndré 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?
Title: Re: Albums can be private only for admin
Post by: allvip on September 17, 2013, 10:05:57 am
yes
Title: Re: Albums can be private only for admin
Post by: Αndré on September 17, 2013, 10:23:58 am
I just updated the above code.
Title: Re: Re: Albums can be private only for admin
Post by: allvip 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
Title: Re: Albums can be private only for admin
Post by: Αndré on September 17, 2013, 10:56:56 am
They aren't identical. Just replace it as described.
Title: Re: Albums can be private only for admin
Post by: allvip 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);
}

Title: Re: Albums can be private only for admin
Post by: Αndré on September 17, 2013, 11:20:40 am
Please read my instructions more careful.
Title: Re: Re: Albums can be private only for admin
Post by: allvip 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
Title: Re: Albums can be private only for admin
Post by: allvip 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);
}
*/

Title: Re: Albums can be private only for admin
Post by: allvip 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]);
}
}




Title: Re: Albums can be private only for admin
Post by: allvip on September 17, 2013, 11:41:58 am
worked 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]);
}





really sorry
I uncommented everything with that */