Bucko219

Mystic connect.mps

Feb 9th, 2026
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. // Auto create MPL for RLOGIN auto-creation example
  2. // ================================================
  3. //
  4. // This would be renamed to connect.mps which is executed as soon as a
  5. // connection comes in, even before graphics detection.
  6. //
  7. // By default this script will create a user automatically if AutoCreate is
  8. // set to TRUE below, or just push them immediately through to the new user
  9. // application if set to FALSE.
  10. //
  11. // Security below defines the level used for the created user. Ideally you
  12. // would probably want to create them with a specific security level and then
  13. // you could redirect them to their own menu system which would be completely
  14. // independant from the BBS.
  15.  
  16. Const
  17. EnableRLOGIN = True; // If True, process RLOGIN users for autocreate
  18. EnableSSH = False; // If True, process SSH users for autocreate
  19. AutoCreate = True; // Set True to autocreate or False to send to new
  20. // user application.
  21. StartMenu = ''; // Menu to start users at (Blank for default)
  22. Security = 0; // Security level to use for created users or 0
  23. // to use the default new user security level
  24. Begin
  25. If ((ServerType = 1 and EnableRLOGIN) or (ServerType = 2 and EnableSSH)) and
  26. (UserLoginName <> '') and (UserLoginPW <> '') Then Begin
  27.  
  28. // This is connection from RLOGIN or SSH, so lets see if the user exists.
  29. // Other manipulation or validation of the User ID or password could be
  30. // done here too as needed.
  31.  
  32. If Not IsUser(UserLoginName) Then Begin
  33.  
  34. // User does not exist, so we can either set "UserLoginNew" to true to
  35. // push the user directly to the new user application, or we could
  36. // create the user and automatically push them through.
  37.  
  38. If AutoCreate Then Begin
  39. Var Cmd : String = 'mystic -newuser handle="' + UserLoginName + '" "pass=' + UserLoginPW + '"';
  40.  
  41. If (Security > 0) and (Security < 250) Then
  42. Cmd := Cmd + ' level=' + Int2Str(Security);
  43.  
  44. If StartMenu <> '' Then
  45. Cmd := Cmd + ' menu=' + StartMenu;
  46.  
  47. If OSType = 1 or OSType = 2 Then
  48. Cmd := './' + Cmd + ' /dev/null 2>&1';
  49.  
  50. SysopLog ('Auto creating user via RLOGIN: ' + UserLoginName);
  51.  
  52. MenuCmd('DD', Cmd);
  53. End Else
  54. UserLoginNew := True;
  55. End;
  56. End;
  57. End.
  58.  
Advertisement
Add Comment
Please, Sign In to add comment