Gossamer Forum
Home : Products : DBMan : Installation :

Adding more roles

Quote Reply
Adding more roles
Hello DBManners

I am trying to add an authority type so I can select what to show depending on the type of user you are...

if ($per_NewAuthType) {&html_record_form_ext (%rec)

I have added the new type in the db.cgi file so I can select it when I create the user in the User Management window.

In sub admin_display I basically added the new type everywhere I saw "per_admin"

print PASS "$in{'new_username'}:$encrypted:$in{'per_view'}:$in{'per_add '}:$in{'per_del'}:$in{'per_mod'}:$in{'per_admin'}:$in{'per_N ewAuthType'}\n";

NewAuthType <input type=checkbox name="per_NewAuthType" value="1" |; ($data[7] and $perm .= "CHECKED"); $perm .= qq|>|;

and

NewAuthType <input type=checkbox name="per_NewAuthType" value="1" |; ($auth_default_perm[5] and $perm .= "CHECKED"); $perm .= qq|>|;


Now, when I add a new user I can click on the NewAuthType option. If I do an "Inquire" on the user I see that the NewAuthType option is saved (clicked) but when I use the "per_NewAuthType" condition in the code, it does not seem to work.

Any ideas? Is there maybe an easier way of accomplishing the same?

Thanks

Jaime Ortega
Quote Reply
Re: Adding more roles In reply to
You'll have to edit auth.pl and make sure that auth_check_passwd returns the authority type as well. Then in db.cgi change:

($status, $uid, $per_view, $per_add, $per_del, $per_mod, $per_admin)
= &auth_check_password; # Authenticate User, get permissions and userid.

to:

($status, $uid, $per_view, $per_add, $per_del, $per_mod, $per_admin, $per_authtype)
= &auth_check_password; # Authenticate User, get permissions and userid.

Now you can use it in the html.pl.

Hope this helps!

Alex
Quote Reply
Re: Adding more roles In reply to
Hi Alex,

Thanks for answering...

I come from a 4 day vacation and puff... Senior Alex has answered my question (which is pretty amazing since after reading my question again I realized that it wasn´t all that clear to begin with)

I looked into the auth.pl file and I added the new authtype everywhere I saw admin. This seemed to do the trick. Thanks for pointing out the auth.pl file to me.


Cheers

-JO