Gossamer Forum
Home : Products : Gossamer Links : Discussions :

editor rights

Quote Reply
editor rights
hello how can I set the editor rights of an user to be visible in a template???

I have done this:

sub {
my $tags = shift;
my $ed_db = $DB->table('Editors');
my $user = $tags->{Username};
my $editor_info = $ed_db->get($user, 'HASH');
return $editor_info;
}

page.cgi?p=editor_info&Username=username

but only the Username will be visible. any other fields form the Editors table are unknown tags.

Who can give me suggestions???

Quote Reply
Re: editor rights In reply to
You also have to define the USER table and pull data (get) based on the USERID.

Regards,

Eliot Lee
Quote Reply
Re: editor rights In reply to
hmmm, I have done that too, but no results, do you have an example?
Before I forgot, is it also possible to create a list of all categories in which a user are editor???

Quote Reply
Re: editor rights In reply to
if have now done this:

sub {
my $tags = shift;
my $ed_db = $DB->table('Editors', 'Users');
my $user = $tags->{Username};
my $editor_info = $ed_db->get($user, 'HASH');
return $editor_info;
}

---------------------------------------------------------
I have defined the user table and defined the primary key, both Username

but it does not work, who can help me with the syntax.

Quote Reply
Re: editor rights In reply to
Hi,

This is a bug, get() works different with Relations, then Tables. You need to do:

my $sth = $ed_db->select ( { 'Editors.Username' => $user } );
my $editor_info = $sth->fetchrow_hashref;
return $editor_info;

You need 'Editors.Username' instead of 'Username' as they are both called Username.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: editor rights In reply to
Ok Now I have done this:

sub {
my $tags = shift;
my $ed_db = $DB->table('Editors', 'Users');
my $sth = $ed_db->select ( { 'Editors.Username' => $user } );
my $editor_info = $sth->fetchrow_hashref;
return $editor_info;
}

that seems to be Ok, but i still get errors about this module, I cal the template editors_info.html on this way:

http://www.ridesworld.net/cgi-bin/ridesworld/page.cgi?p=editor_info&Editors.Username=admin

and I try this way:

http://www.ridesworld.net/cgi-bin/ridesworld/page.cgi?p=editor_info&Username=admin

both no results, I am sure that there is an error in the global, could you give me your global, eventually with option to show the category names???


Quote Reply
Re: editor rights In reply to
I found a solution, namely:

sub {
my $tags = shift;
my $ed_db = $DB->table('Editors', 'Users');
my $user = $tags->{Username};
my $sth = $ed_db->select ( { 'Editors.Username' => $user } );
my $editor_info = $sth->fetchrow_hashref;
return $editor_info;
}

I forgot the: my $user = $tags->{Username};

but how can I set the names of the categories, in which the user are editor, and the links they own???
I have to make a combination with the category & linkstable, but how????