-
New user script
From
Nightfox@VERT/DIGDIST to
All on Wed Sep 3 20:37:09 2014
Recently I have been working on a custom new user application script inãJavaScript. I'm to a point where it asks the relevant questions, and now Iãwant it to actually create the user account. It seems there might be two waysãof doing this:ã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ããIt seems that both of these methods have their own issues. I'd like to let theãnew user continue and log on to the BBS, as in the default new user process,ãbut during my testing, the BBS disconnects when I'm done creating a new userãfor some reason. Also, I'd like to show the user config at the end (usingãbbs.user_config()) so that the user can finalize their settings beforeãcontinuing, but using method #1, it doesn't seem to be saving their informationã- It says they're user #0 and doesn't output their handle, and it also saysãtheir terminal type is TTY (instead of ANSI/ASCII).ããI've seen a new user application script (written by Merlin/Tracker1 of TheãRoughnecks BBS), but it takes the route of creating a new user object andãemailing the password to the user and then disconnecting. I'd rather not haveãto disconnect the user after they create a new user account.ããHas anyone written their own custom new user script and found a way aroundãthis?ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
-
From
Digital Man@VERT to
Nightfox on Wed Sep 3 21:45:35 2014
Re: New user scriptã By: Nightfox to All on Wed Sep 03 2014 08:37 pmãã > Recently I have been working on a custom new user application script inã > JavaScript. I'm to a point where it asks the relevant questions, and now Iã > want it to actually create the user account. It seems there might be twoã > ways of doing this:ã > 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ã >ã > It seems that both of these methods have their own issues. I'd like to letã > the new user continue and log on to the BBS, as in the default new userã > process, but during my testing, the BBS disconnects when I'm done creatingã > a new user for some reason. Also, I'd like to show the user config at theã > end (using bbs.user_config()) so that the user can finalize their settingsã > before continuing, but using method #1, it doesn't seem to be saving theirã > information - It says they're user #0 and doesn't output their handle, andã > it also says their terminal type is TTY (instead of ANSI/ASCII).ã >ã > I've seen a new user application script (written by Merlin/Tracker1 of Theã > Roughnecks BBS), but it takes the route of creating a new user object andã > emailing the password to the user and then disconnecting. I'd rather notã > have to disconnect the user after they create a new user account.ã >ã > Has anyone written their own custom new user script and found a way aroundã > this?ããMethod #1 would definitely be wrong and lead to all kinds of problems, if it ãeven worked at all. The 'user' object should have (in hindsight) been called ã'currentuser' or 'useron' or something more indicative that it represents the ãauthenticated/authorized user and no other user instance.ããNow, I haven't tried to do exactly what you're doing (bypass all the built-in ãnew-user creation logic in Synchronet), so I'm not sure off the top of my head ãthat what you want to do is completely doable without modifying the C/C++ ãsource code.ããYou should use the system.new_user() method to create a new user account ãprogrammatically (as shown in the exec/makeguest.js script). You could then (in ãtheory) "set" the user object to point to the newly created instance like this:ãã newuser = system.new_user("user name");ã user.number = newuser.number;ãã... at least I think that should work. The normal built-in new user process ãdoes all kinds of other stuff too, some of which may not be immediatley ãobvious, so caveat emptor.ãã digital manããSynchronet "Real Fact" #0:ãDevelopment began in 1990 of the (unnamed at the time) Synchronet BBS software.ãNorco, CA WX: 68.6øF, 81.0% humidity, 3 mph SE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Nightfox@VERT/DIGDIST to
Digital Man on Thu Sep 4 07:59:13 2014
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ã