modifying code to not allow users to allow EVERYBODY to uplo

bobbybobbertson

Joined: 2002-10-16
Posts: 9
Posted: Wed, 2002-10-16 15:47

I posted the following in the configuration forum and some suggested that I would need to modify souce code and this would be a better place to get some info. Any help would be appreciated. I was told to modify album_permissions.php, but really don't know where to begin. I can read and program php a little, but am not great at it. So any advice would be great.

====================================================
First off, I would like to say this program is great!! Easy install, pretty configurable.

One thing I would like to know is....

Is it possible to not allow users to allow EVERYBODY to add photos?

I am going to be the administrator of the album, and I will make user accounts for some friends. While I somewhat trust them, I would rather not give them the ability to open up my server to the world for uploads. It would be nice if I could not allow them to put ANYBODY in the permissions box entitled, "Users who can add photos" for their photo albums.

 
bobbybobbertson

Joined: 2002-10-16
Posts: 9
Posted: Fri, 2002-10-18 20:21

In case anyone else wants to do this, I came up with a simple but restrictive change:
This simply only allows the Admin to set permissions for albums. Everybody has to use the defaults. Simple and restrictive. But good enough for my needs.

I modified this lind in albums.php:
<a href="#" onClick="<?php echo popup("album_permissions.php?set_albumName={$tmpAlbumName}")?>">[permissions]</a>

to read:
<?php if ($gallery->user->isAdmin()) { echo '<a href="#" onClick="'; echo popup("album_permissions.php?set_albumName={$tmpAlbumName}"); echo '">[permissions]</a>'; }?>

Then I modified a similar line in view_album.php to only include the admin in the if statement.... Just search for "[permissions]" (not including quotes) and modify the if statement to only be include the check for admin.

if ($gallery->user->isAdmin() ) {
$adminCommands .= '<a href="#" onClick="'.popup("album_permissions.php?set_albumName=" .
$gallery->session->albumName).
'">[permissions]</a>&amp;nbsp;';
}

GOD I LOVE OPEN SOURCE!!! THANKS GALLERY GUYS!!!

The code is very readable. However, I'm sad that I had to make such a change in two place that basically print out the same thing!!!