Gossamer Forum
Home : Products : DBMan : Customization :

Permissions/html_page_top problem

Quote Reply
Permissions/html_page_top problem
Hi All,



I am trying to customise the layout of my pages and have chopped up the permissions bit so that it displays the links somewhere other than at the bottom of the page. Most of it works apart from this section which is in my html_page_top:

<tr>
<td><A HREF="$db_script_link_url&add_form=1">Add a cache</A> | if ($per_add);
print qq|</td>
</tr>
<tr>
<td><A HREF="$db_script_link_url&view_search=1">Search for caches</A> | if ($per_view);
print qq|</td>
</tr>
|;

if (!$per_admin && $auth_modify_own) {
print qq| <tr><td><A HREF="$db_script_link_url&delete_form=1&$db_key=*">Delete</A></td></tr> | if ($per_del);
print qq| <tr><td><A HREF="$db_script_link_url&modify_form=1&$db_key=*">Modify</A></td></tr> | if ($per_mod);
}
else {
print qq| <tr><td><A HREF="$db_script_link_url&delete_search=1">Admin Delete</A></td></tr> | if ($per_del);
print qq| <tr><td><A HREF="$db_script_link_url&modify_search=1">Admin Modify</A></td></tr> | if ($per_mod);
}
print qq|


When I log in as admin it works. If I access the database as default then it won't display any of the html_page_top section.

I also have this:

<tr>
<td><A HREF="$db_script_link_url&view_records=1&$db_key=*">List All</A> | if ($per_view);
print qq|</td>
</tr>

Which works either way.

Any ideas?

ACJ
Quote Reply
Re: [ACJ] Permissions/html_page_top problem In reply to
Silly question but you are doing this within table tags?

I've not seen anyone using <TR><TD> tags to display the footer as:

Modify
Delete, etc. one on each line

Is the starting and ending table tags above in the coding where you are inserting it?

I know it should make a difference whether you use print qq| |; or print qq! ! if ($per_view);

but I have noticed for me it has made a difference when using the tags in other locations within the script.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Permissions/html_page_top problem In reply to
The site has a menu down the left hand side of the page anyway so it made sense to carry on the same theme once people were logged into the database.

I have sort of fixed it now. I got it to the stage where it only happens on pages where they don't need any permissions - forgot password page, sign up page, etc. So all I did was create a sub html_page_top_short and referanced that instead where I needed it.

What is the difference between !| and | in that piece of code BTW? Mine seems to work. If I login as a user then my links say "Delete" but if I login as Admin they say "Admin Delete" which is what I wanted.

This is a gorgeous script isn't it? Maybe not as quick as MySQL/PHP which I've done similar things with but this is quicker to add bells and whistles to. I have never seen a freely available script that is so powerful and so well supported. And $100!!! I could charge loads for reselling and installing this on small sites where a flat file DB is all that's required. Are there any limitations on that?

Regards

ACJ
Quote Reply
Re: [LoisC] Permissions/html_page_top problem In reply to
...And sorry, to answer your question, yes I am doing it within table tags. There are about 10 rows and it was only the ones that relied on a user being logged in with more than per_view that were causing the probs so I thought I would just paste that bit of code to save space.

ACJ
Quote Reply
Re: [ACJ] Permissions/html_page_top problem In reply to
I was recently doing something similiar but I have my side menu contained within my footer. This is what I did to show a different display and to allow the logged in user to remain logged in by choosing the side menu items.

|;
print qq! $tpic <A HREF="mpa.cgi?db=mpa&uid=$db_uid">Main Menu</A><BR> ! unless ($db_userid eq "default");
print qq! $tpic <A HREF="mpa.cgi?db=mpa&uid=$db_uid&view_records=1&$db_key=*&sb=$sort_field&so=$sortorder&Validated=Yes">Browse All</A><BR> ! unless ($db_userid eq "default");
print qq! $tpic <A HREF="mpa.cgi?db=mpa&uid=$db_uid&view_search=1&advanced=1">Search</A> ! unless ($db_userid eq "default");

if ($db_userid eq "default") {
print qq! $tpic <A HREF="mpa.cgi?db=mpa&uid=default">Main Menu</A><BR> !;
print qq! $tpic <A HREF="mpa.cgi?db=mpa&uid=default&view_records=1&$db_key=*&sb=$sort_field&so=$sortorder&Validated=Yes">Browse All</A><BR> !;
print qq! $tpic <A HREF="mpa.cgi?db=mpa&uid=default&view_search=1&advanced=1">Search</A> !;
}
print qq!<BR> $tpic <A HREF="$db_script_url?db=mpa&signup_form=1">Sign Up</A><BR> ! unless ($db_userid ne "default");

I think you would need special permission from Alex to resell his script. You can provide custom installations but each user would have to download and register the copy for their site. Read the copyright notice within the files :)

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Permissions/html_page_top problem In reply to
That's more or less what I had in mind. Anyone can download the script and register it, it's the configuration, adding mods, etc that takes the real time and that's what I would be charging for rather than just selling a copy on disk for example.

I still have the original problem. I thought I had got round it but only because I had changed the default user permissions.

I am thinking of redoing the html.pl file so that instead of moving the permissions section, I will just try and format it differently.

ACJ