Gossamer Forum
Home : Products : DBMan : Customization :

Can't get menu to work with permissions

Quote Reply
Can't get menu to work with permissions
All I want to do is make my default.cfg show the main menu and footer WITHOUT showing all options for ALL users --- in other words restrict the menu and footer to show only the options that the user has permissions for. This would restrict access to even seeing the secondary database, and while the permissions work, the menu items listing and footer listing don't.

Futher explanation:

I have a complicated DBMan implementation. It has 6 databases (actually 6 .cfg's and .pl's and only 3 different database structures, but that's besides the point)

The default has the Main Menu, submenus listing and user admin/change password/change email functions.

then each sub-section (there are 4 now, will be 5) has a menu on the main page for that section

that allows add/modify/delete and view/search records.

if you login as guest with the password guest - you will see the permissions are restricted to Fixed Assets

but the menu also shows Structures, Improvements to Land and Land Parcels.

The main menu is modified from the footer just to be a different font and style, but both exhibit this same behavior. They are not reflecting the restriction to the permissions. Why?

demo has permissions for all for modules and admin has permissions for all modules, Admin shows the expanded menu correctly, demo and guest don't (when I restrict demo I get no change)

Why is this??????????

I'm not even sure which code to post to start attacking this problem. It all Used to work --- famous last words!

Thanks for any help!
Lynette
Hollister, Ca

Last edited by:

Alex: Aug 5, 2003, 3:59 PM
Quote Reply
Re: [ltillner] Can't get menu to work with permissions In reply to
Quote:
(when I restrict demo I get no change)

could be as simple as a browser refresh, always refresh if you don't like the results, then panic. Smile

Make sure the entire DB is requiring authentication (in the config file), which it seems that it is.

Double check that users have the right permissions, they probably do.

Than post the main menu sub and we can look at it.

Tomorrow.
Quote Reply
Re: [joematt] Can't get menu to work with permissions In reply to
Home page and footer subs (both are guilty of not doing what I think they should do!):

sub html_footer {
# --------------------------------------------------------
# 07/30/02 LT -- this subroutine replaced with autosearch.txt MOD - $auth_modify_own =1 and/or $auth_view_own=1
# Print the menu.
#
# We only print options that the user have permissions for.
# 2003/04/10 LT - temporarily removed reports because not yet making
# print qq!| <A HREF="$db_script_url?db=demorpt&uid=$db_uid">Reports</A> |<br>! if {$per_reports};

print qq!<P align=center><$font>!;
print qq!| <A HREF="$db_script_link_url">Main Menu</A> !;
print qq!| <A HREF="$db_script_url?db=demofa&uid=$db_uid">Fixed Assets (Inventory)</A> ! if {$per_fa_add};
print qq!| <A HREF="$db_script_url?db=demostruc&uid=$db_uid">Structures</A> |<BR>! if {$per_cap_add};
print qq!| <A HREF="$db_script_url?db=demoimp&uid=$db_uid">Improvements to Land</A> ! if {$per_imp_add};
print qq!| <A HREF="$db_script_url?db=demoland&uid=$db_uid">Land Parcels</A> ! if {$per_lnd_add};
print qq!| <A HREF="$db_script_link_url&site_admin_display=1">User Admin</A> ! if ($per_siteadmin);
print qq!| <A HREF="$db_script_link_url&admin_display=1">AVS Admin</A> ! if ($per_avsadmin);
print qq!| <A HREF="$db_script_link_url&change_password_form=1">Change Password</A> ! unless ($db_userid eq "default");
print qq!| <A HREF="$db_script_link_url&change_email_form=1">Change Email</A> ! unless ($db_userid eq "default");
print qq!| <A HREF="$db_script_link_url&logoff=1">Log Off</A> !;
print qq!|</font></p>!;

}

sub html_home {
# --------------------------------------------------------
# The database manager home page.

$page_title = "Main Menu";
&html_page_top;

# < -- Start page text -- >
print qq|
<$face size="1"><b>
Permissions:
|;
print "$db_uid |";
print " Fixed&nbsp;Assets&nbsp;(Inventory) |" if ($per_fa_add);
print " Structures |" if ($per_cap_add);
print " Improvements&nbsp;to&nbsp;Land |" if ($per_imp_add);
print " Land&nbsp;Parcels |" if ($per_lnd_add);
print " Reports |" if ($per_reports);
print " Users |" if ($per_siteadmin);
print " AVS&nbsp;Admin |" if ($per_avsadmin);
print " None " if (!($per_fa_add || $per_cap_add || $per_imp_add || $per_lnd_add || $per_reports || $per_siteadmin));
print qq|</b></font>
|;
# 2003/04/10 LT temporarily remove reports link because it doesn't work yet!
# print qq!<dd><li><A HREF="$db_script_url?db=demorpt&uid=$db_uid"><b>Reports</b></A><BR>! if {$per_reports};

print qq!<P align=left><$font_med>!;
print qq!<dd><li><A HREF="$db_script_url?db=demofa&uid=$db_uid"><b>Fixed Assets (Inventory)</b></A><br>! if {$per_fa_add};
print qq!<dd><li><A HREF="$db_script_url?db=demostruc&uid=$db_uid"><b>Structures</b></A><BR>! if {$per_cap_add};
print qq!<dd><li><A HREF="$db_script_url?db=demoimp&uid=$db_uid"><b>Improvements to Land</b></A><BR>! if {$per_imp_add};
print qq!<dd><li><A HREF="$db_script_url?db=demoland&uid=$db_uid"><b>Land Parcels</b></A><BR>! if {$per_lnd_add};
print qq!<dd><li><A HREF="$db_script_link_url&site_admin_display=1"><b>User Admin</b></A><br>! if ($per_siteadmin);
print qq!<dd><li><A HREF="$db_script_link_url&admin_display=1"><b>AVS Admin</b></A><br>! if ($per_avsadmin);
print qq!<dd><li><A HREF="$db_script_link_url&change_password_form=1"><b>Change Password</b></A><br>! unless ($db_userid eq "default");
print qq!<dd><li><A HREF="$db_script_link_url&change_email_form=1"><b>Change Email</b></A><br>! unless ($db_userid eq "default");
print qq!<dd><li><A HREF="$db_script_link_url&logoff=1"><b>Log Off</b></A> !;
print qq!</font></p>!;


# < -- End page text -->

&html_page_bottom;
}


In Reply To:
Quote:
(when I restrict demo I get no change)


Than post the main menu sub and we can look at it.

Tomorrow.


Thanks!
Lynette
Hollister, Ca
Quote Reply
Re: [ltillner] Can't get menu to work with permissions In reply to
If someone wants to look at my code, I've attached the auth.pl, demodef.cgi, htmdefdemo.pl and dbi.cgi. This is for the main menu. I sure haven't been able to see what is keeping this from working right even after a good night's sleep!

Thanks!
Lynette
Hollister, Ca
Quote Reply
Re: [ltillner] Can't get menu to work with permissions In reply to
I see if { when maybe it should be if (

in main menu links SmileSmileSmileSmile

Last edited by:

joematt: Apr 18, 2003, 8:52 AM
Quote Reply
Re: [joematt] Can't get menu to work with permissions In reply to
Thank you Thank you Joe! I just could NOT see this! You have made this a very GOOD -Good Friday indeed!

1 down and one to go!



In Reply To:
I see if { when maybe it should be if (

in main menu links SmileSmileSmileSmile
Lynette
Hollister, Ca