coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: aunrea on January 07, 2007, 06:32:41 PM

Title: Changing new album premissions to registered by default.
Post by: aunrea on January 07, 2007, 06:32:41 PM
I have searched for the answer to this on the forum for over an hour and can only find people who have solved it but don't say how.

Is there a way to change default permission when an album is created to registerd users only?

I have tried changing the line in delete.php to

$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, visibility) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '', '2')";

But that didn't work. I wasn't sure it would because that was a solution to changing it to admin access by default. So how do I do registered by default.
Title: Re: Changing new album premissions to registered by default.
Post by: Nibbler on January 07, 2007, 10:13:05 PM
That is the solution.
Title: Re: Changing new album premissions to registered by default.
Post by: aunrea on January 08, 2007, 12:34:20 AM
I checked it again but it wasn't working. Then I realized there were two lines of the code that need to be changed. I thought there was only one. It works now.
Title: Re: Changing new album premissions to registered by default.
Post by: nivar on January 11, 2007, 03:57:49 AM
im looking for same solution, could you point me on the right direction.
thanks in advace.
Title: Re: Changing new album premissions to registered by default.
Post by: aunrea on January 11, 2007, 07:26:39 PM
In delete.php you need to find:

$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '')";

and replace it with:

$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, visibility) VALUES ('$category', '".addslashes($op['album_nm'])."', 'NO',  '{$op['album_sort']}', '', '2')";

There are two instances of this. This will changed the default album permissions to registered.