MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: MiniMate problem



Quoting Larry Leszczynski (larryl@furph.com):
> Speaking of which, does anyone have a good example for such a .access_gate
> file that checks both the current catalog, and also the user ID? 
> Something that only checks user ID like this: 
>    *: [if session username eq 'adminuser']Yes[else]No[/else][/if]
> seems inadequate if multiple catalogs are being served...
> 

How about:

*: [perl arg="config" interpolate=1]
        my $admin_user   = $Safe{config}{RemoteUser};
        my $current_user = q{[data session user]};
        return 1 if $admin_user eq $current_user;
        return 0;
    [/perl]

Then if the current user equals the RemoteUser directive, it will
allow access.

Another possibility is to use the simple acl method, or other database-based
setting which allows access to certain pages.

<MV4-plug>

    Here is the MV4 equivalent to show easier embedding:

        *: [perl] return $Config->{RemoteUser} eq $Session->{user}; [/perl]

    Also, I have heeded the ASP requests with:

        [mvasp]

            <H1> See if you are the admin user:
				<%
					$yesno = $Config->{RemoteUser} eq $Session->{user} ? 'Yes' : 'No'
					$Document->write($yesno);
				%>

            </H1>

    A trailing [/mvasp] is optional if you are using ASP-style for the whole
    page.

</MV4-plug>

Regards,
-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Be patient. God isn't               131 Willow Lane, Floor 2  | ||  _ \
finished with me yet.               Oxford, OH  45056         | || |_) |
 -- unknown                         <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\


Search for: Match: Format: Sort by: