Gossamer Forum
Home : Products : DBMan : Customization :

How to save the admin id into user's permissions in .pass file?

Quote Reply
How to save the admin id into user's permissions in .pass file?
Hi.
My situation first:
My DB has many sub-admins accounts, so each sub-admin can creates users. The main admin can creates sub-admins and sub-admin can creates users account. But (the problem is) all users created have the same situation on .pass file, it means, It's not possible to know, looking some user, what sub-admin had created this user.
What I want:
When sub-admin creates an user, the sub-admin id is stored into user line on .pass file. Like this:

# UserID : Password : View : Add : Del : Mod : Subadmin : Admin : CREATOR
admin:***********:1::1::1:1:God(??) Smile
john:************:1:1:1:1:1::admin
peter:************:1:1:1:1:1::admin
mary:************:1:1:1:1:::john
james:***********:1::1::::peter

Is there solution for me?
Thank's.
Quote Reply
Re: [pepee] How to save the admin id into user's permissions in .pass file? In reply to
Sure it can be done. I did something similar when I wrote the lookup mod and added the email address to the .pass file.

Take a look at the "basic" file at http://jpdeni.com/...s/secure_lookup.html and the corresponding modification for the html.pl file. All you need to worry about is replacing sub admin_display and sub html_admin_display and change the "email" to "subadmin" (or something else). You might want to add a line to automatically add the subadmin's name before the new user is added.

You'll also probably need to edit your .pass file to start with, to add the subadmins. It would be easier to edit it in a text editor than to go through each person individually.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Quote Reply
Re: [JPDeni] How to save the admin id into user's permissions in .pass file? In reply to
Yes, it was a piece of cake.
Just added the new "$creator" variable in some lines into "sub admin_display" on db.cgi and into "sub html_admin_display" on html.pl. Put the tag "<input type=hidden name="creator" value="$db_userid">" into "sub html_admin_display" on html.pl and increased one more column for the userid names on .pass file.
It can't be more easier.
Thank you.
Quote Reply
Re: [pepee] How to save the admin id into user's permissions in .pass file? In reply to
I"m so glad it worked for you. It always pleases me a great deal when I can give someone a nudge and they follow through on their own. If they need more help, that's fine, but it's great to see people who want to do it on their own.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.