coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: mfaizalar on March 27, 2008, 12:49:45 PM

Title: [Solved]: How to set "me only" as a default album view permission
Post by: mfaizalar on March 27, 2008, 12:49:45 PM
Hi,

I'm looking for a way to make the album viewable by the owner and admin only at the very first it was created. Meaning that the default permission for "Album can be viewed by" column is "me only". At the moment, I could see that the default value is "everybody (public album)". Pls let me where and how to make the changes.

Appreciate if any expertise out there can help me on this. I'm no coder but can try to understand the instruction ;D
Title: Re: How to set "me only" as a default album view permission
Post by: Nibbler on March 27, 2008, 01:57:17 PM
http://forum.coppermine-gallery.net/index.php/topic,38837.0.html
Title: Re: How to set "me only" as a default album view permission
Post by: mfaizalar on March 28, 2008, 11:17:52 AM
Thx dude! I'll hv a look n try it out 1st..
Title: Re: How to set "me only" as a default album view permission
Post by: mfaizalar on April 02, 2008, 05:58:10 AM
Hi Nibbler,
I've tried out based on suggestion from the link given. But still the first album permission is set to "public album". I want "me only". Where did I go wrong? Attached is my delete.php file. Hope you don't mind to scrutinize it very fast  :)
Title: Re: How to set "me only" as a default album view permission
Post by: Nibbler on April 02, 2008, 10:36:09 AM
The part that makes it 'me only' is commented out.
Title: Re: How to set "me only" as a default album view permission
Post by: mfaizalar on April 03, 2008, 12:12:32 PM
I have removed the comments but still not working as what I am expecting. Appreciate if you can show how's the right way to do it. Thx!
Title: Re: How to set "me only" as a default album view permission
Post by: mfaizalar on April 03, 2008, 12:20:18 PM
Oppss.. I guess I got it already!! Hooraayyy!!!!

Below is the code added:


if (GALLERY_ADMIN_MODE){           
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '')";   
} else {
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, visibility) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '', " . (FIRST_USER_CAT + USER_ID) . ")";
}
cpg_db_query($query);


Thx Nibbler  ;D