home *** CD-ROM | disk | FTP | other *** search
- # MODULE[data]: new_user_startup - All platforms
-
- # FUNCTION
- # This file is used to query for information that is user specific and
- # not provided in the sysdflt.tcl file. It is only run the first time
- # the user runs Simeon.
- # END FUNCTION
-
-
- # NOTES
- # The intent for this file is to ask new user's whatever questions
- # are needed to complete the initialization their Simeon configuraton.
- # The file is run if (and only if) after loading the site default
- # file "sysdflt.tcl", we were unable to load a user configuration.
- # The test for seeing if the user configuration was loaded is the
- # existence (or lack thereof) of the option "General.Fullname".
- # Because this option is user specific, the only way that we would
- # actually get this option was to have run this file.
- #
- # As a result, if you (the system administrator) modifies this file,
- # then you had better make sure that "General.Fullname" is set into
- # the user's configuration after they are done with it.
- #
- # The file is a Tool Command Language (TCL) file that contains a set of
- # "option" commands. The "option" command is a Simeon extension to TCL
- # that supports updating the content of the Simeon runtime option
- # (configuration) database. The file can contain any of the standard
- # TCL commands and statements.
- #
- # Options are defined using the following syntax:
- #
- # "option [-default | -permanent | -session] [-readonly] {name} [{value}]
- #
- # where arguments in the [] are optional, and arguments in {} are
- # variables that are provided by you. If just the option {name} is
- # provide with no {value}, then value of the option is returned. If the
- # {name} and {value} are provided, then the value is stored in the
- # runtime option database.
- #
- # Options can be stored in one of three levels: default, permanent, and
- # session. When options are referenced in the repository, a session
- # value is retrieved ahead of a permanent value, and a permanent value
- # is retrieved ahead of a default value. Therefore, a session value
- # will "mask" a permanent value which will "mask" a default value. Only
- # permanent values are saved from the option database to the user's
- # permanent option repository.
- #
- # The file also makes use of a set of user interface extensions to TCL
- # that allows you to put up dialogues and ask questions of the user. A
- # procedure named "askQuestion" has been defined that can be used to ask
- # any one line question of a user on the way in.
- # END NOTES
-
- # HISTORY
- # IncrDev Jul 11, 1997 by ll: added code to test for sysdflt version.
- # IncrDev Jul 10, 1997 by ll: combined startup.demo into this file and
- # incorporated the getInstallData procedure
- # IncrDev Feb 4, 1995 by ll: modified defaultRemainder to only default
- # ms2.hostname (News Host) if it is still set
- # to the factory default of "newshost"
- # IncrDev Jan 9, 1997 by ll : added getDemoUserID, defaultDemoMailAddress
- # procs
- # IncrDev Dec 23, 1996 by ll: changes for 4.1. Enhanced documentation.
- # IncrDev May 6, 1996 by ll: added default for Page Layout footer to contain
- # the user's full name as entered during startup
- # IncrDev Mar 12, 1996 by ll: added documentation and added IMSP and
- # signature defaults in proc DefaultRemainder
- # IncrDev Mar 12, 1996 by ll: added code in proc askQuestion to not
- # select the field if it contains @domain.name
- # IncrDev Mar 7, 1995 by ll: added code to default to default to option
- # in sysdflt.tcl file. If not set, THEN default
- # to Post Office (IMAP) answer
- # IncrDev Dec 28, 1995 by ll: put back other hostname questions but defaulted
- # answers to the Post Office answer
- # IncrDev Dec 28, 1995 by ll: added selection on input field
- # IncrDev Nov 2, 1995 by sh: to only ask one hostname question and default others
- # Doc____ Nov 5, 1995 by sh: first cut of new documentation
- # IncrDev Nov 1, 1995 by sh: added default View options for new users
- # END HISTORY
-
- if {[info exists sysdflt_version] == 1} {
- if {$sdlog == "yes"} {
- debug_trace "startup.tcl : begin"}
- debug_trace "startup.tcl : guest = $guest"
- } else {
- # sysdflt.tcl from version earlier than 4.1.2 so
- # initialize variables.
- set sdlog "no"
- set guest "no"
- debug_trace "startup.tcl : sysdflt.tcl file from 4.1.1 or earlier."
- }
-
- # : This function is called from Simeon, to kick off the
- # : process
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare startSetup"}
-
- proc startSetup {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin startSetup"}
- label t1 -parent startupwin -left 20 -top 60 -right 370 -bottom 80 \
- -title "You'll need to provide a bit of information to start."
- getUserName
- }
-
- # : askQuestion is called in the following routines to prompt the user
- # : for IMAP host, SMTP host, and IMSP (Address book) host.
- # : The nextcmd parameter contains the procedure name of the next
- # : question to be asked. If you wish to skip a question from this
- # : list, modify the previous routine's call to askQuestion as described
- # : in the documentation for the verifyAddrBookHost routine below.
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare askQuestion"}
-
- proc askQuestion {win nextcmd prompt initval example option} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin askQuestion"}
- set w startupwin.$win
- frame $w -parent startupwin -left 10 -top 100 -right 390 -bottom 290 \
- -entercommand "option $option \[get_ctl_title $w.resp\]; hide_win $w; $nextcmd"
- label $w.t1 -parent $w -left 20 -top 30 -right 370 -bottom 50 -title $prompt
-
- edit $w.resp -parent $w -left 30 -top 60 -right 360 -bottom 80 \
- -title $initval -command ""
- focus $w.resp
- if { $initval != "" } {
- # if {$initval != "simeon"} {
- if {[string index $initval 0] != "@" } {
- select $w.resp
- }
- # }
- }
- label $w.ex -parent $w -left 30 -top 100 -right 360 -bottom 120 -title $example
- button $w.done -parent $w -left 135 -top 160 -right 195 -bottom 180 -title "OK" \
- -command "option $option \[get_ctl_title $w.resp\]; hide_win $w; $nextcmd"
- }
-
- # FUNCTION
- # : Ask for the user's full name. No default should be supplied from
- # : sysdflt.tcl Simeon checks for the presence of this option to determine
- # : whether it should run this script.
- # END FUNCTION
- #
- # HISTORY
- # IncrDev July 10, 1997 by ll: if a guest account set the next command
- # to get the DemoUserID rather than getMailAddress
- # END HISTORY
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare getUserName"}
-
- proc getUserName {} {
-
- global sdlog
- global guest
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin getUserName"}
- if {$guest == "yes"} {
- askQuestion name getDemoUserID "What is your full name?" \
- "" "e.g. Bill Smith" General.Fullname
- } else {
- askQuestion name getMailAddress "What is your full name?" \
- "" "e.g. Bill Smith" General.Fullname
- }
- }
-
- # : Ask for user's email address.
- # : General.MailDomain from sysdflt.tcl is defaulted into this field.
- # : If the sysdflt.tcl contains "simeon.com" the user will see
- # : @simeon.com and the cursor placed ahead of the @ when this question
- # : is asked.
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare getMailAddress"}
-
- proc getMailAddress {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin getMailAddress"}
- set init ""
- catch {set init "@[option General.MailDomain]"}
- if { $init=="@"} {set init ""}
- askQuestion email verifyMailHost "What is your email address?" \
- $init "e.g. userid@company.com" General.MailAddress
- }
-
- # : Ask for user's demo account user id.
- # : Only used for demo guest account installations.
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare getDemoUserID"}
-
- proc getDemoUserID {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin getDemoUserID"}
- set init ""
- askQuestion email defaultDemoMailAddress \
- "Enter your Simeon guest account username" \
- $init "e.g. bsmith" General.MailAddress
- }
-
- # : Get the host name of the mail server.
- # : This is the Post Office message service host name and is the server
- # : running an IMAP2bis or IMAP4 daemon.
- # : NOTE: if the setting in sysdflt.tcl is correct and does not need to
- # : be changed by the user, this question can be omitted. See the comments
- # : under Verify Address Book Host for information on how to skip a startup
- # : question.
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare verifyMailHost"}
-
- proc verifyMailHost {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin verifyMailHost"}
- set init ""
- catch {set init [option MsgService.ms1.Hostname]}
- askQuestion email verifySMTPHost \
- "What is your Post Office (IMAP) server hostname?" \
- $init "e.g. mailhost.company.com" MsgService.ms1.Hostname
- }
-
- # : Verify SMTP Host
- # : General.DeliveryHost from sysdflt.tcl is defaulted into this field.
- # : If this field has not been initialized in sysdflt.tcl (ie. still
- # : set to "mailhost") default it to the IMAP host instead.
- # : NOTE: if the setting in sysdflt.tcl is correct and does not need to
- # : be changed by the user, this question can be omitted. See the comments
- # : under Verify Address Book Host for information on how to skip a startup
- # : question.
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare verifySMTPHost"}
-
- proc verifySMTPHost {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin verifySMTPHost"}
- set init ""
- catch {set init [option General.DeliveryHost]}
- if {$init == "mailhost"} {
- catch {set init [option MsgService.ms1.Hostname]}
- }
- askQuestion email verifyAddrBookHost \
- "What is your mail sending (SMTP) server hostname?" \
- $init "e.g. smtphost.company.com" General.DeliveryHost
- }
-
-
- # : Verify Address Book Host
- # : AddrBook.Hostname from sysdflt.tcl is defaulted into this field.
- # : By default this is field is empty in sysdflt.tcl because a value in
- # : this field indicates to Simeon that an IMSP host is available and
- # : Simeon will search for remote address books when the address book
- # : module is started up. For this reason, we do not default this field
- # : to the Post Office host.
- # : If your site does not run IMSP or will not be using IMSP addressbooks
- # : you will not want to ask this question of new users. To eliminate
- # : this question from being asked, modify the following line in
- # : verifySMTPHost
- # : askQuestion email verifyAddrBookHost "What is your mail sending...
- # : to read
- # : askQuestion email defaultRemainder "What is your mail sending...
- # : This causes defaultRemainder to be run after verifySMTPHost instead
- # : of verifyAddrBookHost. This mechanism can be used in any of the
- # : verify routines to eliminate a question or to reorder them.
- # : You can also write a new routine and add it to the list if you wish.
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare verifyAddrBookHost"}
-
- proc verifyAddrBookHost {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin verifyAddrBookHost"}
- set init ""
- catch {set init [option AddrBook.Hostname]}
- askQuestion email defaultRemainder \
- "What is your address book (IMSP) server hostname?" \
- $init "e.g. addrhost.company.com" AddrBook.Hostname
- }
-
- # : Default demo account mail address. If this routine is called, it
- # : is assumed that the user id is an ESYS guest account id and will
- # : append the ESYS demo server domain onto the mail address.
- # : Called only from getDemoUserID
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare defaultDemoMailAddress"}
-
- proc defaultDemoMailAddress {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin defaultDemoMailAddress"}
-
- # : Set userid in Post Office Message Service
- option MsgService.ms1.Userid [option General.MailAddress]
-
- # : Add demo domain to General.MailAddress
- option General.MailAddress [option General.MailAddress]@demo.simeon.com
-
- defaultRemainder
- }
-
- # : Perform other default actions
- # : Note that "doneECSStartup" is a magic token that says ask no
- # : more questions. You must use that token exactly to terminate the question
- # : string.
-
- # HISTORY
- # Oct 17, 1997 by ll: commented out setting of Reply-To variable
- # END HISTORY
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : declare defaultRemainder"}
-
- proc defaultRemainder {} {
- global sdlog
- if {$sdlog == "yes"} {debug_trace "startup.tcl : begin defaultRemainder"}
-
- # : Default the News host name to that of the Post Office
-
- if {[option MsgService.ms2.Hostname] == "newshost"} {
- option MsgService.ms2.Hostname [option MsgService.ms1.Hostname]
- }
-
- # : Default the user's signature to his full name and email address
-
- option Compose.Signature.Lines "3"
- option Compose.Signature.1 "----------------------"
- option Compose.Signature.2 [option General.Fullname]
- option Compose.Signature.3 [option General.MailAddress]
-
- # : default the user's Reply-To address to be the same as his
- # : email address
- # : ReplyTo should only be set if it will be different than
- # : From address, so we no longer do this
-
- # option General.ReplyTo [option General.MailAddress]
-
- # : default print page footer to contain user's name
-
- option PageLayout.Footer "l 'Printed by: [option General.Fullname]' c 'Page: ' \$page"
-
- # : Default the IMSP options hostname to that given for the Address book
- # : with the assumption that the the same IMSP host will be used for both.
- # : If no IMSP host then these options will just be blank.
-
- option -session Options.RemoteHost [option AddrBook.Hostname]
- option -session Options.RemotePort [option AddrBook.TCPPort]
-
- # : Done the startup script.
-
- doneECSStartup
- }
-
- # : define default views for new users
- # : A first time user will inherit these settings into their personal
- # : options file.
-
- option FOLDER.ID "1"
- option Folder.1.IsSelecting "OFF"
- option Folder.1.MS "1"
- option Folder.1.Name "inbox"
- option Folder.1.ViewMsgGrps "OFF"
- option Folder.1.inbox.ID "1"
- option Folder.1.inbox.Sort "Most Recent Date Sent"
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : calling startSetup"}
-
- # : initiate setup scripts
- startSetup
-
- if {$sdlog == "yes"} {debug_trace "startup.tcl : end"}
-
- # END MODULE: new_user_startup - All platforms
-
-
-