Re: New user script
By: Digital Man to Nightfox on Wed Sep 03 2014 21:45:35
>> 1. Set the appropriate fields in the user object which exists in
>> memory
>> 2. Create a new user object with all the information provided
>> by the logged-in user
DM> Method #1 would definitely be wrong and lead to all kinds of problems,
DM> if it even worked at all. The 'user' object should have (in hindsight)
DM> been called 'currentuser' or 'useron' or something more indicative that
DM> it represents the authenticated/authorized user and no other user
DM> instance.
DM> Now, I haven't tried to do exactly what you're doing (bypass all the
DM> built-in new-user creation logic in Synchronet), so I'm not sure off the
DM> top of my head that what you want to do is completely doable without
DM> modifying the C/C++ source code.
DM> newuser = system.new_user("user name");
DM> user.number = newuser.number;
DM> ... at least I think that should work. The normal built-in new user
DM> process does all kinds of other stuff too, some of which may not be
DM> immediatley obvious, so caveat emptor.
Thanks. If the built-in new user process does a lot more than can be done in
JavaScript, maybe I'll leave the built-in process in place.
Nightfox
---
■ Synchronet ■ Digital Distortion BBS - digitaldistortionbbs.com
|