Unverified Commit 0dd6536b authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Some more todo cleanup

parent cce4b201
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -21,23 +21,17 @@ Switch between MAIL and BULLETIN modes? MAIL commands are documented
## Things to do

  * Run [godoc](http://localhost:6060/) and then review where the help text is lacking.
  * Missing [RESPOND] [MAIL] [SET PROMPT_EXPIRE] [SET NOREADNEW] [SET NOSHOWNEW] [SET NOPROMPT_EXPIRE] [SET READNEW] [SET SHOWNEW] [SHOW NEW]
  * Run this.Skew.Safe() before... each command?  each write?
  * Handle broadcast messages - create a broadcast table and add an expiration column.
  * Database
    * trigger to limit values for 'visibility'?
    * trigger to limit values for 'alert'?
  * Add commands:
    * Commands for a local mail system?
    * Commands to connect to Mattermost or mastodon?
  * Make a spreadsheet for signups.
  * Pager:
    * Make "/" work for search.
  * Run [VACUUM](https://www.sqlite.org/lang_vacuum.html) on the expire run.
  * Notifications:
    * Figure out how SHOWNEW, NOTIFY, READNEW and BRIEF work.
  * Permissions:
    * Review permission requirements for each command.
  * Expire.  This was created due to file storage limits.
  * Expire.  This was created due to file storage limits.  Keep it?
  * Code cleanup:
    * Review sql queries and clean out the ones not used.
    * Review sql queries and find duplicates.
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ func Expire() int {

	rows, err := q.DeleteAllExpiredMessages(ctx)
	ask.CheckErr(err)
	_, err = store.ExecContext(ctx, "VACUUM")
	ask.CheckErr(err)
	fmt.Printf("Expired %d messages\n", rows)
	return 0
}
+0 −5
Original line number Diff line number Diff line
@@ -19,9 +19,6 @@ func ValidFolder(folder string) (storage.Folder, error) {
		return storage.Folder{}, errors.New("Unable to select the folder")
	}
	if !IsFolderReadable(correct.Name, this.User.Login) {
		// TODO: Should be:
		//       WRITE(6,'('' You are not allowed to access folder.'')')
		//       WRITE(6,'('' See '',A,'' if you wish to access folder.'')')
		return storage.Folder{}, errors.New("Unable to select the folder")
	}
	return correct, nil
@@ -51,11 +48,9 @@ func CreateFolder(options storage.CreateFolderParams) error {

// ListFolder provides a list of folders that this.User has access to.
func ListFolder() ([]storage.ListFolderRow, error) {
	// TODO: need to check access.
	ctx := storage.Context()
	rows, err := this.Q.ListFolder(ctx)
	if err != nil {
		// TODO: process this error a bit more to give a better error message.
		return []storage.ListFolderRow{}, err
	}
	return rows, nil
+3 −0
Original line number Diff line number Diff line
@@ -79,9 +79,12 @@ func Pager(content string) bool {
			return false
		}

		// TODO: get '/' to work for searching.
		switch key {
		case ' ': // page down
			start += pageSize
		case '\n', '\r': // line down
			start++
		case 'b': // page up
			start -= pageSize
		case 'q', 'Q': // quit
+57 −5
Original line number Diff line number Diff line
@@ -1134,14 +1134,66 @@ characteristics of the BULLETIN Utility.

The following options are available:

  ALWAYS           BRIEF            DEFAULT_EXPIRE   EXPIRE_LIMIT
  FOLDER           NOALWAYS         NOBRIEF          NONOTIFY
	NOPROMPT_EXPIRE  NOREADNEW        NOSHOWNEW        NOSYSTEM
	NOTIFY           PROMPT_EXPIRE    READNEW          SHOWNEW
	SYSTEM
  ACCESS           ALWAYS           BRIEF            DEFAULT_EXPIRE
  EXPIRE_LIMIT     FOLDER           NOALWAYS         NOBRIEF
  NONOTIFY         NOPROMPT_EXPIRE  NOREADNEW        NOSHOWNEW
  NOSYSTEM         NOTIFY           PROMPT_EXPIRE    READNEW
  SHOWNEW          SYSTEM
`,
		Action: ActionSet,
		Commands: dclish.Commands{
			"ACCESS": {
				Description: `Controls  access  to  a  private  folder.   A private folder can only be
selected by users who have been granted access.  Only the owner of  that
folder is allowed to grant access.

  Format:
    SET [NO]ACCESS id-name [folder-name]

The id-name can be one or more ids from the system Rights  Database  for
which  access  is  being  modified.   It  can  also be a file name which
contains a list of  ids.   For  more  information  concerning  usage  of
private  folders, see HELP CREATE /PRIVATE.  NOTE: Access is created via
ACLs.  If a user's process privileges are set  to  override  ACLs,  that
user  will  be  able  to  access  the folder even if access has not been
granted.

It  is suggested that if you plan on granting access to many users, that
you create an id using the AUTHORIZE utility and then use the SET ACCESS
command  to  grant  access  to  that id.  Then, you can use the GRANT/ID
command in AUTHORIZE to grant the id to users, and this will give  those
users  access to the folder.  This is preferred because of problems with
running into system quota when checking for acls on a file with a  large
amount  of  acls.   It  is also means that you don't have to remember to
remove the access for that user from a folder if that  user  is  removed
from the system.

A user with BULLETIN privileges (see HELP SET  PRIV)  will  be  able  to
select a protected folder regardless of the access settings.  However, a
user without explicit access will not receive login notifications of new
messages,  and thus will not be able to set any login flags.  (NOTE:  If
such a user selects such a folder and then uses SET ACCESS to grant  him
or  herself  access,  the user must reselect the folder in order for the
new access to take affect in order to be able to set login flags.)`,
				Action: ActionSetAccess,
				Flags: dclish.Flags{
					"/ALL": {
						Description: `  Specifies that access to the folder  is granted to all users. If /READ
  is not  specified, the folder will  no longer be private.  If /READ is
  specified, all users will have  read access, but only privileged users
  will have write access (of course non-privileged users can gain access
  via a later SET ACCESS command.)

    Format:
      SET ACCESS /ALL [folder-name]`,
					},
					"/READ": {
						Description: `  Specifies that access  to the folder will be limited  to being able to
  read the messages.`,
					},
				},
			},

			"ALWAYS": {
				Description: `Specifies  that  the  selected  folder  has  the ALWAYS attribute.  This
causes messages in the folder to be displayed differently  when  logging
Loading