The login scripts supplied with SGD use several Tcl commands and procedures for communication with the application server.
The Tcl commands are commands that are defined in the Execution Protocol Engine component of SGD. The commands can be used in your own login scripts to provide control over the connection to the application server, and the display of the SGD Application Authentication and Progress dialogs.
The Tcl procedures are defined in the login scripts only. The procedures can be used to provide more control over the SGD Application Authentication dialog.
The following Tcl commands and procedures are used to control the display of the SGD Application Authentication dialog when starting applications:
authrequest [-normal
|-changed
]-showuser
0|1-showpasswd
0|1-title
title
-message
message
-customuserlabel
0|1-userlabel
label
-custompasswdlabel
0|1-passwdlabel
label
-showpasscache
0|1-showsmartcard
0|1-isuserdialog
0|1|2
This Tcl command displays a dialog box that indicates a problem with the user name or password.
Typically you do not call the authrequest command directly in your login scripts. Instead, you use the defined Tcl procedures to call this command with the required arguments.
This command has the following arguments.
Argument | Description |
---|---|
| Specifies that the password is incorrect. |
| Specifies that the password has expired. |
| Specifies that the user name field is displayed. |
| Specifies that the password field is displayed. |
| Specifies the title used for the authentication dialog. |
| Specifies the message that is displayed in the authentication dialog. |
| Specifies whether to use a customized label for the user name field. |
| Specifies the customized label to use for the user name field. |
| Specifies whether to use a customized label for the password field. |
| Specifies the customized label to use for the password field. |
| Specifies whether the Save This Password check box is displayed. |
| Specifies whether the smart card option is displayed. |
| Specifies whether a customized authentication dialog is used. Specify one of the following:
|
The following example displays a dialog box that says the password is incorrect.
authrequest -normal
Displays a dialog box that indicates a problem with the user name or password.
This Tcl procedure calls the authrequest command with the following options.
authenticate [ -normal | -changed ]
The following example displays a dialog box that says the password is incorrect.
authenticate "-normal"
Displays a dialog box that indicates a problem with the user name or password. You can use your own title for the dialog and display your own message. You can also control whether the user name and password fields display.
This Tcl procedure calls the authrequest command with the following arguments.
authenticate2 [ -normal | -changed ] -showuser 0|1 -showpasswd 0|1 -titletitle
-messagemessage
The following example displays a dialog box that says the password has expired. The user name and password fields are displayed.
authenticate2 "-changed" "1" "1" "" ""
Displays a dialog box that indicates a problem with the user name or password. You can fully customize the authentication dialog.
With this procedure, the Execution Protocol Engine does not check the text the user types in the user name field. If Secure Shell (SSH) is used as the connection method for the application and the user changes the user name, the Execution Protocol Engine does not break the connection and reconnect as the new user name. This can cause applications to fail to start. If you are using SSH and allow the user to change the user name, use the userauthenticate procedure instead.
This Tcl procedure calls the authrequest command with the following arguments.
customauthenticate [ -normal | -changed ] -showuser 0|1 -showpasswd 0|1 -titletitle
-messagemessage
-customuserlabel 0|1 -userlabellabel
-custompasswdlabel 0|1 -passwdlabellabel
-showpasscache 0|1 -showsmartcard 0|1
The following example displays a dialog box with a customized label for the password field.
customauthenticate "-normal" "0" "1" "" "" "0" "" "1" "Enter your password:" "0" "0"
Displays a dialog box that indicates a problem with the user name or password. You can fully customize the authentication dialog.
This procedure is the same as customauthenticate except that it checks whether the user has changed the user name. If the user name is changed, the Execution Protocol Engine breaks the connection to the application server and reconnects as the changed user.
This Tcl procedure calls the authrequest
command with the following arguments:
userauthenticate [ -normal | -changed ] -showuser 0|1 -showpasswd 0|1 -titletitle
-messagemessage
-customuserlabel 0|1 -userlabellabel
-custompasswdlabel 0|1 -passwdlabellabel
-showpasscache 0|1 -showsmartcard 0|1
The following example displays a dialog box with a customized label for the password field, after checking for changes in the user name.
userauthenticate "-normal" "0" "1" "" "" "0" "" "1" "Enter your password:" "0" "0"
The following Tcl commands are used to control the display of the SGD progress dialog when starting applications:
loaderror error
You can use this Tcl command to override the error message returned by the login script. You can use this function, for example, to replace the standard login script error messages with your own message. If the application fails to start, the error is displayed in the progress dialog and in the log files. See Section E.5, “Login Script Error Messages”.
clienttimer [time
] [message
] [timers
]
This Tcl command displays message
in
the progress dialog box for the specified
time
. The progress bar has
timers
sections in total. The
following is an example.
clienttimer 10 "Launching the application" 4
canceltimer
This Tcl command cancels the clienttimer command. This command has no arguments.
progress [ message
]
This Tcl command displays message
in
the progress dialog box. The following is an example.
progress "Initializing..."
The following Tcl commands are used to control the connection to the application server:
setbuffer [ -buffer
num
] [ -output
0|1 ]
This Tcl command defines the number of bytes to read from the application server.
Argument | Description |
---|---|
| Specifies the number of bytes. Default is 1. |
| Turns output on (1) or off (0). Default is 1. |
The following is an example.
setbuffer -buffer 1000
locallaunch [ -start
] [ -abort
] [ -user
launchspec
-root
launchspec
]
This Tcl command starts an application when the application server is also the SGD server. This is known as an optimized launch.
Argument | Description |
---|---|
| Starts an optimized launch. |
| Stops the optimized launch and reverts to the standard connection method. |
| Defines the connection methods to use for starting applications on the SGD server when the user is not the UNIX or Linux platform root user. You can specify different behavior for applications that are detached on launch, background applications, and those that are not, foreground applications.
The
The default is |
| Defines the connection methods to use for starting applications on the SGD server when the user is the UNIX or Linux platform root user. You can specify different behavior for applications that are detached on launch, background applications, and those that are not, foreground applications.
The
The default is |
The following is an example.
locallaunch -abort
tarantella -nosocket
-portnumber
num
-thirdtiershell
shell
This Tcl command is used to configure the connection to the application server. You must configure the connection before you use the sgdconnect command.
Argument | Description |
---|---|
| Specifies that the application is to be started by some other means and must be implemented by whoever is creating the script, for example by using Expect's spawn command. This can only be done with applications that do not require a permanent connection, such as X applications. This command is useful if you have an unusual application server, or if you need to integrate with an existing application start mechanism. |
| Overrides the port used to make the connection to the application server. If you use this option, you must execute the tarantella command before the sgdconnect command, otherwise the port number is ignored. |
| Specifies the shell to use on the application server, for example /bin/sh. |
The following example connects to the application server on TCP port 5999.
tarantella -portnumber 5999
sgdconnect
Instructs the Execution Protocol Engine to connect to the application server. This command has no arguments.
Most of the SGD login scripts use sgdconnect to make the connection. If you want to handle the connection to the application server yourself, you must ensure that your script does not use this command.
The wcpwts.exp
standard login script is an
example of a login script that does not use this command to
connect to an application server.