+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Welcome to Account Setup
+
+
+This is the first screen of the main part of Account Setup. It lets users choose whether they want to:
+
+
+
+Create a new account--Account Setup runs in Internet Account Server (IAS ) mode-- or
+
+
+
+Set up access an account they already have--Account Setup runs in Network Configuration (NCI ) mode.
+
+
+Account Setup doesn't present this screen to users if you selected IAS or NCI mode only in Account Setup's global options. For more information about setting global options, click [More Help], below.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/acctInfo.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/acctInfo.htm
new file mode 100644
index 00000000000..944f2dcdbbf
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/acctInfo.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Information About Yourself
+
+This screen asks users for their name and company. Account Setup enters this information into users' Mail & Groups preferences.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/addias.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/addias.htm
new file mode 100644
index 00000000000..e0de762fda9
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/addias.htm
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Edit IAS Configuration
+
+Use the Edit IAS Configuration Dialog and its tabs to enter information about your Internet account server.
+
+To offer the IAS mode of Account Setup, you must create an IAS configuration and enter all of the information in the required tabs (the Options and Scripted Login tabs are optional).
+
+
To create or edit a configuration, follow these steps:
+
+
+ From the pop-up menu in the upper-left corner of the dialog, select the configuration you want to edit.
+
+ Provide all of the information in each tab.
+
+ Click the Save Configuration button in the upper-right corner of the dialog to save your changes.
+
+
+Click Back in the Account Setup navigation pane to return to the IAS Configuration Options dialog.
+
+For more information about each tab, click [MORE HELP], below.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/addnci.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/addnci.htm
new file mode 100644
index 00000000000..f10870d44a0
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/addnci.htm
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Edit NCI Configuration
+
+Use the Edit NCI Configuration dialog and its tabs to enter information about an NCI configuration. All tabs are optional, as is creating an NCI configuration. However, by entering information here, you make the Account Setup process simpler for your users.
+
+By default, Account Setup the values that you enter into an NCI configuration as default values on the Account Setup screens. Or, if you supply all of the information requested on an Account Setup screen, you can turn off that screen altogether.
+
+To create or edit a configuration, follow these steps:
+
+
+ From the pop-up menu in the upper-left corner of the dialog, select the configuration you want to edit.
+
+ Provide any information in any tab.
+
+ Click the Save Configuration button in the upper-right corner of the dialog to save your changes.
+
+
+Click Back in the Account Setup navigation pane to return to the NCI Configuration Options dialog.
+
+For more information about each tab, click [MORE HELP], below.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/askserv.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/askserv.htm
new file mode 100644
index 00000000000..314d90b47e6
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/askserv.htm
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Server Options
+
+Use this Configurator screen to specify whether you want Account Setup to show input fields for IMAP and LDAP server addresses in the "Your Provider's Server Addresses" screen.
+
+Check the checkboxes labelled IMAP and LDAP to display input fields for those server types.
+
+When you have set these options, click Back to return to Account Setup.
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/asksvinf.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/asksvinf.htm
new file mode 100644
index 00000000000..b4c3b0545b7
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/asksvinf.htm
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Options for Saving Account Information
+
+Use this Configurator screen to specify whether you want Account Setup allow users to save a record of their account information to a text file on their computers.
+
+When you have set this option, click Back in the Account Setup navigation pane to return to Account Setup.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/asktty.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/asktty.htm
new file mode 100644
index 00000000000..2cc5152252f
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/asktty.htm
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Login Options
+
+Use this Configurator screen to let users request that their connection software display a terminal (TTY) window whenever they connect, so that they can login manually each time.
+
+When you have set this option, click Back in the Account Setup navigation pane to return to Account Setup.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/billing.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/billing.htm
new file mode 100644
index 00000000000..57780bcc166
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/billing.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Billing Information
+
+This screen asks users to specify a credit card for billing.
+
+If you want users to enter this information after they are connected to your Internet account server, rather than during Account Setup, or if you don't require this information, you can suppress this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+To edit the pop-up list of credit cards on the Account Setup screen, click Screen Options in the Toolbar.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/bothmode.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/bothmode.htm
new file mode 100644
index 00000000000..5846075e166
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/bothmode.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Offer Both Modes (User Chooses Mode)
+
+This option, which is Account Setup's default functional mode, lets users choose whether they want to use the IAS mode to start a new Internet account, or use NCI mode to set up access to an existing account.
+
+In this mode, Account Setup automatically presents the "Welcome to Account Setup" screen, which gives users a choice of IAS or NCI mode.
+
+Note that if you choose this option, you must have a dedicated Internet account server for users who choose the the IAS mode. If you don't have such a server, choose the Use Network Configuration Mode Only option instead.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/cfgtab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/cfgtab.htm
new file mode 100644
index 00000000000..ca98f913dd7
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/cfgtab.htm
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+.cfg File Tab
+
+This tab lets you supply a specific local configuration file (.cfg file) for an NCI configuration. A local configuration file, which you create using the Configuration Editor tool included with Mission Control, lets you set and lock Communicator preferences, interface options, and security policy options, and so on.
+
+To associate a local configuration file with this NCI configuration, follow these steps:
+
+
+ Create one or more local configuration files using the Configuration Editor tool.
+
+ Copy the local configuration files into the Config folder, located inside the dialup package that you are now customizing with the Account Setup Editor.
+
+ In the .cfg File tab, use the pop-up menu to select which local configuration file you want to associate with the NCI configuration you are working on. The pop-up menu lists local configuration (.cfg ) files that are present in the Config folder. Note that you don't need to name these configuration files netscape.cfg . Account Setup renames the file appropriately when configuring the user's system.
+
+
+When a user completes Account Setup, the program moves the selected local configuration file into the proper location in the current user profile folder. Communicator reads reads preferences and settings from this file the next time the user launches it in that profile.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/chgjs.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/chgjs.htm
new file mode 100644
index 00000000000..382acfe5fee
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/chgjs.htm
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+Notes about Changing JavaScript in Account Setup
+
+Account Setup uses JavaScript as the programmatic layer between the HTML screens that the user sees and the functionality provided by the Account Setup Plug-In. Each screen of Account Setup has JavaScript embedded in the <HEAD> element, in forms inputs, and in certain hypertext links.
+
+Because the Account Setup Plug-In is capable of making changes to the files on users' computers, it must be secured so that no other programs or applets can use it. To meet this requirement, Netscape has signed all of the Account Setup files with its digital certificate.
+
+This method of securing the software places certain restrictions on what you can do with the Account Setup Editor:
+
+
+ You can't change any of the JavaScript in Account Setup.
+
+ You can't add any JavaScript to Account Setup.
+
+
+This means that, unless you plan to re-sign the Account Setup files with your own certificate, you can't rename files or add files or change the basic functionality of the program beyond the options supported by the Account Setup Editor. However, Account Setup Editor gives you control over almost all of the most important functions of Account Setup, as well as the capability to work with the any text, graphics, and HTML in the Account Setup screens.
+
+If you want, you can edit the JavaScript used in Account Setup to achieve such results as adding screens, editing the style sheet of the main Account Setup screens, and adding custom forms and functions. If you decide to work with the JavaScript in Account Setup, you must re-sign all of the Account Setup files with your own certificate before distributing your Communicator package to users.
+
+Before you decide to work with the JavaScript in Account Setup, refer to the Signing the Account Setup Files section of the Mission Control documentation to get an idea of how the re-signing process works.
+
+If you don't intend to re-sign the Account Setup files, pay close attention to the JavaScript embedded in the Account Setup HTML files, making sure not to alter it:
+
+
+ Each file has a <SCRIPT SRC=... ARCHIVE=...> </SCRIPT> tag in the header that must remain intact.
+
+ Many of the files have an ID=... attribute in the <BODY> tag that must remain intact.
+
+ Most forms inputs and some hypertext links also have an ID=... attribute that can't be changed.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/connect1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/connect1.htm
new file mode 100644
index 00000000000..6199108aebf
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/connect1.htm
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Connect to Server
+
+This screen lets users initiate a connection to your Internet account server. Account Setup displays the Internet account server screens in the Account Setup window.
+
+To enable users to connect, you must create an IAS configuration for your server. An IAS configuration includes the network, dialing, and login information for your server. To create an IAS configuration for your server, click Screen Options in the Toolbar.
+
+When users are finished using the Internet account server, or when a connection to the server can't be made, Account Setup displays one of several alternate screens. To view and edit those alternate screens, click Connect To Server in the Account Setup navigation pane.
+
+To view the screens presented to users after they are finished using the Internet Account Server, click Connect Now in the Account Setup navigation pane.
+
+
+
+
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+You're Done!
+
+This is the final screen of Account Setup. When users click Connect Now or Done , Account Setup configures their dialer and TCP/IP software.
+
+You can specify the URL of the page loaded when the user clicks Connect Now . You provide this information in an NCI configuration. For more information, click [More Help], below.
+
+To view and edit the "Connection Error" screen, which users could encounter when connecting from this screen, click Connect Now.
+
+If you are finished using the Account Setup Editor, click Exit.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/cpsheet.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/cpsheet.htm
new file mode 100644
index 00000000000..c99b5e9f61a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/cpsheet.htm
@@ -0,0 +1,83 @@
+
+//TAGS FOR COMMUNICATOR PREVIEW SCREENS
+
+//tags.BODY.fontFamily="PrimaSans BT, Helvetica,Arial";
+//tags.BODY.fontSize="12px";
+//tags.BODY.textAlign="left";
+//tags.BODY.color="black";
+//tags.BODY.marginTop="0";
+//tags.BODY.marginBottom="0";
+//tags.BODY.marginLeft="72";
+//tags.BODY.borderWidths(0, 0, 0, 0);
+//tags.BODY.lineHeight="1";
+
+tags.P.fontFamily="PrimaSans BT,Helvetica,Arial";
+tags.P.fontSize="10";
+//tags.P.lineHeight="1";
+tags.P.margins(6,0,0,0);
+tags.P.color="000000";
+
+
+
+
+//Tables (for forms inputs, etc.)
+
+tags.TABLE.marginTop="14";
+tags.TABLE.fontFamily="PrimaSans BT, Helvetica,Arial";
+tags.TABLE.fontSize="10";
+
+tags.TD.fontFamily="PrimaSans BT, Helvetica,Arial";
+tags.TD.fontSize="10";
+
+classes.intro.TD.fontSize="12px";
+
+//the entries below are exceptions to the standard definition
+
+ids.nospace.marginTop="0";
+ids.minspace.marginTop="6";
+ids.nomargins.margins(14,8,8,8);
+ids.buttontext.fontSize="11px";
+
+
+//Lists
+
+tags.UL.listStyleType="disc";
+tags.UL.fontFamily="PrimaSans BT,Helvetica,Arial";
+tags.OL.fontSize="10";
+tags.OL.fontFamily="PrimaSans BT,Helvetica,Arial";
+tags.UL.fontSize="10";
+tags.OL.fontSize="10";
+//tags.UL.lineHeight="1";
+tags.UL.margins(-4,0,0,-28)
+tags.OL.margins(-4,0,0,-28)
+contextual(tags.OL, tags.LI).fontSize="9";
+contextual(tags.UL, tags.LI).fontSize="8";
+
+//tags.LI.marginBottom="-24";
+
+tags.TT.color="000066";
+//tags.TT.fontFamily="monospace";
+
+ids.nomarginbottom.marginBottom="0";
+classes.nomargins.all.marginTop="-4";
+classes.nomargins.all.marginBottom="0";
+//classes.nomargintop.all.lineHeight="1";
+
+classes.title.all.marginTop="0";
+classes.title.all.color="000066";
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/default.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/default.htm
new file mode 100644
index 00000000000..980737101f1
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/default.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Netscape Account Setup Editor
+
+The Account Setup Editor helps you create a custom version of Account Setup. Use the navigation buttons in the Account Setup window to move from screen to screen. Use the Toolbar to make changes to the screens as you go. This Help pane is updated each time you switch screens.
+
+The first step in using the Account Setup Editor is setting Account Setup's global options. To set global options, click the Screen Options button in the Toolbar.
+
+If you want, you can edit the text and graphics in this screen. Click Choose Editor in the Toolbar to specify your text or HTML editor, then click Edit Screen. When you have made and saved your changes to the HTML file, click Reload Screen in the Toolbar to see your changes in the Account Setup window.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/dial.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/dial.htm
new file mode 100644
index 00000000000..998d886ff10
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/dial.htm
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Account Access Phone Number
+
+This screen asks users to enter their account access phone number.
+
+You can preset Account Setup with this information in an NCI configuration. For more information, click [More Help], below.
+
+You can support international phone number formats in this screen by setting Account Setup's global options. For more information, click [More Help], below.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar. However, turn off this screen only if the NCI configuration(s) you are using supply this information and you are not offering the "None of the Above" option in the NCI configurations list.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/dialinf1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/dialinf1.htm
new file mode 100644
index 00000000000..2b3accd3fba
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/dialinf1.htm
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Dialing Settings for Your Location
+
+This screen lets users provide a code to turn off Call Waiting; specify a prefix to access an outside line; and select tone or pulse dialing.
+
+If the user is connecting with an ISDN device, Account Setup automatically suppresses the tone/pulse radio buttons.
+
+You can edit the list of codes to turn off Call Waiting by changing or adding <OPTION> </OPTION> tags to the pop-up menu in this screen's HTML file.
+
+This screen can't be turned off.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/dialinf2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/dialinf2.htm
new file mode 100644
index 00000000000..8bf683beefa
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/dialinf2.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Phone Number of Your Location
+
+In this screen, users enter the phone number of the line that is connected to their modem.
+
+You can support international phone number formats in this screen by setting Account Setup's global options. For more information, click [More Help], below.
+
+This screen can't be turned off.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/dns.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/dns.htm
new file mode 100644
index 00000000000..0786d2e1d89
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/dns.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Provider's Domain and DNS Information
+
+This screen asks users to enter your domain name and DNS server addresses.
+
+You can preset Account Setup with this information in an NCI configuration. For more information about NCI configurations, click [More Help], below.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar. However, turn off this screen only if the NCI configuration(s) you are using supply this information and you are not offering the "None of the Above" option in the NCI configurations list.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw1.htm
new file mode 100644
index 00000000000..44f0e1333c9
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw1.htm
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw2.htm
new file mode 100644
index 00000000000..923ad63284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw2.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw3.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw3.htm
new file mode 100644
index 00000000000..44f0e1333c9
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw3.htm
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw4.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw4.htm
new file mode 100644
index 00000000000..923ad63284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw4.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw5.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw5.htm
new file mode 100644
index 00000000000..923ad63284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw5.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw6.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw6.htm
new file mode 100644
index 00000000000..923ad63284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw6.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw7.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw7.htm
new file mode 100644
index 00000000000..923ad63284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw7.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw7a.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw7a.htm
new file mode 100644
index 00000000000..923ad63284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw7a.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw8.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw8.htm
new file mode 100644
index 00000000000..923ad63284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/duepvw8.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Communicator Preview
+
+
This screen, with the other Communicator Preview screens, provides an overview of the components of Communicator. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Communicator Preview screens to meet your needs. Or, if you don't want to offer the Communicator Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/editcc.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/editcc.htm
new file mode 100644
index 00000000000..b9eec0065ca
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/editcc.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Billing Options
+
+Use this screen to edit the pop-up list of credit cards presented to users in the "Your Billing Information" screen of Account Setup.
+
+Check the checkbox next to each credit card that you want to appear in the pop-up list.
+
+When you have set these options, click Back in the Account Setup navigation pane to return to Account Setup.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/editfour.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/editfour.htm
new file mode 100644
index 00000000000..52aa1e8dcfc
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/editfour.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Other Account Setup Screens
+
+Account Setup displays any remaining screens of the IAS mode in specific circumstances, as described on the screen.
+
+If you don't load and edit any other screens, you should at least load the ok.htm and okreboot.htm screens--there are screen options associated with those screens.
+
+Note that you can't actually connect to an Internet account server from the Account Setup Editor. To test this version of Account Setup with your server, exit the Account Setup Editor and run Account Setup.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/edithlp.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/edithlp.htm
new file mode 100644
index 00000000000..76bcefdd961
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/edithlp.htm
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Editing the Help for Account Setup Screens
+
+You can edit the text of the Help file for any Account Setup screen. To do this, you use the Toolbar to open the screen's HTML-based Help file, then use your text editor to make changes to the file.
+
+To edit a screen's Help file, follow these steps:
+
+
+ Move to the Account Setup screen for which you want to edit the Help file.
+
+ Click Choose Editor in the Toolbar and specify your text editor.
+
+ Click Edit Help in the Toolbar. The Account Setup Editor opens the screen's HTML-based Help file in your text editor.
+
+ Save your changes to the HTML file, then click Reload Screen in the Toolbar to see your changes in the Account Setup Help window.
+
+
+Like the Account Setup screens, the Help files are formatted using JavaScript style sheets. For more information about working with Account Setup's style sheets, click [BACK], below.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/editisps.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/editisps.htm
new file mode 100644
index 00000000000..7a4567abcae
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/editisps.htm
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+NCI Configuration Options
+
+The IAS Configuration Options dialog lets you:
+
+
+Create or edit NCI configurations. Click the Edit Configurations button to begin.
+
+Set NCI configuration options. You can preset Account Setup to use a single NCI configuration or offer users a list of NCI configurations.
+
+Set options for the NCI configurations list.
+
+
+When you are finished working with NCI configurations and their options, click Back in the Account Setup navigation pane to return to Account Setup.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/editregs.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/editregs.htm
new file mode 100644
index 00000000000..65539960f24
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/editregs.htm
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+IAS Configuration Options
+
+The IAS Configuration Options dialog lets you:
+
+
+Create or edit IAS configurations. If you are offering users the IAS mode, you must create at least one configuration. Click Edit Configurations to begin.
+
+Set IAS configuration options. You can preset Account Setup to use a single IAS configuration or offer users a choice of multiple IAS configurations displayed in a pop-up menu. Use the radio buttons and pop-up menu to set these options.
+
+
+When you are finished working with IAS configurations and their options, click Back in the Account Setup navigation pane to return to Account Setup.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/editscn.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/editscn.htm
new file mode 100644
index 00000000000..28fe900dc43
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/editscn.htm
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Editing Text and Graphics
+
+You can edit the text and graphics in any Account Setup screen. To do this, you use the Toolbar to open the screen's HTML file, then use your text to make changes to the file.
+
+To edit a screen's HTML file, follow these steps:
+
+
+ Move to the Account Setup screen you want to edit.
+
+ Click Choose Editor in the Toolbar and specify your text editor.
+
+ Click Edit Screen in the Toolbar. The Account Setup Editor opens the screen's HTML file in your text editor.
+
+ Save your changes to the HTML file, then click Reload Screen in the Toolbar to see your changes in Account Setup.
+
+
+You can change any text or HTML in any file, but make sure that you don't inadvertently change any of the JavaScript in the files. For more information about changing JavaScript in Account Setup, click [BACK], below.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/email.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/email.htm
new file mode 100644
index 00000000000..0fe4439d69e
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/email.htm
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Email Login and Password
+
+
This screen asks users to enter their email login and password.
+
+You can preset Account Setup with this information in an NCI configuration. For more information about NCI configurations, click [More Help], below.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/error.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/error.htm
new file mode 100644
index 00000000000..d90a3b2284d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/error.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Connection Error...
+
+When in IAS mode, Account Setup displays this screen if it can't establish a connection with the Internet account server, or if the user exits from the Internet account server without creating an account.
+
+When in NCI mode, Account Setup displays this screen if it can't establish a connection with the user's account.
+
+As shown in the Expose Layer pop-up menu in the Toolbar, this screen displays a different text layer depending on Account Setup's mode.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/globopts.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/globopts.htm
new file mode 100644
index 00000000000..d7718ea2edc
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/globopts.htm
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Setting Account Setup's Global Options
+
+Before you go on to customize the rest of Account Setup, you should first set its global options.
+
+To set global options, follow these steps:
+
+
+ If you have moved past the first screen of Account Setup, use the navigation pane to move back to the first screen of Account Setup.
+
+ Click Screen Options in the Toolbar to load the global options dialog into the Account Setup window.
+
+ Use the radio buttons and checkboxes in the dialog to set global options.
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/iasmode.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/iasmode.htm
new file mode 100644
index 00000000000..6b05cea9889
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/iasmode.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Use Internet Account Server (IAS) Mode Only
+
+In IAS mode, Account Setup presents screens that can ask users for name, address, and credit card number, as well as modem, and dialing information. Account Setup uses the information to connect users to your Internet account server to create accounts.
+
+If you choose this option, Account Setup automatically hides the "Welcome to Account Setup" screen, which lets users choose the mode they want to use. Instead, it takes them directly into the first screen of the IAS mode, "Preparing to Create an Account".
+
+If you are offering the IAS mode to users, you must provide information about your Internet account server, such as its access phone number and login. To do this, create one or more IAS configurations when you reach the "Connect to Server" screen of the IAS mode.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/iasnmtab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/iasnmtab.htm
new file mode 100644
index 00000000000..2c5b1ac0f60
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/iasnmtab.htm
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Config Name Tab
+
+This tab asks you to provide a name for this IAS configuration--the name by which the configuration is listed in the IAS multiple configurations pop-up menu.
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/imulti.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/imulti.htm
new file mode 100644
index 00000000000..8af15caf6e5
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/imulti.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Offer Multiple IAS Configurations in a List
+
+If you create more than one IAS configuration, this option lets you tell Account Setup to display all of the configurations in a pop-up menu on the "Connect to Server" screen of Account Setup. Users can then select an Internet account server (IAS configuration) from the list.
+
+Click the Edit Configurations button to create or edit an IAS configuration.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw1.htm
new file mode 100644
index 00000000000..4256fd46c0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw1.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Internet Preview
+
+This screen, with the other Internet Preview screens, provides an overview of the Internet and its major services. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Internet Preview screens to meet your needs. Or, if you don't want to offer the Internet Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw2.htm
new file mode 100644
index 00000000000..4256fd46c0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw2.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Internet Preview
+
+This screen, with the other Internet Preview screens, provides an overview of the Internet and its major services. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Internet Preview screens to meet your needs. Or, if you don't want to offer the Internet Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw3.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw3.htm
new file mode 100644
index 00000000000..4256fd46c0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw3.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Internet Preview
+
+This screen, with the other Internet Preview screens, provides an overview of the Internet and its major services. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Internet Preview screens to meet your needs. Or, if you don't want to offer the Internet Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw4.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw4.htm
new file mode 100644
index 00000000000..4256fd46c0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw4.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Internet Preview
+
+This screen, with the other Internet Preview screens, provides an overview of the Internet and its major services. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Internet Preview screens to meet your needs. Or, if you don't want to offer the Internet Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw5.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw5.htm
new file mode 100644
index 00000000000..4256fd46c0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw5.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Internet Preview
+
+This screen, with the other Internet Preview screens, provides an overview of the Internet and its major services. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Internet Preview screens to meet your needs. Or, if you don't want to offer the Internet Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw6.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw6.htm
new file mode 100644
index 00000000000..4256fd46c0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw6.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Internet Preview
+
+This screen, with the other Internet Preview screens, provides an overview of the Internet and its major services. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Internet Preview screens to meet your needs. Or, if you don't want to offer the Internet Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw7.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw7.htm
new file mode 100644
index 00000000000..4256fd46c0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/inpvw7.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Internet Preview
+
+This screen, with the other Internet Preview screens, provides an overview of the Internet and its major services. Users can link to the Internet Preview only from the first screen of Account Setup. At the conclusion of the Internet Preview, users are returned to the first screen of Account Setup.
+
+You can edit the text and graphics on the Internet Preview screens to meet your needs. Or, if you don't want to offer the Internet Preview to users, you can remove it from Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/intmode.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/intmode.htm
new file mode 100644
index 00000000000..effa41384b3
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/intmode.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Support International Name, Address, and Phone Number Formats
+
+This option lets you tell Account Setup to use generic name, address, and phone number formats in its screens.
+
+If you use this option, Account Setup displays no Area Code fields in phone numbers, or any State and ZIP/Postal Code input fields in addresses. It also turns off JavaScript alerts relating to required phone number fields (such as Area Code) and allows a greater number of characters in name, address, and phone number input fields.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/intro1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/intro1.htm
new file mode 100644
index 00000000000..0a1c7aa3431
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/intro1.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Account Setup Introduction
+
+This screen, with the other Introduction screens, provides an overview of a dial-up connection and how Account Setup is used. Users can view the Introduction after clicking the Start Account Setup button in the first screen of Account Setup.
+
+The first Introduction screen gives users the option of viewing the rest of the Introduction screens or bypassing them and proceeding directly to Account Setup. In either case, users end up at the "Welcome to Account Setup" screen of Account Setup.
+
+You can edit the text and graphics on the Introduction screens to meet your needs. Or, if you don't want to offer the Introduction to users, you can set Account Setup's global options so that it doesn't display any of the Introduction screens. Instead, users go directly to Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/intro2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/intro2.htm
new file mode 100644
index 00000000000..0a1c7aa3431
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/intro2.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Account Setup Introduction
+
+This screen, with the other Introduction screens, provides an overview of a dial-up connection and how Account Setup is used. Users can view the Introduction after clicking the Start Account Setup button in the first screen of Account Setup.
+
+The first Introduction screen gives users the option of viewing the rest of the Introduction screens or bypassing them and proceeding directly to Account Setup. In either case, users end up at the "Welcome to Account Setup" screen of Account Setup.
+
+You can edit the text and graphics on the Introduction screens to meet your needs. Or, if you don't want to offer the Introduction to users, you can set Account Setup's global options so that it doesn't display any of the Introduction screens. Instead, users go directly to Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/intro3.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/intro3.htm
new file mode 100644
index 00000000000..0a1c7aa3431
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/intro3.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Account Setup Introduction
+
+This screen, with the other Introduction screens, provides an overview of a dial-up connection and how Account Setup is used. Users can view the Introduction after clicking the Start Account Setup button in the first screen of Account Setup.
+
+The first Introduction screen gives users the option of viewing the rest of the Introduction screens or bypassing them and proceeding directly to Account Setup. In either case, users end up at the "Welcome to Account Setup" screen of Account Setup.
+
+You can edit the text and graphics on the Introduction screens to meet your needs. Or, if you don't want to offer the Introduction to users, you can set Account Setup's global options so that it doesn't display any of the Introduction screens. Instead, users go directly to Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/intro4.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/intro4.htm
new file mode 100644
index 00000000000..0a1c7aa3431
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/intro4.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Account Setup Introduction
+
+This screen, with the other Introduction screens, provides an overview of a dial-up connection and how Account Setup is used. Users can view the Introduction after clicking the Start Account Setup button in the first screen of Account Setup.
+
+The first Introduction screen gives users the option of viewing the rest of the Introduction screens or bypassing them and proceeding directly to Account Setup. In either case, users end up at the "Welcome to Account Setup" screen of Account Setup.
+
+You can edit the text and graphics on the Introduction screens to meet your needs. Or, if you don't want to offer the Introduction to users, you can set Account Setup's global options so that it doesn't display any of the Introduction screens. Instead, users go directly to Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/intro5.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/intro5.htm
new file mode 100644
index 00000000000..0a1c7aa3431
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/intro5.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Account Setup Introduction
+
+This screen, with the other Introduction screens, provides an overview of a dial-up connection and how Account Setup is used. Users can view the Introduction after clicking the Start Account Setup button in the first screen of Account Setup.
+
+The first Introduction screen gives users the option of viewing the rest of the Introduction screens or bypassing them and proceeding directly to Account Setup. In either case, users end up at the "Welcome to Account Setup" screen of Account Setup.
+
+You can edit the text and graphics on the Introduction screens to meet your needs. Or, if you don't want to offer the Introduction to users, you can set Account Setup's global options so that it doesn't display any of the Introduction screens. Instead, users go directly to Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/intro6.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/intro6.htm
new file mode 100644
index 00000000000..0a1c7aa3431
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/intro6.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Account Setup Introduction
+
+This screen, with the other Introduction screens, provides an overview of a dial-up connection and how Account Setup is used. Users can view the Introduction after clicking the Start Account Setup button in the first screen of Account Setup.
+
+The first Introduction screen gives users the option of viewing the rest of the Introduction screens or bypassing them and proceeding directly to Account Setup. In either case, users end up at the "Welcome to Account Setup" screen of Account Setup.
+
+You can edit the text and graphics on the Introduction screens to meet your needs. Or, if you don't want to offer the Introduction to users, you can set Account Setup's global options so that it doesn't display any of the Introduction screens. Instead, users go directly to Account Setup. Click [More Help], below, for instructions.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/isingle.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/isingle.htm
new file mode 100644
index 00000000000..be5dee7675e
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/isingle.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Use a Single IAS Configuration
+
+This option lets you preset Account Setup to use a specific IAS configuration. If you choose this option, you must use the pop-up menu in the dialog screen to select the IAS configuration that you want Account Setup to use.
+
+Click the Edit Configurations button to create or edit an IAS configuration.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/jss.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/jss.htm
new file mode 100644
index 00000000000..458b7209db8
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/jss.htm
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+Style Sheets in Account Setup
+
+Account Setup uses JavaScript Style Sheets to control some aspects of the display of text in its screens. The primary reason for using JavaScript Style Sheets is to ensure a uniform appearance and layout across all of the Windows and Macintosh platforms in the defined space of the Account Setup window. Style sheets also enable you to make global changes to fonts, positioning, and many other text attributes from a central file.
+
+However, because the style sheets are signed, you can only change the styles if you are planning to re-sign the Account Setup files. Refer to Style Sheets in Account Setup for more information.
+
+
+Turning Off Style Sheets
+
+If you don't want to use the style sheets referenced by Account Setup, you can turn off the style sheets by removing the <LINK></LINK> tag from the HEAD element of the files. You can then define fonts locally or use default HTML formatting for the files.
+
+
+Style Sheets and JavaScript Signing
+
+All of the screens of Account Setup are signed with Netscape's certificate, for security.
+
+If you make changes to the style sheets, you must then re-sign the Account Setup files with your own signing certificate. For more information on how to re-sign the Account Setup files, refer to the Signing the Account Setup Files section of the Mission Control Guide.
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/layers.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/layers.htm
new file mode 100644
index 00000000000..89a826950c6
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/layers.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Layers in Account Setup Screens
+
+Many of the Account Setup screens make use of the <LAYER> tag supported by Netscape Communicator. The screens use layers for greater positional control of page elements and for displaying/hiding different text in different situations. Each layer is fully described in an HTML <!-- Comment --> that appears just above each <LAYER> tag.
+
+In screens that use layers to expose text dynamically, the Account Setup Editor lists all alternative layers in the Expose Layer pop-up menu in the Toolbar. You can look at any dynamic layer by selecting it from the pop-up menu. Note that layers used for positioning of graphics and text that are always displayed--rather than being dynamically displayed--are part of the Main Document layer listed in the pop-up menu.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/main.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/main.htm
new file mode 100644
index 00000000000..7020a21c0f2
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/main.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Netscape Account Setup Editor
+
+The Account Setup Editor helps you create a version of Account Setup that you can include in a custom Internet Setup module. Use the navigation buttons in the Account Setup window to move from screen to screen. Use the Toolbar to make changes to the screens as you go. This Help pane is updated each time you switch screens.
+
+The first step in using the Account Setup Editor is setting Account Setup's global options. To set global options, click Screen Options in the Toolbar.
+
+This screen contains dynamically displayed text layers. To view the different layers, select from the Expose Layer pop-up menu in the Account Setup Editor Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/modem1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/modem1.htm
new file mode 100644
index 00000000000..3f573e94ed5
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/modem1.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Modem
+
+This screen asks users to specify the modem connected to their computer.
+
+This screen is used in both the IAS and NCI modes--a single HTML file is used for both. So if you make changes to the text, remember that the text should be appropriate for both modes (unless you are offering only one of the modes).
+
+This screen can't be turned off.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/modes.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/modes.htm
new file mode 100644
index 00000000000..539c5efa883
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/modes.htm
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+About Account Setup's Functional Modes
+
+Account Setup is designed to offer two distinct capabilities to end users--that of connecting to an Internet account server to create new accounts (IAS mode ); and that of simply using Account Setup to configure their dialer and TCP/IP software to access an account they already have (NCI mode ).
+
+To offer the IAS mode, you must have a dedicated Internet account server implemented according to Netscape's Internet Account Server Protocol. See the Guide to Online Internet Account Creation document for information about setting up an Internet account server.
+
+For more information about the IAS mode of Account Setup, refer to the Using the Account Setup Editor section of the Mission Control documentation.
+
+Use Account Setup's global options to choose which functional mode you want to use.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/more.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/more.htm
new file mode 100644
index 00000000000..82b7a036eee
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/more.htm
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/more1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/more1.htm
new file mode 100644
index 00000000000..0022597d2e4
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/more1.htm
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/more2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/more2.htm
new file mode 100644
index 00000000000..c14af5f36f4
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/more2.htm
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/moreias1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/moreias1.htm
new file mode 100644
index 00000000000..da175bde133
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/moreias1.htm
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/moreias2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/moreias2.htm
new file mode 100644
index 00000000000..8748d074f91
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/moreias2.htm
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/morenci.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/morenci.htm
new file mode 100644
index 00000000000..1d8b8f693dc
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/morenci.htm
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/morenci1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/morenci1.htm
new file mode 100644
index 00000000000..cad5bcc1522
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/morenci1.htm
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/morenci2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/morenci2.htm
new file mode 100644
index 00000000000..d3db9662069
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/morenci2.htm
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+More Help...
+
+Related Topics
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/namepw.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/namepw.htm
new file mode 100644
index 00000000000..320cee4f93a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/namepw.htm
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Account Login and Password
+
+This screen asks users to enter their account login and password.
+
+You can preset Account Setup with this information in an NCI configuration. For more information about NCI configurations, click [More Help], below.
+
+You can also choose whether to display the TTY login text and checkbox. To set this option, click Screen Options in the Toolbar.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar. However, turn off this screen only if the NCI configuration(s) you are using supply this information and you are not offering the "None of the Above" option in the NCI configurations list.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/ncicon.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/ncicon.htm
new file mode 100644
index 00000000000..bdd510cca59
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/ncicon.htm
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+About NCI Configurations
+
+The NCI mode of Account Setup consists of a series of screens that ask users for their account access phone number, their login, their mail, news, and DNS server information, and so on. You can supply some or all of this information for your users by creating one or more NCI configurations.
+
+When you supply information in an NCI file, Account Setup displays that information as default settings in the Account Setup screens. If you want, you can turn off screens for which you have provided information, so that using the NCI mode becomes simpler and faster for users.
+
+You can preset Account Setup to use a specific NCI configuration, or you can create several configurations and let users choose the configuration they want to use. Alternatively, you don't need to create any NCI configurations at all. Account Setup simply asks users to provide all of the required information.
+
+To create and edit NCI configurations and set options, move to the "Your Account Access Location" screen and click Screen Options in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/ncimode.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/ncimode.htm
new file mode 100644
index 00000000000..5d8affdce56
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/ncimode.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Use Network Configuration (NCI) Mode Only
+
+In NCI mode, Account Setup presents screens that ask users for account, modem, and dialing information, then uses this information to configure their dialer and TCP/IP software.
+
+If you choose this option, Account Setup automatically hides the "Welcome to Account Setup" screen, which lets users choose the mode they want to use. Instead, it takes them directly into the first screen of the NCI mode, "Your Account Access Location".
+
+If you are offering the NCI mode to users, you can make the set-up process easier for users by providing account information to Account Setup in advance. To do this, create NCI configurations when you get to the "Your Account Access Location" screen.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/needs1.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/needs1.htm
new file mode 100644
index 00000000000..b2b6caf6d12
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/needs1.htm
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Preparing to Create a New Account
+
+This screen explains to users about the process of creating a new Internet account. It also informs them what information they need to provide to create an account.
+
+If your process or information requirements are different from those listed, you can edit the screen by clicking Edit Screen in the Toolbar.
+
+Note that Account Setup dynamically removes either of the first two items listed--name and address and credit card--if you turn off the Account Setup screens that ask for that information (later in Account Setup).
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/needs2.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/needs2.htm
new file mode 100644
index 00000000000..efae4503c94
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/needs2.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Preparing to Set Up Access
+
+This screen explains to users the process of setting up access to an existing Internet account. It also informs users what information they need to provide to complete the process successfully.
+
+If your process or information requirements are different from those listed, edit the screen by clicking Edit Screen in the Toolbar.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/newAcct.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/newAcct.htm
new file mode 100644
index 00000000000..9f77e45dd1b
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/newAcct.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Information about Yourself
+
+This screen asks users for their name, billing address, and phone number.
+
+If you want users to enter this information after they are connected to your Internet account server, rather than during Account Setup, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+You can support international name, address, and phone number formats in this screen by setting Account Setup's global options. To set global options, return to the first screen of Account Setup and click Screen Options in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/nlstname.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/nlstname.htm
new file mode 100644
index 00000000000..bcfec17e08f
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/nlstname.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+List Configurations by Name
+
+This option lets you display the items in the NCI configurations list by their configuration names, which you specify in the Configuration Name tab of each NCI configuration.
+
+If you want to display an NCI configuration by name and access phone number, you can include the access phone number as part of the configuration name.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/nlstnone.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/nlstnone.htm
new file mode 100644
index 00000000000..ec7124bdd0a
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/nlstnone.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Include "None of the Above" Item in List
+
+This option lets you require users to choose one of the NCI configurations in the list. If you uncheck this checkbox to remove the "None of the Above" item from the list, Account Setup doesn't let users move to the next screen unless they select a configuration.
+
+If users attempt to move to the next screen without having selected a configuration, Account Setup displays an alert message. Users click OK on the alert and Account Setup returns them to the "Your Account Access Location" screen.
Note that Account Setup does not display this alert when you are using the Account Setup Editor.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/nlstphon.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/nlstphon.htm
new file mode 100644
index 00000000000..37fbb8fa201
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/nlstphon.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+List Configurations by Access Phone Number
+
+This option lets you display the items in the NCI configurations list by their access phone numbers, which you specify in the Access Phone Number field of the Account Access tab of each NCI configuration.
+
+If you want to display an NCI configuration by name and access phone number, you can include the access phone number as part of the configuration name, which you specify in the Configuration Name tab.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/nmtab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/nmtab.htm
new file mode 100644
index 00000000000..aff091a94c6
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/nmtab.htm
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Config Name Tab
+
+This tab asks you to provide a name for this NCI configuration--the name by which the configuration is listed in the "Your Account Access Location" screen.
+
+If you want to list an access phone number or location rather than a name, make sure to include that information in the configuration name. Account Setup lists each configuration using the exact text you specify in the Configuration Name field.
+
+The tab also lets you provide a technical support phone number for your customers. Account Setup automatically displays this number on the "Preparing to Set Up Access" screen.
+
+Note: On Windows 3.1 and WFW 3.11 platforms, using parentheses or other special characters can cause problems. Special characters can interfere with Account Setup when it is creating the associated account icon on the user's desktop. If you have users on Windows 3.1 and WFW 3.11 systems, use a configuration name that contains no special characters.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/nmulti.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/nmulti.htm
new file mode 100644
index 00000000000..5d2400e9d46
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/nmulti.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Offer Multiple NCI Configurations in a List
+
+If you create more than one NCI configuration, this option lets you tell Account Setup to display all of the configurations in a list on the "Connect to Server" screen of Account Setup. Users can then select an account access location (NCI configuration) from the list.
+
+When you select this option, Account Setup lists your NCI configurations by their configuration names.
+
+Click the Edit Configurations button to create or edit an NCI configuration.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/nsingle.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/nsingle.htm
new file mode 100644
index 00000000000..4b9fa272425
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/nsingle.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Use a Single NCI Configuration
+
+This option lets you preset Account Setup to use a specific NCI configuration. If you choose this option, you must use the pop-up menu in the dialog screen to select the NCI configuration that you want Account Setup to use.
+
+
When you select this option, Account Setup automatically turns off the "Your Account Access Location" screen. Note that Account Setup does not turn off the screen when you are using the Account Setup Editor.
+
+Click the Edit Configurations button to create or edit an NCI configuration.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/ok.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/ok.htm
new file mode 100644
index 00000000000..807f544c77f
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/ok.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Congratulations!
+
+This screen appears after the user has connected to your Internet account server and successfully created an account. Account Setup receives the user's new account information from your server, disconnects from the server, and displays this screen.
+
+This screen lets users choose to have Account Setup write their account information to a text file, for future reference. If you want, you can set Account Setup to writes the account information without the user's account password. Alternatively, you can remove this option from Account Setup.
+
+To set these options, click Screen Options in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/okreboot.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/okreboot.htm
new file mode 100644
index 00000000000..6c54c84e3b6
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/okreboot.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Congratulations!
+
+This screen appears after the user has connected to your Internet account server and successfully created an account, if the user must restart the computer before connecting to the Internet. Account Setup receives the user's new account information from your server, disconnects from the server, and displays this screen.
+
+This screen lets users choose to have Account Setup write their account information to a text file, for future reference. If you want, you can set Account Setup to writes the account information without the user's account password. Alternatively, you can remove this option from Account Setup.
+
+To set these options, click Screen Options in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/othtab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/othtab.htm
new file mode 100644
index 00000000000..bc157c2d6c8
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/othtab.htm
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Options Tab
+
+This tab offers options related to connecting to your server.
+
+
+
+
+ Require Users to Login Manually (Using TTY Window)
+
+
+ Check this checkbox if you want to require users to log in to your Internet account server manually, using a terminal (TTY) window.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/publish.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/publish.htm
new file mode 100644
index 00000000000..f3ea6775db6
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/publish.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Publishing Location
+
+This screen asks users to enter the URLs they use for publishing and viewing their Web pages. It also asks users for the password they use when publishing.
+
+You can preset Account Setup with this information in an NCI configuration. For more information about NCI configurations, click [More Help], below.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/pubtab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/pubtab.htm
new file mode 100644
index 00000000000..3369d8375a7
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/pubtab.htm
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Publishing Tab
+
+This tab lets you to provide information about the location that users can publish their web pages. Account Setup uses this information to configure Communicator's Editor preferences.
+
+
+
+
+ URL for Publishing Pages:
+
+
+ The URL of the location on your web server where you want users to publish their web pages.
+
+
+
+ Password for Publishing:
+
+
+ The password users must provide to access the publishing location (if applicable).
+
+
+
+
+ URL for Viewing Pages:
+
+
+ The URL that users enter in Navigator's Location field to view their web pages.
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/register.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/register.htm
new file mode 100644
index 00000000000..4e0c3795ec4
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/register.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Connecting to the Internet Account Server...
+
+Account Setup displays this screen temporarily, while establishing a connection with your Internet account server.
+
+If you want Account Setup to pass special values up to your Internet Account Server, such as the client platform, the name of the forms data, and so on, you can add your own values to the hidden input fields on this screen. To do so, click Edit Screen in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/remprev.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/remprev.htm
new file mode 100644
index 00000000000..a78206d3d42
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/remprev.htm
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Removing the Internet or Communicator Preview
+
+If you don't want Account Setup to display one of the Previews to your users, you can remove the link to either Preview found in the first screen of Account Setup. You don't need to remove the Preview's HTML files from the dialup package folder.
+
+Note that you can't remove just one of the screens from a Preview without changing the JavaScript in Account Setup--the screens are linked as a sequence. For more information about changing JavaScript in Account Setup, click [BACK], below.
+
+To remove a Preview from Account Setup, follow these steps:
+
+
+ Using the Account Setup navigation pane, move back to the first screen of Account Setup.
+
+ Click Choose Editor in the Toolbar to specify your text or HTML editor (if you haven't already).
+
+ Click Edit Screen in the Toolbar. The Account Setup Editor opens the screen's HTML file in your text or HTML editor.
+
+ In the HTML file, locate the <!-- Previews --> comment. It identifies the table that contains the links to the Previews.
+
+ Delete the appropriate rows from the table, as explained in the comments embedded in the table.
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/satab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/satab.htm
new file mode 100644
index 00000000000..de01357322c
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/satab.htm
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Server Access Tab
+
+This tab asks you to provide information that enables users to connect to your server.
+
+
+
+
+ IAS Access Phone Number:
+
+
+ The telephone number that Account Setup is to dial to connect the user to your server. Enter the phone number in TAPI format (for example: +1 415 555 1212).
+
+
+
+
+ IAS Login:
+
+
+ The login that Account Setup is to provide when connecting to your server.
+
+
+
+
+ IAS Password:
+
+ The password that Account Setup is to provide when connecting to your server. When you enter a password in this text box, the Account Setup Editor automatically encrypts the password in a way that only Account Setup can decrypt. It does this so that users can't open the .ias file containing the password and gain unauthorized access to your Internet account server.
+
+
+
+ IAS CGI URL:
+
+
+ The URL of that Account Setup is to load after connecting to your server. This is usually the URL of your Internet account server CGI script.
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/servers.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/servers.htm
new file mode 100644
index 00000000000..1f3a6818d4f
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/servers.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Provider's Mail and News Servers
+
+This screen asks users to enter the addresses of your email and news servers.
+
+You can preset Account Setup with this information in an NCI configuration. For more information about NCI configurations, click [More Help], below.
+
+If you want, you can turn off this screen by unchecking the Show Screen checkbox in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/settings.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/settings.htm
new file mode 100644
index 00000000000..2dfcb9f3fdf
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/settings.htm
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Account Setup Global Options
+
+The Account Setup Global Options dialog in the Account Setup window lets you set options that determine the overall function of Account Setup.
+
+This dialog lets you:
+
+
+Specify Account Setup's functional mode. You can set the program to operate in either IAS or NCI mode, or to offer users their choice of modes.
+
+Support international names, addresses, and phone numbers.
+
+Set the idle connection timeout interval in users' dialer software.
+
+
+When you have set the global options, click Back in the Account Setup navigation pane to return to Account Setup.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/shintro.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/shintro.htm
new file mode 100644
index 00000000000..cdbfbdf0edb
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/shintro.htm
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Show Account Setup Introduction Screens
+
+This option lets you tell Account Setup whether to display the Account Setup Introduction screens to users. The Introduction screens provide an overview of a dial-up connection and how Account Setup is used. Users can view the Introduction after clicking the Start Account Setup button in the first screen of Account Setup.
+
+If you don't show the Introduction screens, Account Setup automatically takes users directly to the "Welcome to Account Setup" screen when they click Start Account Setup in the opening screen.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/siptab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/siptab.htm
new file mode 100644
index 00000000000..17175ce8f53
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/siptab.htm
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Server IP Tab
+
+This tab asks you to provide network information about your server.
+
+
+
+
+ Domain name:
+
+
+ The domain name of your company.
+
+
+
+
+ Primary DNS Address:
+
+
+ The internet address of your primary DNS server.
+
+
+
+
+ Secondary DNS Address:
+
+ The internet address of your secondary DNS server.
+
+
+
+
+ Server Assigns Client IP Address Dynamically
+
+
+ Check this checkbox if your server assigns clients' IP addresses dynamically.
+
+
+
+
+ Assign Static IP Address:
+
+ If your server doesn't assign clients' IP addresses dynamically, or if you want to assign a specific IP address to the client for connecting to your server, you can specify a static IP address that Account Setup will use.
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/sltab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/sltab.htm
new file mode 100644
index 00000000000..208831c1881
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/sltab.htm
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+
+Scripted Login Tab
+
+This tab gives you the option of specifying a connection script that you want Account Setup to use when connecting. You can use this tab to create and edit the login script.
+
+Note that scripted login is supported only on Windows 3.1 and Macintosh platforms.
+
+
+
+
+ Select a Login Script:
+
+
+ Use the pop-up menu to select the login script that you want Account Setup to use when connecting to your server.
+
+
+
+
+ Edit Script:
+
+
+ Use this input field to create or edit the script selected in the pop-up menu. For more information about creating a login script, refer to the Scripted Login Support section of the Mission Control documentation.
+
+
+
+
+ Script Filename:
+
+ Use this input field to supply a filename for the script selected in the pop-up menu.
+
+
+
+
+ Save
+
+
+ Click this button to save any changes to the login script and its filename. When you save your changes, the Account Setup Editor updates the list of scripts in the pop-up menu.
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/svstab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/svstab.htm
new file mode 100644
index 00000000000..26dc7ce87ce
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/svstab.htm
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Servers Tab
+
+This tab lets you to provide information about DNS, mail, and news servers.
+
+
+
+
+ Domain name:
+
+
+ The domain name of your company.
+
+
+
+ Primary DNS Address:
+
+
+ The Internet address of your primary DNS server.
+
+
+
+
+ Secondary DNS Address:
+
+ The Internet address of your secondary DNS server.
+
+
+
+
+ Server Assigns Client IP Address Dynamically
+
+
+ Check this checkbox if your server assigns clients' IP addresses dynamically.
+
+
+
+
+ Assign Static IP Address
+
+
+ If you unchecked the "Server Assigns Client IP Address Dynamically", you can specify an IP address to assign to the client.
+
+
+
+
+ NNTP Server:
+
+ The address of your newsgroups (NNTP) server.
+
+
+
+
+ SMTP Server:
+
+ The address of your outgoing mail (SMTP) server.
+
+
+
+
+ POP or IMAP Server:
+
+ The address of your POP mail server.
+
+
+
+
+ Default (POP/IMAP):
+
+ The radio button that you select here is displayed as the default choice in Account Setup's "Your Provider's Server Addresses" screen.
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/timeout.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/timeout.htm
new file mode 100644
index 00000000000..d8b47cff59d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/timeout.htm
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Set Dialer Idle Timeout Interval
+
+This global option lets you tell Account Setup to set a specific timeout interval when it configures the user's dialer software. The timeout interval is the amount of time that the dialer permits idle connections to remain active. The default interval is 15 minutes.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/useAcct.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/useAcct.htm
new file mode 100644
index 00000000000..67024753ae2
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/cfghelp/useAcct.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ Account Setup Editor Help
+
+
+
+
+
+
+
+Your Account Access Location
+
+This screen lets users choose an account access phone number or location from a list. Each item displayed in the list represents an NCI configuration , which can contain account access information, mail and news server addresses, DNS addresses, and other information.
+
+When users select an NCI configuration, Account Setup loads all of configuration information as default settings in the screens that follow. To make using the NCI mode easier for your users, and to create access locations for this list, you can create one or more custom NCI configurations for your users.
+
+To create and edit NCI configurations and set options for this screen, click Screen Options in the Toolbar.
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/config.htm b/mozilla/cmd/dialup/tools/kit/config.htm
new file mode 100644
index 00000000000..54bf6bf24ad
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/config.htm
@@ -0,0 +1,356 @@
+
+
+
+
+
+
+
+
+
+
+ Account Setup Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reload Screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reload Screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit Screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit Screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit Help
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit Help
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Choose Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Choose Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Screen Options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Screen Options
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show Screen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Editor Help
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Exit
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Exit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/edit.htm b/mozilla/cmd/dialup/tools/kit/edit.htm
new file mode 100644
index 00000000000..6e1f3ee87cc
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/edit.htm
@@ -0,0 +1,278 @@
+
+
+
+
+ Package Selection
+
+
+
+
+
+
+
+
+
+
+
+Account Setup Editor
+
+Please select a package to customize:
+
+
+
+
+
+________________________________
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/images/license b/mozilla/cmd/dialup/tools/kit/images/license
new file mode 100644
index 00000000000..947718beabb
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/images/license
@@ -0,0 +1,17 @@
+/*
+ * The contents of this directory are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use the files in this directory except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
diff --git a/mozilla/cmd/dialup/tools/kit/imagswap.js b/mozilla/cmd/dialup/tools/kit/imagswap.js
new file mode 100644
index 00000000000..809f7faea6f
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/imagswap.js
@@ -0,0 +1,46 @@
+
+//imageswap.js
+//functions to swap the src and lowsrc of an image
+
+function swapSrc(imageRef)
+{
+ if ((imageRef) && (imageRef != null))
+ {
+ if (imageRef.lowsrc && imageRef.src);
+ {
+
+ var lsrc = imageRef.lowsrc;
+ var src = imageRef.src;
+
+ imageRef.lowsrc = src;
+ imageRef.src = lsrc;
+ }
+ }
+}
+
+function replaceSrc(imageRef, newimg)
+{
+ if ((imageRef) && (imageRef != null))
+ {
+ if ((newimg) && (newimg != null) && (newimg != ""));
+ {
+ imageRef.src = newimg;
+ }
+ }
+}
diff --git a/mozilla/cmd/dialup/tools/kit/kit.htm b/mozilla/cmd/dialup/tools/kit/kit.htm
new file mode 100644
index 00000000000..f003475497f
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/kit.htm
@@ -0,0 +1,100 @@
+
+
+ Package Selection
+
+
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/mkit.htm b/mozilla/cmd/dialup/tools/kit/mkit.htm
new file mode 100644
index 00000000000..faf2b60e38d
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/mkit.htm
@@ -0,0 +1,25 @@
+
+
+ Package Selection
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/tools/kit/sheet.js b/mozilla/cmd/dialup/tools/kit/sheet.js
new file mode 100644
index 00000000000..ba39a5f5e19
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/sheet.js
@@ -0,0 +1,183 @@
+
+ //TAGS FOR ACCOUNT SETUP EDITOR DIALOGS
+
+
+
+document.tags.BODY.marginTop="0";
+document.tags.BODY.marginBottom="0";
+
+document.tags.P.fontFamily="PrimaSans BT,Helvetica,Arial";
+document.tags.P.fontSize="12px";
+//document.tags.P.lineHeight="1";
+document.tags.P.marginTop="14";
+document.tags.P.marginRight="72";
+document.tags.P.marginBottom="0";
+document.tags.P.marginLeft="72";
+
+
+
+//Titles of Account Setup screens
+
+document.classes.title.all.fontFamily="PrimaSans BT,Helvetica,Arial";
+document.classes.title.all.fontSize="12px";
+document.classes.title.all.fontWeight="bold";
+document.classes.title.all.lineHeight="1";
+document.classes.title.all.marginTop="0";
+document.classes.title.all.marginRight="40";
+//classes.title.all.marginBottom="16";
+document.classes.title.all.marginLeft="0";
+
+
+
+
+//Tables (for forms inputs, etc.)
+
+document.tags.TABLE.marginTop="14";
+
+document.tags.TD.fontFamily="PrimaSans BT,Helvetica,Arial";
+document.tags.TD.fontSize="11px";
+document.tags.TD.lineHeight="1.0"
+
+
+
+//the entries below are exceptions to the standard definition
+
+//classes.modem1.P.width="260";
+document.classes.accounts.TD.fontSize="12px";
+document.ids.nospace.marginTop="0";
+document.ids.minspace.marginTop="4";
+document.ids.nomargins.margins(14,8,8,8);
+
+document.classes.item.all.fontSize="11px";
+document.classes.item.all.marginLeft="0";
+document.classes.item.all.fontFamily="PrimaSans BT,Helvetica,Arial";
+document.classes.item.all.marginTop="0";
+
+document.classes.itemtext.all.marginLeft="0";
+document.classes.itemtext.all.fontSize="10px";
+document.classes.itemtext.all.fontFamily="PrimaSans BT,Helvetica,Arial";
+//document.classes.itemtext.all.width="230";
+document.classes.itemtext.all.marginTop="6";
+document.classes.itemtext.all.lineHeight="1";
+
+
+
+document.classes.subitem.all.fontFamily="PrimaSans BT,Helvetica,Arial";
+document.classes.subitem.all.fontSize="10px";
+//document.classes.subitem.all.color="#FFFFFF";
+document.classes.subitem.all.marginTop="0";
+document.classes.subitem.all.marginLeft="24";
+//document.classes.subitem.all.marginLeft="0";
+
+
+
+
+
+
+
+//Lists
+
+document.tags.UL.listStyleType='disc';
+document.tags.UL.fontFamily='PrimaSans BT,Helvetica,Arial';
+document.tags.UL.fontSize='12px';
+document.tags.UL.marginTop='-6';
+document.tags.UL.marginBottom='-6';
+document.tags.UL.marginLeft='72';
+document.tags.UL.marginRight='72';
+
+document.tags.LI.fontSize='10';
+document.tags.LI.marginTop='0';
+document.tags.LI.marginBottom='-14';
+
+//Communicator tag in the main.htm (startup screen of Account Setup)
+
+document.classes.tag.all.fontSize='12px';
+document.classes.tag.all.paddingLeft='2';
+document.classes.tag.all.color='white';
+
+
+//Account Setup tag
+
+document.classes.previewtag.all.fontSize='12px';
+document.classes.previewtag.all.paddingLeft='5';
+document.classes.previewtag.all.color='white';
+
+//TAGS FOR MAIN.HTM
+
+//Previews buttons
+
+document.classes.previewhead.all.fontSize='11px';
+document.classes.previewhead.all.fontFamily='PrimaSans BT, Helvetica,Arial';
+document.classes.previewhead.all.color='white';
+
+document.classes.blurb.all.fontSize='11px';
+document.classes.blurb.all.fontFamily='PrimaSans BT, Helvetica,Arial';
+document.classes.blurb.all.color='black';
+document.classes.blurb.all.lineHeight='1.1';
+
+
+//This tag overrides the standard table marginTop to make bring previews table
+//closer to Start Account Setup button
+
+document.classes.previews.all.marginTop='-2';
+
+
+
+
+//Dial-Up Edition header
+
+document.classes.due.all.fontSize='34px';
+document.classes.due.all.fontFamily='PrimaSans BT,Helvetica,Arial';
+document.classes.due.all.fontWeight='300';
+document.classes.due.all.marginRight='0';
+document.classes.due.all.marginLeft='80';
+document.classes.due.all.marginTop='12';
+
+
+//Start Account Setup button text
+
+document.classes.sas.B.fontSize='23px';
+document.classes.sas.B.fontFamily='PrimaSans BT,Helvetica,Arial';
+
+document.classes.sas1.B.fontSize='17px';
+document.classes.sas1.B.fontFamily='PrimaSans BT,Helvetica,Arial';
+document.classes.sas1.B.marginTop='12';
+document.classes.sas1.B.marginBottom='12';
+
+
+//Text for the body of main.htm--the dynamic layers
+
+
+//classes.body.all.width='560';
+document.classes.body.all.margins(54,25,0,38);
+document.classes.body.all.fontSize='12px';
+
+//Text for all second paragraphs in the body section
+
+document.classes.bodysecondparagraph.all.fontFamily='PrimaSans BT,Helvetica,Arial';
+document.classes.bodysecondparagraph.all.marginLeft='210';
+document.classes.bodysecondparagraph.all.marginRight='2';
+document.classes.bodysecondparagraph.all.marginTop='4';
+document.classes.bodysecondparagraph.all.fontSize='12px';
+
+//Generic classes for tables
+
+document.classes.tabletext.fontsize='11px';
+document.classes.tabletext.fontWeight='900';
+
diff --git a/mozilla/cmd/dialup/tools/kit/toolbar.js b/mozilla/cmd/dialup/tools/kit/toolbar.js
new file mode 100644
index 00000000000..34a9eb96729
--- /dev/null
+++ b/mozilla/cmd/dialup/tools/kit/toolbar.js
@@ -0,0 +1,675 @@
+
+//toolbar.js
+
+
+//handles:
+//Globals frame: opener.top.globals
+//controls frame: opener.top.screen.controls
+
+// Request privilege
+compromisePrincipals(); // work around for the security check
+netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
+//var theEditor = null;
+var ready;
+var cfgHelpWindow;
+var numValidPopupEntries = 0;
+
+function finishedLoading()
+{
+ if (ready && document.layers["reload"])
+ return true;
+ else
+ return false;
+}
+
+function getLayerVisibility(inLayerName)
+{
+ if (finishedLoading && document.layers[inLayerName])
+ return document.layers[inLayerName].visibility;
+}
+
+
+function editScreen(isHelpScreen)
+{
+
+ var thePlatform = new String(navigator.userAgent);
+ var x=thePlatform.indexOf("(")+1;
+ var y=thePlatform.indexOf(";",x+1);
+ var helpFolderAppend = "help/";
+ var macFSHelpFolderAppend = "help:";
+ thePlatform=thePlatform.substring(x,y);
+
+ // Request privilege
+
+ netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
+
+ var theEditor = top.opener.top.globals.document.vars.externalEditor.value;
+ //alert("editor: " + theEditor);
+
+ var theLoc = null;
+
+
+
+ //see if we can find a help Window that is open, and snarf it's location
+ if (top.opener.top.screen.controls.helpWindow && top.opener.top.screen.controls.helpWindow != null && !top.opener.top.screen.controls.helpWindow.closed && top.opener.top.screen.controls.helpWindow.location)
+ {
+ theLoc = new String(top.opener.top.screen.controls.helpWindow.location);
+ helpFolderAppend = ""; // the path will already point to the help folder if we get it from the window.
+ macFSHelpFolderAppend = "";
+ }
+ else
+ {
+ //default case - no help window open, figure out it's location as we normally would.
+ theLoc = new String(opener.top.screen.content.location);
+ }
+
+ //if we should look for the help file, parse that location here
+ if (isHelpScreen && isHelpScreen != null && isHelpScreen == true)
+ {
+ var defaultHelpFile = "ashelp.htm";
+ var slashIdx = theLoc.lastIndexOf("/");
+ var thePath = theLoc.substring(0,slashIdx+1);
+ var thePage = theLoc.substring(slashIdx+1, theLoc.length);
+
+ if (thePath.substring(thePath.length - 6, thePath.length) == "intro/")
+ {
+ thePath = thePath.substring(0, thePath.length - 6);
+ }
+ else if (thePath.substring(thePath.length - 9, thePath.length) == "ipreview/")
+ {
+ thePath = thePath.substring(0, thePath.length - 9);
+ }
+ else if (thePath.substring(thePath.length - 8, thePath.length) == "preview/")
+ {
+ thePath = thePath.substring(0, thePath.length - 8);
+ }
+
+ var helpFile = thePath + helpFolderAppend + defaultHelpFile;
+
+ //now get a directory listing and look for a help file that matches the
+ // thePage fileName
+ if (top.opener && top.opener.top.globals)
+ {
+ helpPath = "" + top.opener.top.globals.getFolder(top.opener.top.globals);
+ }
+
+ if (thePlatform == "Macintosh")
+ { // Macintosh support
+ helpPath = helpPath + macFSHelpFolderAppend;
+ }
+ else
+ { // Windows support
+ helpPath = helpPath + helpFolderAppend;
+ }
+
+ var lookingForFile = thePage;
+
+ var theList = top.opener.top.globals.document.setupPlugin.GetFolderContents(helpPath,".htm");
+ if (theList != null)
+ {
+ for (var i=0; i= 0)
+ {
+ //editWindow=window.open("","_blank","dependent=yes,toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
+ //editWindow.onerror=null;
+ //editWindow.location=theLoc;
+ netscape.plugin.composer.Document.editDocument(theLoc);
+ }
+ else if (theEditor != null && theEditor != "" && theEditor.length > 0)
+ {
+
+ var theFile = theLoc;
+
+ //We need to see if we are editing a multi-layer document, which has the layer popup, and
+ //if so, make sure we get the right document from the popup here
+
+
+ if (theFile.indexOf("file:///") ==0) {
+ theFile = theFile.substring(8,theFile.length);
+ }
+
+ if (thePlatform == "Macintosh") {
+ var path=unescape(theFile);
+ var fileArray=path.split("/");
+ var newpath=fileArray.join(":");
+ if (newpath.charAt(0)==':') {
+ newpath=newpath.substring(1,newpath.length);
+ }
+ theFile=unescape(newpath);
+ }
+ else {
+ // note: JavaScript returns path with '/' instead of '\'
+ var path=unescape(theFile);
+
+ // gets the drive letter and directory path
+ var Drive = path.substring(path.indexOf('|')-1, path.indexOf('|'));
+ var thepath = path.substring(path.indexOf('/'), path.length);
+ var newpath=Drive + ":" + thepath;
+ var fileArray=newpath.split("/");
+ theFile=fileArray.join("\\");
+ }
+
+ //alert("I wanna open: " + theFile);
+ opener.top.globals.document.setupPlugin.OpenFileWithEditor(theEditor, theFile);
+ }
+ else
+ {
+ alert("You must select an application as your editor before you can edit HTML pages.");
+ chooseEditor();
+ }
+
+}
+
+
+function setShowScreenBox()
+{
+ if (document && document.layers["showscreen"] && document.layers["showscreen"].document.ssForm)
+ {
+ var theBox = document.layers["showscreen"].document.ssForm.showScreenBox;
+ if ((theBox))
+ {
+
+ var isVisible = screenVisible();
+
+ if (isVisible == false)
+ {
+ theBox.checked = false;
+ }
+ else
+ {
+ theBox.checked = true;
+ }
+ }
+ }
+}
+
+
+function screenVisible()
+{
+ var visible = true;
+
+ if (opener.top && opener.top.screen && opener.top.screen.controls && opener.top.screen.controls.screenVisible)
+ {
+ visible = opener.top.screen.controls.screenVisible();
+ }
+ //else
+ //alert("toolbar - screenvisible: " + visible);
+
+ return visible;
+}
+
+function reloadScreen()
+{
+ //var theLoc = top.opener.screen.content.location;
+ //alert("top.opener.screen.content.location is " + top.opener.screen.content.location);
+ //top.opener.screen.content.history.go(0);
+ top.opener.screen.controls.reloadDocument();
+ return false;
+}
+
+function chooseEditor()
+{
+
+ netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
+
+ var theEditor = opener.top.globals.document.setupPlugin.GetExternalEditor();
+ if ((theEditor != null) && (theEditor != "")) {
+ top.opener.top.globals.document.vars.externalEditor.value = theEditor;
+ top.opener.top.globals.saveExternalEditor();
+ }
+}
+
+function screenOptions()
+{
+ return opener.top.screen.controls.go('Screen Options');
+
+}
+
+function showScreen(thisRef)
+{
+ var result = thisRef.checked;
+
+ var theBox = document.layers["showscreen"].document.ssForm.showScreenBox;
+ if ((theBox))
+ {
+ var result = opener.top.screen.controls.showScreen(theBox.checked);
+ if ((result != null))
+ theBox.checked = result;
+ }
+
+ return result;
+}
+
+function hidelayer(layerName)
+{
+ if (document.layers)
+ {
+ theLayer = eval("document.layers."+layerName);
+ if(theLayer)
+ {
+ theLayer.visibility="hide";
+ }
+ }
+ else
+ {
+ //alert("hide: " + layerName);
+ theImg = eval("document.images."+layerName);
+ replaceSrc(theImg, "Images/blank.gif");
+ replaceSrc(theImg, "Images/blank1.gif");
+ }
+}
+
+function showlayer(layerName)
+{
+ if (document.layers)
+ {
+ theLayer = eval("document.layers."+layerName);
+ if(theLayer)
+ {
+ theLayer.visibility="show";
+ }
+ }
+ else
+ {
+ //alert("show: " + layerName);
+ theImg = eval("document.images."+layerName);
+ if(theImg)
+ replaceSrc(theImg, theImg.lowsrc);
+ }
+}
+
+
+function toggleShow(lName, checkValue)
+{
+ //alert(checkValue);
+ if ((checkValue != null) && (checkValue == false))
+ hidelayer(lName);
+ else
+ showlayer(lName);
+
+}
+
+function callback()
+{
+ ready = true;
+ opener.top.screen.controls.generateToolBarControls();
+}
+
+function updateLayersLayer()
+{
+ //first, evaluate the ## of layers in the top document.
+ var numLayers = 0;
+ var thePopup = document.layers["layerSwitch"].document.forms[0]["layerSelect"];
+
+ if (thePopup && !top.loading)
+ {
+ //if (top.opener.screen.content.document.layers && top.opener.screen.content.document.layers.length > 0)
+ // numLayers = top.opener.screen.content.document.layers.length;
+ numLayers = top.opener.screen.controls.countDocumentLayers();
+
+ if (numLayers > 0)
+ {
+ document.layers["layerSwitch"].visibility="show";
+ var curLayerName="", curLayerSrc="_none";
+
+
+ //blank out old list
+top.opener.top.globals.debug("deleting options list: " + thePopup.options.length + " present");
+
+ for (var i = (numValidPopupEntries -1); i >= 0 ; i--)
+ {
+ thePopup.options[i] = new Option(" "," ",false,false);
+ }
+ //thePopup.options.length = 0;
+
+ //add a layer for the main body
+ thePopup.options[0] = new Option("Main Document .",top.opener.screen.controls.getDocumentLocation(), false, false);
+ numValidPopupEntries = 1;
+top.opener.top.globals.debug("setting popuocount to 1, options.length is: " + thePopup.options.length);
+
+ for(var index = 0; index < numLayers; index++)
+ {
+ curLayerName=top.opener.screen.controls.getLayerName(index);
+ curLayerSrc=top.opener.screen.controls.getLayerSrc(index);
+ if (!curLayerSrc || curLayerSrc == null || curLayerSrc == "null" || curLayerSrc == "")
+ curLayerSrc = "_none";
+
+ if (top.opener.screen.controls.getDocumentLayerVisibility(index) == "hide")
+ {
+ curLayerName = (curLayerName + " [hidden]");
+ }
+
+ if (curLayerName == null || curLayerName == "")
+ {
+ curLayerName = ("Layer " + eval(index+1));
+ }
+
+ //alert("Layer name: " + curLayerName + "; src: " + curLayerSrc);
+
+ if ((top.opener.screen.controls.getDocumentLayerVisibility(index) == "hide") || ((curLayerSrc != null) && (curLayerSrc != "") && (curLayerSrc != "null") && (curLayerSrc != "_none")))
+ {
+top.opener.top.globals.debug("Adding layer " + curLayerName + " to options " + numValidPopupEntries + ". thePopup.options.length now: " + thePopup.options.length);
+ thePopup.options[numValidPopupEntries] = new Option(curLayerName,curLayerSrc, false, false);
+ numValidPopupEntries++;
+ }
+ }
+ thePopup.selectedIndex=0;
+ document.layers["layerSwitch"].document.layers["g_hideothers"].visibility= "hide"; //hide the checkbox if the main document is selected.
+ }
+ else
+ {
+ hidelayer("layerSwitch");
+ document.layers["layerSwitch"].document.layers["g_hideothers"].visibility= "hide"; //hide the checkbox if the main document is selected.
+
+ }
+ }
+ else
+ setTimeout("updateLayersLayer()",1000);
+
+}
+
+
+function selectLayer(popupIndex)
+{
+
+ var numLayers = numValidPopupEntries;//document.layers["layerSwitch"].document.forms[0]["layerSelect"].options.length;
+ var layerName = "";
+ var hideCheckBox = null;
+
+ if (popupIndex >= numValidPopupEntries)
+ {
+ popupIndex = 0;
+ document.layers["layerSwitch"].document.forms[0]["layerSelect"].selectedIndex = 0;
+ }
+ if (document && document.layers && document.layers["layerSwitch"] && document.layers["layerSwitch"].document.forms[0] && document.layers["layerSwitch"].document.layers["g_hideothers"].document.forms[0]["hideLayers"])
+ hideCheckBox = document.layers["layerSwitch"].document.layers['g_hideothers'].document.forms[0]["hideLayers"];
+
+ if (top.opener.screen.controls.countDocumentLayers() > 0)
+ {
+
+ //first restore all originally hidden layers to their old hidden state:
+ for (var layidx = 1; layidx < numLayers; layidx++)
+ {
+ //alert("Layer " + layidx + "/" + numLayers);
+ var hiddenIndex = document.layers["layerSwitch"].document.forms[0]["layerSelect"].options[layidx].text.toString().indexOf(" [hidden]");
+
+ if (hiddenIndex >= 0)
+ {
+ var layerName = document.layers["layerSwitch"].document.forms[0]["layerSelect"].options[layidx].text.substring(0, hiddenIndex);
+ //alert("hiding " + layerName);
+ //if (top.opener.screen.content.document.layers[layerName].visibility)
+ top.opener.top.screen.controls.showDocumentLayer(layerName, false);
+ //top.opener.screen.content.document.layers[layerName].visibility="hide";
+ }
+ }
+
+ //now make sure we are showing the currently selected layer
+ if (popupIndex > 0) //omit 0 becuase that represents the main document
+ {
+top.opener.top.globals.debug("selectLayer, showing current Layer #: " + popupIndex);
+
+ document.layers["layerSwitch"].document.layers["g_hideothers"].visibility="show";
+ layerName = document.layers["layerSwitch"].document.forms[0]["layerSelect"].options[popupIndex].text.toString();
+top.opener.top.globals.debug("selectLayer, layer name is: " + layerName);
+ if (layerName.indexOf(" [hidden]") > 0)
+ layerName = layerName.substring(0,layerName.indexOf(" [hidden]"));
+ top.opener.top.screen.controls.showDocumentLayer(layerName, true);
+ }
+ else if (hideCheckBox != null && hideCheckBox.checked) //showing main document
+ {
+ numLayers = top.opener.screen.controls.countDocumentLayers();
+ //show all document layers
+ for (var index = 0; index < numLayers; index++)
+ {
+ layerName=top.opener.screen.controls.getLayerName(index);
+
+ if (!checkIfHiddenInLayerPopup(layerName))
+ top.opener.top.screen.controls.showDocumentLayer(layerName, true);
+
+ hideCheckBox.checked = false;
+ }
+ }
+
+ if (popupIndex == 0)
+ document.layers["layerSwitch"].document.layers["g_hideothers"].visibility= "hide"; //hide the checkbox if the main document is selected.
+
+
+
+ }
+}
+
+
+function checkIfHiddenInLayerPopup(inLayerName)
+{
+ var thePopup = document.layers["layerSwitch"].document.forms[0]["layerSelect"];
+ var hiddenName = inLayerName + " [hidden]";
+ var result = false;
+
+ if (thePopup && thePopup != null)
+ {
+top.opener.top.globals.debug("length: " + thePopup.length + ". options.length: " + thePopup.options.length);
+ for (var index = thePopup.length-1; index > 0; index--)
+ {
+ if (thePopup.options[index].text.toString() == hiddenName)
+ {
+ result = true;
+ return result;
+ }
+ }
+ }
+
+ return result;
+}
+
+//show all layers that were originally not hidden.
+function restoreLayers()
+{
+ //first, evaluate the ## of layers in the top document.
+ var numLayers = 0;
+ var curLayerName = "";
+
+ numLayers = top.opener.screen.controls.countDocumentLayers();
+
+ for (var index = 0; index < numLayers; index++)
+ {
+ curLayerName=top.opener.screen.controls.getLayerName(index);
+
+ //if (!checkIfHiddenInLayerPopup(curLayerName))
+ top.opener.top.screen.controls.showDocumentLayer(curLayerName, true);
+ }
+
+ selectLayer(document.layers["layerSwitch"].document.forms[0]["layerSelect"].selectedIndex);
+}
+
+
+function hideOtherLayers(inDoHide)
+{
+
+ var thePopup = document.layers["layerSwitch"].document.forms[0]["layerSelect"];
+
+ if (!thePopup || thePopup == null)
+ return;
+
+ if (inDoHide == false)
+ restoreLayers();
+ else if (thePopup.selectedIndex > 0)
+ {
+ //first, evaluate the ## of layers in the top document.
+ var numLayers = 0;
+ var curLayerName = "";
+top.opener.top.globals.debug("hideOtherLayers, getting layer name for: " + thePopup.selectedIndex);
+ var selectedLayerName = thePopup.options[thePopup.selectedIndex].text.toString();
+top.opener.top.globals.debug("hideOtherLayers, layer name is: " + selectedLayerName);
+
+ numLayers = top.opener.screen.controls.countDocumentLayers();
+
+ for (var index = 0; index < numLayers; index++)
+ {
+ curLayerName=top.opener.screen.controls.getLayerName(index);
+
+ if (curLayerName == selectedLayerName || (curLayerName + " [hidden]") == selectedLayerName)
+ {
+ top.opener.top.screen.controls.showDocumentLayer(curLayerName, true);
+ }
+ else
+ {
+ top.opener.top.screen.controls.showDocumentLayer(curLayerName, false);
+ }
+ }
+
+
+ }
+ else if (document && document.layers && document.layers["layerSwitch"] && document.layers["layerSwitch"].document.forms[0] && document.layers["layerSwitch"].document.layers['g_hideothers'].document.forms[0]["hideLayers"])
+ document.layers["layerSwitch"].document.layers['g_hideothers'].document.forms[0]["hideLayers"].checked = false;
+
+}
+
+
+function cfgHelp()
+{
+ if ((!cfgHelpWindow) || (cfgHelpWindow==null) || (!cfgHelpWindow.location) || (cfgHelpWindow.closed))
+ {
+ cfgHelpWindow = top.open("about:blank", "CFGHELP", "dependent=yes,alwaysRaised=yes,width=300,height=230,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
+ }
+
+ setHelpLocation();
+}
+
+
+function setHelpLocation()
+{
+
+ netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
+
+ if (cfgHelpWindow && !cfgHelpWindow.closed) //don't do anything if there's no window, but set location if there is
+ {
+ var filePrefix = "./cfghelp"; //default prefix, will change
+ var helpFile = "./cfghelp/default.htm"; //put default help screen here
+
+ //figure out the file prefix by checking the toolbar location
+ var toolbarLoc = document.location.toString();
+ filePrefix = toolbarLoc.substring(0, toolbarLoc.lastIndexOf("/")+1) + "cfghelp/";
+
+ if (top.opener.screen.content.document.location)
+ {
+ helpFile = top.opener.screen.content.document.location.toString();
+ var theIdx = helpFile.lastIndexOf("/");
+ var theLength = helpFile.length;
+ helpFile = "" + helpFile.substring(theIdx+1, theLength);
+ }
+
+ //alert("looking for help file: " + helpFile);
+
+ //check if the file we made up exists, if not, revert to the default
+ var helpPath = "";
+
+ if (top.opener && top.opener.top.globals)
+ {
+ helpPath = "" + top.opener.top.globals.getFolder(self);
+ //alert("helppath: " + helpPath);
+ }
+
+ var thePlatform = new String(navigator.userAgent);
+ var x=thePlatform.indexOf("(")+1;
+ var y=thePlatform.indexOf(";",x+1);
+ thePlatform=thePlatform.substring(x,y);
+
+ if (thePlatform == "Macintosh")
+ { // Macintosh support
+ helpPath = helpPath + "cfghelp:";
+ }
+ else
+ { // Windows support
+ helpPath = helpPath + "cfghelp/";
+ }
+
+ var lookingForFile = helpFile;
+ helpFile = filePrefix + "default.htm";
+
+ var theList = top.opener.top.globals.document.setupPlugin.GetFolderContents(helpPath,".htm");
+ if (theList != null)
+ {
+ for (var i=0; i
+
+ Package Selection
+
+
+
+
+
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/include/Helper16.h b/mozilla/cmd/dialup/win/aswplugn/include/Helper16.h
new file mode 100644
index 00000000000..55f48967c94
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/include/Helper16.h
@@ -0,0 +1,166 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+ ////////////////////////////////////////////////////////////////
+// progman.h
+// helper routines for adding/deleting program items
+//
+// Revision History
+// Date Author Reason
+// -------------------------------------------------------------
+// 01/28/97 xxxxxxxxxxxxxx Definition
+////////////////////////////////////////////////////////////////
+
+#ifndef __INC_HELPER_H__
+#define __INC_HELPER_H__
+
+#define INI_NETSCAPE_FILE "nscp.ini"
+#define INI_NAVIGATOR_SECTION "Netscape Navigator"
+#define INI_CURRENTVERSION_KEY "CurrentVersion"
+#define INI_INSTALL_DIR_KEY "Install Directory"
+#define INI_NS_CURRVER_DEFLT "4.0"
+#define INI_NS_INSTALLDIR_DEFLT "c:\\netscape"
+#define INI_NS_APPNAME_PREFIX "Netscape Navigator-"
+#define INI_NS_PROGGRPNAME_KEY "Program Folder"
+#define INI_NS_PROGGRPNAME_DEFLT "Netscape Communicator"
+
+#define DDE_WAIT_TIMER 3 // wait timer in seconds per DDE connections
+
+// ShivaRemote constants..
+#define SR_DFLT_INSTALL_PATH "c:\\Netscape"
+#define SR_CONNFILE_EXT ".sr" // Shiva connection file extension
+#define SR_ALL_CONNFILES "*.sr" // all Shiva connection files
+#define INI_SR_CONNWZ_SECTION "ConnectW Config"
+#define INI_SR_CONFIG_SECTION "Dial-In Configuration" // Shiva config section name
+#define INI_SR_DIALER_SECTION "ConnectW Config" // Shiva INI section name
+
+#define INI_SR_PREFFILE_KEY "preferred file"
+#define INI_SR_DFLT_PREFFILE "sremote.ini"
+#define INI_SR_FILENAME_KEY "preferred file" // Shiva INI section name
+#define INI_SR_MODEM_KEY "Modem" // Shiva key for storing configured modem
+#define INI_SR_PORT_KEY "Port" // Shiva key for storing port number
+#define INI_SR_BPS_KEY "BPSRate" // Shiva key for BPS rate setting
+#define INI_SR_DIALSTR_KEY "DialString" // Shiva key for modem dial string
+
+#include
+
+//////////////////////////////////////////////////////////////////
+// Sleeps for the specified number of seconds
+//////////////////////////////////////////////////////////////////
+void Sleep(UINT);
+
+//***************************************************************
+//***************************************************************
+// Helper Routines dealing paths..
+//***************************************************************
+//***************************************************************
+
+//////////////////////////////////////////////////////////////////
+// Get Shiva install path.
+// path name is copied into csFilePath
+// return TRUE if successful
+//////////////////////////////////////////////////////////////////
+BOOL GetShivaInstallPath(TCHAR* csFilePath);
+
+//////////////////////////////////////////////////////////////////
+// Get ShivaRemote Configuration file:
+// path name is copied into csFilePath
+// return TRUE if successful
+//////////////////////////////////////////////////////////////////
+BOOL GetShivaSRemoteConfigFile(TCHAR* csFilePath);
+
+////////////////////////////////////////////////////////////////
+// Returns a Netscape Communicator program group name
+////////////////////////////////////////////////////////////////
+BOOL GetNetscapeProgramGroupName(TCHAR* lpBuff);
+
+////////////////////////////////////////////////////////////////
+// Returns a full path to the install directory for Netscape
+////////////////////////////////////////////////////////////////
+BOOL GetNetscapeInstallPath(TCHAR* lpBuff);
+
+//********************************************************************************
+// Get Shiva SR connection file path name base on an connection (account) name.
+// path name is copied into csFilePath
+// return TRUE if successful
+//********************************************************************************
+BOOL GetConnectionFilePath(LPCSTR AccountName, TCHAR* csFilePath, BOOL BIncludePath = TRUE);
+
+
+//***************************************************************
+//***************************************************************
+// Helper Routines for editing program group items
+//***************************************************************
+//***************************************************************
+
+/////////////////////////////////////////////////////////////////
+// Sends the given command string to the Program Manager
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL SendShellCommand(DWORD ddeInst, LPCSTR lpszCommand);
+
+/////////////////////////////////////////////////////////////////
+// Add an item to a program group
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL AddProgramItem(DWORD ddeInst, // DDE Instance
+ LPCSTR lpszItemPath, // command line arguement
+ LPCSTR lpszItemTitle, // program item title
+ LPCSTR lpszItemIconPath=NULL);// icon path
+
+/////////////////////////////////////////////////////////////////
+// Delete an item from a program group (caller should select active
+// destination program group prior to calling this function)
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL DeleteProgramItem(DWORD ddeInst, // DDE Instance
+ LPCSTR lpszItemTitle); // program item title
+
+//////////////////////////////////////////////////////////////////
+// Set a program group active
+//////////////////////////////////////////////////////////////////
+BOOL MakeActiveGroup(DWORD ddeInst, const char * lpszFolder);
+
+///////////////////////////////////////////////////////////////////////
+// Add a program item to a program group
+///////////////////////////////////////////////////////////////////////
+BOOL AddProgramGroupItem(LPCSTR lpszProgramGroup, // program group name
+ LPCSTR lpszItemPath, // path of item to be added
+ LPCSTR lpszItemTitle, // program group item title
+ LPCSTR lpszItemIconPath=NULL); // program group item icon path
+
+/////////////////////////////////////////////////////////////////
+// Delete a program item from a program group
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL DeleteProgramGroupItem(LPCSTR lpszProgramGroup, // program group name
+ LPCSTR lpszItemTitle); // program group item title
+
+/////////////////////////////////////////////////////////////////
+// parse win16 name (filename or program item name) to get rid
+// of invalid chars.
+// - pName is original filename
+// - nMaxNameSize is max size of final parsed name
+// - bFileName indicates whether pName is a filename in that case
+// the function will only parse the filename but not the path and
+// nMaxNameSize indicates max size of filename (pathname not included).
+// i.e. if *pName = "c:\test\test,it.txt" becomes "c:\test\testit.txt"
+/////////////////////////////////////////////////////////////////
+void ParseWin16BadChar(char *pName, BOOL bFileName = TRUE, int nMaxNameSize = 12);
+
+
+#endif // __INC_HELPER_H__
diff --git a/mozilla/cmd/dialup/win/aswplugn/include/Modemwiz.imp b/mozilla/cmd/dialup/win/aswplugn/include/Modemwiz.imp
new file mode 100644
index 00000000000..402c00c609f
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/include/Modemwiz.imp
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+#ifndef _MODEMWIZ_IMP
+
+#define _MODEMWIZ_IMP 1
+
+#pragma pack(1)
+typedef struct tagCSETUPMODEMPARAMS
+{
+ char szModemType[256];
+ char szInitString[256];
+ char szAnswerString[256];
+ DWORD dwMaxBps;
+ int nPort;
+ BOOL bFIFO;
+}CSETUPMODEMPARAMS, FAR *LPCSETUPMODEMPARAMS;
+#pragma pack()
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+BOOL FAR PASCAL SetupModemWizard(HWND,LPCSETUPMODEMPARAMS);
+void FAR PASCAL ModemWizardCallback(LPSTR lpszModemType,int nPort,BOOL bFIFO,DWORD dwMaxBps,LPSTR lpszInitString,LPSTR lpszAnswerString,BOOL bRetVal);
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif /* __cplusplus */
+
+#endif
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/include/RasApi16.h b/mozilla/cmd/dialup/win/aswplugn/include/RasApi16.h
new file mode 100644
index 00000000000..3959269026c
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/include/RasApi16.h
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+// RASAPI16.H
+
+class CRasApiDll : public CWinApp
+{
+ public:
+ virtual BOOL InitInstance();
+ virtual int ExitInstance();
+
+ CRasApiDll() : CWinApp() {}
+};
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/include/asw16res.h b/mozilla/cmd/dialup/win/aswplugn/include/asw16res.h
new file mode 100644
index 00000000000..c11f82ee84a
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/include/asw16res.h
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+//{{NO_DEPENDENCIES}}
+// App Studio generated include file.
+// Used by ASW16.RC
+//
+#define IDS_OUT_OF_MEMORY 1
+#define IDS_INVALID_EXE 2
+#define IDS_INVALID_FILE 3
+#define IDS_INVALID_PATH 4
+#define IDS_NO_EDITOR 5
+#define IDS_BAD_PASSWORD 6
+#define IDS_NO_DIALTONE 7
+#define IDS_LINE_BUSY 8
+#define IDS_CONNECTED 9
+#define IDS_DISCONNECTING 10
+#define IDS_OPENING_PORT 11
+#define IDS_LOGGING_ON 12
+#define IDS_VERIFYING 13
+#define IDS_DIALING_OF 14
+#define IDS_DIALING 15
+#define IDS_INIT_MODEM 16
+#define IDS_MISSING_AREA_CODE 17
+#define IDS_NO_RNA_REGSERVER 18
+#define IDS_NO_RAS_FUNCTIONS 19
+#define IDS_UNUSED 20
+#define IDS_SHIVA_LOADERR 20
+#define IDS_APP_NAME 21
+#define IDS_ERR_REBOOT_FAILURE 22
+#define IDS_SECURITY_RISK_WARNING 23
+#define IDS_CONNECTION_FAILED 24
+#define IDS_DIAL_ERR 25
+#define IDS_TEST 26
+#define IDD_STATUS 101
+#define IDC_DIAL_STATUS 1000
+#define IDC_STATIC -1
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+
+#define _APS_NEXT_RESOURCE_VALUE 102
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mozilla/cmd/dialup/win/aswplugn/include/errmsg.h b/mozilla/cmd/dialup/win/aswplugn/include/errmsg.h
new file mode 100644
index 00000000000..8d722492f00
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/include/errmsg.h
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+///////////////////////////////////////////////////////////////////////////////
+//
+// Errmsg.h
+// Revision History:
+// Date Author Reason
+// ----------------------------------------------------------------------------
+// xxxxxxxxxxxxxx Define routines
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _INC_ERRMSG_H_
+#define _INC_ERRMSG_H_
+
+//********************************************************************************
+//
+// getMsgString()
+//
+// loads a Message String from the string table
+//********************************************************************************
+BOOL getMsgString(char *buf, UINT uID);
+
+
+//********************************************************************************
+//
+// DisplayErrMsg()
+//
+// display error messages in a standard windows message box
+//********************************************************************************
+int DisplayErrMsg(char *text, int style = MB_OK);
+
+#endif
diff --git a/mozilla/cmd/dialup/win/aswplugn/include/plugin.h b/mozilla/cmd/dialup/win/aswplugn/include/plugin.h
new file mode 100644
index 00000000000..56aa714af55
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/include/plugin.h
@@ -0,0 +1,201 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+////////////////////////////////////////////////////////////////
+// plugin.h
+// this file is used for both win32 & win16 ported from plugin32.h
+//
+// Revision history:
+// Date Author Reason
+// -------------------------------------------------------------
+// 01/26/97 xxxxxxxxxxxxxx Routine definition
+// xxxxxxxxxxxxxx Routine definition (plugin32.h)
+////////////////////////////////////////////////////////////////
+
+#ifndef _INC_PLUGIN_H_
+#define _INC_PLUGIN_H_
+
+#ifdef WINVER
+#undef WINVER
+#endif
+#define WINVER 0x0401 // Win32 ras.h needs this
+
+#ifdef WIN32
+#include // WIN32 uses MS RAS
+#else
+#include // Shiva RAS APIs
+#endif
+
+
+// default name of Regi program item
+#define REGGIE_PROGITEM_NAME "Registration Server"
+
+// Navigator quit message
+#define ID_APP_SUPER_EXIT 34593
+
+
+// handles to the plugin instance
+typedef struct _PluginInstance
+{
+ NPWindow* fWindow;
+ uint16 fMode;
+
+ HWND fhWnd;
+ WNDPROC fDefaultWindowProc;
+} PluginInstance;
+
+// account parameters
+typedef struct ACCOUNTPARAMS {
+ char ISPName[60]; //we use user's accountname + ISP name on win32
+ char FileName[_MAX_PATH];
+ char DNS[16];
+ char DNS2[16];
+ char DomainName[255];
+ char LoginName[64];
+ char Password[64];
+ char ScriptFileName[255];
+ BOOL ScriptEnabled;
+ BOOL NeedsTTYWindow;
+ char ISPPhoneNum[64];
+ char ISDNPhoneNum[64];
+ BOOL VJCompressionEnabled;
+ BOOL IntlMode;
+ BOOL DialOnDemand;
+} ACCOUNTPARAMS;
+
+
+// location parameters
+typedef struct LOCATIONPARAMS {
+ char ModemName[255];
+ char ModemType[80];
+ BOOL DialType;
+ char OutsideLineAccess[6];
+ BOOL DisableCallWaiting;
+ char DisableCallWaitingCode[6];
+ char UserAreaCode[6];
+ short UserCountryCode;
+ BOOL DialAsLongDistance;
+ char LongDistanceAccess[6];
+ BOOL DialAreaCode;
+ char DialPrefix[32];
+ char DialSuffix[32];
+ BOOL UseBothISDNLines;
+ BOOL b56kISDN;
+ DWORD DisconnectTime;
+} LOCATIONPARAMS;
+
+extern HINSTANCE DLLinstance; // dll instance
+
+
+extern void* RegDataBuf; // regi data buffer
+extern void* RegDataArray; // regi data array
+extern long RegDataLength;
+extern BOOL RegiMode;
+extern char IconFile[_MAX_PATH];
+extern BOOL RegExtendedDataFlag;
+extern JRIGlobalRef globalRef; // reference to JRI object arrray
+
+extern char **ModemList;
+extern int ModemListLen;
+
+
+// RAS struct sizes
+extern size_t stRASENTRY;
+extern size_t stRASCONN;
+extern size_t stRASCTRYINFO;
+extern size_t stRASDIALPARAMS;
+extern size_t stRASDEVINFO;
+extern size_t stRASCREDENTIALS;
+extern size_t stRASENTRYNAME;
+
+
+
+typedef DWORD (WINAPI* RASSETENTRYPROPERTIES)(LPSTR, LPSTR, LPBYTE, DWORD, LPBYTE, DWORD);
+typedef DWORD (WINAPI* RASGETCOUNTRYINFO)(LPRASCTRYINFO, LPDWORD);
+typedef DWORD (WINAPI* RASENUMDEVICES)(LPRASDEVINFO, LPDWORD, LPDWORD);
+typedef DWORD (WINAPI* RASGETENTRYPROPERTIES)(LPSTR, LPSTR, LPBYTE, LPDWORD, LPBYTE, LPDWORD);
+typedef DWORD (WINAPI* RASVALIDATEENTRYNAME)(LPSTR, LPSTR);
+typedef DWORD (WINAPI* RASDELETEENTRY)(LPSTR, LPSTR);
+
+// for win16 only
+#ifndef WIN32
+typedef DWORD (WINAPI* RASDIAL)(LPRASDIALEXTENSIONS, LPSTR, LPRASDIALPARAMS, DWORD, LPVOID, LPHRASCONN);
+typedef DWORD (WINAPI* RASGETERRORSTRING)(UINT, LPSTR, DWORD);
+typedef DWORD (WINAPI* RASHANGUP)(HRASCONN);
+typedef DWORD (WINAPI* RASENUMCONNECTIONS)(LPRASCONN, LPDWORD, LPDWORD);
+typedef DWORD (WINAPI* RASSETENTRYDIALPARAMS)(LPSTR, LPRASDIALPARAMS, BOOL);
+
+// Shiva RAS extension APIs
+typedef BOOL (WINAPI* SRSETUPMODEMWIZARD)(HWND, LPCSETUPMODEMPARAMS);
+typedef DWORD (WINAPI* SRSETDEVICEINFO)(LPCSETUPMODEMPARAMS);
+typedef DWORD (WINAPI* SRSETCOMPRESSIONINFO)(BOOL);
+typedef DWORD (WINAPI* SRSETDIALONDEMANDINFO)(BOOL, LPSTR);
+typedef DWORD (WINAPI* SRSETDIALSTRINGINFO)(BOOL, MODEMVOLUME);
+typedef DWORD (WINAPI* SRSETCONNECTIONINFO)(LPSTR, BOOL, BOOL, DWORD);
+#endif
+
+#ifdef WIN32 // **************************** WIN32 ******************************
+// for NT40 only
+typedef DWORD (WINAPI* RASSETAUTODIALADDRESS)(LPSTR, DWORD, LPRASAUTODIALENTRYA, DWORD, DWORD);
+typedef DWORD (WINAPI* RASSETAUTODIALENABLE)(DWORD, BOOL);
+typedef DWORD (WINAPI* RASSETAUTODIALPARAM) (DWORD, LPVOID, DWORD);
+typedef DWORD (WINAPI* RASSETCREDENTIALS)(LPTSTR, LPTSTR, LPRASCREDENTIALS, BOOL);
+
+extern RASSETAUTODIALENABLE m_lpfnRasSetAutodialEnable;
+extern RASSETAUTODIALADDRESS m_lpfnRasSetAutodialAddress;
+extern RASSETAUTODIALPARAM m_lpfnRasSetAutodialParam;
+extern RASSETCREDENTIALS m_lpfnRasSetCredentials;
+
+#else // **************************** WIN16 ******************************
+
+extern RASDIAL g_lpfnRasDial;
+extern RASGETERRORSTRING g_lpfnRasGetErrorString;
+extern RASHANGUP g_lpfnRasHangUp;
+extern RASENUMCONNECTIONS g_lpfnRasEnumConnections;
+extern RASSETENTRYDIALPARAMS g_lpfnRasSetEntryDialParams;
+
+// Shiva RAS extension APIs
+extern SRSETUPMODEMWIZARD g_lpfnSetupModemWizard;
+extern SRSETDEVICEINFO g_lpfnSetDeviceInfo;
+extern SRSETDIALONDEMANDINFO g_lpfnSetDialOnDemandInfo;
+extern SRSETCOMPRESSIONINFO g_lpfnSetCompressionInfo;
+extern SRSETDIALSTRINGINFO g_lpfnSetDialStringInfo;
+extern SRSETCONNECTIONINFO g_lpfnSetConnectionInfo;
+
+#endif // !WIN32
+
+// library (DLL) instancd handles..
+extern HINSTANCE m_hRasInst;
+#ifndef WIN32
+extern HINSTANCE m_hShivaModemWizInst;
+#endif
+
+extern RASSETENTRYPROPERTIES m_lpfnRasSetEntryProperties;
+extern RASGETCOUNTRYINFO m_lpfnRasGetCountryInfo;
+extern RASENUMDEVICES m_lpfnRasEnumDevices;
+extern RASGETENTRYPROPERTIES m_lpfnRasGetEntryProperties;
+extern RASVALIDATEENTRYNAME m_lpfnRasValidateEntryName;
+extern RASDELETEENTRY m_lpfnRasDeleteEntry;
+
+#ifdef WIN32 // **************************** WIN32 ******************************
+extern int platformOS; // platform OS (95 or NT40)
+void SizeofRASNT40(); // ini WinNT RAS sizes
+#endif // WIN32
+
+void SizeofRAS(); // init Win95 & Win3.1 RAS sizes
+
+#endif // _INC_PLUGIN_H_
diff --git a/mozilla/cmd/dialup/win/aswplugn/makefile.win b/mozilla/cmd/dialup/win/aswplugn/makefile.win
new file mode 100644
index 00000000000..8b663d1c454
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/makefile.win
@@ -0,0 +1,19 @@
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+#
+DEPTH=..\..\..\..
+DIRS=src
+
+!include <$(DEPTH)\config\rules.mak>
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/JRI/makefile.win b/mozilla/cmd/dialup/win/aswplugn/src/JRI/makefile.win
new file mode 100644
index 00000000000..c0613d9d0b4
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/JRI/makefile.win
@@ -0,0 +1,44 @@
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+
+VERBOSE=1
+IGNORE_MANIFEST=1
+DEPTH=..\..\..\..\..\..
+
+# Get CFLAGS, OBJDIR and such defined before using them in this makefile...
+!include "$(DEPTH)\config\config.mak"
+
+#################################################################
+
+JRI_GEN=java.lang.Object \
+ java.io.Serializable \
+ java.lang.String \
+ netscape.plugin.Plugin \
+ netscape.npasw.SetupPlugin \
+ $(NULL)
+
+#################################################################
+
+!include "$(DEPTH)\config\rules.mak"
+
+export::
+ $(MAKE_INSTALL) _jri\java_io_Serializable.h ..\..\include
+ $(MAKE_INSTALL) _jri\java_lang_Object.h ..\..\include
+ $(MAKE_INSTALL) _jri\java_lang_String.h ..\..\include
+ $(MAKE_INSTALL) _jri\netscape_plugin_Plugin.h ..\..\include
+ $(MAKE_INSTALL) _jri\netscape_npasw_SetupPlugin.h ..\..\include
+ $(MAKE_INSTALL) _jri\java_lang_String.c ..
+ $(MAKE_INSTALL) _jri\netscape_plugin_Plugin.c ..
+ $(MAKE_INSTALL) _jri\netscape_npasw_SetupPlugin.c ..
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/RASSIZE.CPP b/mozilla/cmd/dialup/win/aswplugn/src/RASSIZE.CPP
new file mode 100644
index 00000000000..fd7efeab749
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/RASSIZE.CPP
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+//*****************************************************************************
+// RasSize.h
+//
+// Initializes RAS structure sizes for Win95 RAS & Win3.1
+// Shiva's RAS.
+//
+// Revision History
+// Date Author Reason
+// ---------------------------------------------------------
+// 02/14/96 xxxxxxxxxxx Renamed file from rassize95.h
+//*****************************************************************************
+
+#ifndef _INC_RASSIZE_H_
+#define _INC_RASSIZE_H_
+
+#ifdef WIN32
+#ifdef WINVER
+#undef WINVER
+#endif
+#define WINVER 0x0400
+#endif
+
+#include
+
+#ifdef WIN32
+#include
+#else
+#include // Shiva RAS APIs
+#endif
+
+size_t stRASENTRY = 0;
+size_t stRASCONN = 0;
+size_t stRASCTRYINFO = 0;
+size_t stRASDIALPARAMS = 0;
+size_t stRASDEVINFO = 0;
+size_t stRASENTRYNAME = 0;
+
+void SizeofRAS() {
+ stRASENTRY = sizeof(RASENTRY);
+ stRASCONN = sizeof(RASCONN);
+ stRASCTRYINFO = sizeof(RASCTRYINFO);
+ stRASDIALPARAMS = sizeof(RASDIALPARAMS);
+ stRASDEVINFO = sizeof(RASDEVINFO);
+ stRASENTRYNAME = sizeof(RASENTRYNAME);
+}
+
+#endif
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/asw16.def b/mozilla/cmd/dialup/win/aswplugn/src/asw16.def
new file mode 100644
index 00000000000..e49e885bf22
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/asw16.def
@@ -0,0 +1,43 @@
+; -*- Mode: Fundamental -*-
+; The contents of this file are subject to the Netscape Public License
+; Version 1.0 (the "NPL"); you may not use this file except in
+; compliance with the NPL. You may obtain a copy of the NPL at
+; http://www.mozilla.org/NPL/
+;
+; Software distributed under the NPL is distributed on an "AS IS" basis,
+; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+; for the specific language governing rights and limitations under the
+; NPL.
+;
+; The Initial Developer of this code under the NPL is Netscape
+; Communications Corporation. Portions created by Netscape are
+; Copyright (C) 1998 Netscape Communications Corporation. All Rights
+; Reserved.
+;
+;-----------------
+; ASW win16 plugin
+;-----------------
+
+LIBRARY ASW16
+DESCRIPTION 'ASW Win16 Plugin (c) Netscape Comm. 1997'
+STUB 'WINSTUB.EXE'
+EXETYPE WINDOWS
+
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD MOVEABLE SINGLE
+
+HEAPSIZE 1024
+
+EXPORTS
+; WEP PRIVATE
+; To implement your own Windows Exit Procedure add the following
+; function to your application (referring to it in the .def file is
+; not required.) The extern "C" is only required if module is C++.
+; extern "C" int FAR PASCAL _WEP(int)
+; {
+; /* Your WEP functionality goes here */
+; return 1;
+; }
+ NP_GetEntryPoints @1
+ NP_Initialize @2
+ NP_Shutdown @3
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/asw16.rc b/mozilla/cmd/dialup/win/aswplugn/src/asw16.rc
new file mode 100644
index 00000000000..0f626085af6
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/asw16.rc
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+//
+//Microsoft App Studio generated resource script.
+//
+#include "asw16res.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+1 VERSIONINFO
+FILEVERSION 1,0,0,1
+PRODUCTVERSION 1,0,0,1
+FILEFLAGSMASK 0x3fL
+FILEFLAGS 0x0L
+FILEOS 0x40004L
+FILETYPE 0x2L
+FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904e4"
+ BEGIN
+ VALUE "CompanyName", "Netscape Communication Corporation\0"
+ VALUE "FileDescription", "Account Setup Plugin\0"
+ VALUE "FileExtents", "*|*\0"
+ VALUE "FileOpenName", "Setup Plugin (*.*)|Setup Plugin (*.*)\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "aswplugin\0"
+ VALUE "LegalCopyright", "Copyright \251 1997\0"
+ VALUE "MIMEType", "application/x-netscape-autoconfigure-dialer|application/x-netscape-autoconfigure-dialer-v2\0"
+ VALUE "OriginalFilename", "np16asw.dll\0"
+ VALUE "ProductName", "NNPE Account Setup Plugin\0"
+ VALUE "ProductVersion", "1, 0, 0, 1\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END
+
+#ifdef APSTUDIO_INVOKED
+//////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "asw16res.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+/////////////////////////////////////////////////////////////////////////////////////
+#endif // APSTUDIO_INVOKED
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_STATUS DIALOG DISCARDABLE 0, 0, 175, 76
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Account Setup"
+FONT 8, "MS Sans Serif"
+BEGIN
+ PUSHBUTTON "Cancel",IDCANCEL,62,52,50,14
+ LTEXT "Status: ",IDC_STATIC,15,8,27,8
+ LTEXT "",IDC_DIAL_STATUS,52,8,114,37
+END
+
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_OUT_OF_MEMORY "The system is out of memory or resources."
+ IDS_INVALID_EXE "Unable to start the specified External Editor. It is not a valid executible program."
+ IDS_INVALID_FILE "The specified External Editor file was not found."
+ IDS_INVALID_PATH "The specified path for the External Editor is not valid."
+ IDS_NO_EDITOR "Unable to start the External Editor. Please check and make sure the file exists."
+ IDS_BAD_PASSWORD "Invalid pasword in Netscape registration file (regserv.ias)."
+ IDS_NO_DIALTONE "No dial tone.\nMake sure your modem is connected to a phone line.."
+ IDS_LINE_BUSY "The phone number is busy. Please try\nagain later."
+ IDS_CONNECTED "Connection established."
+ IDS_DISCONNECTING "Disconnecting..."
+ IDS_OPENING_PORT "Opening serial port..."
+ IDS_LOGGING_ON "Logging onto network..."
+ IDS_VERIFYING "Verifying user name and password..."
+ IDS_DIALING_OF "Dialing...\n%i of %i"
+ IDS_DIALING "Dialing..."
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_INIT_MODEM "Initializing modem..."
+ IDS_MISSING_AREA_CODE "The service provider's phone number is missing its area code (or is not in TAPI cannonical form in the configuration file). Account creation will fail until this is fixed."
+ IDS_NO_RNA_REGSERVER "Unable to create RNA phone book entry for Registration Server!"
+ IDS_NO_RAS_FUNCTIONS "Failed to load communication module! Make sure the correct version is installed on system."
+ IDS_APP_NAME "Account Setup"
+ IDS_ERR_REBOOT_FAILURE "Failed to reboot windows, possibly caused by at least one running app refusing to terminate!"
+ IDS_SECURITY_RISK_WARNING
+ "SECURITY WARNING!\n\nAccount Setup has the ability to read and write files on your computer,\nconfigure dialing, networking and modem information.\n\nClick OK to operate in this manner.\nOtherwise, click CANCEL to exit."
+ IDS_CONNECTION_FAILED "Connection failed!"
+ IDS_DIAL_ERR "Dialing error!"
+ IDS_TEST "test"
+END
+
+
+#ifndef APSTUDIO_INVOKED
+////////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/ckdnsdun.cpp b/mozilla/cmd/dialup/win/aswplugn/src/ckdnsdun.cpp
new file mode 100644
index 00000000000..48d2493d838
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/ckdnsdun.cpp
@@ -0,0 +1,394 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// Ckdnsdun.cpp
+//
+// Routines for checking Dial-Up Networking & DNS
+//
+// Revision History:
+// Date Author Reason
+// ----------------------------------------------------------------------------
+// xxxxxxxxxxxxxx Define PIs
+///////////////////////////////////////////////////////////////////////////////
+
+// resource include
+#ifdef WIN32 // **************************** WIN32 *****************************
+#include "resource.h"
+#else // **************************** WIN16 *****************************
+#include "asw16res.h"
+#endif // !WIN32
+
+#include
+#include
+#include
+#include "errmsg.h"
+
+extern BOOL getMsgString(char *buf, UINT uID);
+
+//********************************************************************************
+//
+// CheckDNS
+//
+// for Win95
+// If user has DNS enabled, when setting up an account, we need to warn them
+// that there might be problems.
+//********************************************************************************
+void CheckDNS()
+{
+
+ char buf[256];
+ HKEY hKey;
+ DWORD cbData;
+ LONG res;
+
+ // open the key if registry
+ if(ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ "System\\CurrentControlSet\\Services\\VxD\\MSTCP",
+ NULL,
+ KEY_ALL_ACCESS ,
+ &hKey))
+ return;
+
+ cbData = sizeof(buf);
+ res = RegQueryValueEx(hKey, "EnableDNS", NULL, NULL, (LPBYTE)buf, &cbData);
+
+ RegCloseKey(hKey);
+
+ // if DNS is enabled we need to warn the user
+ if(buf[0] == '1') {
+
+ BOOL correctWinsockVersion = FALSE;
+
+ // check for user's winsock version first, see if it's winsock2
+ WORD wVersionRequested;
+ WSADATA wsaData;
+ int err;
+ wVersionRequested = MAKEWORD(2, 2);
+
+ err = WSAStartup(wVersionRequested, &wsaData);
+
+ if (err != 0) {
+
+ // user doesn't have winsock2, so check their winsock's date
+ char winDir[MAX_PATH];
+ UINT uSize = MAX_PATH;
+ char winsockFile[MAX_PATH];
+
+ winDir[0]='\0';
+ winsockFile[0]='\0';
+ GetWindowsDirectory((char *)&winDir, uSize);
+ strcpy(winsockFile, winDir);
+ strcat(winsockFile, "\\winsock.dll");
+
+ HANDLE hfile = CreateFile((char *)&winsockFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (hfile != INVALID_HANDLE_VALUE) { // openned file is valid
+
+ FILETIME lastWriteTime;
+ BOOL rtnval = GetFileTime(hfile, NULL, NULL, &lastWriteTime);
+
+ SYSTEMTIME systemTime;
+ rtnval = FileTimeToSystemTime(&lastWriteTime, &systemTime);
+
+ if ((systemTime.wYear >= 1996) && (systemTime.wMonth >= 8) && (systemTime.wDay >= 24))
+ correctWinsockVersion = TRUE;
+
+ CloseHandle(hfile);
+ }
+ } else {
+ correctWinsockVersion = TRUE;
+ }
+
+
+ if (!correctWinsockVersion) {
+ // Err: Your system is configured for another Domain Name System (DNS) server.
+ // You might need to edit your DNS configuration. Check the User's Guide
+ // for more information.
+ char buf[255];
+ if (getMsgString(buf, IDS_DNS_ALREADY))
+ DisplayErrMsg(buf, MB_OK | MB_ICONASTERISK);
+ }
+ }
+
+ return;
+}
+
+
+static const char c_szRNA[] = "rundll.exe setupx.dll,InstallHinfSection RNA 0 rna.inf";
+
+
+//********************************************************************************
+//
+// CheckDUN
+//
+// for Win95
+// If user doesn't have Dial-Up Networking installed, they will have problem
+// setting up an account.
+//********************************************************************************
+BOOL CheckDUN()
+{
+ BOOL bInstall = FALSE;
+ HKEY hKey;
+ LONG res;
+ char szBuf[MAX_PATH];
+
+ // Let's see if its installed
+ if(ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OptionalComponents\\RNA",
+ NULL,
+ KEY_QUERY_VALUE,
+ &hKey))
+ bInstall = TRUE;
+
+ // the key is there, was it actually installed though...
+ if(!bInstall) {
+ DWORD cbData = sizeof(szBuf);
+ res = RegQueryValueEx(hKey, "Installed", NULL, NULL, (LPBYTE)szBuf, &cbData);
+ if(szBuf[0] != '1' && szBuf[0] != 'Y' && szBuf[0] != 'y')
+ bInstall = TRUE;
+ }
+
+ // make sure a random file from the installation exists so that we
+ // know the user actually installed instead of just skipping over
+ // the install step
+ if(!bInstall) {
+ if(GetSystemDirectory(szBuf, sizeof(szBuf))) {
+
+ // create a name of one of the files
+ strcat(szBuf, "\\pppmac.vxd");
+
+ // let's see if that file exists
+ struct _stat stat_struct;
+ if(_stat(szBuf, &stat_struct) != 0)
+ bInstall = TRUE;
+
+ }
+
+ }
+
+ // if no Dial-Up Networking installed install it now
+ if(bInstall) {
+
+ // let the user not install it or exit
+ //
+ // Err: Dial-Up Networking has not been installed on this machine;
+ // this product will not work until Dial-Up Networking is installed.
+ // Would you like to install Dial-Up Networking now?
+
+ char *buf = (char *)malloc(sizeof(char) * 255);
+ if (!buf)
+ // Err: Out of Memory
+ return (FALSE);
+
+ if (getMsgString(buf, IDS_NO_DUN)) {
+ if (IDOK != DisplayErrMsg(buf, MB_OKCANCEL | MB_ICONASTERISK)) {
+ free(buf);
+ return (FALSE);
+ }
+ }
+ free(buf);
+
+
+ // install Dial-Up Networking
+ PROCESS_INFORMATION pi;
+ STARTUPINFO sti;
+ UINT err = ERROR_SUCCESS;
+
+ memset(&sti,0,sizeof(sti));
+ sti.cb = sizeof(STARTUPINFO);
+
+ // Run the setup application
+ if(CreateProcess(NULL, (LPSTR)c_szRNA,
+ NULL, NULL, FALSE, 0, NULL, NULL, &sti, &pi)) {
+
+ CloseHandle(pi.hThread);
+
+ // Wait for the modem wizard process to complete
+ WaitForSingleObject(pi.hProcess,INFINITE);
+ CloseHandle(pi.hProcess);
+ }
+
+ }
+
+ RegCloseKey(hKey);
+ return(TRUE);
+
+}
+
+
+//********************************************************************************
+//
+// check if a user is an Administrator on NT40
+//
+//********************************************************************************
+BOOL IsAdmin(void)
+{
+ HANDLE hAccessToken;
+ UCHAR InfoBuffer[1024];
+ PTOKEN_GROUPS ptgGroups = (PTOKEN_GROUPS)InfoBuffer;
+ DWORD dwInfoBufferSize;
+ PSID psidAdministrators;
+ SID_IDENTIFIER_AUTHORITY siaNtAuthority = SECURITY_NT_AUTHORITY;
+ UINT x;
+ BOOL bSuccess;
+
+ if(!OpenProcessToken(GetCurrentProcess(),TOKEN_READ,&hAccessToken))
+ return(FALSE);
+
+ bSuccess = GetTokenInformation(hAccessToken,TokenGroups,InfoBuffer,
+ 1024, &dwInfoBufferSize);
+
+ CloseHandle(hAccessToken);
+
+ if( !bSuccess )
+ return FALSE;
+
+ if(!AllocateAndInitializeSid(&siaNtAuthority, 2,
+ SECURITY_BUILTIN_DOMAIN_RID,
+ DOMAIN_ALIAS_RID_ADMINS,
+ 0, 0, 0, 0, 0, 0,
+ &psidAdministrators))
+ return FALSE;
+
+ // assume that we don't find the admin SID.
+ bSuccess = FALSE;
+
+ for(x=0;xGroupCount;x++) {
+ if( EqualSid(psidAdministrators, ptgGroups->Groups[x].Sid) ) {
+ bSuccess = TRUE;
+ break;
+ }
+ }
+
+ FreeSid(&psidAdministrators);
+ return bSuccess;
+}
+
+
+
+//********************************************************************************
+//
+// CheckDUN_NT
+//
+// for WinNT40
+// If user doesn't have Dial-Up Networking installed, they will have problem
+// setting up an account.
+//********************************************************************************
+BOOL CheckDUN_NT()
+{
+ BOOL bInstall = FALSE;
+ BOOL bAdmin = FALSE;
+ HKEY hKey;
+ LONG res;
+ char szBuf[MAX_PATH];
+ char *buf = NULL;
+
+
+ // Let's see if its installed
+ // "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\RemoteAccess"
+ if(ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\RemoteAccess", NULL, KEY_QUERY_VALUE, &hKey))
+ bInstall = TRUE;
+
+ // the key is there, was it actually installed though...
+ // look for some RAS keys
+
+ szBuf[0] = '\0';
+ if(!bInstall) {
+ DWORD cbData = sizeof(szBuf);
+ res = RegQueryValueEx(hKey, "DisplayName", NULL, NULL, (LPBYTE)szBuf, &cbData);
+ if(strlen(szBuf) == 0)
+ bInstall = TRUE;
+
+ RegCloseKey(hKey);
+
+ // how about autodial manager....
+ // "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\RasAuto"
+ if(ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\RasAuto", NULL, KEY_QUERY_VALUE, &hKey))
+ bInstall = TRUE;
+
+ RegCloseKey(hKey);
+
+ }
+
+
+ // if no Dial-Up Networking installed, warn the users depending on
+ // their premissions and return FALSE
+ if(bInstall) {
+
+ bAdmin = IsAdmin();
+
+ if (bAdmin) {
+ //
+ // Err: Dial-Up Networking has not been installed on this machine;
+ // this product will not work until Dial-Up Networking is installed.
+ // Pleas install Dial-Up Networking before running Accout Setup.
+
+ char buf[255];
+
+ if (getMsgString(buf, IDS_NO_DUN_NT)) {
+ DisplayErrMsg(buf, MB_OK | MB_ICONASTERISK);
+ }
+
+#if 0
+ // install Dial-Up Networking
+ PROCESS_INFORMATION pi;
+ STARTUPINFO sti;
+ UINT err = ERROR_SUCCESS;
+ char RASphone[MAX_PATH];
+
+ GetSystemDirectory(RASphone, MAX_PATH);
+ strcat(RASphone, "\\rasphone.exe");
+
+
+ memset(&sti,0,sizeof(sti));
+ sti.cb = sizeof(STARTUPINFO);
+
+ // Run the setup application
+ if(CreateProcess((LPCTSTR)&RASphone, NULL,
+ NULL, NULL, FALSE, 0, NULL, NULL, &sti, &pi)) {
+
+ CloseHandle(pi.hThread);
+
+ // Wait for the Dial-Up Networking install process to complete
+ WaitForSingleObject(pi.hProcess,INFINITE);
+ CloseHandle(pi.hProcess);
+ }
+#endif
+
+ } else {
+
+ // user need to have administrator premission to install, and ASW won't
+ // work if DUN is not installed
+ //
+ // Err: You do not have Administrator premission on this machine to intall
+ // Dial-Up Networking. Please make sure you have Administrator premission
+ // in order to install Dial-Up Networking first before running Account Setup.
+
+ char buf[255];
+
+ if (getMsgString(buf, IDS_NO_ADMIN_PREMISSION))
+ DisplayErrMsg(buf, MB_OK | MB_ICONASTERISK);
+ }
+
+ return(FALSE);
+
+ }
+
+ return(TRUE);
+
+}
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/deskcnfg.cpp b/mozilla/cmd/dialup/win/aswplugn/src/deskcnfg.cpp
new file mode 100644
index 00000000000..0c795dbb0fa
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/deskcnfg.cpp
@@ -0,0 +1,913 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+///////////////////////////////////////////////////////////////////////////////
+//
+// Deskcnfg.cpp
+// Revision History:
+// Date Author Reason
+// ----------------------------------------------------------------------------
+// 02/03/97 xxxxxxxxxxxxxx Port Native API for win3.x
+// xxxxxxxxxxxxxx Define Native API for win95 & winNT
+///////////////////////////////////////////////////////////////////////////////
+
+#include
+#include "plugin.h"
+
+// resource include
+#ifdef WIN32 // **************************** WIN32 *****************************
+#include "resource.h"
+#else // **************************** WIN16 *****************************
+#include "asw16res.h"
+#endif // !WIN32
+
+// windows include
+#ifdef WIN32
+// ********************* Win32 includes **************************
+#include
+#include
+#include
+#include
+#else // WIN16
+// ********************* Win16 includes & consts **************************
+#include
+#include
+#include // Shiva RAS APIs
+
+#define MAX_PROGRAMITEM_NAME 40 // max length of program item name
+#endif //WIN32
+
+#include
+#include
+#include "errmsg.h"
+
+// java includes
+#include "netscape_npasw_SetupPlugin.h"
+#include "java_lang_String.h"
+
+char IconFile[_MAX_PATH] = { '\0' };
+extern BOOL getMsgString(char *buf, UINT uID);
+extern const char *GetStringPlatformChars(JRIEnv *env, struct java_lang_String *string);
+extern BOOL FileExists (LPCSTR lpszFileName);
+extern char acctDescription[256];
+
+#ifndef WIN32
+BOOL g_bExistingPath = FALSE; // TRUE if account creating is an existing account
+#endif
+
+#ifdef WIN32 // ************************** WIN32 ****************************
+//********************************************************************************
+// utility function
+//
+// SameStrings
+//
+// Checks for string equality between a STRRET and a LPCTSTR
+//********************************************************************************
+static BOOL
+SameStrings(LPITEMIDLIST pidl, STRRET& lpStr1, LPCTSTR lpStr2)
+{
+
+ char buf[MAX_PATH];
+ char *mystr;
+
+ switch (lpStr1.uType) {
+
+ case STRRET_WSTR:
+ WideCharToMultiByte(CP_OEMCP, WC_DEFAULTCHAR,
+ lpStr1.pOleStr, -1, buf, sizeof(buf), NULL, NULL);
+ return strcmp(lpStr2, buf) == 0;
+
+ case STRRET_OFFSET:
+ mystr=((char *)pidl) + lpStr1.uOffset;
+ return strcmp(lpStr2, ((char *)pidl) + lpStr1.uOffset) == 0;
+
+ case STRRET_CSTR:
+ mystr=lpStr1.cStr;
+ return strcmp(lpStr2, lpStr1.cStr) == 0;
+ }
+
+ return FALSE;
+}
+
+
+//********************************************************************************
+// utility function
+//
+// GetSize
+//
+//********************************************************************************
+static LPITEMIDLIST
+Next(LPCITEMIDLIST pidl)
+{
+ LPSTR lpMem=(LPSTR)pidl;
+
+ lpMem += pidl->mkid.cb;
+ return (LPITEMIDLIST)lpMem;
+}
+
+
+//********************************************************************************
+// utility function
+//
+// GetSize
+//
+//********************************************************************************
+static UINT
+GetSize(LPCITEMIDLIST pidl)
+{
+ UINT cbTotal = 0;
+
+ if (pidl) {
+ cbTotal += sizeof(pidl->mkid.cb);
+ while (pidl->mkid.cb) {
+ cbTotal += pidl->mkid.cb;
+ pidl = Next(pidl);
+ }
+ }
+
+ return cbTotal;
+}
+
+
+//********************************************************************************
+// utility function
+//
+// Create
+//
+//********************************************************************************
+static LPITEMIDLIST
+Create(UINT cbSize)
+{
+ IMalloc* pMalloc;
+ LPITEMIDLIST pidl = 0;
+
+ if (FAILED(SHGetMalloc(&pMalloc)))
+ return 0;
+
+ pidl = (LPITEMIDLIST)pMalloc->Alloc(cbSize);
+
+ if (pidl)
+ memset(pidl, 0, cbSize);
+
+ pMalloc->Release();
+
+ return pidl;
+}
+
+
+
+//********************************************************************************
+// utility function
+//
+// ConcatPidls
+//
+//********************************************************************************
+static LPITEMIDLIST
+ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
+{
+ UINT cb1 = GetSize(pidl1) - sizeof(pidl1->mkid.cb);
+ UINT cb2 = GetSize(pidl2);
+ LPITEMIDLIST pidlNew = Create(cb1 + cb2);
+
+ if (pidlNew) {
+ memcpy(pidlNew, pidl1, cb1);
+ memcpy(((LPSTR)pidlNew) + cb1, pidl2, cb2);
+ }
+
+ UINT cb3 = GetSize(pidlNew);
+
+ return pidlNew;
+}
+
+
+//********************************************************************************
+//
+// GetMyComputerFolder
+//
+// This routine returns the ISHellFolder for the virtual My Computer folder,
+// and also returns the PIDL.
+//********************************************************************************
+static HRESULT
+GetMyComputerFolder(LPSHELLFOLDER *ppshf, LPITEMIDLIST *ppidl)
+{
+ IMalloc* pMalloc;
+ HRESULT hres;
+
+ hres = SHGetMalloc(&pMalloc);
+ if (FAILED(hres))
+ return hres;
+
+ // Get the PIDL for "My Computer"
+ hres = SHGetSpecialFolderLocation(/*pWndOwner->m_hWnd*/NULL, CSIDL_DRIVES, ppidl);
+ if (SUCCEEDED(hres)) {
+ IShellFolder* pshf;
+
+ hres = SHGetDesktopFolder(&pshf);
+ if (SUCCEEDED(hres)) {
+ // Get the shell folder for "My Computer"
+ hres = pshf->BindToObject(*ppidl, NULL, IID_IShellFolder, (LPVOID *)ppshf);
+ pshf->Release();
+ }
+ }
+
+ pMalloc->Release();
+
+ return hres;
+}
+
+
+//********************************************************************************
+//
+// GetDialupNetworkingFolder
+//
+// This routine returns the ISHellFolder for the virtual Dial-up Networking
+// folder, and also returns the PIDL.
+//********************************************************************************
+static HRESULT
+GetDialUpNetworkingFolder(LPSHELLFOLDER *ppshf, LPITEMIDLIST *ppidl)
+{
+ HRESULT hres;
+
+ IMalloc* pMalloc = NULL;
+ IShellFolder* pmcf = NULL;
+ LPITEMIDLIST pidlmc;
+
+
+ char szDialupName[256];
+ HKEY hKey;
+ DWORD cbData;
+
+ //
+ // Poke around in the registry to find out what the Dial-Up Networking
+ // folder is called on this machine
+ //
+ szDialupName[0] = '\0';
+ if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT,
+ "CLSID\\{992CFFA0-F557-101A-88EC-00DD010CCC48}",
+ NULL,
+ KEY_QUERY_VALUE,
+ &hKey)) {
+
+ cbData = sizeof(szDialupName);
+ RegQueryValueEx(hKey, "", NULL, NULL, (LPBYTE)szDialupName, &cbData);
+
+ }
+
+ // if we didn't get anything just use the default
+ if(szDialupName[0] == '\0') {
+ char *strText;
+ strText = "Dial-Up Networking";
+ strcpy(szDialupName, (LPCSTR)strText);
+ }
+
+ RegCloseKey(hKey);
+
+
+ //
+ // OK, now look for that folder
+ //
+
+ hres = SHGetMalloc(&pMalloc);
+ if (FAILED(hres))
+ return hres;
+
+ // Get the virtual folder for My Computer
+ hres = GetMyComputerFolder(&pmcf, &pidlmc);
+ if (SUCCEEDED(hres)) {
+ IEnumIDList* pEnumIDList;
+
+ // Now we need to find the "Dial-Up Networking" folder
+ hres = pmcf->EnumObjects(/*pWndOwner->m_hWnd*/ NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &pEnumIDList);
+ if (SUCCEEDED(hres)) {
+ LPITEMIDLIST pidl;
+
+ int flag = 1;
+ while ((NOERROR == (hres = pEnumIDList->Next(1, &pidl, NULL))) && (flag)) {
+ STRRET name;
+
+ name.uType = STRRET_CSTR; // preferred choice
+ hres = pmcf->GetDisplayNameOf(pidl, SHGDN_INFOLDER, &name);
+ if (FAILED(hres)) {
+ pMalloc->Free(pidl);
+ flag = 0;
+ //break;
+ }
+
+ if (SameStrings(pidl, name, szDialupName)) {
+ *ppidl = ConcatPidls(pidlmc, pidl);
+ hres = pmcf->BindToObject(pidl, NULL, IID_IShellFolder, (LPVOID *)ppshf);
+ pMalloc->Free(pidl);
+ flag = 0;
+ //break;
+ }
+
+ if (flag)
+ pMalloc->Free(pidl);
+ }
+
+ pEnumIDList->Release();
+ }
+
+ pmcf->Release();
+ pMalloc->Free(pidlmc);
+ }
+
+ pMalloc->Release();
+
+
+ return hres;
+}
+
+
+//********************************************************************************
+//
+// GetDialupConnectionPIDL
+//
+//********************************************************************************
+static HRESULT
+GetDialUpConnectionPIDL(LPCTSTR lpConnectionName, LPITEMIDLIST *ppidl)
+{
+ HRESULT hres;
+
+ IMalloc* pMalloc = NULL;
+ IShellFolder* pshf = NULL;
+ LPITEMIDLIST pidldun;
+
+ // Initialize out parameter
+ *ppidl = NULL;
+
+ hres = SHGetMalloc(&pMalloc);
+ if (FAILED(hres))
+ return hres;
+
+ // First get the Dial-Up Networking virtual folder
+ hres = GetDialUpNetworkingFolder(&pshf, &pidldun);
+ if (SUCCEEDED(hres) && (pshf != NULL)) {
+ IEnumIDList* pEnumIDList;
+
+ // Enumerate the files looking for the desired connection
+ hres = pshf->EnumObjects(/*pWndOwner->m_hWnd*/NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &pEnumIDList);
+ if (SUCCEEDED(hres)) {
+ LPITEMIDLIST pidl;
+
+ int flag=1;
+ while ((NOERROR == (hres = pEnumIDList->Next(1, &pidl, NULL))) && (flag)) {
+ STRRET name;
+
+ name.uType = STRRET_CSTR; // preferred choice
+ hres = pshf->GetDisplayNameOf(pidl, SHGDN_INFOLDER, &name);
+ if (FAILED(hres)) {
+ pMalloc->Free(pidl);
+ flag = 0;
+ //break;
+ }
+
+ if (SameStrings(pidl, name, lpConnectionName)) {
+ *ppidl = ConcatPidls(pidldun, pidl);
+ pMalloc->Free(pidl);
+ flag = 0;
+ //break;
+ }
+
+ if (flag)
+ pMalloc->Free(pidl);
+ }
+
+ pEnumIDList->Release();
+ }
+
+ pshf->Release();
+ pMalloc->Free(pidldun);
+
+ }
+
+ pMalloc->Release();
+
+ return hres;
+}
+
+
+//********************************************************************************
+//
+// GetNetscapePIDL
+//
+//********************************************************************************
+static void
+GetNetscapePidl(LPITEMIDLIST * ppidl)
+{
+
+
+ char szPath[MAX_PATH], * p;
+ OLECHAR olePath[MAX_PATH];
+ IShellFolder * pshf;
+
+ GetModuleFileName(DLLinstance, szPath, sizeof(szPath));
+ //GetModuleFileName(AfxGetInstanceHandle(), szPath, sizeof(szPath));
+
+ //we need to take off \plugins\npasw.dll from the path
+ p = strrchr(szPath, '\\');
+ if(p)
+ *p = '\0';
+ p = strrchr(szPath, '\\');
+ if(p)
+ *p = '\0';
+ strcat(szPath, "\\netscape.exe");
+
+ HRESULT hres = SHGetDesktopFolder(&pshf);
+ if (SUCCEEDED(hres)) {
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCSTR) szPath, -1, (LPWSTR) olePath, sizeof(olePath));
+
+ ULONG lEaten;
+ pshf->ParseDisplayName(NULL, NULL, (LPOLESTR) olePath, &lEaten, ppidl, NULL);
+ }
+
+ return;
+}
+
+
+//********************************************************************************
+//
+// CreateLink
+//
+// Creates a shell shortcut to the PIDL
+//********************************************************************************
+static HRESULT
+CreateLink(LPITEMIDLIST pidl, LPCTSTR lpszPathLink, LPCTSTR lpszDesc)
+{
+ HRESULT hres;
+ IShellLink* psl = NULL;
+ LPCTSTR IconPath = IconFile;
+
+ // Get a pointer to the IShellLink interface.
+ //CoInitialize(NULL); // work around for Nav thread lock bug
+
+ hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+ IID_IShellLink, (LPVOID FAR*)&psl);
+ if (SUCCEEDED(hres)) {
+ IPersistFile* ppf;
+ // Set the path to the shortcut target, and add the description.
+ psl->SetIDList(pidl);
+ psl->SetDescription(lpszDesc);
+ if(IconPath && IconPath[0])
+ psl->SetIconLocation(IconPath, 0);
+
+ // Query IShellLink for the IPersistFile interface for saving the
+ // shortcut in persistent storage.
+ hres = psl->QueryInterface(IID_IPersistFile, (LPVOID FAR*)&ppf);
+
+ if (SUCCEEDED(hres)) {
+ WORD wsz[MAX_PATH];
+
+ // Ensure that the string is ANSI.
+ MultiByteToWideChar(CP_ACP, 0, lpszPathLink, -1, wsz, MAX_PATH);
+
+ // Save the link by calling IPersistFile::Save.
+ hres = ppf->Save((LPCOLESTR)wsz, STGM_READ);
+ ppf->Release();
+ }
+
+ psl->Release();
+
+ }
+
+ //CoUninitialize();
+
+ return hres;
+}
+
+//********************************************************************************
+//
+// CreateDialerShortcut
+//
+// Creates a shell shortcut to the PIDL
+//********************************************************************************
+short CreateDialerShortcut(char* szDesktop, // Desktop path
+ LPCSTR AccountName, // connectoid/phonebook entry name
+ IMalloc* pMalloc,
+ char *szPath, // path to PE folder
+ char *strDesc) // shortcut description
+{
+ HRESULT hres;
+ LPITEMIDLIST pidl;
+
+ char Desktop[MAX_PATH];
+ szDesktop[0] = '\0';
+ DWORD cbData;
+ HKEY hKey;
+ long res;
+
+ // gets Desktop folder path from registry for both win95 & winNT40
+ // "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
+ if (ERROR_SUCCESS != RegOpenKeyEx(HKEY_CURRENT_USER, REGSTR_PATH_SPECIAL_FOLDERS, NULL, KEY_QUERY_VALUE, &hKey))
+ return (-3);
+
+ cbData = MAX_PATH;
+ res = RegQueryValueEx(hKey, "Desktop", NULL, NULL, (LPBYTE)Desktop, &cbData);
+
+ RegCloseKey(hKey);
+
+ strcpy(szDesktop, Desktop);
+
+ // win95 only
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS) {
+
+ // Get a PIDL that points to the dial-up connection
+ hres = GetDialUpConnectionPIDL(AccountName, &pidl);
+
+ if (FAILED(hres)) {
+
+ // Err: Unable to create shortcut to RNA phone book entry
+ char *buf = (char *)malloc(sizeof(char) * 255);
+ if (!buf)
+ // Err: Out of Memory
+ return (-6);
+
+ if (getMsgString(buf, IDS_NO_RNA)) {
+ if (IDOK != DisplayErrMsg(buf, MB_OK | MB_ICONEXCLAMATION)) {
+ free(buf);
+ return (FALSE);
+ }
+ }
+
+ free(buf);
+ return(-1);
+ }
+
+ // If the dial-up networking folder is open when we create the RNA
+ // entry, then we will have failed to get a PIDL above. The dial-up
+ // networking folder itself won't display the icon until it is closed
+ // and re-opened. There's nothing we can do but return
+ if (!pidl) {
+ pMalloc->Release();
+ return(-2);
+ }
+
+ // Create a shortcut on the desktop
+ char strPath[MAX_PATH];
+ strcpy(strPath, szDesktop);
+ strcat(strPath, "\\");
+ strcat(strPath, strDesc);
+ strcat(strPath, ".Lnk");
+ CreateLink(pidl, strPath, strDesc);
+
+ // And one in our PE folder
+ strcpy(strPath, szPath);
+ strcat(strPath, "\\");
+ strcat(strPath, strDesc);
+ strcat(strPath, ".Lnk");
+ CreateLink(pidl, strPath, strDesc);
+
+ } else if (platformOS == VER_PLATFORM_WIN32_NT) { // WinNT40 here
+
+ // make sure the phonebook entry we created still exists
+
+ char *sysDir = (char *)malloc(sizeof(char) * _MAX_PATH);
+ if (!sysDir)
+ return (-5);
+
+ char pbPath[MAX_PATH];
+ GetSystemDirectory(sysDir, MAX_PATH);
+ strcpy(pbPath, sysDir);
+ strcat(pbPath, "\\ras\\rasphone.pbk");
+ strcat(pbPath, "\0");
+ free(sysDir);
+
+ RASENTRYNAME rasEntryName[MAX_PATH];
+ if (!rasEntryName)
+ return (-7);
+
+ rasEntryName[0].dwSize = stRASENTRYNAME;
+ DWORD size = stRASENTRYNAME * MAX_PATH;
+ DWORD entries;
+
+ if (0 != RasEnumEntries(NULL, pbPath, rasEntryName, &size, &entries))
+ return (-4);
+
+ BOOL exists = FALSE;
+ DWORD i=0;
+
+ while ((i < entries) && (!exists)) {
+
+ if (strcmp(rasEntryName[i].szEntryName, AccountName) == 0)
+ exists = TRUE;
+
+ i++;
+ }
+
+ // create a shortcut file on desktop
+ if (exists) {
+ HANDLE hfile = NULL;
+
+ // create phonebook entry shortcut file on desktop, overwrites if exists
+ SECURITY_ATTRIBUTES secAttrib;
+ memset(&secAttrib, 0, sizeof(SECURITY_ATTRIBUTES));
+ secAttrib.nLength = sizeof(SECURITY_ATTRIBUTES);
+ secAttrib.lpSecurityDescriptor = NULL;
+ secAttrib.bInheritHandle = FALSE;
+
+ // construct phonebook entry shortcut file name
+ char file[MAX_PATH];
+ strcpy(file, szDesktop);
+ strcat(file, "\\");
+ strcat(file, AccountName);
+ strcat(file, ".rnk");
+
+ hfile = CreateFile(file, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
+ &secAttrib, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (hfile == INVALID_HANDLE_VALUE)
+ return (-9);
+
+ CloseHandle(hfile);
+ hfile = NULL;
+
+ // writes shortcut file data in the following format:
+ // [Dial-Up Shortcut]
+ // Entry=stuff
+ // Phonebook=C:\WINNT40\System32\RAS\rasphone.pbk (default system phonebook)
+
+ WritePrivateProfileString("Dial-Up Shortcut", "Entry", AccountName, file);
+ WritePrivateProfileString("Dial-Up Shortcut", "Phonebook", pbPath, file);
+
+ // create the same shortcut file in our PE folder
+ strcpy(file, szPath);
+ strcat(file, "\\");
+ strcat(file, AccountName);
+ strcat(file, ".rnk");
+
+ hfile = CreateFile(file, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
+ &secAttrib, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (hfile == INVALID_HANDLE_VALUE)
+ return (-10);
+
+ CloseHandle(hfile);
+ WritePrivateProfileString("Dial-Up Shortcut", "Entry", AccountName, file);
+ WritePrivateProfileString("Dial-Up Shortcut", "Phonebook", pbPath, file);
+
+ } else {
+
+ return (-8);
+ }
+ }
+
+ return (0);
+}
+
+//********************************************************************************
+//
+// CreateProgramItems
+//
+// adds 2 icons:
+// Dialer - to Dial-Up Networking folder, Desktop & our PE folder
+// Navigator - to our PE folder
+//********************************************************************************
+static short
+CreateProgramItems(LPCSTR AccountName,
+ LPCSTR CustomIniPath)
+
+{
+ char szPath[MAX_PATH];
+ LPITEMIDLIST pidl;
+
+ char szBuf[MAX_PATH];
+
+ IMalloc* pMalloc;
+ SHGetMalloc(&pMalloc);
+
+ // gets the path to "Programs" folder
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS) {
+
+ SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAMS, &pidl);
+ SHGetPathFromIDList(pidl, szBuf);
+ pMalloc->Free(pidl);
+
+ } else if (platformOS == VER_PLATFORM_WIN32_NT) {
+
+ // NT4.0: get the "Programs" folder for "All Users"
+
+ HKEY hKey;
+ DWORD bufsize = sizeof(szBuf);
+
+ if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
+ NULL,
+ KEY_QUERY_VALUE,
+ &hKey)) {
+ RegQueryValueEx(hKey, "PathName", NULL, NULL, (LPBYTE)szBuf, &bufsize);
+ strcat(szBuf, "\\Profiles\\All Users\\Start Menu\\Programs");
+
+ } else {
+
+ return (-1);
+ }
+
+ }
+
+ //
+ // gets Netscape PE folder here
+ //
+
+ char buf[256];
+ char *csFolderName;
+ csFolderName =(char *)malloc(sizeof(char) * 256);
+
+ if (!csFolderName)
+ return (-4);
+
+ strcpy(csFolderName, "Netscape Personal Edition");
+
+ // check for custom folder name
+ if(::GetPrivateProfileString("General", "InstallFolder", (const char *)csFolderName, buf, sizeof(buf), CustomIniPath))
+ strcpy(csFolderName,buf);
+
+ strcpy(szPath, szBuf);
+ strcat(szPath, "\\");
+ strcat(szPath, csFolderName);
+
+ free(csFolderName);
+
+ //
+ // First do Dialer Icon
+ //
+
+ // Create a dialer icon shortcut description
+ char strDesc[MAX_PATH];
+
+#ifdef UPGRADE
+ if (???entryInfo.bUpgrading) {
+ char *csTmp = "Dialer";
+ strcpy(strDesc, AccountName);
+ strcat(strDesc, " ");
+ strcat(strDesc, csTmp);
+ } else {
+ strcpy(strDesc, "Dial");
+ strcat(strDesc, " ");
+ strcat(strDesc, AccountName);
+ }
+#else
+ strcpy(strDesc,"Dial");
+// strcat(strDesc, " ");
+ strDesc[strlen(strDesc)+1] = '\0';
+ strDesc[strlen(strDesc)] = (char)32;
+ strcat(strDesc, AccountName);
+#endif
+
+ char szDesktop[512];
+
+ //
+ // create dialer shortcut icon on desktop and in PE folder
+ //
+
+ int rtn = CreateDialerShortcut(szDesktop, AccountName, pMalloc, szPath, strDesc);
+
+ if (rtn != 0)
+ return rtn;
+
+
+#ifdef FOLDER_IN_START_MENU
+ // Cleanup
+ pMalloc->Free(pidl);
+ pMalloc->Release();
+#endif
+
+ ::Sleep(250);
+
+ return(0);
+}
+
+#else // ****************************** WIN16 ************************
+
+//********************************************************************************
+//
+// CreateProgramItems
+//
+// Dialer - to Dial-Up Networking folder, Desktop & our PE folder
+// Navigator - to our PE folder
+//********************************************************************************
+BOOL CreateProgramItems16(LPCSTR AccountName, LPCSTR IconFileName, LPCSTR CustomIniPath)
+{
+ // get Netscape window
+ HWND hNavWnd = GetActiveWindow();
+
+ // obtain Program Group Name
+ char csProgramGroup[256],
+ csProgramGroupDeflt[256], // default program group name
+ csItemPath[256],
+ csItemName[MAX_PROGRAMITEM_NAME + 1];
+// csItemIconPath[256];
+ int nBytesCopied;
+ BOOL bResult;
+
+ bResult = GetNetscapeProgramGroupName(csProgramGroupDeflt);
+
+ // get custom folder name
+ nBytesCopied = GetPrivateProfileString("General", "InstallFolder", csProgramGroupDeflt,
+ csProgramGroup, 256, CustomIniPath);
+ // create item name (truncate if item name too long
+ strcpy(csItemName, "Dial ");
+ strncat(csItemName, AccountName, MAX_PROGRAMITEM_NAME - strlen(csItemName));
+
+ // parse out invalid char in program item name
+ ParseWin16BadChar(csItemName, FALSE, MAX_PROGRAMITEM_NAME);
+
+/*
+ // Check if ACCTSET.INI override for Icon name
+ nBytesCopied = GetPrivateProfileString("General", "NavIconName", "", csItemIconPath,
+ sizeof(csItemIconPath), CustomIniPath))
+*/
+
+ // get path to connection Shiva SR file
+ bResult = GetConnectionFilePath(acctDescription, csItemPath);
+
+ if (bResult)
+ {
+ bResult = AddProgramGroupItem(csProgramGroup, csItemPath, csItemName, IconFileName);
+ }
+
+ // set Netscape window active to prevent program mgr on top of netscape
+ // no need for existing account because, AS terminates after program item is created.
+ if (!g_bExistingPath)
+ SetActiveWindow(hNavWnd);
+
+ return bResult;
+}
+#endif // WIN16
+
+
+
+//********************************************************************************
+// native method:
+//
+// DesktopConfig
+//
+// Sets up user's desktop (creates icons and short cuts)
+//********************************************************************************
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fDesktopConfig(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin,
+ struct java_lang_String *JSAccountName,
+ struct java_lang_String *JSIconFile,
+ struct java_lang_String *JSAcctsetIniPath)
+{
+ const char *AccountName=NULL, *CustomIniPath=NULL;
+
+ if (JSAccountName != NULL)
+ AccountName = GetStringPlatformChars(env, JSAccountName);
+
+ if (JSIconFile != NULL) {
+ const char* IconFileName;
+ IconFileName = GetStringPlatformChars(env, JSIconFile);
+ //JS may pass us different file for icon file
+ if ((IconFileName) && (strcmp(IconFileName, IconFile) != 0)) {
+ if (strcmp(IconFile, "") != 0) {
+ if(FileExists(IconFile)) // a temp icon file may already existed
+ _unlink(IconFile);
+ }
+
+ // check if icon file exists
+ if (FileExists(IconFileName))
+ strcpy(IconFile, IconFileName);
+ else
+ IconFile[0] = '\0';
+ }
+ }
+
+ if (JSAcctsetIniPath != NULL)
+ CustomIniPath = GetStringPlatformChars(env, JSAcctsetIniPath);
+
+
+#ifdef WIN32 // **************** WIN32 ****************
+
+ // remove the RegiServer RAS
+ char regiRAS[50];
+ getMsgString((char *)regiRAS, IDS_REGGIE_PROGITEM_NAME);
+ (*m_lpfnRasDeleteEntry) (NULL, (LPSTR) (const char *) regiRAS);
+
+ // creates prgram icons in folders and desktop
+ int ret = CreateProgramItems(AccountName, CustomIniPath);
+
+#else // **************** WIN16 ****************
+
+ // remove reggie
+ BOOL bResult = DeleteProgramGroupItem("StartUp", REGGIE_PROGITEM_NAME);
+ bResult = CreateProgramItems16(AccountName,
+ strlen(IconFile) > 0 ? IconFile : NULL,
+ CustomIniPath);
+#endif // !WIN32
+}
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/dialer.cpp b/mozilla/cmd/dialup/win/aswplugn/src/dialer.cpp
new file mode 100644
index 00000000000..9f82fd672da
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/dialer.cpp
@@ -0,0 +1,2176 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+///////////////////////////////////////////////////////////////////////////////
+//
+// Dialer.cpp
+// This file contains Modem Dialing Native APIs, for Win32 (NT & 95 uses
+// MS RAS APIs) & Win16 (uses Shiva's dialer & modem routines)
+//
+// Revision History:
+// Date Author Reason
+// ----------------------------------------------------------------------------
+// 02/27/97 xxxxxxxxxxxxxx Code cleanup
+// 01/26/97 xxxxxxxxxxxxxx Define Native API for win3.x
+// xxxxxxxxxxxxxx Define Native API for win95 & winNT
+///////////////////////////////////////////////////////////////////////////////
+
+#include
+#include "plugin.h"
+
+// resource include
+#ifdef WIN32 // **************************** WIN32 *****************************
+#include "resource.h"
+#else // **************************** WIN16 *****************************
+#include "asw16res.h"
+#include "helper16.h"
+#endif // !WIN32
+
+
+#if __cplusplus
+extern "C"
+{
+#include
+#include
+#include
+#include
+#include
+
+#ifdef WIN32
+#include // WIN32 uses MS RAS
+#else
+#include
+#include // WIN16 uses Shiva RAS
+#endif
+}
+#endif
+
+#ifdef WIN32
+//**************************** WIN32 Includes ****************************
+#include
+#include // windows include
+//**************************** WIN32 Decls ****************************
+#else
+//**************************** WIN16 Includes ****************************
+#include // windows include
+#if __cplusplus
+extern "C"
+{
+#include // Shiva RAS APIs
+}
+#endif
+
+//**************************** WIN16 Decls ****************************
+#define REGGI_SERVER_NAME "Registration Server" // reggie name
+#define DEF_AUTODISCONNECT_PERIOD 10 // default autodisconnect idle period
+
+// Shiva constants..
+#define SHIVA_INI_DIALER_SECTION "ConnectW Config" // Shiva INI section name
+#define SHIVA_INI_FILENAME_KEY "preferred file" // Shiva INI section name
+#define SHIVA_CONNFILE_EXT ".sr" // Shiva connection file extension
+#define SHIVA_ALL_CONNFILES "*.sr" // all Shiva connection files
+#endif // !WIN32
+
+#include "errmsg.h"
+
+// java include
+#include "netscape_npasw_SetupPlugin.h"
+#include "java_lang_String.h"
+
+#ifndef WIN32
+extern BOOL g_bExistingPath; // TRUE if account creating is an existing account
+#endif
+
+char *ReggieScript = NULL;
+
+HANDLE hRasMon = NULL; //process handle to RasMon on WinNT
+
+#ifdef WIN32
+extern BOOL SetLocationInfo(ACCOUNTPARAMS account, LOCATIONPARAMS location);
+extern BOOL SetLocationInfoNT(ACCOUNTPARAMS account, LOCATIONPARAMS location);
+#endif
+extern BOOL ConvertPassword(LPCSTR lpszPassword, LPSTR lpBuf);
+extern BOOL getMsgString(char *buf, UINT uID);
+extern const char *GetStringPlatformChars(JRIEnv *env, struct java_lang_String *string);
+extern int DisplayErrMsgWnd(char *text, int style, HWND hwnd);
+extern void GetProfileDirectory(char *profilePath);
+
+enum CallState {StateIdle, StateConnecting, StateConnected, StateDisconnecting};
+CallState m_callState;
+
+// keeps the current connection info
+RASDIALPARAMS dialParams;
+
+// determine the dialer we're configuring/dialing is a registration server dialder
+BOOL RegiMode=FALSE;
+
+// keeps the total number of dialing count
+int Dial;
+
+// handle to the current ras connection
+HRASCONN hRasConn;
+
+// current connection's ras state
+RASCONNSTATE RASstate;
+
+// The number of times we try to dial
+#define NUM_ATTEMPTS 3
+#define IDDISCONNECTED 31
+
+
+// handle to our connection status window
+HWND hwndStatus = NULL;
+BOOL setStatusHwnd = FALSE;
+BOOL NotCanceled = TRUE; // assume connection will be there unless user cancels
+BOOL LineDrop = FALSE;
+BOOL deviceErr = FALSE;// assume no hardware err
+HWND hwndNavigator = NULL;
+
+// str of sr file's description line
+char acctDescription[256];
+
+
+
+void SafeEndDialog()
+{
+ if(hwndStatus) {
+ EndDialog(hwndStatus, TRUE);
+ hwndStatus = NULL;
+ }
+}
+
+void SafeSetWindowText(int iField, const char *pText)
+{
+ if(hwndStatus) {
+ HWND hField = GetDlgItem(hwndStatus, iField);
+ if(hField) {
+ SetWindowText(hField, pText);
+ }
+ }
+}
+
+BOOL CALLBACK
+statusDlgcallback(HWND hWnd,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ BOOL bRetval = FALSE;
+
+ if (!setStatusHwnd) {
+ hwndStatus = hWnd;
+ setStatusHwnd = TRUE;
+ }
+
+ switch(uMsg) {
+
+ case WM_COMMAND: {
+
+ WORD wNotifyCode = HIWORD(wParam);
+ WORD wID = LOWORD(wParam);
+ HWND hControl = (HWND)lParam;
+
+ switch(wID) {
+ case IDDISCONNECTED:
+// if (AfxMessageBox(IDS_LOST_CONNECTION, MB_YESNO) == IDYES)
+// m_pMainWnd->PostMessage(WM_COMMAND, IDC_DIAL);
+ break;
+
+ case IDCANCEL: {
+ // RasHangUp & destroy dialog box
+ bRetval = TRUE;
+ NotCanceled = FALSE;
+
+#ifdef WIN32
+ char strText[255];
+
+ getMsgString(strText, IDS_CANCELDIAL);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+
+ RasHangUp(hRasConn);
+ Sleep(3000);
+#else
+ assert(g_lpfnRasHangUp);
+ (*g_lpfnRasHangUp)(hRasConn);
+ Sleep(3);
+#endif
+ SafeEndDialog();
+ break;
+ }
+ }
+ }
+
+ }
+
+ return bRetval;
+}
+
+void SetCallState(CallState newState)
+{
+ m_callState = newState;
+
+ switch (m_callState) {
+ case StateConnected:
+ // destroy our connection status window
+ SafeEndDialog();
+ break;
+
+ case StateConnecting:
+ // creates status dialog box
+ HWND hwndParent = GetActiveWindow();
+ int nResult;
+
+ nResult = DialogBox(DLLinstance, MAKEINTRESOURCE(IDD_STATUS), hwndParent, (DLGPROC)statusDlgcallback);
+ assert(nResult != -1);
+ break;
+ }
+}
+
+
+void DisplayDialErrorMsg(DWORD dwError)
+{
+ char szErr[255];
+ char szErrStr[255];
+
+#ifdef WIN32
+ RasGetErrorString((UINT)dwError, szErr, sizeof(szErr));
+#else
+ (*g_lpfnRasGetErrorString)((UINT)dwError, szErr, sizeof(szErr));
+#endif
+ // Some of the default error strings are pretty lame
+ switch (dwError) {
+ case ERROR_NO_DIALTONE:
+ getMsgString(szErr, IDS_NO_DIALTONE);
+ break;
+
+ case ERROR_LINE_BUSY:
+ getMsgString(szErr, IDS_LINE_BUSY);
+ break;
+#ifdef WIN32
+ case ERROR_PROTOCOL_NOT_CONFIGURED:
+ getMsgString(szErr, IDS_PROTOCOL_NOT_CONFIGURED);
+#endif
+ default:
+ break;
+ }
+
+ getMsgString(szErrStr, IDS_CONNECTION_FAILED);
+ strcat(szErrStr, szErr);
+
+ HWND hwnd;
+ if (hwndStatus)
+ hwnd = hwndStatus;
+ else
+ hwnd = hwndNavigator;
+
+ DisplayErrMsgWnd(szErrStr, MB_OK | MB_ICONEXCLAMATION, hwnd);
+}
+
+void ConnectErr(DWORD dwError)
+{
+
+ char strText[255];
+
+ if(hwndStatus) {
+ getMsgString((char *)strText, IDS_DIAL_ERR);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ Sleep(1000);
+ EndDialog(hwndStatus, TRUE);
+ hwndStatus = NULL;
+ }
+
+ deviceErr = TRUE; // some sort of device err
+ DisplayDialErrorMsg(dwError);
+
+ return;
+}
+
+
+void ProcessRasDialEvent(RASCONNSTATE rasconnstate, DWORD dwError)
+{
+ char strText[255];
+
+ switch (rasconnstate) {
+ case RASCS_OpenPort:
+ while (hwndStatus == NULL) //wait for status dialog shows up first
+ Sleep(1000);
+
+ getMsgString(strText, IDS_OPENING_PORT);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ if (dwError)
+ ConnectErr(dwError);
+ else
+ Sleep(1000);
+ break;
+
+ case RASCS_PortOpened:
+
+ getMsgString(strText, IDS_INIT_MODEM);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ if (dwError)
+ ConnectErr(dwError);
+ else
+ Sleep(1000);
+
+ break;
+
+ case RASCS_ConnectDevice:
+
+ if (Dial == 1)
+ {
+ getMsgString(strText, IDS_DIALING);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ } else {
+ char szBuf[128];
+
+ getMsgString(strText, IDS_DIALING_OF);
+ wsprintf(szBuf, (LPCSTR)strText, Dial, NUM_ATTEMPTS);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ }
+ if (dwError)
+ ConnectErr(dwError);
+ else
+ Sleep(1000);
+
+ break;
+
+
+ case RASCS_Authenticate:
+ getMsgString(strText, IDS_VERIFYING);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ if (dwError)
+ ConnectErr(dwError);
+ else
+ Sleep(1000);
+
+ break;
+
+ case RASCS_Authenticated:
+ getMsgString(strText, IDS_LOGGING_ON);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ if (dwError)
+ ConnectErr(dwError);
+ else
+ Sleep(1000);
+
+ break;
+
+ case RASCS_Connected:
+ getMsgString(strText, IDS_CONNECTED);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ SetCallState(StateConnected);
+ if (dwError)
+ ConnectErr(dwError);
+ else
+ Sleep(1000);
+
+ break;
+
+ case RASCS_Disconnected:
+ // If this is an unexpected disconnect then hangup and take
+ // down the status dialog box
+ if (m_callState == StateConnected) {
+#ifdef WIN32
+ ::RasHangUp(hRasConn);
+ Sleep(3000);
+#else
+ assert(g_lpfnRasHangUp);
+ (*g_lpfnRasHangUp)(hRasConn);
+ Sleep(3);
+#endif
+ // here we pass redial msg if needed.
+ SafeEndDialog();
+
+ } else if (m_callState == StateConnecting) {
+#ifdef WIN32
+ ::RasHangUp(hRasConn);
+ Sleep(3000);
+#else
+ assert(g_lpfnRasHangUp);
+ (*g_lpfnRasHangUp)(hRasConn);
+ Sleep(3);
+#endif
+ if (dwError != SUCCESS) {
+ if (hwndStatus) {
+ getMsgString(strText, IDS_DISCONNECTING);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ }
+ SafeEndDialog();
+ LineDrop = TRUE; // remove if we ask users for redial
+ DisplayDialErrorMsg(dwError);
+ }
+ }
+
+ SetCallState(StateIdle);
+ break;
+
+ case RASCS_WaitForModemReset:
+ getMsgString(strText, IDS_DISCONNECTING);
+ SafeSetWindowText(IDC_DIAL_STATUS, strText);
+ if (dwError)
+ ConnectErr(dwError);
+ else
+ Sleep(1000);
+
+ break;
+
+ default:
+ if (dwError)
+ ConnectErr(dwError);
+ break;
+
+ }
+}
+
+
+//********************************************************************************
+// RasDialFunc
+//
+// call back function for RasDial
+//
+//********************************************************************************
+#ifdef WIN32 //************************ WIN 32 *****************************
+void CALLBACK
+RasDialFunc(HRASCONN hRasConn,
+ UINT uMsg,
+ RASCONNSTATE rasconnstate,
+ DWORD dwError,
+ DWORD dwExtendedError)
+#else //************************ WIN 16 *****************************
+void
+RasDialFunc(UINT uMsg, // type of dial event
+ RASCONNSTATE rasconnstate, // connection state to be entered
+ DWORD dwError) // error
+#endif // !WIN32
+{
+ if (uMsg == WM_RASDIALEVENT)
+ { // ignore all other messages
+ RASstate = rasconnstate;
+ ProcessRasDialEvent(rasconnstate, dwError);
+ }
+}
+
+
+//********************************************************************************
+// IsDialerConnected
+//
+// checks if the dialer is still connected
+//********************************************************************************
+static BOOL IsDialerConnected()
+{
+
+ BOOL bConnected = FALSE;
+#if 0
+ if ((RASstate == RASCS_Connected) && (connected == TRUE))
+ return TRUE;
+
+ return FALSE;
+#endif
+
+ RASCONN *pInfo = NULL, *lpTemp = NULL;
+ DWORD code, count = 0;
+ DWORD dSize = stRASCONN;
+ char szMessage[256]="";
+
+#ifdef WIN32
+ HLOCAL hBuffer = NULL;
+
+ // try to get a buffer to receive the connection data
+ hBuffer = LocalAlloc(LPTR, (UINT) dSize);
+ if (!hBuffer) // Err: trouble allocating buffer
+ {
+ return FALSE;
+ }
+ pInfo = (RASCONN*) hBuffer;
+
+ // see if there are any open connections
+ assert(pInfo);
+ pInfo->dwSize = (DWORD) stRASCONN;
+#else
+ RASCONN connInfo;
+ connInfo.dwSize = stRASCONN;
+#endif
+
+ // ------------------- Enumerate connections --------------------------
+#ifdef WIN32
+ code = RasEnumConnections(pInfo, &dSize, &count);
+#else
+ assert(g_lpfnRasEnumConnections);
+ if (g_lpfnRasEnumConnections)
+ code = (*g_lpfnRasEnumConnections)(&connInfo, &dSize, &count);
+
+ // ------- re-enumerate connection with larger buffer ---------
+#endif
+
+ if (ERROR_BUFFER_TOO_SMALL == code) { // buffer too small...
+ // free the old buffer & re-allocate bigger buffer
+#ifdef WIN32
+ LocalFree(hBuffer);
+ hBuffer = LocalAlloc(LPTR, (UINT) dSize);
+ if (!hBuffer)
+ return FALSE;
+ pInfo = (RASCONN*) hBuffer; // Err: trouble allocating buffer
+#else
+ pInfo = (RASCONN*) malloc((size_t)dSize);
+ if (!pInfo)
+ return FALSE;
+#endif // !WIN32
+
+ // try to enumerate connections again
+ pInfo->dwSize = dSize;
+
+#ifdef WIN32
+ if (0 != RasEnumConnections(pInfo, &dSize, &count)) {
+#else
+ if (0 != (*g_lpfnRasEnumConnections)(pInfo, &dSize, &count)) {
+#endif
+ // can't enumerate connections, assume none is active
+ count = 0;
+ }
+ }
+
+#ifdef WIN32
+ LocalFree(hBuffer);
+
+ // removes regi icon
+ if ((RegiMode) && (count == 0)) {
+ char regiRAS[50];
+ getMsgString((char *)regiRAS, IDS_REGGIE_PROGITEM_NAME);
+ DWORD ret = (*m_lpfnRasDeleteEntry) (NULL, (LPSTR) (const char *) regiRAS);
+
+ // delete NT4.0 RasMon process
+ if ((platformOS == VER_PLATFORM_WIN32_NT) && (hRasMon)) {
+ CloseHandle(hRasMon);
+ hRasMon = NULL;
+ }
+
+ }
+
+#else
+ free(pInfo);
+#endif
+
+ return (count > 0);
+}
+
+
+
+//********************************************************************************
+// native method:
+//
+// DialerConnect
+//
+// initiates the dialer to connect (used if Dial on Demand is disabled)
+// assume RASDAILPARAM is already configured
+//********************************************************************************
+extern JRI_PUBLIC_API(jbool)
+native_netscape_npasw_SetupPlugin_SECURE_0005fDialerConnect(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin)
+{
+ // return if dialer already connected
+#ifndef WIN32
+ if (IsDialerConnected())
+ return TRUE;
+#endif
+
+ DWORD dwError;
+ BOOL connectSucceed=TRUE;
+ hwndNavigator = GetActiveWindow();
+
+ // Let RNA do the dial
+ Dial = 1;
+ hRasConn = NULL; // init global connection handle
+ NotCanceled = TRUE; // assume connection is not canceled by the user, unless otherwise
+
+#ifdef WIN32 // ************************** WIN 32 *************************
+ // Win95 starts RASDIAL
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS) {
+ // do the dialing here
+ dwError = RasDial(NULL, NULL, &dialParams, 1, RasDialFunc /*NULL*/, &hRasConn);
+ }
+ // WinNT40 find system phone book first then start RASDIAL
+ else if (platformOS == VER_PLATFORM_WIN32_NT) {
+ char *sysDir;
+ char *pbpath;
+ sysDir = (char *)malloc(sizeof(char) * MAX_PATH);
+ if (sysDir) {
+ GetSystemDirectory(sysDir, MAX_PATH);
+ pbpath = (char *)malloc(sizeof(char) * strlen(sysDir) + 30);
+ if (pbpath) {
+ strcpy(pbpath, sysDir);
+ strcat(pbpath, "\\ras\\rasphone.pbk");
+ strcat(pbpath, "\0");
+
+ // starts up RASMON process
+ PROCESS_INFORMATION pi;
+ BOOL fRet;
+ STARTUPINFO sti;
+ UINT err = ERROR_SUCCESS;
+ char RASMONpath[40];
+
+ strcpy(RASMONpath, sysDir);
+ strcat(RASMONpath, "\\rasmon.exe");
+ strcat(RASMONpath, "\0");
+
+ memset(&sti,0,sizeof(sti));
+ sti.cb = sizeof(STARTUPINFO);
+
+ // Run the RASMON app
+ fRet = CreateProcess(RASMONpath, NULL,
+ NULL, NULL, FALSE, 0, NULL, NULL, &sti, &pi);
+
+ hRasMon = pi.hProcess;
+
+ Sleep(3000);
+
+ //do the dialing here
+ dwError = RasDial(NULL, pbpath, &dialParams, 1, RasDialFunc /*NULL*/, &hRasConn);
+
+ free(sysDir);
+ free(pbpath);
+
+
+ } else {
+ free(sysDir);
+ // Err: not enough memory for pbpath!
+ return (FALSE);
+ }
+ } else {
+ // Err: not enough memory for sysDir;
+ return (FALSE);
+ }
+ }
+
+#else // ****************************** WIN16 *****************************
+
+ HWND hNavWnd = GetActiveWindow(); // save Navigator's window to set active later..
+
+ // WIN16 uses ShivaRemote RAS APIs
+// dwError = (*g_lpfnRasDial)(NULL, NULL, &dialParams, 0, (void *) RasDialFunc, &hRasConn); // async call
+ dwError = (*g_lpfnRasDial)(NULL, NULL, &dialParams, 0, NULL, &hRasConn); // sync call
+
+#endif // !WIN32
+
+#ifdef WIN32
+ if (dwError == SUCCESS) { // Dialing succeeded
+#else
+ if (dwError == 0) {
+#endif
+ // display connections status dialog & dispatch window msgs...
+#ifdef WIN32
+ SetCallState(StateConnecting);
+ MSG msg;
+ while (((RASstate != RASCS_Connected) && (RASstate != RASCS_Disconnected)) &&
+ (NotCanceled) &&
+ (!LineDrop) &&
+ (!deviceErr))
+ {
+
+ if(::GetMessage(&msg, NULL, 0, 0)) {
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ }
+ else {
+ // WM_QUIT!!!
+ break;
+ }
+ }
+
+ SafeEndDialog();
+
+ // sets flag back so we can get a new handle next time
+ setStatusHwnd = FALSE;
+ if ((RASstate != RASCS_Connected) || (!NotCanceled))
+ connectSucceed = FALSE;
+#endif
+
+ } else { // dialing failed!!!, display err msg
+ connectSucceed = FALSE;
+ DisplayDialErrorMsg(dwError);
+ }
+
+ if (!connectSucceed) {
+
+ // hangup connection
+ if (hRasConn) {
+#ifdef WIN32 // ***************************** WIN32 ***********************************
+ RasHangUp(hRasConn);
+ SafeEndDialog();
+
+ // give RasHangUp some time till complete hangup
+ Sleep(3000);
+#else // ***************************** WIN16 ***********************************
+ assert(g_lpfnRasHangUp);
+ (*g_lpfnRasHangUp)(hRasConn);
+ Sleep(3);
+#endif // !WIN32
+ }
+
+ assert(m_lpfnRasDeleteEntry);
+#ifdef WIN32
+ // remove the RegiServer RAS, for any reason if we fail to connect
+ char regiRAS[50];
+ getMsgString((char *)regiRAS, IDS_REGGIE_PROGITEM_NAME);
+ DWORD ret = (*m_lpfnRasDeleteEntry) (NULL, (LPSTR) (const char *) regiRAS);
+#else
+ DWORD ret = (*m_lpfnRasDeleteEntry) (NULL, REGGI_SERVER_NAME);
+#endif
+ }
+
+#ifndef WIN32
+ SetActiveWindow(hNavWnd);
+#endif
+
+ return (connectSucceed);
+}
+
+
+
+//********************************************************************************
+//
+// DialerHangup
+//
+//********************************************************************************
+void DialerHangup()
+{
+ RASCONN *Info = NULL, *lpTemp = NULL;
+ DWORD code, count = 0;
+ char szMessage[256] = { '\0' };
+ DWORD dSize = stRASCONN;
+
+#ifdef WIN32
+ HLOCAL hBuffer = NULL;
+ // try to get a buffer to receive the connection data
+ hBuffer = LocalAlloc(LPTR, (UINT) dSize);
+ Info = (RASCONN*) hBuffer;
+#else
+ Info = (RASCONN*) malloc(size_t(dSize));
+#endif
+
+ if (!Info)
+ {
+ return;
+ }
+
+ // set RAS struct size
+ Info->dwSize = dSize;
+
+ // enumerate open connections
+#ifdef WIN32
+ code = RasEnumConnections (Info, &dSize, &count);
+#else
+ assert(g_lpfnRasEnumConnections);
+ code = (*g_lpfnRasEnumConnections)(Info, &dSize, &count);
+#endif
+ if (ERROR_BUFFER_TOO_SMALL == code) {
+
+ // free the old buffer & allocate a new bigger one
+#ifdef WIN32
+ LocalFree(hBuffer);
+ hBuffer = LocalAlloc(LPTR, (UINT) dSize);
+ Info = (RASCONN *) hBuffer;
+#else
+ free(Info);
+ Info = (RASCONN*) malloc(size_t(dSize));
+#endif
+ if(!Info)
+ {
+ return;
+ }
+
+ // try to enumerate again
+ Info->dwSize = dSize;
+#ifdef WIN32
+ if (RasEnumConnections(Info, &dSize, &count) != 0) {
+ LocalFree(hBuffer);
+#else
+ if ((*g_lpfnRasEnumConnections)(Info, &dSize, &count) != 0) {
+ free(Info);
+#endif
+ return;
+ }
+ }
+
+ // check for no connections
+ if (0 == count) {
+#ifdef WIN32
+ LocalFree(hBuffer);
+#else
+ free(Info);
+#endif
+ return;
+ }
+
+#if 0
+ // ask user if they want to hang up.
+ // we check for IDNO & leave hangup loop outside because
+ // hangup will never get called if we don't display
+ // messagebox.
+ if(IDNO == MessageBox(NULL, "There are open modem connections. Would you like to close them?",
+ "Dial-Up Networking", MB_YESNO)) {
+#ifdef WIN32
+ LocalFree(hBuffer);
+#else
+ free(Info);
+#endif
+ return;
+ }
+#endif
+
+ // just hang up everything
+ for (int i = 0; i < (int) count; i++) {
+#ifdef WIN32
+ RasHangUp(Info[i].hrasconn);
+ Sleep(3000);
+#else
+ assert(g_lpfnRasHangUp);
+ (*g_lpfnRasHangUp)(Info[i].hrasconn);
+ Sleep(3);
+#endif
+ }
+
+#ifdef WIN32
+ LocalFree(hBuffer);
+#else
+ free(Info);
+#endif
+
+ // removes regi icon
+ if (RegiMode) {
+#ifdef WIN32
+ char regiRAS[50];
+ getMsgString((char *)regiRAS, IDS_REGGIE_PROGITEM_NAME);
+ DWORD ret = (*m_lpfnRasDeleteEntry) (NULL, (LPSTR) (const char *) regiRAS);
+
+ // delete NT4.0 RasMon process
+ if ((platformOS == VER_PLATFORM_WIN32_NT) && (hRasMon)) {
+ CloseHandle(hRasMon);
+ hRasMon = NULL;
+ }
+
+#else
+ DWORD ret = (*m_lpfnRasDeleteEntry) (NULL, REGGI_SERVER_NAME);
+#endif
+ }
+
+
+}
+
+
+
+
+//********************************************************************************
+// native method:
+//
+// DialerHangup
+//
+// hangs up the dialer when:
+// 1. after regi communication is complete
+// 2. user tries to close the ASW while connected to regi
+//********************************************************************************
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fDialerHangup(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin)
+{
+ DialerHangup();
+}
+
+
+//********************************************************************************
+//
+// findDialerData
+//
+// search the javascript array for specific string value
+//********************************************************************************
+char *findDialerData(JRIEnv* env,
+ jstringArray dialerData,
+ char *name)
+{
+ long arraylen;
+ void *jri_str;
+ const char *arrayline;
+ char *lineptr;
+ char *key;
+ char *value = NULL;
+
+ arraylen = JRI_GetObjectArrayLength(env, dialerData);
+ for (short i=0; iISPName, accountName); //default for regi server
+#else
+ strcpy(account->ISPName, REGGI_SERVER_NAME);
+#endif
+ } else {
+ value = findDialerData(env, dialerData, "AccountName");
+ strcpy(account->ISPName, value ? value : "My Account");
+ strcpy(acctDescription, account->ISPName);
+ }
+
+ // file name
+ value = findDialerData(env, dialerData, "FileName");
+ strcpy(account->FileName, value ? value : "My Account");
+
+ // DNS
+ value = findDialerData(env, dialerData, "DNSAddress");
+ strcpy(account->DNS, value ? value : "0.0.0.0");
+
+ // DNS2
+ value = findDialerData(env, dialerData, "DNSAddress2");
+ strcpy(account->DNS2, value ? value : "0.0.0.0");
+
+ // domain name
+ value = findDialerData(env, dialerData, "DomainName");
+ strcpy(account->DomainName, value ? value : "");
+
+ // login name
+ value = findDialerData(env, dialerData, "LoginName");
+ strcpy(account->LoginName, value ? value : "");
+
+ // password
+ value = findDialerData(env, dialerData, "Password");
+ strcpy(account->Password, value ? value : "");
+
+ // script file name
+ value = findDialerData(env, dialerData, "ScriptFileName");
+ strcpy(account->ScriptFileName, value ? value : "");
+
+ // script enabled?
+ value = findDialerData(env, dialerData, "ScriptEnabled");
+ if (value)
+ {
+ account->ScriptEnabled = (strcmp(value, "TRUE") == 0);
+
+ // get script content
+ value = findDialerData(env, dialerData, "Script");
+ if (value)
+ {
+ ReggieScript = (char*) malloc(strlen(value) + 1);
+ strcpy(ReggieScript, value);
+ }
+ }
+ else
+ account->ScriptEnabled = 0;
+
+ // need TTY window?
+ value = findDialerData(env, dialerData, "NeedsTTYWindow");
+ if (value)
+ account->NeedsTTYWindow = (value && (strcmp(value, "TRUE") == 0));
+ else
+ account->NeedsTTYWindow = 0;
+
+ // isp phone number
+ value = findDialerData(env, dialerData, "ISPPhoneNum");
+ if (value)
+ strcpy(account->ISPPhoneNum, value);
+ else
+ strcpy(account->ISPPhoneNum, "");
+
+ // ISDN phone number
+ value = findDialerData(env, dialerData, "ISDNPhoneNum");
+ if (value)
+ strcpy(account->ISDNPhoneNum, value);
+ else
+ strcpy(account->ISDNPhoneNum, "");
+
+ // VJ compression enabled?
+ value = findDialerData(env, dialerData, "VJCompresssionEnabled");
+ if (value)
+ account->VJCompressionEnabled = (value && (strcmp(value, "TRUE") == 0));
+ else
+ account->VJCompressionEnabled = 0;
+
+ // International mode?
+ value = findDialerData(env, dialerData, "IntlMode");
+ if (value)
+ account->IntlMode = (strcmp(value, "TRUE") == 0);
+ else
+ account->IntlMode = 0;
+
+ // dial on demand?
+ value = findDialerData(env, dialerData, "DialOnDemand");
+ if (value)
+ account->DialOnDemand = (strcmp(value, "TRUE") == 0);
+ else
+ account->DialOnDemand = 1;
+}
+
+
+
+
+//********************************************************************************
+//
+// fillLocationParameters
+//
+// fill in location information, given from JS array
+//********************************************************************************
+void fillLocationParameters(JRIEnv* env,
+ jstringArray dialerData,
+ LOCATIONPARAMS *location,
+ BOOL RegiMode)
+{
+ char *value;
+
+ // modem name
+ value = findDialerData(env, dialerData, "ModemName");
+ strcpy(location->ModemName, value ? value : "");
+
+ // modem type
+ value = findDialerData(env, dialerData, "ModemType");
+ strcpy(location->ModemType, value ? value : "");
+
+ // dial type
+ value = findDialerData(env, dialerData, "DialType");
+ if (value)
+ location->DialType = (strcmp(value, "TONE") == 0);
+ else
+ location->DialType = 1;
+
+ // outside line access
+ value = findDialerData(env, dialerData, "OutsideLineAccess");
+ strcpy(location->OutsideLineAccess, value ? value : "");
+
+ // disable call waiting?
+ value = findDialerData(env, dialerData, "DisableCallWaiting");
+ if (value)
+ location->DisableCallWaiting = (strcmp(value, "TRUE") == 0);
+ else
+ location->DisableCallWaiting = 0;
+
+ // disable call waiting code
+ value = findDialerData(env, dialerData, "DisableCallWaitingCode");
+ strcpy(location->DisableCallWaitingCode, value ? value : "");
+
+ // user area code
+ value = findDialerData(env, dialerData, "UserAreaCode");
+ strcpy(location->UserAreaCode, value ? value : "");
+
+ // user country code
+ value = findDialerData(env, dialerData, "CountryCode");
+ if (value) {
+ char *stopstr = "\0";
+ location->UserCountryCode = (short)strtol(value, &stopstr, 10);
+ } else
+ location->UserCountryCode = 1; // default to US
+
+ // dial as long distance?
+ value = findDialerData(env, dialerData, "DialAsLongDistance");
+ if (value)
+ location->DialAsLongDistance = (strcmp(value, "TRUE") == 0);
+ else
+ location->DialAsLongDistance = 0;
+
+ // long distance access
+ value = findDialerData(env, dialerData, "LongDistanceAccess");
+ strcpy(location->LongDistanceAccess, value ? value : "");
+
+ // dial area code?
+ value = findDialerData(env, dialerData, "DialAreaCode");
+ if (value)
+ location->DialAreaCode = (strcmp(value, "TRUE") == 0);
+ else
+ location->DialAreaCode = 0;
+
+ // dial prefix code
+ value = findDialerData(env, dialerData, "DialPrefix");
+ strcpy(location->DialPrefix, value ? value : "");
+
+ // dial suffix code
+ value = findDialerData(env, dialerData, "DialSuffix");
+ strcpy(location->DialSuffix, value ? value : "");
+
+ // use both ISDN lines?
+ value = findDialerData(env, dialerData, "UseBothISDNLines");
+ if (value)
+ location->UseBothISDNLines = (strcmp(value, "TRUE") == 0);
+ else
+ location->UseBothISDNLines = 0;
+
+ // 56k ISDN?
+ value = findDialerData(env, dialerData, "56kISDN");
+ if (value)
+ location->b56kISDN = (strcmp(value, "TRUE") == 0);
+ else
+ location->b56kISDN = 0;
+
+ // disconnect time
+ value = findDialerData(env, dialerData, "DisconnectTime");
+
+ if (value) {
+ location->DisconnectTime = atoi(value);
+ } else {
+ location->DisconnectTime = 5;
+ }
+
+
+
+}
+
+
+
+//********************************************************************************
+//
+// ParseNumber
+//
+// Parses a canonical TAPI phone number into country code, area code, and
+// local subscriber number
+//********************************************************************************
+static void
+ParseNumber(LPCSTR lpszCanonical, LPDWORD lpdwCountryCode, LPSTR lpszAreaCode, LPSTR lpszLocal)
+{
+ //*** sscanf dependency removed for win16 compatibility
+
+ char temp[256];
+ int p1, p2;
+
+ // Initialize our return values
+ *lpdwCountryCode = 1; // North America Calling Plan
+ *lpszAreaCode = '\0';
+ *lpszLocal = '\0';
+
+ if (!lpszCanonical || !*lpszCanonical)
+ return;
+
+ // We allow three variations (two too many):
+ // -: +1 (415) 428-3838 (TAPI canonical number)
+ // -: (415) 428-3838 (TAPI canonical number minus country code)
+ // -: 428-3838 (subscriber number only)
+ //
+ // NOTE: this approach only works if there is a city/area code. The TAPI
+ // spec says the city/area code is optional for countries that have a flat
+ // phone numbering system
+
+ // Take my advice, always start at the beginning.
+ p1 = 0;
+
+ // Allow spaces
+ while (lpszCanonical[p1] == ' ') p1++;
+
+ // Handle the country code if '+' prefix seen
+ if (lpszCanonical[p1] == '+')
+ {
+ p1++;
+ if (!isdigit(lpszCanonical[p1])) return;
+
+ p2 = p1;
+ while (isdigit(lpszCanonical[p1])) p1++;
+ strncpy(temp, &lpszCanonical[p2], p1-p2);
+ *lpdwCountryCode = atoi(temp);
+ }
+
+ // Allow spaces
+ while (lpszCanonical[p1] == ' ') p1++;
+
+ // Handle the area code if '(' prefix seen
+ if (lpszCanonical[p1] == '(')
+ {
+ p1++;
+ if (!isdigit(lpszCanonical[p1])) return;
+
+ p2 = p1;
+ while (isdigit(lpszCanonical[p1])) p1++;
+ strncpy(lpszAreaCode, &lpszCanonical[p2], p1-p2);
+
+ p1++; // Skip over the trailing ')'
+ }
+
+ // Allow spaces
+ while (lpszCanonical[p1] == ' ') p1++;
+
+ // Whatever's left is the subscriber number (possibly including the whole string)
+ strcpy(lpszLocal, &lpszCanonical[p1]);
+}
+
+//********************************************************************************
+//
+// OnlyOneSet
+//
+// Just an XOR of DialAsLongDistance & DialAreaCode - if only one of them is
+// set then we can't use MS Locations (if neither are set then we can use
+// locations, but disable use of both - they just don't allow disable of each
+// individually)
+//********************************************************************************
+BOOL OnlyOneSet(const LOCATIONPARAMS& location)
+{
+ if (location.DialAsLongDistance && !location.DialAreaCode)
+ return TRUE;
+ else if (!location.DialAsLongDistance && location.DialAreaCode)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+//********************************************************************************
+// PrefixAvail() returns TRUE if there are prefixes that makes location unusable
+//********************************************************************************
+BOOL PrefixAvail(const LOCATIONPARAMS& Location)
+{
+ return (Location.DisableCallWaiting && Location.DisableCallWaitingCode[0] != 0) ||
+ (Location.OutsideLineAccess && Location.OutsideLineAccess[0] != 0);
+}
+
+//********************************************************************************
+//
+// ComposeNumber
+//
+// Create a phone number encompassing all of the location information to hack
+// around dialup networking ignoring the location information if you turn off
+// the "dial area and country code" flag
+//********************************************************************************
+static void
+ComposeNumber(ACCOUNTPARAMS &account, const LOCATIONPARAMS &Location, char csNumber[])
+{
+ // if they need to dial something to get an outside line next
+ if (Location.OutsideLineAccess[0] != 0) {
+ strcat(csNumber, Location.OutsideLineAccess);
+ strcat(csNumber, " ");
+ }
+
+ // add disable call waiting if it exists
+ if (Location.DisableCallWaiting && Location.DisableCallWaitingCode[0] != 0) {
+ strcat(csNumber, Location.DisableCallWaitingCode);
+ strcat(csNumber, " ");
+ }
+
+ if (account.IntlMode) {
+
+ // In international mode we don't fill out the area code or
+ // anything, just the exchange part
+ strcat(csNumber, account.ISPPhoneNum);
+ }
+ else {
+
+ // lets parse the number into pieces so we can get the area code & country code
+ DWORD nCntry;
+ char szAreaCode[32];
+ char szPhoneNumber[32];
+ ParseNumber(account.ISPPhoneNum, &nCntry, szAreaCode, szPhoneNumber);
+
+ // dial the 1 (country code) first if they want it
+ if (Location.DialAsLongDistance) {
+
+ char Cntry[10];
+#ifdef WIN32
+ ultoa(nCntry, Cntry, 10);
+#else
+ itoa((int) nCntry, Cntry, 10);
+#endif
+
+ if (strcmp(Location.LongDistanceAccess, "") == 0)
+ strcat(csNumber, Cntry);
+ else
+ strcat(csNumber, Location.LongDistanceAccess);
+ strcat(csNumber, " ");
+ }
+
+ // dial the area code next if requested
+ if (Location.DialAreaCode) {
+ strcat(csNumber, szAreaCode);
+ strcat(csNumber, " ");
+ }
+
+ // dial the local part of the number
+ strcat(csNumber, szPhoneNumber);
+ }
+}
+
+
+//********************************************************************************
+//
+// GetCountryID
+//
+//********************************************************************************
+static BOOL
+GetCountryID(DWORD dwCountryCode, DWORD &dwCountryID)
+{
+ assert(m_lpfnRasGetCountryInfo);
+ if (NULL == m_lpfnRasGetCountryInfo)
+ return FALSE;
+
+ RASCTRYINFO *pCI = NULL;
+ BOOL bRetval = FALSE;
+
+ DWORD dwSize = stRASCTRYINFO + 256;
+ pCI = (RASCTRYINFO *)malloc((UINT) dwSize);
+ if(pCI) {
+ pCI->dwSize = stRASCTRYINFO;
+ pCI->dwCountryID = 1;
+
+ while ((m_lpfnRasGetCountryInfo)(pCI, &dwSize) == 0) {
+ if (pCI->dwCountryCode == dwCountryCode) {
+ dwCountryID = pCI->dwCountryID;
+ bRetval = TRUE;
+ break;
+ }
+ pCI->dwCountryID = pCI->dwNextCountryID;
+ }
+
+ free(pCI);
+ pCI = NULL;
+ }
+
+ return(bRetval);
+}
+
+//********************************************************************************
+//
+// ProcessScriptLogin
+//
+// Generate a script file and return the name of the file. The
+// caller is responsible for freeing the script file name
+//********************************************************************************
+BOOL ProcessScriptedLogin(LPSTR lpszBuf, const char *lpszScriptFile)
+{
+ // validate our args just for fun
+ if (!lpszBuf || (lpszBuf[0] == '\0') || !lpszScriptFile)
+ return(FALSE);
+
+ // open the actual script file
+ FILE * fp = fopen(lpszScriptFile, "w");
+ if (!fp)
+ return(FALSE);
+
+ // generate a prolog
+ char timebuf[24];
+ char datebuf[24];
+ _strtime(timebuf);
+ _strdate(datebuf);
+ fprintf(fp, "; %s\n; Created: %s at %s\n;\n;\nproc main\n", lpszScriptFile, datebuf, timebuf);
+
+ // Send a return to poke the server. Is this needed?
+ fprintf(fp, "transmit \"^M\"\n");
+
+ for (int i = 0; lpszBuf; i++) {
+ LPSTR lpszDelim;
+
+ // Each event consists of two parts:
+ // 1. string to wait for
+ // 2. string to reply with
+ //
+ // The string to reply with is optional. A '|' separates the two strings
+ // and another '|' separates each event
+ lpszDelim = strchr(lpszBuf, '|');
+ if(lpszDelim)
+ *lpszDelim = '\0';
+
+ // we are in the "wait for event"
+ fprintf(fp, "waitfor \"%s\",matchcase until 30\n", lpszBuf);
+
+ // skip to the next bit
+ lpszBuf = lpszDelim ? lpszDelim + 1 : NULL;
+
+ if (lpszBuf) {
+ // now look for the reply event
+ lpszDelim = strchr(lpszBuf, '|');
+ if(lpszDelim)
+ *lpszDelim = '\0';
+
+ // we are in the "reply with" event
+ // NOTE: we will want to get the ^M value from someone else
+ // since different ISPs will probably want different ones
+ if (!stricmp(lpszBuf, "%name"))
+ fprintf(fp, "transmit $USERID\n");
+ else if(!stricmp(lpszBuf, "%password"))
+ fprintf(fp, "transmit $PASSWORD\n");
+ else if(lpszBuf[0])
+ fprintf(fp, "transmit \"%s\"\n", lpszBuf);
+
+ fprintf(fp, "transmit \"^M\"\n");
+ }
+
+ lpszBuf = lpszDelim ? lpszDelim + 1 : NULL;
+ }
+
+ // writeout the ending bits and cleanup
+ fprintf(fp, "endproc\n");
+ fclose(fp);
+
+ return(TRUE);
+}
+
+//********************************************************************************
+//
+// FileExists
+//
+//********************************************************************************
+BOOL FileExists (LPCSTR lpszFileName)
+{
+ BOOL bResult = FALSE;
+
+#ifdef WIN32 // ********************* Win32 **************************
+ HANDLE hFile=NULL;
+
+ // opens the file for READ
+ hFile = CreateFile(lpszFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (hFile != INVALID_HANDLE_VALUE) { // openned file is valid
+ bResult = TRUE;
+ CloseHandle(hFile);
+ }
+#else // ********************* Win16 **************************
+ OFSTRUCT of;
+ HFILE hFile = OpenFile(lpszFileName, &of, OF_EXIST);
+ bResult = hFile != HFILE_ERROR;
+ if (bResult)
+ _lclose(hFile);
+#endif
+
+ return bResult;
+}
+
+
+#ifdef WIN32
+//********************************************************************************
+//
+// EnableDialOnDemand (win95)
+//
+// Set the magic keys in the registry to enable dial on demand
+//********************************************************************************
+static void
+EnableDialOnDemand(LPSTR lpProfileName)
+{
+ HKEY hKey;
+ DWORD dwDisposition;
+ long result;
+ char *szData;
+
+ //
+ // We need to tell windows about dialing on demand
+ //
+ result = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Services\\Winsock\\Autodial",
+ NULL, NULL, NULL, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ szData = "url.dll";
+ result = RegSetValueEx(hKey, "AutodialDllName32", NULL, REG_SZ, (LPBYTE)szData, strlen(szData));
+
+ szData = "AutodialHookCallback";
+ result = RegSetValueEx(hKey, "AutodialFcnName32", NULL, REG_SZ, (LPBYTE)szData, strlen(szData));
+
+ RegCloseKey(hKey);
+
+ //
+ // set the autodial flag first
+ //
+ result = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
+ NULL, NULL, NULL, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ // set the autodial and idle-time disconnect
+ DWORD dwValue = TRUE;
+ result = RegSetValueEx(hKey, "EnableAutodial", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+
+ //
+ // set the autodial flag here too
+ //
+ result = RegCreateKeyEx(HKEY_USERS, ".Default\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
+ NULL, NULL, NULL, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ // set the autodial and idle-time disconnect
+ dwValue = TRUE;
+ result = RegSetValueEx(hKey, "EnableAutodial", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+
+ //
+ // OK, let's tell it which profile to autodial
+ //
+ result = RegCreateKeyEx(HKEY_CURRENT_USER, "RemoteAccess", NULL, NULL, NULL,
+ KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ result = RegSetValueEx(hKey, "InternetProfile", NULL, REG_SZ, (LPBYTE)lpProfileName, strlen(lpProfileName));
+ result = RegSetValueEx(hKey, "Default", NULL, REG_SZ, (LPBYTE)lpProfileName, strlen(lpProfileName));
+
+ RegCloseKey(hKey);
+}
+
+//********************************************************************************
+//
+// EnableDialOnDemand (winNT40)
+//
+// Sets the RAS structure for Dial on Demand, NT40 doesn't use registry like win95
+//********************************************************************************
+void FAR PASCAL
+lineCallbackFuncNT(DWORD /* hDevice */,
+ DWORD /* dwMsg */,
+ DWORD /* dwCallbackInstance */,
+ DWORD /* dwParam1 */,
+ DWORD /* dwParam2 */,
+ DWORD /* dwParam3 */)
+{
+}
+
+
+//********************************************************************************
+// EnableDialOnDemand (win16)
+//********************************************************************************
+void EnableDialOnDemandNT(LPSTR lpProfileName)
+{
+ RASAUTODIALENTRY rasAutodialEntry;
+ DWORD dwBytes = 0;
+ DWORD dwNumDevs;
+ HLINEAPP m_LineApp;
+ DWORD dwApiVersion;
+ LINEINITIALIZEEXPARAMS m_LineInitExParams;
+ LINETRANSLATECAPS m_LineTranslateCaps;
+ int rtn;
+
+ // Initialize TAPI. We need to do this in order to get the dialable
+ // number and to bring up the location dialog
+
+ dwApiVersion = 0x00020000;
+ m_LineInitExParams.dwOptions = LINEINITIALIZEEXOPTION_USEEVENT;
+ m_LineInitExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS);
+ m_LineInitExParams.dwNeededSize = sizeof(LINEINITIALIZEEXPARAMS);
+
+ rtn = lineInitializeEx(&m_LineApp, DLLinstance, lineCallbackFuncNT,
+ NULL, &dwNumDevs, &dwApiVersion, &m_LineInitExParams);
+ if ( rtn == 0)
+ {
+ m_LineTranslateCaps.dwTotalSize = sizeof(LINETRANSLATECAPS);
+ m_LineTranslateCaps.dwNeededSize = sizeof(LINETRANSLATECAPS);
+ rtn = lineGetTranslateCaps(m_LineApp, dwApiVersion, &m_LineTranslateCaps);
+ }
+
+ rasAutodialEntry.dwFlags = 0;
+ rasAutodialEntry.dwDialingLocation = m_LineTranslateCaps.dwCurrentLocationID;
+ strcpy(rasAutodialEntry.szEntry, lpProfileName); //entry
+ rasAutodialEntry.dwSize = sizeof(RASAUTODIALENTRY);
+
+ // set auto dial params
+ int val = 1;
+ rtn = (*m_lpfnRasSetAutodialParam)(RASADP_DisableConnectionQuery, &val, sizeof(int));
+
+ rtn = (*m_lpfnRasSetAutodialAddress)("www.netscape.com", 0, &rasAutodialEntry,
+ sizeof(RASAUTODIALENTRY), 1);
+ rtn = (*m_lpfnRasSetAutodialEnable)(rasAutodialEntry.dwDialingLocation, TRUE);
+}
+
+#else // ************************************* WIN16 *************************************
+
+//////////////////////////////////////////////////////////////////////////////////
+// Enable Shiva DOD
+//////////////////////////////////////////////////////////////////////////////////
+BOOL EnableDialOnDemand16(LPCSTR szName, BOOL bSet)
+{
+ char szIniFName[255], // ShivaRemote Config (ini) file name
+ szConnFilePath[100]; // path to Shiva's INI file
+
+ // get Shiva INI filename (sremote.ini)
+ BOOL bResult = GetShivaSRemoteConfigFile(szIniFName);
+ if (bResult)
+ {
+ // Get ShivaRemote connection file for the specified connection
+ bResult = GetConnectionFilePath(szName, szConnFilePath, TRUE);
+
+ if (g_lpfnSetDialOnDemandInfo && bResult)
+ bResult = (*g_lpfnSetDialOnDemandInfo)(bSet, szConnFilePath) == 0;
+ }
+
+ return bResult;
+}
+
+#endif // !WIN32
+
+
+//********************************************************************************
+//
+// ToNumericAddress
+//
+// Converts from dotted address to numeric internet address
+//********************************************************************************
+BOOL ToNumericAddress(LPCSTR lpszAddress, DWORD& dwAddress)
+{
+ //*** sscanf dependency removed for win16 compatibility
+
+ char temp[256];
+ int a, b, c, d;
+ int p1, p2;
+
+ strcpy(temp, lpszAddress);
+
+ p2 = p1 = 0;
+ while (temp[p1] != '.') p1++;
+ temp[p1] = '\0';
+ a = atoi(&temp[p2]);
+
+ p2 = ++p1;
+ while (temp[p1] != '.') p1++;
+ temp[p1] = '\0';
+ b = atoi(&temp[p2]);
+
+ p2 = ++p1;
+ while (temp[p1] != '.') p1++;
+ temp[p1] = '\0';
+ c = atoi(&temp[p2]);
+
+ p2 = ++p1;
+ d = atoi(&temp[p2]);
+
+ // Must be in network order (different than Intel byte ordering)
+ LPBYTE lpByte = (LPBYTE)&dwAddress;
+
+ *lpByte++ = BYTE(a);
+ *lpByte++ = BYTE(b);
+ *lpByte++ = BYTE(c);
+ *lpByte = BYTE(d);
+
+ return TRUE;
+}
+
+
+#ifdef WIN32
+//********************************************************************************
+//
+// SetAutoDisconnect
+//
+// Sets the autodisconnect time if idle
+//
+// the parameter "disconnectTime" is specified as MINUTES, convert it to SECONDS
+// as necessary
+//********************************************************************************
+void SetAutoDisconnect(DWORD disconnectTime)
+{
+ HKEY hKey;
+ DWORD dwDisposition;
+ long result;
+ DWORD dwValue;
+
+ // if it's win95
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS) {
+
+ //
+ // set the autodial flag first
+ //
+ result = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
+ NULL, NULL, NULL, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ // try setting autodisconnect here
+ dwValue = 1;
+ result = RegSetValueEx(hKey, "EnableAutoDisconnect", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ // default auto-disconnect after 5 minutes or as specified (with a minimal of 3 minutes)
+ if (disconnectTime < 3)
+ dwValue = 3;
+ else
+ dwValue = disconnectTime;
+ result = RegSetValueEx(hKey, "DisconnectIdleTime", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ RegCloseKey(hKey);
+
+ //
+ // set the autodisconnect flags here too
+ //
+ result = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\Internet Settings",
+ NULL, NULL, NULL, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ dwValue = 1;
+ result = RegSetValueEx(hKey, "EnableAutoDisconnect", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ // default auto-disconnect after 5 minutes
+ if (disconnectTime < 3)
+ dwValue = 3;
+ else
+ dwValue = disconnectTime;
+ result = RegSetValueEx(hKey, "DisconnectIdleTime", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ RegCloseKey(hKey);
+
+
+ //
+ // also set the autodial flag here
+ //
+ result = RegCreateKeyEx(HKEY_USERS, ".Default\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
+ NULL, NULL, NULL, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ // try setting autodisconnect here
+ dwValue = 1;
+ result = RegSetValueEx(hKey, "EnableAutoDisconnect", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ // default auto-disconnect after 5 minutes or as specified (with a minimal of 3 minutes)
+ if (disconnectTime < 3)
+ dwValue = 3;
+ else
+ dwValue = disconnectTime;
+ result = RegSetValueEx(hKey, "DisconnectIdleTime", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ RegCloseKey(hKey);
+
+ //
+ // set the autodisconnect flags here too
+ //
+ result = RegCreateKeyEx(HKEY_USERS, ".Default\\Software\\Microsoft\\Windows\\Internet Settings",
+ NULL, NULL, NULL, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
+
+ // err, oops
+ if (result != ERROR_SUCCESS)
+ return;
+
+ dwValue = 1;
+ result = RegSetValueEx(hKey, "EnableAutoDisconnect", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ // default auto-disconnect after 5 minutes
+ if (disconnectTime < 3)
+ dwValue = 3;
+ else
+ dwValue = disconnectTime;
+ result = RegSetValueEx(hKey, "DisconnectIdleTime", NULL, REG_BINARY, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ RegCloseKey(hKey);
+
+ } else { // NT40
+
+ // we need to convert disconnectTime to # of seconds for NT40
+ dwValue = (disconnectTime * 60);
+
+ result = RegOpenKeyEx(HKEY_USERS, ".DEFAULT\\Software\\Microsoft\\RAS Phonebook", NULL, KEY_ALL_ACCESS, &hKey);
+
+ if (result != ERROR_SUCCESS)
+ return;
+
+ // now set the auto disconnect seconds
+ result = RegSetValueEx(hKey, "IdleHangupSeconds", NULL, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));
+
+ RegCloseKey(hKey);
+
+
+ }
+
+ return;
+}
+#endif
+
+//********************************************************************************
+//
+// CreateRNAEntry
+//
+// Create a dial-up networking profile
+//********************************************************************************
+static BOOL
+CreateRNAEntry(ACCOUNTPARAMS account, const LOCATIONPARAMS& location)
+{
+ DWORD dwRet;
+ BOOL ret = 0;
+ RASENTRY rasEntry;
+
+ // abort if RAS API ptrs are invalid & mem alloc fails
+ assert(m_lpfnRasSetEntryProperties);
+#ifdef WIN32
+ if (!m_lpfnRasSetEntryProperties)
+#else
+ assert(g_lpfnRasSetEntryDialParams && g_lpfnSetDialStringInfo);
+ if (!m_lpfnRasSetEntryProperties ||
+ !g_lpfnRasSetEntryDialParams ||
+ !g_lpfnSetDialStringInfo)
+#endif // !WIN32
+ return FALSE;
+
+ // Initialize the RNA struct
+ memset(&rasEntry, 0, stRASENTRY);
+ rasEntry.dwSize = stRASENTRY;
+
+ rasEntry.dwfOptions = RASEO_ModemLights | RASEO_RemoteDefaultGateway;
+
+ // Only allow compression if reg server says its OK
+ if (account.VJCompressionEnabled)
+ rasEntry.dwfOptions |= RASEO_IpHeaderCompression | RASEO_SwCompression;
+
+ if (account.NeedsTTYWindow)
+#ifdef WIN32
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS)
+ rasEntry.dwfOptions |= RASEO_TerminalBeforeDial; //win95 bug! RASEO_TerminalBeforeDial means terminal after dial
+ else
+#endif
+ rasEntry.dwfOptions |= RASEO_TerminalAfterDial;
+
+ // If Intl Number (not NorthAmerica), or Area Code w/o LDAccess (1) or
+ // visa-versa, then abandon using Location - NOTE: for Intl Number we
+ // should be able to use location, check it out!
+#ifdef WIN32
+ if (account.IntlMode || OnlyOneSet(location)) {
+#else
+ if (account.IntlMode || OnlyOneSet(location) || PrefixAvail(location)) {
+#endif
+ char szNumber[RAS_MaxPhoneNumber + 1];
+ szNumber[0] = '\0';
+
+ ComposeNumber(account, location, szNumber);
+ strcpy(rasEntry.szLocalPhoneNumber, szNumber);
+
+#ifdef WIN32
+ strcpy(rasEntry.szAreaCode, "415"); // hack around MS bug--ignored
+ rasEntry.dwCountryCode = 1; // hack around MS bug -- ignored
+#endif
+ } else {
+ // Let Win95 decide to dial the area code or not
+ rasEntry.dwfOptions |= RASEO_UseCountryAndAreaCodes;
+
+ // Configure the phone number
+ ParseNumber(account.ISPPhoneNum, &rasEntry.dwCountryCode,
+ rasEntry.szAreaCode, rasEntry.szLocalPhoneNumber);
+
+ if (!account.IntlMode) {
+ // if not internationalize version, check the area code and make
+ // sure we got a valid area code, if not throw up a err msg
+ if (rasEntry.szAreaCode[0] == '\0') {
+ // Err: The service provider's phone number is missing its area code
+ // (or is not in TAPI cannonical form in the configuration file).
+ // Account creation will fail until this is fixed.
+ char *buf = (char *)malloc(sizeof(char) * 255);
+ if (buf) {
+ if (getMsgString(buf, IDS_MISSING_AREA_CODE))
+ DisplayErrMsgWnd(buf, MB_OK | MB_ICONEXCLAMATION, hwndNavigator);
+ free(buf);
+ }
+ return (FALSE);
+ }
+ }
+ }
+
+ // Now that we have the country code, we need to find the associated
+ // country ID
+ GetCountryID(rasEntry.dwCountryCode, rasEntry.dwCountryID);
+
+ // Configure the IP data
+ rasEntry.dwfOptions |= RASEO_SpecificNameServers;
+ if (account.DNS[0])
+ ToNumericAddress(account.DNS, *(LPDWORD)&rasEntry.ipaddrDns);
+
+ if (account.DNS2[0])
+ ToNumericAddress(account.DNS2, *(LPDWORD)&rasEntry.ipaddrDnsAlt);
+
+ // Configure the protocol and device settings here:
+
+ // Negotiate TCP/IP
+ rasEntry.dwfNetProtocols = RASNP_Ip;
+
+ // Point-to-Point protocal (PPP)
+ rasEntry.dwFramingProtocol = RASFP_Ppp;
+
+ // modem's information
+ strcpy(rasEntry.szDeviceName, location.ModemName);
+ strcpy(rasEntry.szDeviceType, location.ModemType);
+
+ // If we have a script, then store it too
+ if (account.ScriptEnabled)
+ {
+ BOOL rtnval = TRUE;
+
+ // if there is script content, 'Translate' and store in file
+ if (ReggieScript)
+ {
+ // construct script filename if it does not exists
+ if (strlen(account.ScriptFileName) == 0)
+ {
+ GetProfileDirectory(account.ScriptFileName);
+ int nIndex = strlen(account.ScriptFileName);
+ strncat(account.ScriptFileName, account.ISPName, 8);
+ strcat(account.ScriptFileName, ".scp");
+#ifndef WIN32
+ ParseWin16BadChar(account.ScriptFileName);
+#endif
+ }
+ rtnval = ProcessScriptedLogin((LPSTR)ReggieScript, account.ScriptFileName);
+ free(ReggieScript);
+ }
+
+ /* if there really is a script file (from ISP or Reggie) then use it */
+ if (rtnval && FileExists(account.ScriptFileName))
+ {
+ strcpy(rasEntry.szScript, account.ScriptFileName);
+
+ // convert forward slash to backward slash
+ int nLen = strlen(rasEntry.szScript);
+ for (int i=0; i < nLen; i++)
+ if (rasEntry.szScript[i] == '/')
+ rasEntry.szScript[i] = '\\';
+ }
+ }
+
+ // dialing on demand is cool. let's do that on win95 now
+#ifdef WIN32 // ************************ Win32 *************************
+ if ((account.DialOnDemand) && (platformOS == VER_PLATFORM_WIN32_WINDOWS) && (!RegiMode))
+ EnableDialOnDemand((LPSTR)(LPCSTR)account.ISPName);
+#endif //WIN32
+
+ dwRet = (*m_lpfnRasSetEntryProperties)(NULL, (LPSTR)(LPCSTR)account.ISPName,
+ (LPBYTE)&rasEntry, stRASENTRY, NULL, 0);
+ assert(dwRet == 0);
+ if (dwRet)
+ {
+ return -1;
+ }
+
+ // We need to set the login name and password with a separate call
+ // why doesn't this work for winNT40??
+ memset(&dialParams, 0, sizeof(dialParams));
+ dialParams.dwSize = stRASDIALPARAMS;
+ strcpy(dialParams.szEntryName, account.ISPName);
+ strcpy(dialParams.szUserName, account.LoginName);
+ strcpy(dialParams.szPassword, account.Password);
+
+ // Creating connection entry!
+#ifdef WIN32 // *************** Win32 *****************
+
+ // if win95, go ahead change connection info and return
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS) {
+
+ ret = (RasSetEntryDialParams((LPSTR)(LPCSTR)account.ISPName,
+ &dialParams, FALSE)==0); //Returns 0 for okay
+
+ } else if (platformOS == VER_PLATFORM_WIN32_NT) {
+ // if winNT40, creates a connection info in phonebook and then enable
+ // Dial on Demand afterwords.
+
+ // here we need to find system phonebook first!
+ // something like ... "c:\\winnt40\\system32\\ras\\rasphone.pbk"
+
+ char *sysDir;
+ char *pbPath;
+ RASCREDENTIALS credentials;
+ sysDir = (char *)malloc(sizeof(char) * MAX_PATH);
+ if (sysDir) {
+ GetSystemDirectory(sysDir, MAX_PATH);
+ pbPath = (char *)malloc(sizeof(char) * strlen(sysDir) + 30);
+ if (pbPath) {
+ strcpy(pbPath, sysDir);
+ strcat(pbPath, "\\ras\\rasphone.pbk");
+ strcat(pbPath, "\0");
+
+ ret = (RasSetEntryDialParams(pbPath, &dialParams, FALSE) == 0);
+
+ // sets up user login info for new phonebook entry
+ memset(&credentials, 0, sizeof(RASCREDENTIALS));
+ credentials.dwSize = sizeof(RASCREDENTIALS);
+ credentials.dwMask = RASCM_UserName | RASCM_Password;
+ strcpy(credentials.szUserName, account.LoginName);
+ strcpy(credentials.szPassword, account.Password);
+ strcpy(credentials.szDomain, account.DomainName);
+
+ ret = (m_lpfnRasSetCredentials(pbPath, (LPSTR)(LPCSTR)account.ISPName,
+ &credentials, FALSE) == 0);
+
+ free(sysDir);
+ free(pbPath);
+
+ // enable dial on demand for NT4, don't do it if it's regi
+ if ((ret == TRUE) && (account.DialOnDemand) && (!RegiMode))
+ EnableDialOnDemandNT((LPSTR)(LPCSTR)account.ISPName);
+ } else {
+ free(sysDir);
+ // Err: not enough memory for pbPath!
+ return -2;
+ }
+ } else {
+ // Err: not enough memory for sysDir;
+ return -3;
+ } // if (sysDir)
+ } // else if (platformOS == VER_PLATFORM_WIN32_NT
+
+ SetAutoDisconnect(location.DisconnectTime);
+
+#else // *************** Win16 *****************
+ strcpy(dialParams.szDomain, account.DomainName);
+
+ ret = (*g_lpfnRasSetEntryDialParams)(NULL, &dialParams, FALSE) == 0;
+
+ if (ret) // RasSetEntryDialParams() succeeds
+ {
+ // set dial on demand for non-reggie connections
+ if ((account.DialOnDemand) && (!RegiMode))
+ EnableDialOnDemand16(account.ISPName, TRUE);
+
+ // set tone or pulse dialing
+ if (g_lpfnSetDialStringInfo)
+ (*g_lpfnSetDialStringInfo)(location.DialType, MODEMVOLUME_Low);
+
+ // for Reggie connection: disable PPP compression to avoid connection drop w/ PortMasters for RPI modems
+ if (g_lpfnSetCompressionInfo)
+ (*g_lpfnSetCompressionInfo)(!RegiMode);
+
+ // set connection info: autoreconnect, autodisconnect & idle period
+ // for Reggie: disable reconnect dialog to avoid 2 places for reconnect
+ if (g_lpfnSetConnectionInfo)
+ (*g_lpfnSetConnectionInfo)(account.ISPName, !RegiMode, TRUE, location.DisconnectTime);
+ }
+
+#endif
+
+ return ret;
+}
+
+//********************************************************************************
+// native method:
+//
+// IsDialerConnected
+//
+// checks if the dialer is still connected
+//********************************************************************************
+extern JRI_PUBLIC_API(jbool)
+native_netscape_npasw_SetupPlugin_SECURE_0005fIsDialerConnected(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin)
+{
+ jbool bResult = IsDialerConnected();
+ return bResult;
+}
+
+//********************************************************************************
+// native method:
+//
+// DialerConfig
+//
+// setup and configures the dialer and networking stuff
+// used in 3 conditions:
+// 1. when calling regi for a new account
+// 2. to configure new account from regi on users system
+// 3. when optionally register Navigator in existing account path
+//********************************************************************************
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fDialerConfig(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin,
+ jstringArray JSdialerDataArray,
+ jbool JSregiMode)
+{
+ hwndNavigator = GetActiveWindow();
+
+ ACCOUNTPARAMS account;
+ LOCATIONPARAMS location;
+
+ RegiMode = JSregiMode;
+
+ if (!JSdialerDataArray) {
+ // Err: no dialer data array passed, can't configure dialer
+ return;
+ }
+
+ // now we try to get values from the JS array and put them into corresponding
+ // account and location parameters
+ fillAccountParameters(env, JSdialerDataArray, &account, RegiMode);
+ fillLocationParameters(env, JSdialerDataArray, &location, RegiMode);
+
+ // if Reggie call then decrypt the 'shuffled' password
+ if (RegiMode) {
+
+ char Password[64];
+
+ if (!ConvertPassword(account.Password, Password)) {
+
+ // Err: Invalid pasword in Netscape registration file (regserv.ias).
+ char *buf = (char *)malloc(sizeof(char) * 255);
+ if (buf) {
+ if (getMsgString(buf, IDS_BAD_PASSWORD))
+ DisplayErrMsgWnd(buf, MB_OK | MB_ICONEXCLAMATION, hwndNavigator);
+ free(buf);
+ }
+
+ return;
+ }
+ strcpy(account.Password, Password);
+ }
+
+ // configure & creating Dial-Up Networking profile here for Win95 & WinNT40
+ // win16 use Shiva's RAS
+ if (!(CreateRNAEntry(account, location))) {
+
+ // Err: Unable to crate RNA phone book entry!
+ char *buf = (char *)malloc(sizeof(char) * 255);
+ if (buf) {
+ if (getMsgString(buf, IDS_NO_RNA_REGSERVER))
+ DisplayErrMsgWnd(buf, MB_OK | MB_ICONEXCLAMATION, hwndNavigator);
+ free(buf);
+ }
+ }
+
+#ifdef WIN32
+ int ret;
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS) {
+ // sets the location stuff
+ ret = SetLocationInfo(account, location);
+ //ret = DisplayDialableNumber();
+ } else {
+ ret = SetLocationInfoNT(account, location);
+ }
+#else
+ // check if Account Path is existing!!!
+ char *value = findDialerData(env, JSdialerDataArray, "Path");
+ if (value)
+ g_bExistingPath = (strcmp(value, "Existing") == 0);
+
+#endif
+}
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/errmsg.cpp b/mozilla/cmd/dialup/win/aswplugn/src/errmsg.cpp
new file mode 100644
index 00000000000..8401daeb13a
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/errmsg.cpp
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+///////////////////////////////////////////////////////////////////////////////
+//
+// Errmsg.cpp
+// Revision History:
+// Date Author Reason
+// ----------------------------------------------------------------------------
+// xxxxxxxxxxxxxx Define routines
+///////////////////////////////////////////////////////////////////////////////
+
+#include
+
+// resource include
+#ifdef WIN32 // **************************** WIN32 *****************************
+#include "resource.h"
+#else // **************************** WIN16 *****************************
+#include "asw16res.h"
+#endif // !WIN32
+
+extern HINSTANCE DLLinstance; // dll instance
+
+
+//********************************************************************************
+//
+// getMsgString
+//
+// loads a Message String from the string table
+//********************************************************************************
+BOOL getMsgString(char *buf, UINT uID)
+{
+ if (!buf)
+ return FALSE;
+
+ HINSTANCE hInstance = DLLinstance;
+ int ret = LoadString(hInstance, uID, buf, 255);
+
+ return ret;
+}
+
+
+//********************************************************************************
+//
+// DisplayErrMsg
+//
+// display error messages in a standard windows message box
+//********************************************************************************
+int DisplayErrMsg(char *text,
+ int style)
+{
+ char title[50];
+ getMsgString((char *)&title, IDS_APP_NAME);
+
+ // try to get navigator window handle here
+ HWND hwnd = GetActiveWindow();
+
+ return MessageBox(hwnd, text, title, style);
+}
+
+
+//********************************************************************************
+//
+// DisplayErrMsgWnd
+//
+// display error messages in a standard windows message box
+// this is the err msg box call if we for sure can get a navigator window handle
+//
+// mostly used for displaying RAS connection errs
+//********************************************************************************
+int DisplayErrMsgWnd(char *text,
+ int style,
+ HWND hwnd)
+
+{
+ char title[50];
+ getMsgString((char *)&title, IDS_APP_NAME);
+
+ int ret = MessageBox(hwnd, text, title, style);
+
+ return ret;
+}
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/fileio.cpp b/mozilla/cmd/dialup/win/aswplugn/src/fileio.cpp
new file mode 100644
index 00000000000..9537fb0a9ec
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/fileio.cpp
@@ -0,0 +1,946 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+///////////////////////////////////////////////////////////////////////////////
+//
+// Fileio.cpp
+// Revision History:
+// Date Author Reason
+// ----------------------------------------------------------------------------
+// 02/05/97 xxxxxxxxxxxxxx Define Native API for win3.x
+// xxxxxxxxxxxxxx Define Native API for win95 & winNT
+///////////////////////////////////////////////////////////////////////////////
+
+#include
+#include "plugin.h"
+
+// resource include
+#ifdef WIN32 // **************************** WIN32 *****************************
+#include "resource.h"
+#else // **************************** WIN16 *****************************
+#include "asw16res.h"
+#endif // !WIN32
+
+#ifdef WIN32
+// ********************* Win32 includes **************************
+#include
+#else // win16
+// ********************* Win16 includes **************************
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include // for _S_IWRITE etc..
+#include
+#include "helper16.h"
+// ********************* Win16 constants **************************
+#define MAX_FILELENGTH 16000 // max filesize when reading in entire file content
+#define MAX_PATH 255
+#define LPCTSTR LPCSTR
+#define LPTSTR LPSTR
+#define DEF_ACCINFOFILENAME "acctinfo.txt"
+// ******* Win16 equivalent of error constants for WinExec() ******
+#define ERROR_FILE_NOT_FOUND 2
+#define ERROR_PATH_NOT_FOUND 3
+#define ERROR_BAD_FORMAT 11
+// ********************* Win16 vars *******************************
+#endif
+
+// ======================== general includes ======================
+#include
+#include // includes common dialog functionality
+#include // includes common dialog template defines
+#include // includes the common dialog error codes
+#include "errmsg.h"
+
+// ========================= java include ========================
+#include "netscape_npasw_SetupPlugin.h"
+#include "java_lang_String.h"
+
+// ========================= constants ============================
+#define INI_BUFFER_SIZE 255 // INI key value buffer size
+#define REGSERV_SR "RegServ.SR"
+
+JRIGlobalRef g_globalRefFileList = NULL;
+
+//********************************************************************************
+//
+// GetStringPlatformChars
+//
+// converts java string to c string depends on platform OS chars
+//********************************************************************************
+const char *GetStringPlatformChars(JRIEnv *env,
+ struct java_lang_String *JSstring)
+{
+ const char *newString = NULL;
+
+ if (JSstring != NULL)
+ newString = JRI_GetStringPlatformChars(env, JSstring, NULL, 0);
+
+// JRI_ExceptionDescribe(env);
+ JRI_ExceptionClear(env);
+
+ return (const char *)newString;
+}
+
+//********************************************************************************
+// native method:
+//
+// GetNameValuePair
+//
+// retrieves a string from the specified section in an initialization file
+//********************************************************************************
+JRI_PUBLIC_API(struct java_lang_String *)
+native_netscape_npasw_SetupPlugin_SECURE_0005fGetNameValuePair(JRIEnv *env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin,
+ struct java_lang_String *JSfile,
+ struct java_lang_String *JSsection,
+ struct java_lang_String *JSname)
+
+{
+ int err = 0;
+ struct java_lang_String *value;
+ char *buf=NULL; //allocate 1k, in case we return the entire file
+ short len = 0;
+ unsigned long ret = 0;
+
+ // converts plugin strings to c strings
+ const char *file = NULL, *section = NULL, *name = NULL;
+
+ // converts plugin strings to c strings
+ if (JSfile != NULL)
+ file = GetStringPlatformChars(env, JSfile);
+ if (JSsection != NULL)
+ section = GetStringPlatformChars(env, JSsection);
+ if (JSname != NULL)
+ name = GetStringPlatformChars(env, JSname);
+
+ if ((file) && (!section) && (!name)) {
+
+ // both section and name are NULL, means return the entire file contents!
+ // the file may not be in INI format
+#ifdef WIN32 // ********************* Win32 **************************
+ HANDLE hFile=NULL;
+
+ // opens the file for READ
+ hFile = CreateFile(file, GENERIC_READ, 0, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (hFile != INVALID_HANDLE_VALUE) { // openned file is valid
+
+ OVERLAPPED overlap;
+ DWORD bytesRead;
+
+ memset(&overlap, 0, sizeof(overlap));
+
+ // gets file size
+ DWORD fileSize = GetFileSize(hFile, NULL);
+
+#else // ********************* Win16 **************************
+
+ unsigned int bytesRead = BUFSIZ;
+ int hFile = _open(file, _O_RDONLY|_O_BINARY, _S_IREAD);
+
+ if(hFile != -1)
+ {
+ long fileSize = _filelength(hFile);
+ if (fileSize == -1L ||
+ fileSize >= MAX_FILELENGTH) // abort if file is longer then threshold
+ return NULL; // to avoid hitting 16K limit in JRI_NewStringPlatform()
+#endif
+ len = (short) fileSize;
+
+ // allocate enough for the file buffer
+ buf = (char *)malloc((size_t)(sizeof(char) * (fileSize+1)));
+ if (!buf)
+ return NULL;
+
+ // read the file from beginning
+#ifdef WIN32 // ********************* Win32 **************************
+ if (ReadFile(hFile, buf, fileSize, &bytesRead, NULL) == FALSE)
+ err = GetLastError();
+#else // ********************* Win16 **************************
+ if ((bytesRead = _read(hFile, buf, (unsigned int) fileSize)) <= 0)
+ bytesRead = 0;
+
+ assert(bytesRead <= fileSize);
+#endif
+ buf[bytesRead] = '\0';
+
+ // close file
+#ifdef WIN32 // ********************* Win32 **************************
+ CloseHandle(hFile);
+#else // ********************* Win16 **************************
+ int nResult = _close(hFile);
+ assert(nResult == 0);
+#endif
+ } else { // invalid file!
+
+
+#ifdef WIN32 // ********************* Win32 **************************
+ err = GetLastError();
+#endif
+ return NULL;
+ }
+ } else { // read an INI entry
+
+ buf = (char *)malloc(sizeof(char) * (INI_BUFFER_SIZE + 1));
+ assert(buf);
+ if (!buf)
+ return NULL;
+
+ ret = GetPrivateProfileString(section, name, "", buf, INI_BUFFER_SIZE, file);
+
+ len = (short)ret + 1;
+ }
+
+ value = JRI_NewStringPlatform(env, buf, len, NULL, 0);
+ free(buf);
+
+ return (struct java_lang_String *)value;
+}
+
+
+//********************************************************************************
+// native method:
+//
+// SetNameValuePair
+//
+// sets the value of a key string in the specified section in a *.SR or *.INI file
+//********************************************************************************
+JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fSetNameValuePair(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin *ThisPlugin,
+ struct java_lang_String *JSfile,
+ struct java_lang_String *JSsection,
+ struct java_lang_String *JSname,
+ struct java_lang_String *JSvalue)
+{
+ const char *file = NULL, *section = NULL, *name = NULL, *value = NULL;
+
+ // convert JavaScript string to c strings
+ if (JSfile != NULL)
+ file = GetStringPlatformChars(env, JSfile);
+ if (JSsection != NULL)
+ section = GetStringPlatformChars(env, JSsection);
+ if (JSname != NULL)
+ name = GetStringPlatformChars(env, JSname);
+ if (JSvalue != NULL)
+ value = GetStringPlatformChars(env, JSvalue);
+
+ // if file doesn't exist, create the file
+#ifdef WIN32 // ********************* Win32 **************************
+
+ WIN32_FIND_DATA *lpFileInfo = new WIN32_FIND_DATA;
+ HANDLE hfile = FindFirstFile(file, lpFileInfo);
+
+ if (hfile == INVALID_HANDLE_VALUE) {
+
+ SECURITY_ATTRIBUTES secAttrib;
+ memset(&secAttrib, 0, sizeof(SECURITY_ATTRIBUTES));
+ secAttrib.nLength = sizeof(SECURITY_ATTRIBUTES);
+ secAttrib.lpSecurityDescriptor = NULL;
+ secAttrib.bInheritHandle = FALSE;
+
+ HANDLE hfile = CreateFile (file, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
+ &secAttrib, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (hfile)
+ CloseHandle(hfile);
+
+ } else {
+
+ FindClose(hfile);
+
+ }
+
+ delete lpFileInfo;
+
+ // writes the value out to file
+ BOOL bResult = WritePrivateProfileString(section, name, value, file);
+ assert(bResult);
+
+#else // ************************************ WIN 16 ********************************
+
+ if (file && *file) // write if file name is valid
+ {
+ // writes the value out to file, if file does not exist, it'll be created
+ WritePrivateProfileString(section, name, value, file);
+ }
+#endif // !WIN16
+}
+
+
+//********************************************************************************
+// native method:
+//
+// GetFolderContents
+//
+// returns a list of file names in the specified directory
+//********************************************************************************
+JRI_PUBLIC_API(jref)
+native_netscape_npasw_SetupPlugin_SECURE_0005fGetFolderContents(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin,
+ struct java_lang_String *JSpath,
+ struct java_lang_String *JSsuffix)
+{
+ char szfilepath[_MAX_PATH];
+ char **ppFileArray = NULL;
+ short iFileCount = 0;
+ struct java_lang_String *value;
+
+ const char *path=NULL, *suffix=NULL;
+
+ // gets the file directory
+ if (JSpath != NULL)
+ path = GetStringPlatformChars(env, JSpath);
+ else
+ return NULL;
+
+ // gets the file extention
+ if(JSsuffix != NULL)
+ suffix = GetStringPlatformChars(env, JSsuffix);
+ else
+ return NULL;
+
+
+ // constructs the file path we're looking for
+ strcpy(szfilepath, path);
+ strcat(szfilepath, "*");
+ strcat(szfilepath, suffix);
+
+ // finds firt file in the directory
+
+#ifdef WIN32 // ********************* Win32 **************************
+
+ WIN32_FIND_DATA fileInfo;
+ HANDLE hFindFile = FindFirstFile(szfilepath, &fileInfo);
+
+ if (hFindFile != INVALID_HANDLE_VALUE) {
+
+ ppFileArray = (char **)malloc(sizeof(char *) * (iFileCount + 1));
+ ppFileArray[iFileCount] = strdup(fileInfo.cFileName);
+ iFileCount++;
+
+ // finds the next file
+ while (FindNextFile(hFindFile, &fileInfo)) {
+
+ if (strcmp(fileInfo.cFileName, REGSERV_SR) != 0) {
+
+ ppFileArray = (char **)realloc(ppFileArray, sizeof(char *) * (iFileCount + 1));
+ ppFileArray[iFileCount] = strdup(fileInfo.cFileName);
+
+#else // ********************* Win16 **************************
+
+ struct _find_t c_file;
+ unsigned uResult = _dos_findfirst(szfilepath, _A_NORMAL, &c_file);
+ if (0 == uResult)
+ {
+ ppFileArray = (char **)malloc(sizeof(char *) * (iFileCount + 1));
+ ppFileArray[iFileCount] = strdup(c_file.name);
+ iFileCount++;
+
+ // finds the next file
+ while(0 == _dos_findnext(&c_file))
+ {
+ // don't add "RegServ.SR" file
+ if (0 != strcmp(c_file.name, REGSERV_SR))
+ {
+ ppFileArray = (char **)realloc(ppFileArray, sizeof(char *) * (iFileCount + 1));
+ ppFileArray[iFileCount] = strdup(c_file.name);
+#endif
+
+ iFileCount++;
+ }
+ }
+
+ // dumps everything in the JRI array
+ void *resultFileArray = JRI_NewObjectArray(env, iFileCount, class_java_lang_String(env), NULL);
+ if (resultFileArray == NULL)
+ return NULL;
+
+ // lock the JRI array reference, dispose old reference if necessary
+ if (g_globalRefFileList)
+ JRI_DisposeGlobalRef(env, g_globalRefFileList);
+ g_globalRefFileList = JRI_NewGlobalRef(env, resultFileArray);
+
+ if (resultFileArray) {
+
+ for (short i=0; i
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include // WIN16 uses Shiva RAS
+#if __cplusplus
+extern "C"
+{
+#include // Shiva RAS APIs
+}
+#endif
+
+#include "helper16.h"
+
+TCHAR g_szShivaInstallPath[255] = {'\0'},
+ g_szNetscapeInstallPath[255] = {'\0'},
+ g_szShivaSRemoteConfigFile[255] = {'\0'},
+ g_szNavProgramFolderName[255] = {'\0'};
+
+//***************************************************************
+//***************************************************************
+// Utility Routines..
+//***************************************************************
+//***************************************************************
+
+//////////////////////////////////////////////////////////////////
+// Sleeps for the specified number of seconds
+//////////////////////////////////////////////////////////////////
+void Sleep(UINT nSec)
+{
+ if (nSec == 0)
+ return;
+
+ MSG msg;
+ time_t currTime, quitTime;
+ time(&currTime); // get current time
+ quitTime = currTime + nSec;
+
+ while (currTime < quitTime)
+ {
+ if(GetMessage(&msg, NULL, 0, 0))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ time(&currTime); // get current time
+ }
+}
+
+
+//***************************************************************
+//***************************************************************
+// Helper Routines dealing paths..
+//***************************************************************
+//***************************************************************
+
+//////////////////////////////////////////////////////////////////
+// Get Shiva install path.
+// path name is copied into csFilePath
+// return TRUE if successful
+//////////////////////////////////////////////////////////////////
+BOOL GetShivaInstallPath(TCHAR* csFilePath)
+{
+ if (!csFilePath)
+ return FALSE;
+
+ if (strlen(g_szShivaInstallPath) > 0) // Shiva install path saved?
+ {
+ strcpy(csFilePath, g_szShivaInstallPath);
+ return TRUE;
+ }
+
+ TCHAR szPreferredFile[255];
+ // Get Shiva preferred file path in win.ini: use sremote.ini entry as default
+ int nBytesCopied = GetProfileString(INI_SR_CONNWZ_SECTION, INI_SR_PREFFILE_KEY,
+ INI_SR_DFLT_PREFFILE, szPreferredFile, sizeof(szPreferredFile));
+
+ // Get Shiva install path in win.ini: use preferred file (default: sremote.ini) entry
+ nBytesCopied = GetProfileString(INI_SR_CONNWZ_SECTION, szPreferredFile,
+ INI_SR_DFLT_PREFFILE, g_szShivaInstallPath, sizeof(g_szShivaInstallPath));
+
+ strcpy(csFilePath, g_szShivaInstallPath);
+
+ assert(nBytesCopied > 0);
+ return (nBytesCopied > 0);
+}
+
+//////////////////////////////////////////////////////////////////
+// Get ShivaRemote Configuration file:
+// path name is copied into csFilePath
+// return TRUE if successful
+//////////////////////////////////////////////////////////////////
+BOOL GetShivaSRemoteConfigFile(TCHAR* csFilePath)
+{
+ if (!csFilePath)
+ return FALSE;
+
+ if (strlen(g_szShivaSRemoteConfigFile) > 0) // Shiva install path saved, just copy
+ {
+ strcpy(csFilePath, g_szShivaSRemoteConfigFile);
+ }
+ else // Shiva config file not avail, construct it
+ {
+ TCHAR szPreferredFile[64];
+
+ GetShivaInstallPath(g_szShivaSRemoteConfigFile);
+ strcat(g_szShivaSRemoteConfigFile, "\\");
+
+ // Get Shiva preferred file path in win.ini: use sremote.ini entry as default
+ GetProfileString(INI_SR_CONNWZ_SECTION, INI_SR_PREFFILE_KEY,
+ INI_SR_DFLT_PREFFILE, szPreferredFile, sizeof(szPreferredFile));
+
+ strcat(g_szShivaSRemoteConfigFile, szPreferredFile);
+ strcpy(csFilePath, g_szShivaSRemoteConfigFile);
+ }
+
+ return TRUE;
+}
+
+////////////////////////////////////////////////////////////////
+// Returns a full path to the install directory for Netscape
+////////////////////////////////////////////////////////////////
+BOOL GetNetscapeInstallPath(TCHAR* lpBuff)
+{
+ if (!lpBuff)
+ return FALSE;
+ if (strlen(g_szNetscapeInstallPath) > 0) // Shiva install path saved?
+ {
+ strcpy(lpBuff, g_szNetscapeInstallPath);
+ return TRUE;
+ }
+
+ char szCurrentVersion[_MAX_PATH],
+ szCurrentVersionIniSection[_MAX_PATH];
+ BOOL bResult = FALSE;
+ int nPathSize;
+
+ assert(lpBuff);
+ if (lpBuff)
+ {
+ // get current version, if not found, use default: INI_NS_CURRVER_DEFLT
+ nPathSize = ::GetPrivateProfileString(INI_NAVIGATOR_SECTION, INI_CURRENTVERSION_KEY,
+ INI_NS_CURRVER_DEFLT, szCurrentVersion, _MAX_PATH, INI_NETSCAPE_FILE);
+ assert(nPathSize);
+
+ if (nPathSize > 0)
+ {
+ // build section name "Netscape Navigator-xxx" where xxx == current version
+ strcpy(szCurrentVersionIniSection, INI_NS_APPNAME_PREFIX);
+ strcat(szCurrentVersionIniSection, szCurrentVersion);
+
+ nPathSize = ::GetPrivateProfileString(szCurrentVersionIniSection, INI_INSTALL_DIR_KEY,
+ INI_NS_INSTALLDIR_DEFLT, lpBuff, _MAX_PATH, INI_NETSCAPE_FILE);
+
+ // if failed to get path, then use default path
+ if (nPathSize == 0 || strlen(lpBuff) == 0)
+ strcpy(lpBuff, INI_NS_INSTALLDIR_DEFLT);
+
+ strcpy(g_szNetscapeInstallPath, lpBuff); // save install path
+ bResult = TRUE;
+ }
+ }
+
+ assert(bResult);
+ return bResult;
+}
+
+////////////////////////////////////////////////////////////////
+// Returns a Netscape Communicator program group name
+////////////////////////////////////////////////////////////////
+BOOL GetNetscapeProgramGroupName(TCHAR* lpBuff)
+{
+ if (!lpBuff)
+ return FALSE;
+
+ if (strlen(g_szNavProgramFolderName) > 0) // program folder saved?
+ {
+ strcpy(lpBuff, g_szNavProgramFolderName);
+ return TRUE;
+ }
+
+ char szCurrentVersion[_MAX_PATH],
+ szCurrentVersionIniSection[_MAX_PATH];
+ BOOL bResult = FALSE;
+ int nPathSize;
+
+ assert(lpBuff);
+ if (lpBuff)
+ {
+ // get current version, if not found, use default: INI_NS_CURRVER_DEFLT
+ nPathSize = ::GetPrivateProfileString(INI_NAVIGATOR_SECTION, INI_CURRENTVERSION_KEY,
+ INI_NS_CURRVER_DEFLT, szCurrentVersion, _MAX_PATH, INI_NETSCAPE_FILE);
+ assert(nPathSize);
+
+ if (nPathSize > 0)
+ {
+ // build section name "Netscape Navigator-xxx" where xxx == current version
+ strcpy(szCurrentVersionIniSection, INI_NS_APPNAME_PREFIX);
+ strcat(szCurrentVersionIniSection, szCurrentVersion);
+
+ // get program group name
+ nPathSize = ::GetPrivateProfileString(szCurrentVersionIniSection, INI_NS_PROGGRPNAME_KEY,
+ INI_NS_PROGGRPNAME_DEFLT, lpBuff, _MAX_PATH, INI_NETSCAPE_FILE);
+
+ // if failed to get path, then use default path
+ if (nPathSize == 0 || strlen(lpBuff) == 0)
+ strcpy(lpBuff, INI_NS_INSTALLDIR_DEFLT);
+
+ strcpy(g_szNavProgramFolderName, lpBuff); // save install path
+ bResult = TRUE;
+ }
+ }
+
+ assert(bResult);
+ return bResult;
+}
+
+//////////////////////////////////////////////////////////////////
+// Get Shiva SR connection file path name base on an connection (account) name.
+// path name is copied into csFilePath
+// return TRUE if successful
+//////////////////////////////////////////////////////////////////
+BOOL GetConnectionFilePath(LPCSTR AccountName, TCHAR* csFilePath, BOOL bIncludePath)
+{
+ char szIniPath[_MAX_PATH], // path to Shiva's install path with Shiva INI files
+ szIniFName[20], // Shiva's INI file name
+ szFilePath[_MAX_PATH], // path to Shiva's INI file
+ szTemplate[_MAX_PATH], // template for searching sr files
+ szEntryFName[_MAX_PATH]; // entry file name
+
+ // sample of Shiva's section in win.ini:
+ // [ConnectW Config]
+ // preferred file=sremote.ini
+ // sremote.ini=C:\Netscape\program
+
+ BOOL bResult = GetShivaInstallPath(szIniPath);
+
+ strcat(szIniPath, "\\"); // (c:\netscape\program\)
+ strcpy(szFilePath, szIniPath); // (c:\netscape\program\)
+ strcpy(szTemplate, szFilePath);
+ strcat(szTemplate, SR_ALL_CONNFILES);// (c:\netscape\program\*.sr)
+ strcat(szIniPath, szIniFName); // (c:\netscape\program\sremote.ini)
+
+ // find connection file name for the entry
+ struct _find_t c_file;
+ long hFile;
+ BOOL bEntryFound = FALSE;
+ if ((hFile = _dos_findfirst(szTemplate, _A_NORMAL, &c_file)) == 0)
+ {
+ do // seek thru connection files to match entry name
+ {
+ char szCurrEntryName[RAS_MaxEntryName];
+
+ strcpy(szEntryFName, szFilePath); // (c:\netscape\program\)
+ strcat(szEntryFName, c_file.name); // (c:\netscape\program\current.sr)
+
+ // get Shiva entry description (name)
+ int nResult = GetPrivateProfileString("Dial-In Configuration", "Description", "",
+ szCurrEntryName, RAS_MaxEntryName, szEntryFName);
+
+ // match?
+ if ((!strcmpi(szCurrEntryName, AccountName)) || (strstr(szCurrEntryName, AccountName)))
+ {
+ bEntryFound = TRUE;
+ if (!bIncludePath)
+ strcpy(szEntryFName, c_file.name);
+ }
+ } while (!bEntryFound && (_dos_findnext(&c_file) == 0));
+ }
+
+ strcpy(csFilePath, szEntryFName);
+
+ return bEntryFound;
+}
+
+
+//***************************************************************
+//***************************************************************
+// Helper Routines for editing program group items
+//***************************************************************
+//***************************************************************
+
+////////////////////////////////////////////////////////////////
+// DDE call back function
+////////////////////////////////////////////////////////////////
+HDDEDATA CALLBACK _export
+DdeCallback(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1,HSZ hsz2,
+ HDDEDATA hDDEData, DWORD dwData1, DWORD dwData2)
+{
+ return NULL; // nothing needs to be done here...
+}
+
+/////////////////////////////////////////////////////////////////
+// Sends the given command string to the Program Manager
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL SendShellCommand(DWORD ddeInst, LPCSTR lpszCommand)
+{
+ HSZ hszServTop;
+ HCONV hconv;
+ int nLen;
+ HDDEDATA hData;
+ DWORD dwResult;
+ BOOL bResult = FALSE;
+
+ // Create string handle to service/topic
+ hszServTop = DdeCreateStringHandle(ddeInst, "PROGMAN", CP_WINANSI);
+
+ // Attempt to start conversation with server app
+ if ((hconv = DdeConnect(ddeInst, hszServTop, hszServTop, NULL)) != NULL)
+ {
+ // Get length of the command string
+ nLen = strlen(lpszCommand);
+
+ // Send command to server app
+ hData = DdeClientTransaction((LPBYTE)lpszCommand, // data to pass
+ nLen + 1, // length of data
+ hconv, // handle of conversation
+ NULL, // handle of name-string
+ CF_TEXT, // clipboard format
+ XTYP_EXECUTE, // transaction type
+ 1000, // timeout duration
+ &dwResult); // points to transaction result
+ if (hData)
+ bResult = TRUE;
+
+ // End conversation
+ DdeDisconnect(hconv);
+ }
+
+ // Free service/topic string handle
+ DdeFreeStringHandle(ddeInst, hszServTop);
+
+ // Delay a little to give the shell time to acknowledge the termination
+// Sleep(DDE_WAIT_TIMER);
+
+ return bResult;
+}
+
+/////////////////////////////////////////////////////////////////
+// Add an item to an program group (caller should select active
+// destination program group prior to calling this function)
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL AddProgramItem(DWORD ddeInst, // DDE Instance
+ LPCSTR lpszItemPath, // command line arguement
+ LPCSTR lpszItemTitle, // program item title
+ LPCSTR lpszItemIconPath) // icon path
+{
+ BOOL bResult;
+ static char NEAR szBuf[1024];
+
+ if (lpszItemIconPath)
+ wsprintf(szBuf, "[AddItem(%s,%s,%s)]", lpszItemPath, lpszItemTitle, lpszItemIconPath);
+ else
+ wsprintf(szBuf, "[AddItem(%s,%s)]", lpszItemPath, lpszItemTitle);
+ bResult = SendShellCommand(ddeInst, szBuf);
+
+ assert(bResult);
+ return bResult;
+}
+
+/////////////////////////////////////////////////////////////////
+// Delete an item to an program group (caller should select active
+// destination program group prior to calling this function)
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL DeleteProgramItem(DWORD ddeInst, // DDE Instance
+ LPCSTR lpszItemTitle) // program item title
+{
+ BOOL bResult = TRUE;
+ static char NEAR szBuf[1024];
+
+ sprintf(szBuf, "[DeleteItem(%s)]", lpszItemTitle);
+ bResult = SendShellCommand(ddeInst, szBuf);
+
+ assert(bResult);
+
+ return bResult;
+}
+
+//////////////////////////////////////////////////////////////////
+// make a program group active
+//////////////////////////////////////////////////////////////////
+BOOL MakeActiveGroup(DWORD ddeInst, const char * lpszFolder)
+{
+ // Win3.x will not activate a group if the group is already restored.
+ // This is a workaround for the problem
+ char lpCommand[512];
+ sprintf(lpCommand, "[ShowGroup(%s, 2)][ShowGroup(%s, 1)]", lpszFolder, lpszFolder);
+ BOOL bResult = SendShellCommand(ddeInst, lpCommand);
+ assert(bResult);
+
+ return bResult;
+}
+
+///////////////////////////////////////////////////////////////////////
+// Add a program item to the StartUp program group
+///////////////////////////////////////////////////////////////////////
+BOOL AddProgramGroupItem(LPCSTR lpszProgramGroup, // program group name
+ LPCSTR lpszItemPath, // path of item to be added
+ LPCSTR lpszItemTitle, // program group item title
+ LPCSTR lpszItemIconPath) // program group item icon path
+{
+ DWORD ddeInst = 0;
+ UINT uDDEInit = DdeInitialize(&ddeInst, DdeCallback, APPCMD_CLIENTONLY, 0);
+
+ assert(uDDEInit == DMLERR_NO_ERROR);
+ BOOL bResult = FALSE;
+ if (uDDEInit == DMLERR_NO_ERROR)
+ {
+ // Make Netscape the active group
+ if (bResult = MakeActiveGroup(ddeInst, lpszProgramGroup))
+ {
+// Sleep(DDE_WAIT_TIMER);
+
+ // Create a program item instance for the Internet provider
+ bResult = AddProgramItem(ddeInst, lpszItemPath, lpszItemTitle,
+ lpszItemIconPath);
+
+// Sleep(DDE_WAIT_TIMER);
+ }
+
+ DdeUninitialize(ddeInst);
+ }
+
+ assert(bResult);
+
+ return bResult;
+}
+
+/////////////////////////////////////////////////////////////////
+// Delete a program item from a program group
+// return TRUE if successful
+/////////////////////////////////////////////////////////////////
+BOOL DeleteProgramGroupItem(LPCSTR lpszProgramGroup, // program group name
+ LPCSTR lpszItemTitle) // program group item title
+{
+ DWORD ddeInst = 0;
+ UINT uDDEInit = DdeInitialize(&ddeInst, DdeCallback, APPCMD_CLIENTONLY, 0);
+ assert(uDDEInit == DMLERR_NO_ERROR);
+
+ BOOL bResult;
+ if (uDDEInit)
+ {
+ // Make Netscape Personal Edition the active group
+ if (bResult = MakeActiveGroup(ddeInst, lpszProgramGroup))
+ {
+// Sleep(DDE_WAIT_TIMER);
+
+ // Create a program item instance for the Internet provider
+ DeleteProgramItem(ddeInst,lpszItemTitle);
+
+// Sleep(DDE_WAIT_TIMER);
+ }
+
+ DdeUninitialize(ddeInst);
+ }
+
+ assert(bResult);
+ return bResult;
+}
+
+/////////////////////////////////////////////////////////////////
+// construct a valid win16 name (filename or program item name)
+/////////////////////////////////////////////////////////////////
+void ParseWin16BadChar(char *pName, BOOL bFileName, int nMaxNameSize)
+{
+ if ((!pName && pName[0] == '\0') || !nMaxNameSize)
+ return;
+
+ // skip pathname if parsing filename
+ char *pFilename = pName;
+ if (bFileName)
+ {
+ char *pChar = strrchr(pName, '\\');
+ if (pChar)
+ pFilename = ++pChar;
+ }
+
+ // allocate buffer: filesize is 8.3 format, + null terminator
+ int nBufSize = bFileName ? (12 + 1) : (nMaxNameSize + 1);
+ char *temp = (char *) malloc(sizeof(char) * nBufSize);
+ memset(temp, '\0', nBufSize);
+
+ int nIndex = 0;
+ int nMax = (bFileName) ? 8 : nBufSize;
+ BOOL bDone = FALSE; // TRUE if all is parsed
+ for (int i = 0; i < nMax; i++)
+ {
+ if (pFilename[nIndex] == '\0') // hit the end, done...
+ {
+ bDone = TRUE;
+ break;
+ }
+
+ if (bFileName) // parsing file name
+ {
+ if (pFilename[nIndex] == '.') // hit end of filename
+ {
+ strncat(temp, &(pFilename[nIndex]), 4); // concatenate extension
+ bDone = TRUE;
+ break;
+ }
+ switch (pFilename[nIndex])
+ {
+ // skip bad filename chars
+ case ' ' : case '\'': case ',' : case '(' : case ';' :
+ case '\\': case '+' : case '=' : case '|' : case '[' :
+ case ']' : case '"' : case ':' : case '?' : case '*' :
+ case '>' : case '<' :
+ ++nIndex;
+ --i;
+ break;
+ default :
+ temp[i] = pFilename[nIndex++];
+ } // switch
+ }
+ else
+ {
+ switch (pFilename[nIndex])
+ {
+ // skip bad chars
+ case ',' : case '(' : case ';' : case '\\': case '+' :
+ case '=' : case '|' : case '[' : case ']' : case '"' :
+ case ':' : case '?' : case '*' : case '>' : case '<' :
+ ++nIndex;
+ --i;
+ break;
+ default :
+ temp[i] = pFilename[nIndex++];
+ } //switch()
+ } // else
+ } // for()
+
+ // for filenames: append extension if avail
+ if (!bDone && bFileName)
+ {
+ char *pTemp = strrchr(pFilename, '.');
+ if (pTemp)
+ strncat(temp, pTemp, 4);
+ }
+
+ strncpy(pFilename, temp, nBufSize);
+}
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/location.cpp b/mozilla/cmd/dialup/win/aswplugn/src/location.cpp
new file mode 100644
index 00000000000..dfbd78d7de8
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/location.cpp
@@ -0,0 +1,468 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#include
+#include "plugin.h"
+#include
+
+// resource include
+#ifdef WIN32
+#include "resource.h"
+#endif
+
+#define TAPI_VERSION 0x00010004
+
+//
+// The format of the entry is
+// LocationX=Y,"name","outside-line-local","outside-line-long-D","area-code",1,0,0,1,"",tone=0,"call-waiting-string"
+//
+typedef struct tapiLineStruct {
+ int nIndex;
+ char csLocationName[60];
+ char csOutsideLocal[20];
+ char csOutsideLongDistance[20];
+ char csAreaCode[20];
+ int nCountryCode;
+ int nCreditCard;
+ int nDunnoB;
+ int nDunnoC;
+ char csDialAsLongDistance[10];
+ int nPulseDialing;
+ char csCallWaiting[20];
+} tapiLine;
+
+
+extern BOOL getMsgString(char *buf, UINT uID);
+extern int DisplayErrMsg(char *text, int style);
+extern void FAR PASCAL lineCallbackFuncNT(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
+
+
+//********************************************************************************
+// GetInt
+//
+// Pull an int off the front of the string and return the new string ptr
+//********************************************************************************
+char * GetInt(char * pInString, int * pInt)
+{
+ char * pStr;
+ char buf[32];
+
+ if(!pInString) {
+ *pInt = 0;
+ return(NULL);
+ }
+
+ // copy the string over. This strchr should be smarter
+ pStr = strchr(pInString, ',');
+ if(!pStr) {
+ *pInt = 0;
+ return(NULL);
+ }
+
+ // convert the string
+ strncpy(buf, pInString, pStr - pInString);
+ buf[pStr - pInString] = '\0';
+ *pInt = atoi(buf);
+
+ // return the part after the int
+ return(pStr + 1);
+
+}
+
+
+
+
+//********************************************************************************
+// GetString
+//
+// Pull a string from the front of the incoming string and return
+// the first character after the string
+//********************************************************************************
+char * GetString(char * pInString, char *csString)
+{
+ csString[0] = '\0';
+ int i=0,x=0;
+ BOOL copy = FALSE;
+ char newpInString[MAX_PATH];
+
+ if(!pInString) {
+ csString = "";
+ return(NULL);
+ }
+
+ // skip over first quote
+ if(pInString[i] == '\"')
+ i++;
+
+ // copy over stuff by hand line a moron
+ while(pInString[i] != '\"') {
+ //strcat(csString, (char *)pInString[i]);
+ csString[x] = pInString[i];
+ i++;
+ x++;
+ copy = TRUE;
+ }
+
+ if (copy)
+ csString[x] = '\0';
+
+
+ // skip over the closing quote
+ if(pInString[i] == '\"')
+ i++;
+
+ // skip over the comma at the end
+ if(pInString[i] == ',')
+ i++;
+
+ newpInString[0]='\0';
+ x=0;
+ for (unsigned short j=i; jnIndex);
+ pString = GetString(pString, (char *)&line->csLocationName);
+ pString = GetString(pString, (char *)&line->csOutsideLocal);
+ pString = GetString(pString, (char *)&line->csOutsideLongDistance);
+ pString = GetString(pString, (char *)&line->csAreaCode);
+ pString = GetInt(pString, &line->nCountryCode);
+ pString = GetInt(pString, &line->nCreditCard);
+ pString = GetInt(pString, &line->nDunnoB);
+ pString = GetInt(pString, &line->nDunnoC);
+ pString = GetString(pString, (char *)&line->csDialAsLongDistance);
+ pString = GetInt(pString, &line->nPulseDialing);
+ pString = GetString(pString, (char *)&line->csCallWaiting);
+
+}
+
+
+
+//********************************************************************************
+// WriteLine
+//
+// Given a tapiLine structure write it out to telephon.ini
+//
+//********************************************************************************
+void WriteLine(char * lpszFile, int nLineNumber, tapiLine * line)
+{
+
+ char buffer[256];
+ sprintf(buffer, "%d,\"%s\",\"%s\",\"%s\",\"%s\",%d,%d,%d,%d,\"%s\",%d,\"%s\"",
+ line->nIndex,
+ (const char *) line->csLocationName,
+ (const char *) line->csOutsideLocal,
+ (const char *) line->csOutsideLongDistance,
+ (const char *) line->csAreaCode,
+ line->nCountryCode,
+ line->nCreditCard,
+ line->nDunnoB,
+ line->nDunnoC,
+ (const char *) line->csDialAsLongDistance,
+ line->nPulseDialing,
+ (const char *) line->csCallWaiting);
+
+ char pLocation[32];
+ sprintf(pLocation, "Location%d", nLineNumber);
+ ::WritePrivateProfileString("Locations", pLocation, buffer, lpszFile);
+
+}
+
+
+
+//********************************************************************************
+// SetLocationInfo
+//
+// sets the location info for win95 dialers
+//
+// The format of the entry is
+// LocationX=Y,"name","outside-line-local","outside-line-long-D","area-code",1,0,0,1,"",tone=0,"call-waiting-string"
+//
+//********************************************************************************
+BOOL SetLocationInfo(ACCOUNTPARAMS account, LOCATIONPARAMS location)
+{
+
+ // first read information from telephon.ini
+ char buf[256];
+
+ // get windows directory
+ char lpszDir[MAX_PATH];
+ if(GetWindowsDirectory(lpszDir, MAX_PATH) == 0)
+ return -1;
+
+ strcat(lpszDir, "\\telephon.ini");
+
+ // now we build new line information based on the old one and some info
+ // see if there were any locations to begin with
+ ::GetPrivateProfileString("Locations", "CurrentLocation", "", buf, sizeof(buf), lpszDir);
+ if(buf[0] == '\0') {
+
+ // build the string
+ tapiLine line;
+ line.nIndex = 0;
+ strcpy(line.csLocationName, "Default Location");
+ strcpy(line.csOutsideLocal, location.OutsideLineAccess);
+ strcpy(line.csOutsideLongDistance, location.OutsideLineAccess);
+ strcpy(line.csAreaCode, location.UserAreaCode);
+ line.nCountryCode = location.UserCountryCode;
+ line.nCreditCard = 0;
+ line.nDunnoB = 0;
+ line.nDunnoC = 1;
+
+ if (location.DialAsLongDistance == TRUE) {
+ strcpy(line.csDialAsLongDistance, "528");
+ } else {
+ strcpy(line.csDialAsLongDistance, "");
+ }
+ line.nPulseDialing = (location.DialType == 0 ? 1 : 0);
+ if(location.DisableCallWaiting)
+ strcpy(line.csCallWaiting, location.DisableCallWaitingCode);
+ else
+ strcpy(line.csCallWaiting, "");
+
+ WriteLine(lpszDir, 0, &line);
+
+ // need to create a whole location section
+ ::WritePrivateProfileString("Locations", "CurrentLocation", "0,0", lpszDir);
+ ::WritePrivateProfileString("Locations", "Locations", "1,1", lpszDir);
+ ::WritePrivateProfileString("Locations", "Inited", "1", lpszDir);
+
+ }
+ else {
+
+ int nId, nCount;
+ sscanf(buf, "%d,%d", &nId, &nCount);
+
+ // read the line
+ tapiLine line;
+ ReadLine(lpszDir, nId, &line);
+
+ strcpy(line.csOutsideLocal, location.OutsideLineAccess);
+ strcpy(line.csOutsideLongDistance, location.OutsideLineAccess);
+ if(location.DisableCallWaiting)
+ strcpy(line.csCallWaiting, location.DisableCallWaitingCode);
+ else
+ strcpy(line.csCallWaiting, "");
+
+ line.nPulseDialing = (location.DialType == 0 ? 1 : 0);
+
+ if(strcmp(location.UserAreaCode, "") != 0)
+ strcpy(line.csAreaCode, location.UserAreaCode);
+
+ if (location.DialAsLongDistance == TRUE) {
+ strcpy(line.csDialAsLongDistance, "528");
+ } else {
+ strcpy(line.csDialAsLongDistance, "");
+ }
+
+ // write the line back out
+ WriteLine(lpszDir, nId, &line);
+
+ }
+
+ return TRUE;
+}
+
+
+//********************************************************************************
+// SetLocationInfo
+//
+// sets the location info for winNT dialers
+//********************************************************************************
+BOOL SetLocationInfoNT(ACCOUNTPARAMS account, LOCATIONPARAMS location)
+{
+
+ LINEINITIALIZEEXPARAMS m_LineInitExParams;
+ HLINEAPP m_LineApp;
+ DWORD dwNumDevs;
+ LINETRANSLATECAPS m_LineTranslateCaps;
+
+ DWORD dwApiVersion = 0x00020000;
+
+
+ // Initialize TAPI. in order to get current location ID
+ m_LineInitExParams.dwOptions = LINEINITIALIZEEXOPTION_USEEVENT;
+ m_LineInitExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS);
+ m_LineInitExParams.dwNeededSize = sizeof(LINEINITIALIZEEXPARAMS);
+
+
+ if (lineInitialize(&m_LineApp, DLLinstance, lineCallbackFuncNT, NULL, &dwNumDevs) != 0) {
+ char buf[255];
+ if (getMsgString(buf, IDS_NO_TAPI))
+ DisplayErrMsg(buf, MB_OK | MB_ICONEXCLAMATION);
+
+ return FALSE;
+ }
+
+ m_LineTranslateCaps.dwTotalSize = sizeof(LINETRANSLATECAPS);
+ m_LineTranslateCaps.dwNeededSize = sizeof(LINETRANSLATECAPS);
+ if (lineGetTranslateCaps(m_LineApp, dwApiVersion, &m_LineTranslateCaps) != 0)
+ return FALSE;
+
+
+ //m_LineTranslateCaps.dwCurrentLocationID
+
+ // gets the location info from registry
+ HKEY hKey;
+ char *keyPath = (char *)malloc(sizeof(char) * 512);
+
+ assert(keyPath);
+ if (!keyPath)
+ return NULL;
+ strcpy(keyPath, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\locations");
+
+ // finds the user profile location in registry
+ if(ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyPath, NULL, KEY_ALL_ACCESS, &hKey))
+ return -1;
+
+ DWORD subKeys;
+ DWORD maxSubKeyLen;
+ DWORD maxClassLen;
+ DWORD values;
+ DWORD maxValueNameLen;
+ DWORD maxValueLen;
+ DWORD securityDescriptor;
+ FILETIME lastWriteTime;
+
+ // get some information about this reg key
+ if (ERROR_SUCCESS != RegQueryInfoKey(hKey, NULL, NULL, NULL, &subKeys, &maxSubKeyLen, &maxClassLen, &values, &maxValueNameLen, &maxValueLen, &securityDescriptor, &lastWriteTime))
+ return -2;
+
+
+ // now loop through the location keys to find the one that matches current location ID
+ if (subKeys > 0) {
+
+ DWORD subkeyNameSize = maxSubKeyLen + 1;
+ char subkeyName[20];
+
+ for (DWORD index=0; index
+#include "plugin.h"
+
+
+// windows include
+#ifdef WIN32 // ********************* Win32 includes **************************
+#include "resource.h" // win32 resource
+#include
+#else // ********************* Win16 includes **************************
+#include "asw16res.h" // win16 resource
+#include
+#include
+#include
+#include "shivaras.h" // Shiva RAS APIs
+#include "helper16.h"
+
+#define RAS16_DLLNAME "rasapi16.dll" // Shiva RAS DLL name
+#define MDMWZ16_DLLNAME "modemwiz.dll" // SHiva RAS Modem Wizard DLL name
+#endif // !WIN32
+
+#include
+#include "errmsg.h" // for DisplayErrMsg()
+
+// java include
+#include "netscape_npasw_SetupPlugin.h"
+#include "java_lang_String.h"
+
+JRIGlobalRef g_globalRefModemList = NULL;
+
+
+HINSTANCE m_hRasInst; // RAS DLL instance
+#ifndef WIN32
+HINSTANCE m_hShivaModemWizInst; // Shiva Modem Wizard DLL instance
+#endif
+
+RASSETENTRYPROPERTIES m_lpfnRasSetEntryProperties;
+RASGETCOUNTRYINFO m_lpfnRasGetCountryInfo;
+RASENUMDEVICES m_lpfnRasEnumDevices;
+RASGETENTRYPROPERTIES m_lpfnRasGetEntryProperties;
+RASVALIDATEENTRYNAME m_lpfnRasValidateEntryName;
+RASDELETEENTRY m_lpfnRasDeleteEntry;
+
+#ifndef WIN32 // ***************** WIN16 ************************
+RASDIAL g_lpfnRasDial;
+RASGETERRORSTRING g_lpfnRasGetErrorString;
+RASHANGUP g_lpfnRasHangUp;
+RASENUMCONNECTIONS g_lpfnRasEnumConnections;
+RASSETENTRYDIALPARAMS g_lpfnRasSetEntryDialParams;
+
+// Shiva RAS extension APIs
+SRSETUPMODEMWIZARD g_lpfnSetupModemWizard;
+SRSETDEVICEINFO g_lpfnSetDeviceInfo;
+SRSETDIALONDEMANDINFO g_lpfnSetDialOnDemandInfo;
+SRSETCOMPRESSIONINFO g_lpfnSetCompressionInfo;
+SRSETDIALSTRINGINFO g_lpfnSetDialStringInfo;
+SRSETCONNECTIONINFO g_lpfnSetConnectionInfo;
+#endif
+
+#ifdef WIN32
+// for NT40
+RASSETAUTODIALENABLE m_lpfnRasSetAutodialEnable;
+RASSETAUTODIALADDRESS m_lpfnRasSetAutodialAddress;
+RASSETAUTODIALPARAM m_lpfnRasSetAutodialParam;
+RASSETCREDENTIALS m_lpfnRasSetCredentials;
+#endif
+
+extern const char *GetStringPlatformChars(JRIEnv *env, struct java_lang_String *string);
+
+#ifdef WIN32
+char **ModemList = NULL;
+int ModemListLen = 0;
+#else
+char g_szAddedModem[256] = { '\0' };
+#endif
+
+#ifdef WIN32 // ***************************** WIN32 ******************************
+
+//********************************************************************************
+//
+// LoadRasFunctions()
+//
+// Used by NPP_Initialize() to Load Proper RAS DLL for Win95 & Win3.x
+//
+//********************************************************************************
+BOOL LoadRasFunctions(LPCSTR lpszLibrary)
+{
+ m_hRasInst = ::LoadLibrary(lpszLibrary);
+ if (m_hRasInst) {
+ if ((m_lpfnRasSetEntryProperties = (RASSETENTRYPROPERTIES)::GetProcAddress(m_hRasInst,
+ "RasSetEntryProperties")) &&
+ (m_lpfnRasGetCountryInfo = (RASGETCOUNTRYINFO)::GetProcAddress(m_hRasInst,
+ "RasGetCountryInfo")) &&
+ (m_lpfnRasEnumDevices = (RASENUMDEVICES)::GetProcAddress(m_hRasInst,
+ "RasEnumDevices")) &&
+ (m_lpfnRasGetEntryProperties = (RASGETENTRYPROPERTIES)::GetProcAddress(m_hRasInst,
+ "RasGetEntryProperties")) &&
+ (m_lpfnRasValidateEntryName = (RASVALIDATEENTRYNAME)::GetProcAddress(m_hRasInst,
+ "RasValidateEntryName")) &&
+ (m_lpfnRasDeleteEntry = (RASDELETEENTRY)::GetProcAddress(m_hRasInst,
+ "RasDeleteEntry")))
+ return TRUE;
+ else
+ ::FreeLibrary(m_hRasInst);
+ }
+
+ m_hRasInst = NULL;
+ return FALSE;
+}
+
+//********************************************************************************
+//
+// LoadRasFunctionsNT()
+//
+// Used by NPP_Initialize() to Load Proper RAS DLL for WinNT
+//
+//********************************************************************************
+BOOL LoadRasFunctionsNT(LPCSTR lpszLibrary)
+{
+ m_hRasInst = ::LoadLibrary(lpszLibrary);
+ if (m_hRasInst) {
+ m_lpfnRasSetEntryProperties = (RASSETENTRYPROPERTIES)::GetProcAddress(m_hRasInst,
+ "RasSetEntryPropertiesA");
+
+ if (m_lpfnRasSetEntryProperties) {
+
+ m_lpfnRasGetCountryInfo = (RASGETCOUNTRYINFO)::GetProcAddress(m_hRasInst,
+ "RasGetCountryInfoA");
+ m_lpfnRasEnumDevices = (RASENUMDEVICES)::GetProcAddress(m_hRasInst, "RasEnumDevicesA");
+ m_lpfnRasGetEntryProperties = (RASGETENTRYPROPERTIES)::GetProcAddress(m_hRasInst,
+ "RasGetEntryPropertiesA");
+ m_lpfnRasValidateEntryName = (RASVALIDATEENTRYNAME)::GetProcAddress(m_hRasInst,
+ "RasValidateEntryNameA");
+ m_lpfnRasDeleteEntry = (RASDELETEENTRY)::GetProcAddress(m_hRasInst,
+ "RasDeleteEntryA");
+
+ // for NT40
+ m_lpfnRasSetAutodialEnable = (RASSETAUTODIALENABLE)::GetProcAddress(m_hRasInst,
+ "RasSetAutodialEnableA");
+ m_lpfnRasSetAutodialAddress = (RASSETAUTODIALADDRESS)::GetProcAddress(m_hRasInst,
+ "RasSetAutodialAddressA");
+ m_lpfnRasSetCredentials = (RASSETCREDENTIALS)::GetProcAddress(m_hRasInst,
+ "RasSetCredentialsA");
+ m_lpfnRasSetAutodialParam = (RASSETAUTODIALPARAM)::GetProcAddress(m_hRasInst,
+ "RasSetAutodialParamA");
+
+ return TRUE;
+ } else {
+ ::FreeLibrary(m_hRasInst);
+ }
+ }
+
+ m_hRasInst = NULL;
+ return FALSE;
+}
+
+#else // ***************************** WIN16 ******************************
+
+//********************************************************************************
+// LoadRas16Functions()
+//
+// Used by NPP_Initialize() to Load Proper Shiva RAS APIs Win3.x
+//********************************************************************************
+BOOL LoadRas16Functions()
+{
+ TCHAR szInstallPath[255], szLibPath[255];
+ BOOL bGetInstallPath = GetShivaInstallPath(szInstallPath);
+ assert(bGetInstallPath);
+
+ if (!bGetInstallPath) // abort if failed to find install path
+ return FALSE;
+
+ // construct path for Shiva CommModule RAS libraries to be loaded
+ strcpy(szLibPath, szInstallPath);
+ strcat(szLibPath, "\\");
+ int nEndPath = strlen(szLibPath);
+
+ strcat(szLibPath, RAS16_DLLNAME);
+ m_hRasInst = ::LoadLibrary(szLibPath);
+
+ strcpy(szLibPath, szInstallPath);
+ strcat(szLibPath, "\\");
+ strcat(szLibPath, MDMWZ16_DLLNAME);
+ m_hShivaModemWizInst = ::LoadLibrary(szLibPath);
+
+ BOOL bRasLibLoaded = ((UINT)m_hRasInst >= 32),
+ bModemWizLoaded = ((UINT)m_hShivaModemWizInst >= 32);
+
+ if (bRasLibLoaded && bModemWizLoaded)
+ {
+ BOOL bGotProc; // TRUE if all procedures are succesfully loaded
+ bGotProc = (m_lpfnRasSetEntryProperties = (RASSETENTRYPROPERTIES)::GetProcAddress(m_hRasInst, "RasSetEntryProperties")) &&
+ (m_lpfnRasEnumDevices = (RASENUMDEVICES)::GetProcAddress(m_hRasInst, "RasEnumDevices")) &&
+ (m_lpfnRasGetEntryProperties = (RASGETENTRYPROPERTIES)::GetProcAddress(m_hRasInst, "RasEnumEntries")) &&
+ (m_lpfnRasGetCountryInfo = (RASGETCOUNTRYINFO)::GetProcAddress(m_hRasInst, "RasGetCountryInfo")) &&
+ (m_lpfnRasValidateEntryName = (RASVALIDATEENTRYNAME)::GetProcAddress(m_hRasInst, "RasValidateEntryNameA")) &&
+ (m_lpfnRasDeleteEntry = (RASDELETEENTRY)::GetProcAddress(m_hRasInst, "RasDeleteEntry"))&&
+ (g_lpfnRasDial = (RASDIAL)::GetProcAddress(m_hRasInst, "RasDial")) &&
+ (g_lpfnRasSetEntryDialParams = (RASSETENTRYDIALPARAMS)::GetProcAddress(m_hRasInst, "RasSetEntryDialParams")) &&
+ (g_lpfnRasGetErrorString = (RASGETERRORSTRING)::GetProcAddress(m_hRasInst, "RasGetErrorString")) &&
+ (g_lpfnRasHangUp = (RASHANGUP)::GetProcAddress(m_hRasInst, "RasHangUp")) &&
+ (g_lpfnRasEnumConnections = (RASENUMCONNECTIONS)::GetProcAddress(m_hRasInst, "RasEnumConnections")) &&
+
+ // Shiva RAS extension
+ (g_lpfnSetupModemWizard = (SRSETUPMODEMWIZARD)::GetProcAddress(m_hShivaModemWizInst, "SetupModemWizard")) &&
+ (g_lpfnSetDeviceInfo = (SRSETDEVICEINFO)::GetProcAddress(m_hRasInst, "SetDeviceInfo")) &&
+ (g_lpfnSetDialOnDemandInfo = (SRSETDIALONDEMANDINFO)::GetProcAddress(m_hRasInst, "SetDialOnDemandInfo")) &&
+ (g_lpfnSetCompressionInfo = (SRSETCOMPRESSIONINFO)::GetProcAddress(m_hRasInst, "SetCompressionInfo")) &&
+ (g_lpfnSetDialStringInfo = (SRSETDIALSTRINGINFO)::GetProcAddress(m_hRasInst, "SetDialStringInfo")) &&
+ (g_lpfnSetConnectionInfo = (SRSETCONNECTIONINFO)::GetProcAddress(m_hRasInst, "SetConnectionInfo"));
+
+ if (bGotProc)
+ return TRUE;
+ }
+
+ // free loaded libs
+ if (bRasLibLoaded)
+ ::FreeLibrary(m_hRasInst);
+ if (bModemWizLoaded)
+ ::FreeLibrary(m_hShivaModemWizInst);
+
+ // failed to load ShivaRemote DLLs
+ return FALSE;
+}
+#endif // !WIN32
+
+
+static const char c_szModemCPL[] = "rundll32.exe Shell32.dll,Control_RunDLL modem.cpl,,add";
+
+//********************************************************************************
+// native method:
+//
+// OpenModemWizard
+//
+// Runs the Modem Wizard (in this case the Win95 MdmWiz, and waits for conclusion)
+//********************************************************************************
+
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fOpenModemWizard(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin)
+{
+#ifdef WIN32 //****************************** WIN32 ***************************
+ PROCESS_INFORMATION pi;
+ BOOL fRet;
+ STARTUPINFO sti;
+ UINT err = ERROR_SUCCESS;
+
+ memset(&sti,0,sizeof(sti));
+ sti.cb = sizeof(STARTUPINFO);
+
+ // BUGBUG-- need to check to make sure modem CPL is not already running,
+ // bag out if that's the case
+
+ // Run the modem wizard
+ fRet = CreateProcess(NULL, (LPSTR)c_szModemCPL,
+ NULL, NULL, FALSE, 0, NULL, NULL, &sti, &pi);
+
+ if (!fRet)
+ err = GetLastError();
+ else {
+ CloseHandle(pi.hThread);
+
+ // Wait for the modem wizard process to complete
+ WaitForSingleObject(pi.hProcess,INFINITE);
+ CloseHandle(pi.hProcess);
+ }
+#else //*********************************** WIN16 *******************************
+ assert(g_lpfnSetupModemWizard);
+ if (!g_lpfnSetupModemWizard)
+ return;
+
+ DWORD dwResult;
+
+ CSETUPMODEMPARAMS setup_modem_param;
+ memset( &setup_modem_param, 0, sizeof( CSETUPMODEMPARAMS));
+
+ // get & set new modem via Modem Wizard...
+ BOOL bResult;
+ if (bResult = (*g_lpfnSetupModemWizard)(GetActiveWindow(), &setup_modem_param))
+ {
+ dwResult = (*g_lpfnSetDeviceInfo)(&setup_modem_param);
+ if (dwResult == 0)
+ strcpy(g_szAddedModem, setup_modem_param.szModemType);
+ else
+ g_szAddedModem[0] = '0';
+ }
+
+#endif // WIN32
+
+#if 0
+ //
+ // Update Win9x's internal structures so everyone knows about the modem
+ //
+ FinishModemConfiguration();
+#endif
+}
+
+
+//********************************************************************************
+// native method:
+//
+// IsModemWizardOpen
+//
+// Returns FALSE (modem wiz is always finished by return of StartModemWizard())
+//********************************************************************************
+extern JRI_PUBLIC_API(jbool)
+native_netscape_npasw_SetupPlugin_SECURE_0005fIsModemWizardOpen(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin)
+{
+ return(FALSE);
+}
+
+
+//********************************************************************************
+// native method:
+//
+// CloseModemWizard
+//
+// Don't do anything? (may be able to force close of ModemWiz - need to check)
+//********************************************************************************
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fCloseModemWizard(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin)
+{
+ return;
+}
+
+
+//********************************************************************************
+// native method:
+//
+// GetModemList (s/b GetModems)
+//
+// Returns list of modems available for use ('installed' by the user). For Win95
+// this list come from the OS, and each entry contains 2 strings - the first is
+// the Modem Name, and the second is the device type (both are needed to select
+// the device to use to make a Dial-up connection).
+//********************************************************************************
+extern JRI_PUBLIC_API(jref)
+native_netscape_npasw_SetupPlugin_SECURE_0005fGetModemList(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* ThisPlugin)
+{
+ if (!m_lpfnRasEnumDevices)
+ return NULL;
+
+ DWORD dwBytes = 0, dwDevices = 0;
+ LPRASDEVINFO lpRnaDevInfo;
+ struct java_lang_String *value = NULL;
+
+ // First find out how much memory to allocate
+ DWORD dwResult = (*m_lpfnRasEnumDevices)(NULL, &dwBytes, &dwDevices);
+
+ // no devices configured, return
+ if (dwBytes == 0)
+ return NULL;
+
+ lpRnaDevInfo = (LPRASDEVINFO)malloc((size_t) dwBytes);
+
+ if (!lpRnaDevInfo)
+ {
+ return NULL;
+ }
+
+ lpRnaDevInfo->dwSize = stRASDEVINFO;
+
+ // now get the # devices..
+ dwResult = (*m_lpfnRasEnumDevices)(lpRnaDevInfo, &dwBytes, &dwDevices);
+ assert(dwResult == 0);
+
+ // Allocate JavaScript array to store modem list
+ void *resultModemArray = JRI_NewObjectArray(env, dwDevices, class_java_lang_String(env), NULL);
+ if (NULL == resultModemArray)
+ return NULL;
+
+ // lock the JRI array reference, dispose old reference if necessary
+ if (g_globalRefModemList)
+ JRI_DisposeGlobalRef(env, g_globalRefModemList);
+ g_globalRefModemList=JRI_NewGlobalRef(env, resultModemArray);
+
+#ifdef WIN32
+
+ if (!ModemList) {
+
+ // allocate array to store modem lists
+
+ ModemList = (char **)malloc(sizeof(char *) * dwDevices);
+ ModemListLen = dwDevices;
+
+ if (!ModemList)
+ return NULL;
+
+ } else {
+
+ //free the old ModemList, and allocate new one
+
+ for (int i=0; idwSize = stRASDEVINFO;
+
+ (*m_lpfnRasEnumDevices)(lpRnaDevInfo, &dwBytes, &dwDevices);
+
+ // Convert modem type to 'C' string
+ if (JSModemName != NULL)
+ modem_name = GetStringPlatformChars(env, JSModemName);
+
+ // If match the modem given from JS then return the associated Type
+ for (unsigned short i=0; idwSize = stRASDEVINFO;
+
+ // now get the # devices..
+ dwResult = (*m_lpfnRasEnumDevices)(lpRnaDevInfo, &dwBytes, &dwDevices);
+ assert(dwResult == 0);
+
+ if (dwDevices > 0) {
+
+ if (!NewModemList) {
+ NewModemList = (char **)malloc((size_t)(sizeof(char *) * dwDevices));
+ if (!NewModemList)
+ return NULL;
+ }
+
+ *NewModemListLen = (int) dwDevices;
+
+ for (unsigned short i=0; i 0)
+ {
+ struct java_lang_String *modem = JRI_NewStringPlatform(env, g_szAddedModem, strlen(g_szAddedModem), NULL, 0);
+ return modem;
+ }
+ return (NULL);
+#endif
+}
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/nodl.cpp b/mozilla/cmd/dialup/win/aswplugn/src/nodl.cpp
new file mode 100644
index 00000000000..3b25d3f69dc
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/nodl.cpp
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+//*****************************************************************************
+// nodl.cpp
+//
+// Adding a NODL table
+//
+//
+// This module generates the nodl_table containing ALL java native methods.
+// This table is used by NSPR when looking up symbols in the DLL.
+//
+// Since Win16 GetProcAddress() is NOT case-sensitive, it is necessary to
+// use the nodl table to maintain the case-sensitive java native method names...
+//
+//*****************************************************************************
+
+
+// java include
+#include "netscape_npasw_SetupPlugin.h"
+
+//****************************************************************
+// adding NODL Table
+//****************************************************************
+
+struct PRStaticLinkTableStr {
+ char *name;
+ void (*fp)(void);
+};
+
+typedef struct PRStaticLinkTableStr PRStaticLinkTable;
+extern "C" PRStaticLinkTable FAR awt_nodl_tab[];
+
+extern "C" PRStaticLinkTable * CALLBACK __export __loadds NODL_TABLE(void)
+{
+ return awt_nodl_tab;
+}
+
+
+extern "C"
+{
+// file I/O
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetNameValuePair_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fSetNameValuePair_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetFolderContents_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetExternalEditor_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fOpenFileWithEditor_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fSaveTextToFile_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fReadFile_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fWriteFile_stub();
+
+// Modem/RAS
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fOpenModemWizard_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fIsModemWizardOpen_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fCloseModemWizard_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetModemList_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetModemType_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentModemName_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerConfig_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerConnect_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerHangup_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fIsDialerConnected_stub();
+
+// Desktop/OS
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fNeedReboot_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fReboot_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fDesktopConfig_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fSetKiosk_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fMilan_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fCheckEnvironment_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fQuitNavigator_stub();
+
+// Profile
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileDirectory_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileName_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fSetCurrentProfileName_stub();
+
+// Misc
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fGetRegInfo_stub();
+extern void Java_netscape_npasw_SetupPlugin_SECURE_0005fEncryptString_stub();
+
+
+PRStaticLinkTable FAR awt_nodl_tab[] =
+{
+ // file I/O
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetNameValuePair_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetNameValuePair_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fSetNameValuePair_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fSetNameValuePair_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetFolderContents_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetFolderContents_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetExternalEditor_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetExternalEditor_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fOpenFileWithEditor_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fOpenFileWithEditor_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fSaveTextToFile_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fSaveTextToFile_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fReadFile_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fReadFile_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fWriteFile_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fWriteFile_stub } ,
+
+ // Modem/RAS
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fOpenModemWizard_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fOpenModemWizard_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fIsModemWizardOpen_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fIsModemWizardOpen_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fCloseModemWizard_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fCloseModemWizard_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetModemList_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetModemList_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetModemType_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetModemType_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentModemName_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentModemName_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerConfig_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerConfig_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerConnect_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerConnect_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerHangup_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fDialerHangup_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fIsDialerConnected_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fIsDialerConnected_stub } ,
+
+ // Desktop/OS
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fNeedReboot_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fNeedReboot_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fReboot_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fReboot_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fDesktopConfig_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fDesktopConfig_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fSetKiosk_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fSetKiosk_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fMilan_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fMilan_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fCheckEnvironment_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fCheckEnvironment_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fQuitNavigator_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fQuitNavigator_stub } ,
+
+ // Profile
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileDirectory_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileDirectory_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileName_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileName_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fSetCurrentProfileName_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fSetCurrentProfileName_stub } ,
+
+ // Miscel
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fGetRegInfo_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fGetRegInfo_stub } ,
+ {"Java_netscape_npasw_SetupPlugin_SECURE_0005fEncryptString_stub", Java_netscape_npasw_SetupPlugin_SECURE_0005fEncryptString_stub } ,
+};
+} // extern "C"
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/npwin.cpp b/mozilla/cmd/dialup/win/aswplugn/src/npwin.cpp
new file mode 100644
index 00000000000..a046b61a304
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/npwin.cpp
@@ -0,0 +1,331 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+/* npwin.cpp */
+
+//\\// INCLUDE
+
+// netscape
+#ifndef _NPAPI_H_
+#include "npapi.h"
+#endif
+#ifndef _NPUPP_H_
+#include "npupp.h"
+#endif
+
+//\\// DEFINE
+#ifdef WIN32
+ #define NP_EXPORT //__declspec( dllexport )
+#else
+ #define NP_EXPORT _export
+#endif
+
+//\\// GLOBAL DATA
+NPNetscapeFuncs* g_pNavigatorFuncs = NULL;
+//JRIGlobalRef Private_GetJavaClass(void);
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// Private_GetJavaClass (global function)
+//
+// Given a Java class reference (thru NPP_GetJavaClass) inform JRT
+// of this class existence
+//
+JRIGlobalRef
+Private_GetJavaClass(void)
+{
+ jref clazz = NPP_GetJavaClass();
+ if (clazz) {
+ JRIEnv* env = NPN_GetJavaEnv();
+ return JRI_NewGlobalRef(env, clazz);
+ }
+ return NULL;
+}
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// PLUGIN DLL entry points
+//
+// These are the Windows specific DLL entry points. They must be exoprted
+//
+
+// we need these to be global since we have to fill one of its field
+// with a data (class) which requires knowlwdge of the navigator
+// jump-table. This jump table is known at Initialize time (NP_Initialize)
+// which is called after NP_GetEntryPoint
+static NPPluginFuncs* g_pluginFuncs;
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// NP_GetEntryPoints
+//
+// fills in the func table used by Navigator to call entry points in
+// plugin DLL. Note that these entry points ensure that DS is loaded
+// by using the NP_LOADDS macro, when compiling for Win16
+//
+NPError WINAPI NP_EXPORT
+NP_GetEntryPoints(NPPluginFuncs* pFuncs)
+{
+ // trap a NULL ptr
+ if(pFuncs == NULL)
+ return NPERR_INVALID_FUNCTABLE_ERROR;
+
+ // if the plugin's function table is smaller than the plugin expects,
+ // then they are incompatible, and should return an error
+
+ pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
+ pFuncs->newp = NPP_New;
+ pFuncs->destroy = NPP_Destroy;
+ pFuncs->setwindow = NPP_SetWindow;
+ pFuncs->newstream = NPP_NewStream;
+ pFuncs->destroystream = NPP_DestroyStream;
+ pFuncs->asfile = NPP_StreamAsFile;
+ pFuncs->writeready = NPP_WriteReady;
+ pFuncs->write = NPP_Write;
+ pFuncs->print = NPP_Print;
+ pFuncs->event = 0; /// reserved
+
+ g_pluginFuncs = pFuncs;
+
+ return NPERR_NO_ERROR;
+}
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// NP_Initialize
+//
+// called immediately after the plugin DLL is loaded
+//
+NPError WINAPI NP_EXPORT
+NP_Initialize(NPNetscapeFuncs* pFuncs)
+{
+ // trap a NULL ptr
+ if(pFuncs == NULL)
+ return NPERR_INVALID_FUNCTABLE_ERROR;
+
+ g_pNavigatorFuncs = pFuncs; // save it for future reference
+
+ // if the plugin's major ver level is lower than the Navigator's,
+ // then they are incompatible, and should return an error
+ if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
+ return NPERR_INCOMPATIBLE_VERSION_ERROR;
+
+ // We have to defer these assignments until g_pNavigatorFuncs is set
+ int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+
+ if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+ g_pluginFuncs->urlnotify = NPP_URLNotify;
+ }
+
+ if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) {
+ g_pluginFuncs->javaClass = Private_GetJavaClass();
+ }
+
+ // NPP_Initialize is a standard (cross-platform) initialize function.
+ return NPP_Initialize();
+}
+
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+// NP_Shutdown
+//
+// called immediately before the plugin DLL is unloaded.
+// This functio shuold check for some ref count on the dll to see if it is
+// unloadable or it needs to stay in memory.
+//
+NPError WINAPI NP_EXPORT
+NP_Shutdown()
+{
+ NPP_Shutdown();
+ g_pNavigatorFuncs = NULL;
+ return NPERR_NO_ERROR;
+}
+
+// END - PLUGIN DLL entry points
+////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
+//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
+
+/* NAVIGATOR Entry points */
+
+/* These entry points expect to be called from within the plugin. The
+ noteworthy assumption is that DS has already been set to point to the
+ plugin's DLL data segment. Don't call these functions from outside
+ the plugin without ensuring DS is set to the DLLs data segment first,
+ typically using the NP_LOADDS macro
+*/
+
+/* returns the major/minor version numbers of the Plugin API for the plugin
+ and the Navigator
+*/
+void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
+{
+ *plugin_major = NP_VERSION_MAJOR;
+ *plugin_minor = NP_VERSION_MINOR;
+ *netscape_major = HIBYTE(g_pNavigatorFuncs->version);
+ *netscape_minor = LOBYTE(g_pNavigatorFuncs->version);
+}
+
+/* causes the specified URL to be fetched and streamed in
+*/
+NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData)
+
+{
+ int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+ if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+ err = g_pNavigatorFuncs->geturlnotify(instance, url, target, notifyData);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+
+NPError NPN_GetURL(NPP instance, const char *url, const char *target)
+{
+ return g_pNavigatorFuncs->geturl(instance, url, target);
+}
+
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
+{
+ int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+ if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+ err = g_pNavigatorFuncs->posturlnotify(instance, url, window, len, buf, file, notifyData);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+
+NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
+{
+ return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file);
+}
+
+/* Requests that a number of bytes be provided on a stream. Typically
+ this would be used if a stream was in "pull" mode. An optional
+ position can be provided for streams which are seekable.
+*/
+NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
+{
+ return g_pNavigatorFuncs->requestread(stream, rangeList);
+}
+
+/* Creates a new stream of data from the plug-in to be interpreted
+ by Netscape in the current window.
+*/
+NPError NPN_NewStream(NPP instance, NPMIMEType type,
+ const char* target, NPStream** stream)
+{
+ int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+
+ if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+ err = g_pNavigatorFuncs->newstream(instance, type, target, stream);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+/* Provides len bytes of data.
+*/
+int32 NPN_Write(NPP instance, NPStream *stream,
+ int32 len, void *buffer)
+{
+ int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+ int32 result;
+
+ if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+ result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
+ }
+ else {
+ result = -1;
+ }
+ return result;
+}
+
+/* Closes a stream object.
+reason indicates why the stream was closed.
+*/
+NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
+{
+ int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+ NPError err;
+
+ if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+ err = g_pNavigatorFuncs->destroystream(instance, stream, reason);
+ }
+ else {
+ err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+ return err;
+}
+
+/* Provides a text status message in the Netscape client user interface
+*/
+void NPN_Status(NPP instance, const char *message)
+{
+ g_pNavigatorFuncs->status(instance, message);
+}
+
+/* returns the user agent string of Navigator, which contains version info
+*/
+const char* NPN_UserAgent(NPP instance)
+{
+ return g_pNavigatorFuncs->uagent(instance);
+}
+
+/* allocates memory from the Navigator's memory space. Necessary so that
+ saved instance data may be freed by Navigator when exiting.
+*/
+
+
+void* NPN_MemAlloc(uint32 size)
+{
+ return g_pNavigatorFuncs->memalloc(size);
+}
+
+/* reciprocal of MemAlloc() above
+*/
+void NPN_MemFree(void* ptr)
+{
+ g_pNavigatorFuncs->memfree(ptr);
+}
+
+/* private function to Netscape. do not use!
+*/
+void NPN_ReloadPlugins(NPBool reloadPages)
+{
+ g_pNavigatorFuncs->reloadplugins(reloadPages);
+}
+
+JRIEnv* NPN_GetJavaEnv(void)
+{
+ return g_pNavigatorFuncs->getJavaEnv();
+}
+
+jref NPN_GetJavaPeer(NPP instance)
+{
+ return g_pNavigatorFuncs->getJavaPeer(instance);
+}
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/plugn32.def b/mozilla/cmd/dialup/win/aswplugn/src/plugn32.def
new file mode 100644
index 00000000000..52bff48b82b
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/plugn32.def
@@ -0,0 +1,27 @@
+; -*- Mode: Fundamental -*-
+; The contents of this file are subject to the Netscape Public License
+; Version 1.0 (the "NPL"); you may not use this file except in
+; compliance with the NPL. You may obtain a copy of the NPL at
+; http://www.mozilla.org/NPL/
+;
+; Software distributed under the NPL is distributed on an "AS IS" basis,
+; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+; for the specific language governing rights and limitations under the
+; NPL.
+;
+; The Initial Developer of this code under the NPL is Netscape
+; Communications Corporation. Portions created by Netscape are
+; Copyright (C) 1998 Netscape Communications Corporation. All Rights
+; Reserved.
+;
+LIBRARY NP32ASW
+
+CODE PRELOAD MOVEABLE DISCARDABLE
+DATA PRELOAD SINGLE
+
+HEAPSIZE 32000
+
+EXPORTS
+ NP_GetEntryPoints @1
+ NP_Initialize @2
+ NP_Shutdown @3
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/plugn32.rc b/mozilla/cmd/dialup/win/aswplugn/src/plugn32.rc
new file mode 100644
index 00000000000..dfa713817a4
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/plugn32.rc
@@ -0,0 +1,197 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+//
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904e4"
+ BEGIN
+ VALUE "CompanyName", "Netscape Communication Corporation\0"
+ VALUE "FileDescription", "Account Setup Plugin\0"
+ VALUE "FileExtents", "*|*\0"
+ VALUE "FileOpenName", "Setup Plugin (*.*)|Setup Plugin (*.*)\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "aswplugin\0"
+ VALUE "LegalCopyright", "Copyright © 1997\0"
+ VALUE "MIMEType", "application/x-netscape-autoconfigure-dialer|application/x-netscape-autoconfigure-dialer-v2\0"
+ VALUE "OriginalFilename", "np32asw.dll\0"
+ VALUE "ProductName", "NNPE Account Setup Plugin\0"
+ VALUE "ProductVersion", "1, 0, 0, 1\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END
+
+#endif // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_STATUS DIALOG DISCARDABLE 0, 0, 170, 55
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Account Setup"
+FONT 8, "MS Sans Serif"
+BEGIN
+ PUSHBUTTON "Cancel",IDCANCEL,60,34,50,14
+ LTEXT "Status:",IDC_STATIC,13,11,23,10
+ LTEXT "",IDC_DIAL_STATUS,41,11,111,18
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_APP_NAME "Account Setup"
+ IDS_NO_RAS_FUNCTIONS "Unable to dynamically load extended RAS functions!"
+ IDS_NO_DUN "Dial-Up Networking has not been installed on this machine; this product will not work until Dial-Up Networking is installed. Would you like to install Dial-Up Networking now?"
+ IDS_DNS_ALREADY "Your system is configured for another Domain Name System (DNS) server. You may need to change your Dial-Up Networking settings to connect to the Internet.\n\nPlease see the troubleshooting section of the Installation and Setup Guide for more information."
+ IDS_BAD_PASSWORD "Invalid pasword in Netscape registration file."
+ IDS_NO_RNA_REGSERVER "Unable to create RNA phone book entry!"
+ IDS_MISSING_AREA_CODE "The service provider's phone number is missing its area code (or is not in TAPI cannonical form in the configuration file). Account creation will fail until this is fixed."
+ IDS_NO_RNA "Unable to create shortcut to RNA phone book entry!"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_OUT_OF_MEMORY "The system is out of memory or resources."
+ IDS_INVALID_EXE "Unable to start the specified External Editor. It is not a valid executible program."
+ IDS_INVALID_FILE "The specified External Editor file was not found."
+ IDS_INVALID_PATH "The specified path for the External Editor is not valid."
+ IDS_NO_EDITOR "Unable to start the External Editor. Please check and make sure the file exists."
+ IDS_OPENING_PORT "Opening serial port..."
+ IDS_INIT_MODEM "Initializing modem..."
+ IDS_DIALING "Dialing..."
+ IDS_DIALING_OF "Dialing...\n%i of %i"
+ IDS_VERIFYING "Verifying user name and password..."
+ IDS_LOGGING_ON "Logging onto network..."
+ IDS_DISCONNECTING "Disconnecting..."
+ IDS_CONNECTED "Connection established."
+ IDS_NO_DIALTONE "No dial tone.\nMake sure your modem is connected to a phone line.."
+ IDS_LINE_BUSY "The phone number is busy. Please try\nagain later."
+ IDS_NO_ADMIN_PREMISSION "You do not have Administrator premission on this machine to intall Dial-Up Networking. Please make sure you have Administrator premission in order to install Dial-Up Networking first before running Account Setup."
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_REGGIE_PROGITEM_NAME "Registration Server"
+ IDS_SECURITY_RISK_WARNING
+ "SECURITY WARNING!\n\nAccount Setup has the ability to read and write files on your computer,\nconfigure dialing, networking and modem information.\n\nClick OK to allow Account Setup to operate in this manner.\nOtherwise, click CANCEL to exit this application."
+ IDS_CONNECTION_FAILED "Failed to connect due to following error:\n"
+ IDS_DIAL_ERR "ERROR! Connection failed."
+ IDS_CANCELDIAL "Cancel modem connection..."
+ IDS_NO_DUN_INSTALLED "Account Setup will not work without Dial-Up Networking installed. Please install Dial-Up Networking first before running Account Setup."
+ IDS_NO_DUN_NT "Dial-Up Networking has not been installed on this machine; this product will not work until Dial-Up Networking is installed. Pleas install Dial-Up Networking before running Accout Setup."
+ IDS_NO_TAPI "Unable to initialize TAPI."
+ IDS_ERR_EDITOR "Can't open external editor:\n%s with file\n%s"
+ IDS_ERR_EDITOR2 "external editor:\n%s\nerr code=%d\nlength=%d\nlength(editor)=%d last char=%d\nlength(file)=%d first char=%d"
+ IDS_PROTOCOL_NOT_CONFIGURED
+ "The protocol is not configured.\nPlease reset your modem or restart your machine and try again later."
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/profile.cpp b/mozilla/cmd/dialup/win/aswplugn/src/profile.cpp
new file mode 100644
index 00000000000..30f50c77719
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/profile.cpp
@@ -0,0 +1,530 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
+#include
+#include "plugin.h"
+
+// resource include
+#ifdef WIN32 // **************************** WIN32 *****************************
+#include "resource.h"
+#include
+#include
+#else // **************************** WIN16 *****************************
+#include "asw16res.h"
+#include
+#include
+#include
+
+#define INI_USER_SECTION "Users"
+#define INI_USERADDINFO_SECTION "Users Additional Info"
+#define INI_CURRUSER_KEY "CurrentUser"
+#endif // !WIN32
+
+// java includes
+#include "netscape_npasw_SetupPlugin.h"
+#include "java_lang_String.h"
+
+extern const char *GetStringPlatformChars(JRIEnv *env, struct java_lang_String *string);
+
+
+void GetProfileDirectory(char *profilePath);
+
+
+//********************************************************************************
+//
+// getCurrentProfileDirectory
+//
+// gets the current Navigator user profile directory
+//********************************************************************************
+extern JRI_PUBLIC_API(struct java_lang_String *)
+native_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileDirectory(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self)
+{
+ struct java_lang_String *profilePath = NULL;
+ char buf[_MAX_PATH];
+ DWORD bufsize = sizeof(buf);
+ buf[0] = '\0';
+
+#ifdef WIN32 // ***************************** WIN32 ********************************
+ HKEY hKey;
+ char *keyPath = (char *)malloc(sizeof(char) * 512);
+
+ assert(keyPath);
+ if (!keyPath)
+ return NULL;
+ strcpy(keyPath, "SOFTWARE\\Netscape\\Netscape Navigator\\Users");
+
+ // finds the user profile path in registry
+ if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyPath, NULL, KEY_ALL_ACCESS, &hKey))
+ {
+
+ if (ERROR_SUCCESS == RegQueryValueEx(hKey, "CurrentUser", NULL, NULL, (LPBYTE)buf, (LPDWORD)&bufsize)) {
+
+ RegCloseKey(hKey);
+
+ strcat(keyPath, "\\");
+ strcat(keyPath, buf);
+
+ buf[0]='\0';
+ bufsize = sizeof(buf); // bufsize got reset from the last RegQueryValueEx
+
+ if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyPath, NULL, KEY_ALL_ACCESS, &hKey)) {
+
+ if (ERROR_SUCCESS == RegQueryValueEx(hKey, "DirRoot", NULL, NULL, (LPBYTE)buf, (LPDWORD)&bufsize)) {
+
+ // make sure we append the last '\' in the profile dir path
+ strcat(buf, "\\");
+
+ int len = strlen(buf);
+ profilePath = JRI_NewStringPlatform(env, buf, len, NULL, 0);
+
+ RegCloseKey(hKey);
+
+ }
+ }
+ }
+ }
+
+ free(keyPath);
+
+#else // ***************************** WIN16 ********************************
+
+ GetProfileDirectory(buf);
+ profilePath = JRI_NewStringUTF(env, buf, strlen(buf));
+
+#endif
+
+ return (struct java_lang_String *)profilePath;
+}
+
+
+//********************************************************************************
+//
+// getCurrentProfileName
+//
+// gets the current Navigator user profile name
+//********************************************************************************
+extern JRI_PUBLIC_API(struct java_lang_String *)
+native_netscape_npasw_SetupPlugin_SECURE_0005fGetCurrentProfileName(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self)
+{
+ struct java_lang_String *profileName = NULL;
+ char buf[_MAX_PATH];
+ DWORD bufsize = sizeof(buf);
+ buf[0] = '\0';
+
+#ifdef WIN32 // ***************************** WIN32 ********************************
+
+ HKEY hKey;
+
+ // finds the user profile path in registry
+ if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Netscape\\Netscape Navigator\\Users",
+ NULL,
+ KEY_ALL_ACCESS,
+ &hKey))
+ {
+
+ RegQueryValueEx(hKey, "CurrentUser", NULL, NULL, (LPBYTE)buf, (LPDWORD)&bufsize);
+ profileName = JRI_NewStringPlatform(env, buf, strlen(buf), NULL, 0);
+ RegCloseKey(hKey);
+
+ }
+
+#else // ***************************** WIN16 ********************************
+
+ // get current profile name
+ GetPrivateProfileString(INI_USERADDINFO_SECTION, INI_CURRUSER_KEY,
+ "\0", buf, (int) bufsize, INI_NETSCAPE_FILE);
+ assert('\0' != buf[0]);
+ if ('\0' == '\0')
+ return NULL;
+
+ profileName = JRI_NewStringPlatform(env, buf, strlen(buf), NULL, 0);
+
+#endif
+
+ return (struct java_lang_String *)profileName;
+}
+
+
+
+//********************************************************************************
+// copyRegKeys
+//
+// copies registry keys
+//********************************************************************************
+#ifdef WIN32
+BOOL CopyRegKeys(HKEY hKeyOldName,
+ HKEY hKeyNewName,
+ DWORD subkeys,
+ DWORD maxSubKeyLen,
+ DWORD maxClassLen,
+ DWORD values,
+ DWORD maxValueNameLen,
+ DWORD maxValueLen,
+ char *OldPath,
+ char *NewPath)
+{
+ BOOL Err = FALSE;
+ DWORD index;
+
+
+ // first loop through and copies all the value keys
+ if (values > 0) {
+
+ DWORD valueNameSize = maxValueNameLen + 1;
+ char *valueName = (char *)malloc(sizeof(char) * valueNameSize);
+ DWORD dataSize = maxValueLen + 1;
+ unsigned char *data = (unsigned char *)malloc(sizeof(char) * dataSize);
+ DWORD type;
+
+ if ((valueName) && (data)) {
+
+ for (index=0; index 0) {
+
+ char OldSubkeyPath[260];
+ char NewSubkeyPath[260];
+ HKEY hkeyOldSubkey;
+ HKEY hkeyNewSubkey;
+
+ for (index=0; index
+#include
+
+size_t stRASENTRY = 0;
+size_t stRASCONN = 0;
+size_t stRASCTRYINFO = 0;
+size_t stRASDIALPARAMS = 0;
+size_t stRASDEVINFO = 0;
+size_t stRASENTRYNAME = 0;
+
+void SizeofRAS95() {
+ stRASENTRY = sizeof(RASENTRY);
+ stRASCONN = sizeof(RASCONN);
+ stRASCTRYINFO = sizeof(RASCTRYINFO);
+ stRASDIALPARAMS = sizeof(RASDIALPARAMS);
+ stRASDEVINFO = sizeof(RASDEVINFO);
+ stRASENTRYNAME = sizeof(RASENTRYNAME);
+}
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/rasnt40.cpp b/mozilla/cmd/dialup/win/aswplugn/src/rasnt40.cpp
new file mode 100644
index 00000000000..275bfa708ce
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/rasnt40.cpp
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+#ifdef WINVER
+#undef WINVER
+#endif
+#define WINVER 0x0401
+
+#include
+#include
+
+extern size_t stRASENTRY;
+extern size_t stRASCONN;
+extern size_t stRASCTRYINFO;
+extern size_t stRASDIALPARAMS;
+extern size_t stRASDEVINFO;
+extern size_t stRASENTRYNAME;
+
+
+void SizeofRASNT40() {
+ stRASENTRY = sizeof(RASENTRY);
+ stRASCONN = sizeof(RASCONN);
+ stRASCTRYINFO = sizeof(RASCTRYINFO);
+ stRASDIALPARAMS = sizeof(RASDIALPARAMS);
+ stRASDEVINFO = sizeof(RASDEVINFO);
+ stRASENTRYNAME = sizeof(RASENTRYNAME);
+}
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/resource.h b/mozilla/cmd/dialup/win/aswplugn/src/resource.h
new file mode 100644
index 00000000000..15703cc0e4c
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/resource.h
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by plugn32.rc
+//
+#define IDD_STATUS 101
+#define IDC_DIAL_STATUS 1001
+#define IDS_APP_NAME 63000
+#define IDS_NO_RAS_FUNCTIONS 63001
+#define IDS_NO_DUN 63002
+#define IDS_DNS_ALREADY 63003
+#define IDS_BAD_PASSWORD 63004
+#define IDS_NO_RNA_REGSERVER 63005
+#define IDS_MISSING_AREA_CODE 63006
+#define IDS_NO_RNA 63007
+#define IDS_TEST 63008
+#define IDS_OUT_OF_MEMORY 63008
+#define IDS_INVALID_EXE 63009
+#define IDS_INVALID_FILE 63010
+#define IDS_INVALID_PATH 63011
+#define IDS_NO_EDITOR 63012
+#define IDS_OPENING_PORT 63013
+#define IDS_INIT_MODEM 63014
+#define IDS_DIALING 63015
+#define IDS_DIALING_OF 63016
+#define IDS_VERIFYING 63017
+#define IDS_LOGGING_ON 63018
+#define IDS_DISCONNECTING 63019
+#define IDS_CONNECTED 63020
+#define IDS_NO_DIALTONE 63021
+#define IDS_LINE_BUSY 63022
+#define IDS_NO_ADMIN_PREMISSION 63023
+#define IDS_REGGIE_PROGITEM_NAME 63024
+#define IDS_SECURITY_RISK_WARNING 63025
+#define IDS_CONNECTION_FAILED 63026
+#define IDS_DIAL_ERR 63027
+#define IDS_CANCELDIAL 63028
+#define IDS_NO_DUN_INSTALLED 63029
+#define IDS_NO_DUN_NT 63030
+#define IDS_NO_TAPI 63031
+#define IDS_ERR_EDITOR 63032
+#define IDS_ERR_EDITOR2 63033
+#define IDS_PROTOCOL_NOT_CONFIGURED 63034
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 104
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1003
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mozilla/cmd/dialup/win/aswplugn/src/sysnregi.cpp b/mozilla/cmd/dialup/win/aswplugn/src/sysnregi.cpp
new file mode 100644
index 00000000000..cf6d74e7f20
--- /dev/null
+++ b/mozilla/cmd/dialup/win/aswplugn/src/sysnregi.cpp
@@ -0,0 +1,567 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+///////////////////////////////////////////////////////////////////////////////
+//
+// Sysnregi.cpp
+// Revision History:
+// Date Author Reason
+// ----------------------------------------------------------------------------
+// 02/27/97 xxxxxxxxxxxxxx Port Native API for win3.x
+// xxxxxxxxxxxxxx Define Native API for win95 & winNT
+///////////////////////////////////////////////////////////////////////////////
+
+#include
+#include "plugin.h"
+
+#include
+#include
+
+// windows include
+#ifdef WIN32
+// ********************* Win32 includes **************************
+#include
+#else
+// ********************* Win16 includes **************************
+#include
+#include // for ntohs()
+#include // for _S_IWRITE etc..
+#include
+#include "asw16res.h"
+#include "errmsg.h"
+#endif // WIN32
+
+// java include
+#include "netscape_npasw_SetupPlugin.h"
+#include "java_lang_String.h"
+
+#ifdef WIN32 //********************************* WIN32 **********************************
+#define NAV_REL_PNAME "\\program\\netscape.exe" // navigator relative path name
+#else //********************************* WIN32 **********************************
+#define NAV_REL_PNAME "\\netscape.exe" // navigator relative path name
+#endif //!WIN32
+
+char IconName[256] = {'\0' };
+//char g_sScriptFilename[256] = {'\0' };
+
+extern const char *GetStringPlatformChars(JRIEnv *env, struct java_lang_String *string);
+
+extern void GetProfileDirectory(char *profilePath);
+
+//********************************************************************************
+// native method:
+//
+// GetRegInfo
+//
+// returns the data sent back from regi server
+//********************************************************************************
+extern JRI_PUBLIC_API(jref)
+native_netscape_npasw_SetupPlugin_SECURE_0005fGetRegInfo(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self,
+ jbool JSflushDataFlag)
+{
+ void* data = NULL;
+ data = RegDataArray;
+
+ if (JSflushDataFlag == TRUE) {
+
+ RegDataArray = NULL;
+ }
+
+ return (jref)data;
+}
+
+
+//********************************************************************************
+// native method:
+//
+// NeedReboot
+//
+// determine if reboot is needed (win31 only)
+//********************************************************************************
+extern JRI_PUBLIC_API(jbool)
+native_netscape_npasw_SetupPlugin_SECURE_0005fNeedReboot(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self)
+{
+
+ // we normally return FALSE, i.e. don't reboot, unless it's
+ // needed for seting up modem or whatever condition we
+ // should check.
+
+ return (FALSE);
+}
+
+//********************************************************************************
+// native method:
+//
+// Reboot
+//
+// reboots the system
+//********************************************************************************
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fReboot(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self,
+ struct java_lang_String *JSaccountSetupPathname)
+{
+ char buf[512];
+ char *startupPath;
+ DWORD cbData;
+
+ const char *ASWpath=NULL;
+ if (JSaccountSetupPathname != NULL)
+ ASWpath = GetStringPlatformChars(env, JSaccountSetupPathname);
+
+ // if path is NOT null, lauch ASW after reboot
+ if (ASWpath)
+ {
+ BOOL bResult = FALSE;
+ buf[0] = '\0';
+ cbData = sizeof(buf);
+
+ //gets netscape install directory (e.g. "C:\\Program Files\\Netscape\\Navigator")
+#ifdef WIN32 // ********************** WIN32 **********************
+ HKEY hKey;
+ RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Netscape\\Netscape Communicator\\Main",
+ NULL, KEY_QUERY_VALUE, &hKey);
+ bResult = (RegQueryValueEx(hKey, "Install Directory", NULL, NULL, (LPBYTE)buf, &cbData) == ERROR_SUCCESS);
+#else // ********************** WIN16 **********************
+ bResult = GetNetscapeInstallPath(buf);
+ assert(bResult);
+#endif // !WIN32
+
+ // construct startup path
+ if (bResult)
+ {
+ // allocate 2 extra space here, 1 for null char at the end, 1 for
+ // space btween navigator and asw file path
+ startupPath = (char *)malloc(sizeof(char) * (strlen(buf) + strlen(NAV_REL_PNAME) + strlen(ASWpath) + 2));
+ if (NULL == startupPath) // abort if memory allocation fails
+ return;
+
+ strcpy (startupPath, buf); // copy netscape install dir
+ strcat (startupPath, NAV_REL_PNAME); // append navigator relative path name
+ strcat (startupPath, " ");
+ strcat (startupPath, ASWpath); // append ASW path
+ }
+
+ // add startup item to the system (WIN32: add to system registry, WIN16: add to StartUp program group)
+#ifdef WIN32
+ RegCloseKey(hKey);
+
+ // Win32: puts ASW path in RunServiceOne registry key
+ bResult = (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunServicesOnce",
+ NULL, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS);
+ if (!bResult)
+ return;
+
+ // the actual registry key value assignment
+ bResult = (RegSetValueEx(hKey, "(Default)", NULL, REG_SZ, (LPBYTE)startupPath,
+ strlen(startupPath) + 1) == ERROR_SUCCESS);
+
+ RegCloseKey(hKey);
+#else
+ bResult = AddProgramGroupItem("StartUp", startupPath, "Netscape Account Setup");
+ assert(bResult);
+
+ if (!bResult)
+ {
+ return;
+ }
+#endif
+
+ free(startupPath); // free memory
+ if (!bResult) // abort! error creating or opening the registry key
+ {
+ return;
+ }
+ }
+
+ // reboot system
+
+#ifdef WIN32 //**************************** WIN32 *************************
+ if (!ExitWindows(EWX_REBOOT, 0))
+ {
+ DWORD err = GetLastError();
+ }
+#else //**************************** WIN16 *************************
+ BOOL bReboot = ExitWindows(EW_REBOOTSYSTEM, 0);
+ if (!bReboot)
+ {
+ char errStr[255];
+ getMsgString(errStr, IDS_ERR_REBOOT_FAILURE);
+ DisplayErrMsg(errStr, MB_OK | MB_ICONEXCLAMATION);
+ }
+
+ assert(bReboot);
+#endif // WIN32
+}
+
+//********************************************************************************
+// native method:
+//
+// QuitNavigator
+//
+// quits the navigator
+//********************************************************************************
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fQuitNavigator(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self)
+{
+ PostMessage(HWND_BROADCAST, WM_COMMAND, ID_APP_SUPER_EXIT, 0L);
+}
+
+
+//********************************************************************************
+//
+// countRegItems
+//
+// counts the number of pairs regi sends
+//********************************************************************************
+long countRegItems(void* regDataBuf,
+ long regDataLen,
+ BOOL extendLen)
+{
+ unsigned short len;
+ unsigned long lenLong;
+ long regItemCount = 0;
+ char *buf = (char *)malloc(sizeof(char) * regDataLen);
+
+ char *buffer = (char *)regDataBuf;
+ long position = regDataLen;
+
+ if (buf) {
+ while (position > 0) {
+ if (extendLen == TRUE) {
+ memcpy(buf, buffer, sizeof(lenLong));
+ lenLong = ntohl(*((long *)buf));
+ buffer+=sizeof(lenLong);
+ position-=sizeof(lenLong);
+ if ((unsigned long) position0 && position>0) {
+ if (extendLen == TRUE) {
+ memcpy(buf, buffer, sizeof(len));
+ len = ntohl(*((long *)buf));
+ buffer+=sizeof(len);
+ position-=sizeof(len);
+ if ((unsigned long) position0) {
+ if (extendLen == TRUE) {
+ memcpy(buf, buffer, sizeof(len));
+ len = ntohl(*((long *)buf));
+ buffer+=sizeof(len);
+ position-=sizeof(len);
+ if ((unsigned long) position
+#include "plugin.h"
+
+
+// resource include
+#ifdef WIN32 // **************************** WIN32 *****************************
+#include "resource.h"
+#else // **************************** WIN16 *****************************
+#include "asw16res.h"
+#endif // !WIN32
+
+
+#ifdef WIN32 //******************** WIN32 Includes ***********************
+#include
+#include
+#else //******************** WIN16 Includes ***********************
+#include
+ //********************** WIN 16 Decls ***********************
+#define VER_PLATFORM_WIN16 -1
+#endif // WIN32
+
+#include
+#include "errmsg.h"
+
+// java include
+#include "netscape_npasw_SetupPlugin.h"
+#include "java_lang_String.h"
+#include "netscape_plugin_Plugin.h"
+
+extern BOOL LoadRasFunctions(LPCSTR lpszLibrary);
+extern BOOL LoadRasFunctionsNT(LPCSTR lpszLibrary);
+extern BOOL LoadRas16Functions();
+
+extern long countRegItems(void* regDataBuf, long regDataLen, BOOL extendLen);
+extern java_lang_String * getRegElement(JRIEnv *env, void *RegDataBuf, long itemNum, BOOL extendLen);
+extern BOOL getMsgString(char *buf, UINT uID);
+extern void CheckDNS();
+extern BOOL CheckDUN();
+extern BOOL CheckDUN_NT();
+extern void SizeofRAS();
+extern void DialerHangup();
+
+// keep a global execution environment
+JRIEnv* env;
+
+// Keeps track of OS version, either win95, winNT, or win16
+#ifdef WIN32
+int platformOS;
+#else
+int platformOS = VER_PLATFORM_WIN16;
+#endif
+
+// pointer to the data passed by regi server
+void* RegDataBuf = NULL;
+void* RegDataArray;
+long RegDataLength = 0;
+BOOL RegExtendedDataFlag = FALSE;
+HINSTANCE DLLinstance = NULL;
+
+//JRIGlobalRef globalRef=NULL;
+JRIGlobalRef g_globalRefReg = NULL;
+
+
+
+//********************************************************************************
+//
+// NPP_Initialize
+//
+// provides global initialization for plug-in
+// allocate any memory or resources share by all instance of our plug-in here
+//********************************************************************************
+NPError NPP_Initialize(void)
+{
+ // gets the java environment here
+ env = NPN_GetJavaEnv();
+
+ // gets the java_lang_String class
+ if (env) {
+ //register_java_lang_String(env); //Not necessary?
+ }
+
+
+#ifdef WIN32 // ******************* WIN32 ***********************
+ // gets the OS version
+ // note: we need another way to check for win31
+ OSVERSIONINFO OsVersionInfo;
+ memset(&OsVersionInfo, 0, sizeof(OSVERSIONINFO));
+ OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+ if (GetVersionEx(&OsVersionInfo)) {
+ platformOS = (int) OsVersionInfo.dwPlatformId;
+ } else {
+ return FALSE;
+ }
+#else // ********************* WIN16 ***********************
+ platformOS = VER_PLATFORM_WIN16;
+#endif // WIN32
+
+ return NPERR_NO_ERROR;
+}
+
+//*********************************************************************************
+//
+// NPP_GetJavaClass
+//
+// return the java class associated with our plug-in
+// if no java is used, return NULL
+//*********************************************************************************
+jref NP_LOADDS NPP_GetJavaClass(void)
+{
+ struct java_lang_Class* myClass;
+ JRIEnv* env = NPN_GetJavaEnv();
+ if (env == NULL) {
+ return NULL; /* Java disabled */
+ }
+
+ myClass = use_netscape_npasw_SetupPlugin(env);
+ register_netscape_npasw_SetupPlugin(env); //Not necessary?
+ use_netscape_plugin_Plugin( env );
+
+ return (jref)myClass;
+}
+
+//*********************************************************************************
+//
+// NPP_Shutdown
+//
+// provides global deinitialization for plug-in
+// release any memory or resource shared across all instance of our plug-in here
+//*********************************************************************************
+void NPP_Shutdown(void)
+{
+ // hang up any live modem connections if we're in the middle of reggie
+ if (RegiMode) {
+ DialerHangup();
+ }
+
+#ifdef WIN32
+ // free modem list
+ if (ModemList) {
+ for (int i=0; ipdata = NPN_MemAlloc(sizeof(PluginInstance));
+
+ This = (PluginInstance*) instance->pdata;
+ if (This == NULL)
+ return NPERR_OUT_OF_MEMORY_ERROR;
+
+ {
+ /* mode is NP_EMBED, NP_FULL, or NP_BACKGROUND (see npapi.h) */
+ This->fWindow = NULL;
+ This->fMode = mode;
+
+ This->fhWnd = NULL;
+ This->fDefaultWindowProc = NULL;
+
+ }
+
+ return result;
+}
+
+
+//******************************************************************************
+//
+// NPP_Destroy
+//
+// deletes a specific instance of a plug-in and returns an error value
+// called when a plug-in instance is deleted
+//******************************************************************************
+NPError NP_LOADDS NPP_Destroy(NPP instance,
+ NPSavedData** save)
+{
+ PluginInstance* This;
+
+ if (instance == NULL)
+ return NPERR_INVALID_INSTANCE_ERROR;
+
+ This = (PluginInstance*) instance->pdata;
+
+ if (This != NULL) {
+ NPN_MemFree(instance->pdata);
+ instance->pdata = NULL;
+ }
+
+ return NPERR_NO_ERROR;
+}
+
+
+//******************************************************************************
+//
+// NPP_SetWindow
+//
+// sets the window in which a plug-in draws
+//******************************************************************************
+NPError NP_LOADDS NPP_SetWindow(NPP instance,
+ NPWindow* window)
+{
+ NPError result = NPERR_NO_ERROR;
+ PluginInstance* This;
+
+ if (!window)
+ return NPERR_GENERIC_ERROR;
+
+ if (!instance)
+ return NPERR_INVALID_INSTANCE_ERROR;
+
+ // get the plugin instance object
+ This = (PluginInstance*) instance->pdata;
+
+ This->fWindow = window;
+ return result;
+}
+
+
+
+//*******************************************************************************
+//
+// NPP_NewStream
+//
+// notifies an instance of a new data stream
+//*******************************************************************************
+NPError NP_LOADDS NPP_NewStream(NPP instance,
+ NPMIMEType type,
+ NPStream *stream,
+ NPBool seekable,
+ uint16 *stype)
+{
+ PluginInstance* This;
+
+ if (instance == NULL)
+ return NPERR_INVALID_INSTANCE_ERROR;
+
+ This = (PluginInstance*) instance->pdata;
+
+ if (type) {
+ RegExtendedDataFlag = (!strcmp(type,"application/x-netscape-autoconfigure-dialer-v2")) ? TRUE:FALSE;
+ }
+
+
+ return NPERR_NO_ERROR;
+}
+
+
+
+int32 STREAMBUFSIZE = 0X0FFFFFFF; /* If we are reading from a file in NPAsFile
+ * mode so we can take any size stream in our
+ * write call (since we ignore it) */
+
+//********************************************************************************
+//
+// NPP_WriteReady
+//
+// returns the maximum number of bytes that an instance is prepared to accpet
+// in NPP_Write()
+//********************************************************************************
+int32 NP_LOADDS NPP_WriteReady(NPP instance,
+ NPStream *stream)
+{
+ PluginInstance* This;
+ if (instance != NULL)
+ This = (PluginInstance*) instance->pdata;
+
+ return STREAMBUFSIZE;
+}
+
+
+//******************************************************************************
+//
+// NPP_Write
+//
+// deliveries the data from a stream and return the number of bytes written
+//******************************************************************************
+int32 NP_LOADDS NPP_Write(NPP instance,
+ NPStream *stream,
+ int32 offset,
+ int32 len,
+ void *buffer)
+{
+ PluginInstance* This;
+
+ if (instance != NULL)
+ {
+ This = (PluginInstance*) instance->pdata;
+ }
+
+ if (!RegDataBuf) {
+ // assume it's the begining of the data stream
+ RegDataBuf = (void *)malloc((size_t)(sizeof(char) * len));
+ } else {
+ RegDataBuf = (void *)realloc(RegDataBuf, (size_t)(sizeof(char) * RegDataLength + len));
+ }
+
+ if (len) {
+ if (RegDataBuf) {
+ // copy data to buffer
+ memcpy(&((char *)RegDataBuf)[RegDataLength], buffer, (size_t) len);
+ RegDataLength += (long) len;
+ }
+ }
+
+ return len; /* The number of bytes accepted */
+}
+
+
+//*******************************************************************************
+//
+// NPP_DestroyStream
+//
+// indicates the closure and deletion of a stream
+//*******************************************************************************
+NPError NP_LOADDS NPP_DestroyStream(NPP instance,
+ NPStream *stream,
+ NPError reason)
+{
+ PluginInstance* This;
+
+ if (instance == NULL)
+ return NPERR_INVALID_INSTANCE_ERROR;
+ This = (PluginInstance*) instance->pdata;
+
+ // if done passing data
+ if (reason == NPRES_DONE) {
+
+ JRIEnv* env = NPN_GetJavaEnv();
+
+ if (RegDataBuf && env) {
+
+ java_lang_String *Element;
+
+ // read and parse regi data here
+ long numItems = countRegItems(RegDataBuf, RegDataLength, RegExtendedDataFlag);
+
+ RegDataArray = JRI_NewObjectArray(env, numItems, class_java_lang_String(env), NULL);
+ if (RegDataArray == NULL)
+ return NULL;
+
+ // lock the JRI array reference, dispose old reference if necessary
+ if (g_globalRefReg)
+ JRI_DisposeGlobalRef(env, g_globalRefReg);
+ g_globalRefReg = JRI_NewGlobalRef(env, RegDataArray);
+
+ for (long x=0; xpdata;
+
+}
+
+
+//******************************************************************************
+//
+// NPP_Print
+//
+// request a platform-specific print operation for the instance
+//******************************************************************************
+void NP_LOADDS NPP_Print(NPP instance, NPPrint* printInfo)
+{
+
+ if(printInfo == NULL)
+ return;
+
+ if (instance != NULL) {
+ PluginInstance* This = (PluginInstance*) instance->pdata;
+
+ if (printInfo->mode == NP_FULL) {
+
+ void* platformPrint = printInfo->print.fullPrint.platformPrint;
+ NPBool printOne = printInfo->print.fullPrint.printOne;
+
+ /* Do the default*/
+ printInfo->print.fullPrint.pluginPrinted = FALSE;
+ }
+ else { /* If not fullscreen, we must be embedded */
+
+ NPWindow* printWindow = &(printInfo->print.embedPrint.window);
+ void* platformPrint = printInfo->print.embedPrint.platformPrint;
+ }
+ }
+}
+
+
+
+//********************************************************************************
+//
+// NPP_URLNotify
+//
+// notifies the instance of the comp.etion of a URL request
+//********************************************************************************
+void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
+{
+}
+
+
+//********************************************************************************
+// native method:
+//
+// SetKiosk
+//
+// runs navigator in kiosk mode. (mac only, just a stub here)
+//********************************************************************************
+extern JRI_PUBLIC_API(void)
+native_netscape_npasw_SetupPlugin_SECURE_0005fSetKiosk(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self,
+ jbool a)
+{
+ return;
+}
+
+
+
+//********************************************************************************
+// native method:
+//
+// SetKiosk
+//
+// runs navigator in kiosk mode. (mac only, just a stub here)
+//********************************************************************************
+extern JRI_PUBLIC_API(jbool)
+native_netscape_npasw_SetupPlugin_SECURE_0005fMilan(JRIEnv* env, struct netscape_npasw_SetupPlugin* self,
+ struct java_lang_String *a,
+ struct java_lang_String *b,
+ jbool c,
+ jbool d)
+{
+ return (FALSE);
+}
+
+
+
+//********************************************************************************
+// native method:
+//
+// CheckEnvironment
+//
+// checks for DUN, RAS function loading correctly
+//********************************************************************************
+extern JRI_PUBLIC_API(jbool)
+native_netscape_npasw_SetupPlugin_SECURE_0005fCheckEnvironment(JRIEnv* env,
+ struct netscape_npasw_SetupPlugin* self)
+{
+ // try loading RAS routines in RAS dlls
+ // if fails return FALSE
+
+ switch (platformOS) {
+#ifdef WIN32 // ********************* WIN32 ***********************
+ case VER_PLATFORM_WIN32_NT: // NT
+ SizeofRASNT40(); // Sizeof.
+
+ //check if it's WinNT40 first
+ if (!LoadRasFunctionsNT("RASAPI32.DLL")) {
+
+ // Err: Unable to dynamically load extended RAS functions!
+ char *buf = (char *)malloc(sizeof(char) * 255);
+ if (buf) {
+ if (getMsgString(buf, IDS_NO_RAS_FUNCTIONS))
+ DisplayErrMsg(buf, MB_OK | MB_ICONEXCLAMATION);
+ free(buf);
+ }
+
+ return (FALSE);
+ }
+ break;
+
+ case VER_PLATFORM_WIN32_WINDOWS: // defaults to win95
+#else
+ case VER_PLATFORM_WIN16: // win16
+#endif // WIN32
+
+ SizeofRAS(); // Sizeof.
+
+#ifdef WIN32 // *********************** WIN32 **************************
+ if (!LoadRasFunctions("RASAPI32.DLL") && !LoadRasFunctions("RNAPH.DLL")) {
+#else // *********************** WIN16 **************************
+ if (!LoadRas16Functions()) {
+#endif
+ // Err: Unable to dynamically load extended RAS functions!
+ char *buf = (char *)malloc(sizeof(char) * 255);
+ if (buf) {
+ if (getMsgString(buf, IDS_NO_RAS_FUNCTIONS))
+ DisplayErrMsg(buf, MB_OK | MB_ICONEXCLAMATION);
+ free(buf);
+ }
+
+ return (FALSE);
+ }
+ }
+
+ // Check to make sure Dial-Up Networking is installed.
+ // It may be uninstalled by user.
+ // return FALSE if Dialup Networking is not installed
+#ifdef WIN32
+ switch (platformOS) {
+ case VER_PLATFORM_WIN32_NT:
+ if (FALSE == CheckDUN_NT()) {
+ char buf[255];
+ if (getMsgString((char *)buf, IDS_NO_DUN_INSTALLED))
+ DisplayErrMsg((char *)buf, MB_OK | MB_ICONEXCLAMATION);
+ return (FALSE);
+ }
+ break;
+ default:
+ if (FALSE == CheckDUN()) {
+
+ char buf[255];
+ if (getMsgString((char *)buf, IDS_NO_DUN_INSTALLED))
+ DisplayErrMsg((char *)buf, MB_OK | MB_ICONEXCLAMATION);
+ return (FALSE);
+ }
+ break;
+ }
+
+ // for win95 only:
+ // Check to see if DNS is already configured for a LAN connection.
+ // If so warn the user that this may cause conflicts, and continue.
+ if (platformOS == VER_PLATFORM_WIN32_WINDOWS)
+ CheckDNS();
+#endif
+
+ return (TRUE);
+}
+
+/*******************************************************************************
+ * Native Methods:
+ * These are the signatures of the native methods which you must implement.
+ ******************************************************************************/
+/*** public native intern ()Ljava/lang/String; ***/
+extern JRI_PUBLIC_API(struct java_lang_String *)
+native_java_lang_String_intern(JRIEnv* env, struct java_lang_String* self)
+{
+ return NULL;
+}
+
+
+HINSTANCE g_hDllInstance = NULL;
+
+
+// DDL Entry point for WIN32 & WIN16
+#ifdef WIN32 //******************* WIN 32 ***************
+//************************************************************************
+// DllEntryPoint
+//************************************************************************
+
+BOOL WINAPI
+DllMain( HINSTANCE hinstDLL, // handle of DLL module
+ DWORD fdwReason, // reason for calling function
+ LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_PROCESS_DETACH:
+ {
+ DLLinstance = hinstDLL; // keeps DLL instance
+ break;
+ }
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
+#else //*********************** WIN16 *******************
+
+//************************************************************************
+// DllEntryPoint
+//************************************************************************
+int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg, WORD wHeapSize, LPSTR lpszCndLine)
+{
+ if (wHeapSize > 0)
+ UnlockData(0);
+ g_hDllInstance = hInstance;
+ return 1;
+}
+
+int FAR PASCAL _export WEP(int nParam)
+{
+ return 1;
+}
+
+#endif
diff --git a/mozilla/cmd/dialup/win/icons/license b/mozilla/cmd/dialup/win/icons/license
new file mode 100644
index 00000000000..947718beabb
--- /dev/null
+++ b/mozilla/cmd/dialup/win/icons/license
@@ -0,0 +1,17 @@
+/*
+ * The contents of this directory are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use the files in this directory except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+
diff --git a/mozilla/cmd/dialup/win/makefile.win b/mozilla/cmd/dialup/win/makefile.win
new file mode 100644
index 00000000000..2a94e11231c
--- /dev/null
+++ b/mozilla/cmd/dialup/win/makefile.win
@@ -0,0 +1,19 @@
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+#
+DEPTH=..\..\..
+DIRS=aswplugn
+
+!include <$(DEPTH)\config\rules.mak>
diff --git a/mozilla/cmd/dialup/win/muc/src/MUC.CPP b/mozilla/cmd/dialup/win/muc/src/MUC.CPP
new file mode 100644
index 00000000000..f73fd02f844
--- /dev/null
+++ b/mozilla/cmd/dialup/win/muc/src/MUC.CPP
@@ -0,0 +1,291 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+// muc.cpp : Defines the initialization routines for the DLL.
+//
+
+#include "stdafx.h"
+#include "muc.h"
+#include "dialshr.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+// Keeps track of OS version, either win95 or winNT
+int platformOS;
+HINSTANCE DLLinstance;
+int GetAcctConfig(char *returnData);
+int GetModemConfig(char *returnData);
+
+/////////////////////////////////////////////////////////////////////////////
+// CMucApp
+
+BEGIN_MESSAGE_MAP(CMucApp, CWinApp)
+ //{{AFX_MSG_MAP(CMucApp)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ // DO NOT EDIT what you see in these blocks of generated code!
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CMucApp construction
+
+CMucApp::CMucApp()
+{
+}
+/////////////////////////////////////////////////////////////////////////////
+// CMucApp deconstruction
+CMucApp::~CMucApp()
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CMucApp InitInstance
+
+CMucApp::InitInstance()
+{
+ CWinApp::InitInstance();
+
+ SetDialogBkColor(); // Set dialog background color to gray
+ LoadStdProfileSettings(); // Load standard INI file options (including MRU)
+
+#ifdef WIN32
+ platformOS = 0;
+
+ OSVERSIONINFO *lpOsVersionInfo = new OSVERSIONINFO;
+ lpOsVersionInfo->dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+ if (GetVersionEx(lpOsVersionInfo))
+ platformOS = (int)lpOsVersionInfo->dwPlatformId;
+
+ switch (platformOS)
+ {
+ case VER_PLATFORM_WIN32_WINDOWS: //win95
+ if(!LoadRasFunctions("rasapi32.dll"))
+ return FALSE;
+ SizeofRAS95();
+ break;
+
+ case VER_PLATFORM_WIN32_NT: // win nt
+ if(!LoadRasFunctionsNT("rasapi32.dll"))
+ return FALSE;
+ SizeofRASNT40();
+ break;
+
+ default:
+ break;
+ }
+#else
+ if(!LoadRasFunctions("rasapi16.dll"))
+ return FALSE;
+#endif
+
+ return TRUE;
+}
+/////////////////////////////////////////////////////////////////////////////
+// CMucApp ExitInstance
+
+BOOL CMucApp::ExitInstance()
+{
+#ifdef WIN32
+ if(lpOsVersionInfo != NULL)
+ {
+ delete lpOsVersionInfo;
+ lpOsVersionInfo = NULL;
+ }
+#else
+ FreeRasFunctions();
+#endif
+
+ return CWinApp::ExitInstance();
+}
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CMucApp object
+
+CMucApp theApp;
+
+enum
+{
+ kGetPluginVersion,
+ kSelectAcctConfig,
+ kSelectModemConfig,
+ kSelectDialOnDemand
+};
+
+#ifdef WIN32
+STDAPI_(long)
+#else
+extern "C" long FAR PASCAL _export
+#endif
+PEPluginFunc( long selectorCode, void* paramBlock, void* returnData )
+{
+ long returnCode = 0;
+ BOOL flag = TRUE;
+ char acctStr[MAX_PATH];
+
+ DLLinstance = theApp.m_hInstance;
+
+ switch ( selectorCode )
+ {
+ // fill in the version in paramBlock
+ case kGetPluginVersion:
+ *(long*)returnData = 0x00010000;
+ returnCode = 0;
+ break;
+
+ // get account list
+ case kSelectAcctConfig:
+ *(int*)paramBlock = GetAcctConfig((char*)returnData);
+ break;
+
+ // get modem list
+ case kSelectModemConfig:
+ *(int*)paramBlock = GetModemConfig((char*)returnData);
+ break;
+
+ case kSelectDialOnDemand:
+ // kludge: dealing with dogbert PR3 bug
+ if (*(int*)paramBlock == 1)
+ strcpy(acctStr, (char*)returnData);
+ else if( *(int*)returnData == 1)
+ {
+ strcpy(acctStr, (char *)paramBlock);
+ if(strcmp(acctStr, "None") == 0)
+ flag = FALSE;
+ }
+ else
+ {
+ strcpy(acctStr, "");
+ flag = FALSE;
+ }
+#ifdef WIN32
+ switch(platformOS)
+ {
+ case VER_PLATFORM_WIN32_WINDOWS: //win95
+ EnableDialOnDemand95(acctStr,flag);
+ break;
+
+ case VER_PLATFORM_WIN32_NT: // win nt
+ EnableDialOnDemandNT(acctStr,flag);
+ break;
+
+ default:
+ break;
+ }
+#else
+ EnableDialOnDemand16(acctStr,flag);
+ break;
+#endif
+
+ default:
+ returnCode = 0;
+ break;
+ }
+
+ return returnCode;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+int GetAcctConfig (char *returnData)
+{
+ CONNECTIONPARAMS *connectionNames;
+ int numNames=0;
+ int i=0, rtn;
+ CString str, tmp;
+
+#ifdef WIN32
+ switch (platformOS)
+ {
+ case VER_PLATFORM_WIN32_WINDOWS: //win95
+ rtn = GetDialUpConnection95(&connectionNames, &numNames);
+ break;
+
+ case VER_PLATFORM_WIN32_NT: // win nt
+ rtn = GetDialUpConnectionNT(&connectionNames, &numNames);
+ break;
+
+ default:
+ return FALSE;
+ }
+#else
+ rtn = GetDialUpConnection16(&connectionNames, &numNames);
+#endif
+
+ if(rtn)
+ {
+ returnData[0] = 0x00;
+ if(connectionNames != NULL)
+ {
+ // pile up account names in a single array, separated by a ()
+ for(i=0; i < numNames; i++)
+ {
+ tmp = connectionNames[i].szEntryName;
+ str += tmp;
+ str += "()";
+ }
+ strcpy(returnData, (const char*)str);
+
+ delete []connectionNames;
+ }
+ }
+ return numNames;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+int GetModemConfig(char *returnData)
+{
+ char **modemResults;
+ int numDevices;
+ int i;
+ CString str, tmp;
+
+ if(!::GetModemList(&modemResults, &numDevices))
+ {
+ if(modemResults != NULL)
+ {
+ for(i=0; i // MFC core and standard components
+#include