Gossamer Forum
Home : Products : Gossamer Links : Discussions :

how to know: is editor after login?

Quote Reply
how to know: is editor after login?
A question to the editors.
I am working now for a couple of months with Gossamer Links and now I want to give the editors the possibility to edit categories and links. Therefore they have to login and after this I want to present them a link to the browser.cgi. But this link should only the editors see. All the registered users shouldn't. But how is it possible to get to know after login (login_success) that the user who is logged in is an editor?

Many thanks for any help!
Alexander
Quote Reply
Re: [alexiusk] how to know: is editor after login? In reply to
Hi,

It's automatic.

If you have not altered the menu bar, there is an <%if%> around the browser.cgi

Do a test. Create a dummy account, and then set them up as editor of a category or sub category. Then log in as them.

You'll see the "Editors" link in the top of the menu bar, and when you click it, the javascript tree on the left will only show the categories they are able to edit.

You can set editor permissions for each category when you set them up as editor.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] how to know: is editor after login? In reply to
Hi
thanks a lot for the fast answer.
But!? I tested it and the result made me not happy. The field 'status' should change to the value 'Editor' if the user logged in is an editor. But if I look to the DB the only available values for the field 'status' are Not Validated, Registered and Administrator. Therefore the value of the field 'status' of this user is Registered and not Editor. (Probably it can't get the value 'Editor' at all)
Where is the mistake? What do I have to change?
In an former post (http://www.gossamer-threads.com/...i?post=188709#188709) the problem seems to be the same. But not solved?
Looking forward for any help.

Alex
Quote Reply
Re: [alexiusk] how to know: is editor after login? In reply to
Hi Alex this is an adapted version of one I use on GT Community :

Call the global "is_editor" :

sub {
my $tags = shift;
my $username = $tags->{Username};
my $is_editor = $DB->table('Editors')->count( { Username => $username });
return $is_editor;
}

Then use this in your templates :

<%if is_editor%> Content for editor only <%endif%>

Here is the initial post with the global from Alex (the Admin) :)

http://www.gossamer-threads.com/...i?post=272704#272704

Cheers,

John
Significant Media
Quote Reply
Re: [Jag] how to know: is editor after login? In reply to
Hi John,
your hint was very!! helpfulSmile. Now I am able to identify the editors.
thanks again
Alex (the beginner Wink)