• script to create / update a user in Mystic BBS

    From Alessandro Trebbi@2:331/313 to All on Sun Sep 27 17:24:08 2020
    I need a script to create a user, given username / password / email ; the script should check if the user is already existing, and in this case update email and password

    Is there something already available ? or a tip to create it

    The script will be executed from linux command line and will be used to keep synchronised the mystic user base with users of an external forum

    thanks in advance
    --- FUDforum on https://fidonet.3bsoft.com
    * Origin: Nightmare BBS (2:331/313)
  • From g00r00@1:129/215 to Alessandro Trebbi on Sun Sep 27 13:08:44 2020
    I need a script to create a user, given username / password / email ; the script should check if the user is already existing, and in this case update email and password

    There is no way to update the password via command line because that could be a huge security issue, but you can create users from command line if you need
    to:

    mystic -newuser handle=g00r00 email=me@mysticbbs.com pass=1234

    It will return "TRUE" or "FALSE" to STDIO depending on whether or not the user is created. It will not update an existing user, it will return FALSE if the ID is already taken.

    Do you have a way to detect in your script if the user is new or existing?

    I suppose I could do a "update" function that allows a user to be updated as long as their security level is less than 250. I don't know that I want to create a single function that either creates OR updates a user though, I'd
    have to think that through more.

    --- Mystic BBS v1.12 A47 2020/09/25 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From Chad Adams@1:19/37 to All on Sun Sep 27 15:06:44 2020
    Ever considered making a command line utility for management? I’d love to write in in FreePascal if I knew how to open the user and system file to read and write.

    I wonder if I could find out from the last Mystic open source that’s out there.

    On 08:08 27/09 , g00r00 wrote:
    I need a script to create a user, given username / password / email ; the script should check if the user is already existing, and in this case update email and password

    There is no way to update the password via command line because that could
    be a
    huge security issue, but you can create users from command line if you need >to:

    mystic -newuser handle=g00r00 email=me@mysticbbs.com pass=1234

    It will return "TRUE" or "FALSE" to STDIO depending on whether or not the user >is created. It will not update an existing user, it will return FALSE if the ID
    is already taken.

    Do you have a way to detect in your script if the user is new or existing?

    I suppose I could do a "update" function that allows a user to be updated as >long as their security level is less than 250. I don't know that I want to >create a single function that either creates OR updates a user though, I'd >have to think that through more.

    --- Mystic BBS v1.12 A47 2020/09/25 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)


    --
    yrNews Usenet Reader for iOS
    http://appstore.com/yrNewsUsenetReader

    --- Mystic BBS/NNTP v1.12 A47 2020/09/12 (Linux/64)
    * Origin: The ByteXchange BBS | bbs.thebytexchange.com (1:19/37)
  • From Alessandro Trebbi@2:331/313 to g00r00 on Tue Sep 29 15:00:16 2020
    Quota: g00r00 (1:129/215) ha scritto in data Dom, 27 Settembre 2020 15:08

    ----------------------------------------------------
    There is no way to update the password via command line because that could be a
    huge security issue, but you can create users from command line if you need to:

    mystic -newuser handle=g00r00 email=me@mysticbbs.com pass=1234

    Do you have a way to detect in your script if the user is new or existing?
    ----------------------------------------------------

    I have an happy flow where user first registers and then may update data ; but, in general, there are some ways to work around this flow: for example, user register but does not confirm an account ; or I update data of a user that is not in MysticBBS (because there was no integration when it was created)

    something like this may do the job:
    mystic -newuser handle=g00r00 email=me@mysticbbs.com pass=1234 -updateifexists

    or may I do something like this with mystic pascal ? (I have tried python, but did not manage to have it work)

    --- FUDforum on https://fidonet.3bsoft.com
    * Origin: Nightmare BBS (2:331/313)
  • From g00r00@1:129/215 to Alessandro Trebbi on Tue Sep 29 10:35:55 2020
    something like this may do the job:
    mystic -newuser handle=g00r00 email=me@mysticbbs.com pass=1234 -updateifexists

    Okay I will experiment with adding an "update=true" option for you. But as with the creation it will only work on users that are less than security 250.

    or may I do something like this with mystic pascal ? (I have tried
    python, but did not manage to have it work)

    Yes this could be done in MPL too but hold off on that I will try to give
    you a better way to do things. I should have time to work on that today.

    --- Mystic BBS v1.12 A47 2020/09/27 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)