From 1d45f0434924ef6e418fdee3abf379b0354675d8 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Sat, 30 Jun 2012 16:25:29 -0400 Subject: [PATCH] IsUser MPL function, newuserapp bugfix --- mystic/HISTORY.txt | 5 +++++ mystic/bbs_user.pas | 33 ++++++++++++++++++--------------- mystic/mpl_common.pas | 3 ++- mystic/mpl_execute.pas | 4 ++++ 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/mystic/HISTORY.txt b/mystic/HISTORY.txt index fac2a0b..bf5ef95 100644 --- a/mystic/HISTORY.txt +++ b/mystic/HISTORY.txt @@ -4205,3 +4205,8 @@ If the newuserapp.mpx exists in the scripts directory, it will be executed instead of the normal application process. + + + New MPL function IsUser takes a string value which can contain either + a user realname, handle, or user perm index number. If the user exists, + it will return a TRUE result or FALSE if the user does not exist. + diff --git a/mystic/bbs_user.pas b/mystic/bbs_user.pas index 00a9bf7..cf863b2 100644 --- a/mystic/bbs_user.pas +++ b/mystic/bbs_user.pas @@ -90,21 +90,24 @@ Begin FillChar (ThisUser, SizeOf(ThisUser), #0); FillChar (Security, SizeOf(Security), #0); - UserNum := -1; - ThisUser.ScreenSize := Config.DefScreenSize; - ThisUser.Theme := Config.DefThemeFile; - ThisUser.DateType := 1; - ThisUser.HotKeys := True; - ThisUser.RealName := 'Unknown'; - ThisUser.Handle := ThisUser.RealName; - ThisUser.EditType := 1; - ThisUser.Birthday := CurDateJulian; - ThisUser.Gender := 'U'; - ThisUser.FirstOn := CurDateDos; - ThisUser.TimeLeft := Config.LoginTime; - ThisUser.Archive := Config.qwkArchive; - ThisUser.LastFGroup := Config.StartFGroup; - ThisUser.LastMGroup := Config.StartMGroup; + UserNum := -1; + ThisUser.ScreenSize := Config.DefScreenSize; + ThisUser.Theme := Config.DefThemeFile; + ThisUser.StartMenu := Config.DefStartMenu; + ThisUser.DateType := 1; + ThisUser.HotKeys := True; + ThisUser.RealName := 'Unknown'; + ThisUser.Handle := ThisUser.RealName; + ThisUser.EditType := 1; + ThisUser.Birthday := CurDateJulian; + ThisUser.Gender := 'U'; + ThisUser.FirstOn := CurDateDos; + ThisUser.TimeLeft := Config.LoginTime; + ThisUser.Archive := Config.qwkArchive; + ThisUser.LastFGroup := Config.StartFGroup; + ThisUser.LastMGroup := Config.StartMGroup; + ThisUser.UseLBQuote := True; + ThisUser.UseFulLChat := True; IgnoreGroup := False; InChat := False; diff --git a/mystic/mpl_common.pas b/mystic/mpl_common.pas index 94c1511..e0b4391 100644 --- a/mystic/mpl_common.pas +++ b/mystic/mpl_common.pas @@ -286,8 +286,9 @@ Begin AddProc ({$IFDEF MPLPARSER} 'strmci', {$ENDIF} 's', iString); // 535 AddProc ({$IFDEF MPLPARSER} 'getcharxy', {$ENDIF} 'bb', iChar); // 536 AddProc ({$IFDEF MPLPARSER} 'getattrxy', {$ENDIF} 'bb', iByte); // 537 - AddProc ({$IFDEF MPLPARSER} 'putthisuser' {$ENDIF} '', iNone); // 538 + AddProc ({$IFDEF MPLPARSER} 'putthisuser', {$ENDIF} '', iNone); // 538 AddProc ({$IFDEF MPLPARSER} 'putuser', {$ENDIF} 'l', iNone); // 539 + AddProc ({$IFDEF MPLPARSER} 'isuser', {$ENDIF} 's', iBool); // 540 { END OF PROCEDURE DEFINITIONS } diff --git a/mystic/mpl_execute.pas b/mystic/mpl_execute.pas index 6352acc..f132cfe 100644 --- a/mystic/mpl_execute.pas +++ b/mystic/mpl_execute.pas @@ -1883,6 +1883,10 @@ Begin End; 538 : PutUserVars(Session.User.ThisUser); 539 : PutUserRecord(Param[1].L); + 540 : Begin + TempBool := Session.User.FindUser(Param[1].S, False); + Store (TempBool, 1); + End; End; End;