I would love to post attached code but I can't (not enough priviledges) so here is steps to ensure that ONLY Gallery Administrators can change the items in the "Advanced Options" tab when uploading or editing a photo.
1. Beneath the following line of code in ControlPanel\Photos\PostEditControl.ascx.cs:
protected
2. After the line
SetYesNo(post.PostConfig, post.IsApproved, !post.IsLocked, post.EnableAllOwnerNotification, post.EnableRatings, post.EnableTrackBacks, hasMultipleOwners);
Add the code:
3. Finally, after the line
SetYesNo(CurrentGallery.DefaultPostConfig,
Only users who are members of the Gallery Admins role will be able to specify advanced options when uploading or updating a picture.
There's more!!!
Owners of a gallery can change the gallery options such as "comment moderation", "enable ratings" etc etc.
To prevent non gallery admins from doing this:
1. Open ControlPanel\Photos\Options\PostOptions.aspx.cs
Add the following code anywhere in the file:
#region
private void DisableOptions()
{
ynEnableReplies.Enabled=false;
ynEnableRatings.Enabled=false;
ynEnableTrackbacks.Enabled=false;
ynEnableOrderPrints.Enabled=false;
ynAggregatePost.Enabled=false;
ynCommunity.Enabled=false;
ynSyndicateExcerpt.Enabled=false;
ModerationDDL.Enabled=false;
ynEnableRepliesOverride.Enabled = false;
ynEnableRatingsOverride.Enabled=false;
ynEnableTrackbacksOverride.Enabled=false;
ynEnableOrderPrintsOverride.Enabled=false;
NotificationType.Enabled=false;
ModerationDDLOverride.Enabled=false;
ExpiredDays.Enabled=false;
}
#endregion
2. At the very end of the Page_Load method, add the following code:
CSContext context = CSContext.Current;
if (!context.User.IsGalleryAdministrator)
DisableOptions();
That's it. Now only Gallery Admins can change the settings for a gallery. Even the Owners cannot change these settings.
I must be too much of a noob with this but where is the Page_Load method and I'm not sure if
ControlPanel\Photos\Options\PostOptions.aspx
is the same as
ControlPanel\Photos\Options\PostOptions.aspx.cs
Hi Ibrahim, this is great!
Do you know a way to turn off the ability to delete photos, yet still be able to upload them, except the Gallery Admin? Lots of folks here would love to be able to do that.
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com