Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [nielsp] default user problems

Quote Reply
Re: [nielsp] default user problems In reply to
I was having the same problem as described by Nielsp. Using following setup as suggested by TheStone, the default user URl does not show any records.
Quote:

The Authorization Options should be set:

auth_no_authentication: No

auth_allow_default: view

auth_modify_own: Yes

auth_user_field: This is the field name in the database used for storing the userid who owns the record.

The URL of default user to view all records:
db.cgi?db=table_name&do=search_results&keyword=*&uid=default

TheStone.
Gossamer Threads Inc.


It seems that the reason might be the code in Home.pm in Sub search_results. I changed the following code -

=========
# Check if users can view only their own record
if ( $self->{cfg}->{'auth_view_own'} and $self->{cfg}->{'auth_user_field'} and !$self->{user}->{admin_p} ) {
$self->{cgi}->{$self->{cfg}->{'auth_user_field'}} = $self->{user}->{'Username'};
$self->{cgi}->{"$self->{cfg}->{'auth_user_field'}-opt"} = '=';
}
=========

to

=========
# Check if users can view only their own record
if ( $self->{cfg}->{'auth_view_own'} and $self->{cfg}->{'auth_user_field'} and !$self->{user}->{admin_p} ) {
# if Statement introduced to enable displaying of records for default user, and not put the condition
if ( $self->{user}->{'Username'} ne 'default' ) {
$self->{cgi}->{$self->{cfg}->{'auth_user_field'}} = $self->{user}->{'Username'};
$self->{cgi}->{"$self->{cfg}->{'auth_user_field'}-opt"} = '=';
}
}
=========

It seems to work now. I am not certain if this is a correct solution or it will have some side effects. Would appreciate if TheStone or someone from GT can validate this, it would help many.

Thanks.

Subject Author Views Date
Thread default user problems nielsp 5596 Jul 7, 2004, 4:01 AM
Thread Re: [nielsp] default user problems
olivers 5467 Jul 7, 2004, 11:38 AM
Thread Re: [olivers] default user problems
nielsp 5472 Jul 7, 2004, 12:42 PM
Thread Re: [nielsp] default user problems
olivers 5460 Jul 7, 2004, 1:12 PM
Thread Re: [olivers] default user problems
nielsp 5468 Jul 7, 2004, 1:30 PM
Post Re: [nielsp] default user problems
TIF 5085 Apr 24, 2007, 7:32 PM