home *** CD-ROM | disk | FTP | other *** search
- [==========================================================================
- login.ACE
- ----------
-
- The Knowledge Land main navigation interface.
-
- Requires:
- FRAMEWRK.ACE.
-
- ==========================================================================]
-
- To activate login interface,
- If login does not exist in mainScreen,
- In mainScreen,
- Make login.
- Set mainScreen's login to a loginModule from 0,0 to 640,480.
- Log in to mainScreen's login.
- Fade in.
- If system is loggedIn,
- If system is firstTime,
- Play voice over "NARRATE\\SIWEL1.SND".
- Wait until mediaPlayer is not running.
- Play voice over "NARRATE\\SISIGM2.SND".
- Otherwise,
- If system is firstTime,
- Play voice over "NARRATE\\SIWEL5.SND".
- Wait until mediaPlayer is not running.
- Play voice over "NARRATE\\SISIGS1.SND".
- Wait until mediaPlayer is not running.
-
- A loginModule is a kind of module which has:
-
- A way for anyone to get
- a loginModule from an xynumber 'a' to an xynumber 'b',
-
- Make new. Set it to a module from a to b.
- Make it into a loginModule.
- In new,
- Make loginData. Set it to an array of the data "LOGIN\\LOGIN.DAT".
- Make entryPic. Set it to a control of loginData's entryPicData.
- Make selectedUser. Set it to 0.
- Detach it. Return it.
-
- A way to handle an upclickevent 'e' in a buttoncontrol 'c' in a loginModule 'm',
-
- If c's id is "loginbutton",
- Hide cursor in m's entryDialog's nameEntry.
- Make n. Set it to m's entryDialog's nameEntry's buffer.
- Make p. Set it to m's entryDialog's passwordEntry's password.
- If system is not loggedIn,
- Check name n in m.
- Otherwise,
- Check name n in m.
- Check password p of name n in m.
- Otherwise if c's id is "dlg_ok",
- if mdialog exists in m,
- Set m's mdialog's answer to "dlg_ok".
- Clear modal dialog in m.
- Otherwise if c's id is "exitbutton",
- Exit this program.
-
- A way to handle a keyevent 'e' in an editcontrol 'c' in a loginModule 'm',
-
- If e's key is the enter key,
- Hide cursor in c.
- Make str. Set it to c's buffer.
- Check name str in m.
- Give m's entryDialog's passwordEntry keyboard focus.
- If e's key is the delete key,
- Delete selected user in m.
-
- A way to handle a keyevent 'e' in a passwordcontrol 'c' in a loginModule 'm',
-
- If e's key is the enter key,
- Make str. Set it to c's password.
- Hide cursor in m's entryDialog's nameEntry.
- Make n. Set it to m's entryDialog's nameEntry's buffer.
- Check name n in m.
- Check password str of name n in m.
- If e's key is the delete key,
- Delete selected user in m.
-
- A way to delete selected user in a loginModule 'm',
- If m's selectedUser > 0,
- Detach m's UserList's users_'s string # (m's selectedUser).
- Save m's UserList to the data "USER.DAT".
- Detach m's users's userData # (m's selectedUser).
- Remove string (m's selectedUser) from m's entryDialog's namelist.
- Set m's selectedUser to 0.
-
- A way to receive an event 'e' in a control 'c' in a loginModule 'm',
-
- If e's originLink's target is a listbox,
- Set m's selectedUser to e's index.
- If str exists in e,
- If c is a listbox,
- Add e's str into c.
- If c is an editcontrol,
- Change the text of c to e's str.
- Give m's entryDialog's passwordEntry keyboard focus.
-
- To log in to a loginModule 'm',
- In m,
- Make entryDialog. Set it to a control of loginData's entryDialogPicture.
- In it,
- Make nameEntry. Set it to a control of loginData's nameEntryData.
- Make nameList. Set it to a control of loginData's nameListData.
- Subscribe nameList to nameEntry.
- Subscribe nameEntry to nameList.
- Give nameEntry keyboard focus.
- Make passwordEntry. Set it to a control of loginData's PasswordEntryData.
- Make loginButton. Set it to a control of loginData's loginButtonData.
- Make exitButton. Set it to a control of loginData's exitButtonData.
-
- Make userList. Set it to an array.
- Set userList to an array of the data "USER.DAT".
- Make users. Set it to an array.
- For each string 's' in userList's users_,
- In users,
- Make an array of the data s.
- Make it into a userData.
-
- For each userData 'a' in users,
- Add a's id into m's entryDialog's nameList.
- Detach loginData.
-
- To check name a string 'n' in a loginModule 'm',
-
- Call m's entryDialog's nameList l.
- Make match. Set it to 0.
- Make data.
-
- Make j. Set it to 0.
- For each string 's' in l's slist,
- j += 1.
- If n is s,
- // Name is already in the list
- match = 1.
- If j > the number of userDatas in m's users,
- match = 0.
- Otherwise,
- Set data to m's users's userData # j.
-
- If match = 0,
- Add n into l.
- Make ns.
- Make fn. Set it to "USER".
- Make pn. Set it to "PROF".
- Make nz.
- Make ulink.
- In m's users,
- Make a userData.
- //Call it u.
- Set ulink to a link to it.
- Set its id to n.
- m's userList's count_ += 1.
-
- //
- // Generate unique filename for user data
- //
- Set ns to "". Print m's userList's count_ to ns.
-
- Set nz to 4 - the number of characters in ns.
- while nz > 0,
- Add "0" to fn.
- Add "0" to pn.
- nz -= 1.
- Add ns to fn.
- Add ns to pn.
- Add ".DAT" to fn.
- Add ".DAT" to pn.
- call ulink's target u.
- Set u's filename to fn.
-
- Save u.
- In m's userList's users_,
- Add fn.
-
- Save m's userList to the data "USER.DAT".
- Make a. Set it to an array. Save it to the data pn.
- Set data to u.
-
- If system is not loggedIn,
- Log in data.
-
-
- To check password a string 'p' of name a string 'n' in a loginModule 'm',
-
- Call m's users u.
- Make match. Set it to 0.
- For each userData 'a' in u,
- If a's id is n,
- If the number of characters in a's password > 0,
- If a's password is p,
- Log in a.
- Otherwise,
- Display message "Wrong Password!" in m.
- Play voice over "NARRATE\\SIPAS2.SND".
- Otherwise,
- //
- // New password. Store it with user's data
- //
- Set a's password to p.
- Save a.
- Log in a.
-
- To log in a userData 'd',
-
- //
- // Logging in a user.
- // If this is the first login of the day, distribute kCards into
- // the environment.
- //
- Set TheUser to d.
- // Print theUser.
-
- Make thisDate. Set it to
- (today's year mod 100 * 10000) +
- (today's monthNumber * 100) +
- today's dayOfMonth.
-
- If TheUser's lastLogin != thisDate,
- //
- // Sprinkle kCards, etc. around in the environment for TheUser to find
- //
- Initialize environment for TheUser.
- Set TheUser's lastLogin to thisDate.
- Save TheUser.
-
- // Record that system is loggedin.
- //
- // Go to avatar selection screen
- //
- If system is firstTime,
- Enter module "avatar" from module "profile".
- Otherwise,
- Enter module "profile".
-
- // $Log: LOGIN.ACE $
- // Revision 1.11 1996/08/25 20:14:09 Quoc
- // Revision 1.10 1996/08/20 22:37:25 Quoc
- // Revision 1.9 1996/08/15 15:31:04 Quoc
- // Revision 1.8 1996/08/12 13:57:24 Quoc
- // Revision 1.7 1996/08/05 18:12:16 Quoc
- // Revision 1.6 1996/07/11 02:34:00 Quoc
- // Trade interface and profile screens working.
- // Revision 1.5 1996/07/08 10:16:07 Quoc
- // Profile sent to server
- // Revision 1.4 1996/06/30 19:12:35 SCOTTR
- // Another Alpha.
- // Set up user environment on login. Fix various bugs exposed by that.
- // Revision 1.3 1996/06/22 04:42:34 Quoc
- // Revision 1.2 1996/06/19 23:18:09 Quoc
- // Revision 1.1 1996/06/14 00:03:32 Quoc