Log in

View Full Version : Mods editing user accounts


BrAinZ
03-10-2004, 08:03 AM
Hiya,

I would like a bit of general help.

I'm trying to give my Mods very limited access to changing certain user account details. I've got it pretty much there, but I just can't get it to actually SAVE the data from the Mod panel

I'm guessing it's something to do with user.php.

I have the doformfooter("Save Changes"); line in there, but it doesn't do anything when you click the SAVE button.

It's it just cause they can't access the Admin Control Panel, as using the Mod Panel, I can't do it either as Admin :(

Any help or pointers in the right direction would be appreciated!

Christine
03-10-2004, 11:39 AM
Did you add the logic to update the database for those fields to the modcp/user.php file?

BrAinZ
03-10-2004, 02:21 PM
Did you add the logic to update the database for those fields to the modcp/user.php file?It's a very good question. To be honest, I'm not much of an expert in PHP, just trying to get by on what limited knowledge I have.

Which bit of the user.php would do that?

I don't really understand what the..
doformfooter("Save Changes");
bit does.

Christine
03-10-2004, 03:17 PM
The user.php file in the ModCP folder isn't set to take modifications to the user fields with the exception of pics, avatars, signatures and reputation (may be one or two others as well).

If you are going to add things that the mods can change (like birthdate, homepage, etc...), you will need to add the logic to the user.php file to update the database.

Without that, 'save changes' won't do anything.

:):

If you want to see an example of how this would need to look, I have a hack that allows mods to change usergroups. Look at the changegroup.php file in the zip -- that will give you an idea of what all you need to add so that the interface and database pieces are both there.

Here is that thread:

https://vborg.vbsupport.ru/showthread.php?t=62018

:)

BrAinZ
03-10-2004, 04:24 PM
Excellent.. I'll take a look.

I was hoping that I could "Borrow" the relevant code from the admin/user.php file It must be in there somewhere.

Christine
03-10-2004, 09:31 PM
It isn't that hard once you have all of the elements in place.

:):

BrAinZ
03-11-2004, 05:51 AM
It isn't that hard once you have all of the elements in place.

:):Yes... If I could just find that "other" element, then I'd be away :)

BrAinZ
03-11-2004, 05:53 AM
This is what I have so far...

Christine
03-11-2004, 11:09 AM
Hi BrAinZ,

Just a note -- you need to take that attachment out as it is against the rules to post vB's php files here. You can upload ones that you create from scratch, but not their source files (original or those that you have modified).

Easiest way to share your changes is to make a .txt document and put in it what you added to the file and where.

;)

BrAinZ
03-11-2004, 04:59 PM
Whoops.. sorry!

BrAinZ
03-15-2004, 07:58 PM
I'm still trying to get this sorted. Could anyone tell me where the logic is that deals with the save user data form?