Refining User Permissions

asiop

Joined: 2004-09-22
Posts: 1
Posted: Fri, 2004-10-01 00:37

Hello there :)
I've been embedding rather succesfully gallery 1.4.x with my own web site that has its own user base and so far it has been smooth and easy, many thanks to a couple of IRC users that I've bothered. sorry for that.

anyway I'm almost done now, but I do have a couple of more questions,
first - how can I remove some of the options for the non-admin users, such as some album properties or the ability to vote for albums etc. is it possible to make the simple user interface more simple by cutting off some of the things one can define for his albums (such as custom fields, borders etc). any clean way to make some of these options available for the admin user?

also, if i want to display some of the gallery newest photos or random photos in the website home page or other pages, how can this be done?

If this thing have been discussed beofre I'll be happy to have a reference to relevant docs/threads

thanks once again
you're doing a wonderful job!

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3473
Posted: Fri, 2004-10-01 00:44

[properties]
Add a check at the top of edit_properties.php (or whatever it's called) to make that if $gallery->user->isAdmin() returns false, to exit... something like:

if (!$gallery->user->isAdmin()) {
        echo _("You are not allowed to perform this action!");
        exit;
}

Same deal for the voting page.

Random photos: use block-random.php that ships with Gallery. Add this to the php page where you want it to go:

<?php
$GALLERY_NO_SESSIONS=true;
include('gallery/block-random.php');
?>

Recent photos: not sure what the best code is out there. I recommend searching the Customization Forum, and if you can't find anything, then posting in there and asking around.

-Beckett (

)