Sauron Linux BBS version 0.4.1.1

CHANGELOG:

29-08-08 Simon Horton <simon@sauron.org.uk>

	* VERSION: 0.4.1.1 (BUG FIXES)
	
	* data.pp:
	- Commented out routinues which opened/closed the
	- old messge database files.

	* forum.pp:
	- Fixed bug in FORUMDISPLAY which did not show the 
	- lightbar after select no to the option to post to
	- an empty forum.
	- Fixed bug which did not display a new post symbol
	- when a new post is created in a empty forum

	- User now goes back to the forum post list after
	- posting a reply.

	- Fixed bug on GETPOSTMSG which now clears all previous
	- msg post data prior to reading the new post.

	* mail.pp:
	- Added routinue to set the mail replied flag in 
	- the SQL table: MAILMARKREPLY

	- Left arrow now exists mail 

	- Fixed bug which displayed the mail line in the inbox
	- 1 space to the left when highlighted. 

28-08-08 Simon Horton <simon@sauron.org.uk>

	* sql:
	- Moved L1T - L2C over bbs_config table

	* data.pp:
	- Moved L1T - L2C over to ReadBBSConfig
	- Commented out code in ReadINI

	- Comment out code which read SIMPBBS.DAT
	- no longer need...

	* sysop.pp:
	- Change procedure SYSOPLEVELCALLS to
	- use SQL

	- Change procedure SYSOPLEVELTIMES to
	- use SQL

	* sf2u.pp:
	- Commented out BBS VARS:
	- %LASTTOWN% %LASTUSER%
	- No longer needed as last callers are
	- writen to login dat.

	- New VAR %ROOT% = true if root user

27-08-08 Simon Horton <simon@sauron.org.uk>

	* sysop.pp:
	- Added new procedure SYSOPUSERUID
	- Changes the Linux UID range
	
	- Added new procedure SYSOPUID
	- Changes the Sysop UID
	
	- Added new procedure GUESTUID
	- Changes the GUEST UID

	- Added new procedure SYSOPGUESTSALLOWED
	- Changes the number of guests allowed online at
	- any one time.

	- Added new procedure SYSOPBBSCALLS
	- Changes the BBS call number
	
	- Added new procedure SYSOPIDLETIME
	- Changes the BBS User Idle Time
	
	- Added new procedure SYSOPERRORLOG
	- Changes the BBS error log filename

	- Added new procedure SYSOPUSERLOG
	- Changes the BBS user log filename
	
	- Added new procedure SYSOPSHOWIP
	- Changes the BBS ShowIP value

	- Added new procedure SYSOPBULLETINFORUM
	- Changes the BBS bulletin Forum FID

	* sf2u.pp:
	- New BBS Script commands:
	- SYSOPUSERUID
	- SYSOPUID
	- SYSOPGUESTUID
	- SYSOPGUESTSALLOWED
	- SYSOPBBSCALLS
	- SYSOPIDLETIME
	- SYSOPERRORLOG
	- SYSOPUSERLOG
	- SYSOPSHOWIP
	- SYSOPBULLETINFORUM

	* data.pp:
	- New function GETNEXTGUESTNUMBER : boolean
	- Gets and updates the guest numbering system in SQL
	- recycles old numbers when it reaches 1000

	- Change GetNextGuest to new routinue

	- New procedure SQLConnect
	- Connects to the SQL server, moved from OPENDATAFILES function.

	* slbbs.pp:
	- Added SQLCONNECT to main routine

26-08-08 Simon Horton <simon@sauron.org.uk>

	* sysop.pp:
	- Change procedure edituser to allow the
	- deletion of the user account.

	* lib.pp:
	- Added new function UPDATEBBSCALLS : BOOLEAN
	- Increments BBS calls by 1
	- removed the INI update calls code

	* data.pp:
	- Added new function READBBSCONFIG : BOOLEAN;
	- Reads BBS Config Data from SQL

	* slbbs.pp:
	- Added  UpdateBBSCalls to  main routine


19-08-08 Simon Horton <simon@sauron.org.uk>

	* user.pp:
	- New procedure UserDisplay
	- Lists all registered users

	* sf2u.pp:
	- New script command USERLIST
	- Display all registered users

19-08-08 Simon Horton <simon@sauron.org.uk>

	* sf2u.pp:
	- New VAR %ALLFORUMREPLIES%
	- Displays all forum replies total

	* data.pp:
	- Added BBSCFG.LINUXUID
	- Holds the start of the Linux UID range for BBS
	- users. Pulled for now from linux.ini

	* linux.ini:
	- Added new option LINUXUID=xxxx

18-08-08 Simon Horton <simon@sauron.org.uk>

	* sf2u.pp:
	- Changed the following user commands to
	- allow exit on a blank input.
	- CHANGEUSERFULLNAME
	- CHNAGEUSETTOWN
	- CHANGEEMAIL

	- New var %LASTERROR% display last error 1 or 0

	* user.pp:
	- Added routine  updateusertimestamp updates users
	- logon timestamp, used by 24 access


15-08-08 Simon Horton <simon@sauron.org.uk>

	* sysop.pp:
	- Change SYSOPINFO routine to SQL

10-08-08 Simon Horton <simon@sauron.org.uk>

	* sql:
	- Added bbs_config table
	- Replaces configuration from linux.ini

	* sysop.pp:
	- Change sysopnode routinue to SQL

10-08-08 Simon Horton <simon@sauron.org.uk>

	* selectionbox.pp:
	- New module for lightbar routinues

31-07-08 Simon Horton <simon@sauron.org.uk>

	* sf2up.pp:
	- Changed VAR %EMSGWAITING% to use function
	- MailCountNew() and changed VAR msg to
	- [YOU HAVE NEW MAIL]

	* mail.pp:
	- Changed MailDisplayHeader() and
	- ReadEMail() to include
	- mail header information

	- Changed DeleteMail() moved to SQL
	- TODO: clean up !!!

30-07-08 Simon Horton <simon@sauron.org.uk>

	* sql:
	- Added user_mail table

	* mail.pp:
	- Added SQLDB to use
	
	- Added Function MailCountTotal
	- Total number of mail a user has

	- Added function MailCountNew
	- Total number of unread mail a user has

	- Updated function MailUser
	- Moved to SQL
	- Commented out code which saved to a file
	- TODO: Clean up!!

	- Updated function RetrieveMailHeaders
	- moved to SQL
	- Commented out old code
	- TODO: Clean up!!!

	- Update function RetrieveMail
	- Moved to SQL
	- Commented out old code
	- TODOL Clean up!!!

	- Changed procedure ReadEMail(MSG : string)
	- To procedure ReadEMail(EID : integer);

	- Changed ListMail routine
	- Added Reply/New marker

	- New procedure MailMarkRead()
	- Sets users mail as read

	* sf2u.pp:
	- VARS	
	%MAILCOUNTTOTAL% Displays users total mail
	%MAILCOUNTNEW% Displays users total unread mail
	
	- IF VARS
	%MAILCOUNTTOTAL% True if Mail > 0
	%MAILCOUNTNEW% True if New Mail

24-07-08 Simon Horton <simon@sauron.org.uk>

	* user.pp:
	Added updateuserreg()
	- Set UserInfo.UserReg in SQL user_data to 1
	
	Added usersignupcount()
	- Returns the number of accounts waiting creation

	* sf2u.pp:
	Set menudisplay to true due to menu not working correctly

	%NEWUSERS% - Displays the number of users waiting creation

	SYSOPNEWSIGNUPS - Script command, list, delete users waiting
	creation

	* sql:
	Added new user signup table user_signup

	* linuxnew.pp:
	Added pascal units sqldb, user

	Change routine Check_For_Existing_User()
	- Checks against SQL table user_signup for usernames waiting
	- creation.
	- Removed code which checked against adduser.dat.

	Changed routine Create_User()
	- Insert new user data into SQL table user_signup.
	- Removed code which used adduser.dat.

	Removed the following routines:
	-  Close_Database
	-  Open_Database
	-  Create_Database
	-  Get_User_Size

	* sysop.pp:
	Added sysopsignups()
	- List, Delete new users waiting creation.

23-07-08 Simon Horton <simon@sauron.org.uk>

	* sysop.pp:
	Added sysopedituser - List & edit user accounts
	Added sysopdeleteguests
	- Deletes guest accounts who have not logged in x days

	* user.pp:
	Added guestusercount
	Added usercount
	Added updateuserfullname()
	Added updateuseremail()
	Added updateuserinfo()
	Added updateuserlevel()

	* sf2u.pp:
	Change CHANGEFULLNAME sub to include updateuserfullname
	Change CHANGEEMAIL sub to include updateuseremail
	change USERINFO1-8 sub to include updateuserinfo

	new unit var menudisplay : boolean
	- Set to true if the menu script command is set in the script
	- file. Used by the script interpreter to determine if the ansi
	- menu should be display when a command is not found.
	- MenuDisplay is set to false until the MENU script command
	- is used.

	%USEREMAIL% - Displays users current email address
	%USERTOTAL% - Displays total registered users
	%GUESTTOTAL% - Displays total guest users

	SYSOPEDITUSER - Script command, List & edit user accounts
	SYSOPEDITGUESTUSER - Script command, List & edit guest user accounts
	SYSOPDELETEGUESTS - Script command, deletes guest accounts

21-07-08 Simon Horton <simon@sauron.org.uk>

	* user.pp: New User Unit (SQL functions for user data)
	- Move user data over to SQL

	* sf2u.pp:
	%NEWFORUMREPLIES% (New script variable)
	Displays number of new forum replies since users last log on

	* changelog.txt: New format

18-07-08

new VARS

  %SYSOPDELETEFORUMS%

 - Displays number of forums with the deletetag set to 1

new script command

 - SYSOPADDFORUM
 - SYSOPDELETEFORUMS
 - SYSOPEDITFORUM

sysop.pp

 - procedure sysopaddforum;

forum.pp

 - function deleteforum : boolean;

17-07-08

new script command

 - SYSOPDELETEPOSTS

New VAR %SYSOPDELETEPOSTS%

 - Displays the number of posts with the deletetag set to 1

sysop.pp

 - function sysopdeletedposts : integer;
 - procedure sysopdeleteposts;

08-07-08

Removed the need for BULLETINNUMBER in linux.ini, now use
BULLETINNUMBER routine in bulletin.pp to get the number of
posts in the bulletin forum.

07-07-08

New var

 - %NEWFORUMPOSTS% - Number of forum posts since user last login

27-06-2008

new script command DISPLAYBULLETINS

 - Shows all posts from  bulletin forum

Added to linux.ini

 - ;
 - ; Forum ID which is used as the bulletin forum
 - ;
 - BULLETINFORUM=10


new unit bulletin.pp

 - Uses one defined unit as the bulletin

added new lib.pp procedure colourprint(buffer : string)

 - Prints sauron colour codes to output and colour
 - used for fulleditor.pp

20-06-2008

Added  UserInfo.UserLogon  : time_t; { epochtime of user login }


19-06-2008

Added function DaysPassed(ttime: time_t): longint;
to dates.pp

 - Returns the number of days between 2 epoch times

13-06-2008

new script command

 - FORUMPOSTMSG
 - Write message and post to forum

new sub-routinue forum.pp

 - ForumPostMessage

12-06-2008

new vars:

 - %FORUMTITLE%  Current Forum Title
 - %FORUMDESC%   Current Forum Description
 - %FORUMPOSTS%  Number of Posts in forum

11-06-2008

new vars:

 - %FORUMS%  Total number of forums
 - %ALLFORUMPOSTS% Total Forum Posts

new Script Command:

 - SELECTFORUM <forum id>
 - No id will display a list of available forums
 - for the user to select.


added sql_connect(host,user,pass) to opendatafiles
and sql_close to closedatafiles in data.pp

included SQL server information into linux.ini,
updated data.pp for SQL configuration:

 - [SQL]
 - ; MYSQL
 - SERVER=127.0.0.1  : BBSCfg.SQLServer
 - USER=root         : BBSCfg.SQLUser
 - PASS=             : BBSCfg.SQLPass
 - DB=bbs            : BBSCfg.SQLDb


added forum.pp sqldb.pp

new version 0.4.0.0 - sql

04-06-2008

Error in getdoortime - Currently disabled..

Disabled ANSIDETECT routine while testing SCONNECT
will make into a script command for option of using
SCONNECT..


30-05-2008

Added DOOR32.SYS dropfile format

28-05-2008

Changed DOOR.SYS format - see docs/door.sys

27-05-2008

Fixed WHOSBEENONLINE date from being 24 hrs into the future

Changed CHANGEEMAIL/JOINEMAIL text length from 30 -> 40

Update LINUXLOCK.PP to include error strings into error.log on
lock file access/read/write errors.

Added User Email in new user mail to sysop.

21-05-2008

Added door.sys dropfile in door.pp GetDoorSys(Node : Byte)

  - creates a user door.sys or door.sys.<hostname> if a guest
  - see example door scripts in bbs/door on how to use.
  -
  - still may need to review the door.sys file as I found
  - a number of different file formats.

Fixed bug in READKB() which would print * on the screen for
for non allowed chars for GETPASSWORD

19-05-2008

changed GETPASSWORD command to only allow 0-9,a-z,A-Z. User also has to
hit enter to submit.

added new global var ThisUser
	
	- holds the current user name from pw_name
	- used for node lock filenames.

Changed guest node lock filenames so they will not be removed
by the REMOVEOLDLOCKS.SH script during mentenance.

	- from: <remoteip>.lock
	- to  : guest.<remoteip>.lock

Updated Node Lock file with a Door Lock :
      	- updatelocktime(false); (linuxlock.pp)

	- Updates the users lock file with a timestamp
	- if the users lock file is left after a hangup
	- then the next user will remove the lock file
	- after the timeout period
	-
	- if the user is in a door, then this file is not
	- update periodically, so we lock the node file with
	- the door true flag sa it cannot be removed by another
	- node if the timestamp has not been updated. If the user
	- in a door and hangsup/disconnected the node door lock will
	- not be removed, so the bbs maintenance script will remove the
	- file

New maintenace script : REMOVEOLDLOCKS.SH

	- Removes any old lock files which the BBS has failed to delete
	- This will be the case if the user has been in a door and either
	- disconnected, or hung up, as the <user>.lock file sets a door
	- flag in the lock file to prevent it from being deleted by the
	- deleteoldlockfiles routine within the BBS. Whilst the users
	- lock file remains in the door lock state, the user will be
	- unable to connect to the BBS.
	-
	- uses the Linux WHO command to check users currently
	- logged into the system against node lock files. Node files
        - which do not have a logged in user will be removed.
	-
	- This script should be run every 5 - 15 minutes as a cron job.

16-05-2008

Added %USEREMAILADDRESS% displays users registered email address

Added %TIMESTAMP% display variable - julien date stamp

SCRIPTTITLE <text> - sets the title of the current running
                   - script. Will be used as a whosonline
                   - option set in linux.ini

Add %SCRIPTTITLE% display variable

Changed the SHOWWHOSONLINE command to display the following:

- linux.ini SHOWIP -> SHOWWHO
- 0 = OFF
- 1 = IP Address
- 2 = Users current ScriptTitle (default)

15-05-2008

fixed bug in adduser name which would rub out more then the
number of chars in the username input field.
Increase username length to 15

Added %NEWUSERNAME% var - Displays the requested username

Added %USEROLDPASSWORD% - Holds users old password from the
GETUSEROLDPASSWORD script command, required for changing
passwords..

New command:

CREATEPASSWORDTAG  - creates a file called password.tag in
                   - users home directory. this file
                   - contains the old/new passwords
                   - needed by changepassword.sh in order
                   - to change the users password.
                   - createpasswordtag must be called prior
                   - to calling the changepasswd script.

New scripts:

changepassword.sh  - script to change users password
changepassword.ex  - expect script to change password
                   - called by changepassword script

05-05-2008

changed adduser name to only allow 0-9,a-z,A-Z. User also has to
hit enter to submit requested name.

New Version 0.31.0.1

01-05-2008

Rewrite and revamped the user mail interface due too many bugs...
New version 0.31.0.0

30-04-2008

Mail is now displayed in date order. Oldest -> Newest.

29-04-2008

Fixed error preventing level 9 users from tagging a download file.

28-04-2008

Increased data string for BBS name to 40 chars

Added option in linux.ini to withhold connecting hosts IP address from being displayed
in whosonline to all non-sysop users.
; 0 = disabled 1 = enabled (defualt if option missing from ini)
SHOWIP=0

04-04-2008

Minor Bug fixes

03-03-2008

Added RETURN command - executes previous script

28-02-2008

Added maxtags into linux.ini for max number of files a user can download.
Included check maxtags when tagging files for dowonload.
updated getdl.pp (updatedownloadtags) to include guest users and point to user
home areas.
Enabled UPDATEFILEDOWNLOAD command.
Added command DELETETAGFILE
