Gossamer Forum
Home : Products : DBMan : Customization :

User Management form - Urgent!

Quote Reply
User Management form - Urgent!
Tongue I need to modify the User Management form so that the Delete and Modify checkboxes do NOT appear (we don't allow delete or modify just add) and I need Admin and Validated to be separate as well (can add user but can't mark a record as validated -- which we call complete)

Help this is for a meeting at 9 am PDT tomorrow and I want the screen to be right!

I haven't been able to find where to modify this!

Thanks,

Lynette
Lynette
Hollister, Ca
Quote Reply
Re: [ltillner] User Management form - Urgent! In reply to
Is this part of the validation MOD?

In my sub html_validate_form
I find
Code:
print qq|<tr><td valign=top>
<INPUT TYPE=radio NAME="$tmp{$db_key}" VALUE="validate">Validate<BR>
<INPUT TYPE=radio NAME="$tmp{$db_key}" VALUE="delete">Delete<BR>
<a href="$db_script_link_url&$db_key=$tmp{$db_key}&modify_form=1">Modify</a></TD></td><td>|;

which I think adds the check boxes to the screen.

You can change the print qq|

to a
Code:
print qq|<tr><td valign=top>|;

print qq!| <INPUT TYPE=radio NAME="$tmp{$db_key}" VALUE="validate">Validate<BR>! if ($per_admin);
print qq!| <INPUT TYPE=radio NAME="$tmp{$db_key}" VALUE="delete">Delete<BR>! if ($per_admin);
print qq!| <a href="$db_script_link_url&$db_key=$tmp{$db_key}&modify_form=1">Modify</a>! if ($per_admin);

print qq|</TD></td><td>|;

so that only admin level gets to see the checkboxes.

Hope that helps
Quote Reply
Re: [ltillner] User Management form - Urgent! In reply to
User management should only be viewable by admin so I'm not sure why you would need to actually remove the checkboxes from Admin view.

The permissions options are set within the .cfg file for both default and registered users. If you state the permissions there then you shouldn't have to remove the checkboxes which would be available for assigning say delete and modify for admin or specific people.

The validate should also only be available to admin by putting that option within your record_form:

if ($per_admin) { print qq|
<TR><TD colspan=2><$font>Validated: &nbsp;|; print &build_radio_field("Validated",$rec{'Validated'}); print qq|</font></TD></TR> |;
}
else { print qq|<TR><TD colspan=2>
<input type="hidden" NAME="Validated" VALUE="$rec{'Validated'}"></TD></TR> |;
}

and in your footer use something like this:

print qq!| <A HREF="$db_script_link_url&validate_form=1">Validate</A> ! if ($per_admin);

If you are having others use the admin functions, perhaps you should setup another permission level?

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] User Management form - Urgent! In reply to
I actually need two levels of admin. One that allows adding users only and one that allows adding users and validating records.

We also don't use the modify and delete functions at all. so client admins( that can only add users) are confused by having those check boxes.

I will see what happens with this. Thanks for your help!
Lynette
Hollister, Ca
Quote Reply
Re: [LoisC] User Management form - Urgent! In reply to
Yes, adding another permission level is where I'm at right now, working on Add Permission Mod and then to make the validate be separate from admin.
Lynette
Hollister, Ca
Quote Reply
Re: [LoisC] User Management form - Urgent! In reply to
Ok, I've been thinking some more on this. I added the Add Permission Mod by JPDeni this morning. It's working and now I need to modify the scripts to put it into action.

I really need a "Super Admin" -- and that is who would be able to assign Admin rights to a user (a regular admin could only set up a new user and assign -- View/Add/ rights.) and I don't want Admin to be able to change the password or email of or delete the Super Admin.

So what I would like to do is use the new $mem permission to set this as the "Site Admin" leaving Admin as the super Admin

I assume the easy start would be to duplicate and pare down the Admin code for the new 'site admin.'

The Superadmin only needs to be one or two logins.... so I can use if else statements there I suppose.

Thanks for any additional suggestions you might have!
Lynette
Hollister, Ca
Quote Reply
Re: [LoisC] User Management form - Urgent! In reply to
I've made progress on this but run into a couple problems, going back your message, I'm confused.

You say the .cfg file contains all the "permission" options. Do you mean that I need to create new options for my "siteadmin" permission?

I left the admin permission as is, so it does full user management and validation

I added the siteadmin permission and want to make that a pared down version of admin (only able to do user management for users it adds)

In DB.cgi,

I cloned the admin_display and called it site_admin_display - modified it to call &html_site_admin_display

added an else if for it with an if ($per_siteadmin)

In my html.pl,

I cloned sub html_admin_display anc called it html_site_admin_display

but in the siteadmin user management form I don't get the user list select box, and I don't get the list of permissions. I've been unsuccessful and determining what code I need to modify to fix this!

Thanks for any help!
Lynette
Hollister, Ca
Quote Reply
Re: [LoisC] User Management form - Urgent! In reply to
Blush I figured it out! needed to change <input type=hidden name="admin_display" value="1">

to "site_admin_display" (in my new sub html_site_admin_display (in html.pl)

and in db.cgi, change elsif for site_admin_display to also find &site_admin_display instead of &admin_display

I getting this slowly!
Lynette
Hollister, Ca