diff --git a/mozilla/cmd/dialup/as_html/1step.htm b/mozilla/cmd/dialup/as_html/1step.htm new file mode 100644 index 00000000000..d27d7d43d12 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/1step.htm @@ -0,0 +1,71 @@ + + + + + +Account Setup + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+

Connecting to the Internet
account server...

+ + + + +
+ + + + + + + + + + +
+
+ + + + + + diff --git a/mozilla/cmd/dialup/as_html/1step.js b/mozilla/cmd/dialup/as_html/1step.js new file mode 100644 index 00000000000..ac791199801 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/1step.js @@ -0,0 +1,270 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/aboutbox.htm b/mozilla/cmd/dialup/as_html/aboutbox.htm new file mode 100644 index 00000000000..e93ba2f7b22 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/aboutbox.htm @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + +
Account Setup
4.0
+
+ + + + + + +
Internet
Signup
Program
+
+ + + + + + +
Copyright © 1996, 1997
Netscape Communications Corp.
All Rights Reserved.
+
+ + +
Brought to you by:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Client EngineeringRobert John Churchill, Rex Lam, Tim McClarren, Arshad Tayyeb, Cathleen Wang, Stella Yun
FreePPPSteve Dagley
Server EngineeringSteve Elmer, Lucy Wu
Documentation/HelpDirk Dougherty, Robin Foster, Kate O'Day
User ExperienceJim Corban, Valerie Hunter
Kwality AssuranceAracely Areas, John Bennett, Bruce Gay, Sarah Groves, Vashti Holt, Brent Martin, Dylan Shea, John Unruh, Pascal Vin
Release EngineeringDon Bragg, Doug Turner, Chris Yeh
InternationalDavid Yett
ManagementLeland Hambley, Nancy Wang, Monique Barbanson
MarketingKen Hickman, Debra Evans, John Freeborg, Julie Herendeen
Thanks!The entire Communicator team!
Thank Goodness for...Mountain Dew!
+ + +
+ + +
+
+ + Go Netscape! + +
+
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/aboutbox.js b/mozilla/cmd/dialup/as_html/aboutbox.js new file mode 100644 index 00000000000..91cea9e5609 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/aboutbox.js @@ -0,0 +1,113 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/accounts.htm b/mozilla/cmd/dialup/as_html/accounts.htm new file mode 100644 index 00000000000..405ff285bdb --- /dev/null +++ b/mozilla/cmd/dialup/as_html/accounts.htm @@ -0,0 +1,104 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ + +

Welcome to Account Setup

+ + + +

Please click one of the buttons below to choose whether you would like to create a new Internet account or set up Communicator to access an account that you already have.

+ + + + + + + + + + + + + + + + +
+ + + + + I want to create a new Internet account. + + + + If you're new to the Internet, Account Setup helps you create an Internet account that you can use right away. You can also choose this option if you want to create a second Internet account or change your Internet service provider. + +
+
+ + + + + I already have an Internet account. I want to set up Communicator to access my account. + + + + If you already have an Internet account with an Internet service provider, Account Setup helps you quickly set up Communicator to access your account. + +
+ + + + diff --git a/mozilla/cmd/dialup/as_html/accounts.js b/mozilla/cmd/dialup/as_html/accounts.js new file mode 100644 index 00000000000..864b07655b7 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/accounts.js @@ -0,0 +1,67 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/acctInfo.htm b/mozilla/cmd/dialup/as_html/acctInfo.htm new file mode 100644 index 00000000000..3654e137db5 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/acctInfo.htm @@ -0,0 +1,120 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + + + +

Information About Yourself

+ +

Please enter your name and, optionally, you organization name below. Account Setup sets Communicator to add this information to the email you send and the web pages you create.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ First: + + Last: +
+ Name: + + + + + + +
+ +
+ Organization: + + + + +
+
+ + + + + + + diff --git a/mozilla/cmd/dialup/as_html/acctInfo.js b/mozilla/cmd/dialup/as_html/acctInfo.js new file mode 100644 index 00000000000..798e0d51560 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/acctInfo.js @@ -0,0 +1,107 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/billing.htm b/mozilla/cmd/dialup/as_html/billing.htm new file mode 100644 index 00000000000..11c3330042d --- /dev/null +++ b/mozilla/cmd/dialup/as_html/billing.htm @@ -0,0 +1,175 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Your Billing Information

+ +

Internet accounts are paid for by credit card. Please provide information about the credit card that you would like to use for billing. Account Setup forwards this information to your provider when you create your account.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name on Card: + + + + +
+ +
+ Type of Card: + + + + +
+ +
+ + Card Number: + + + + + +
+ +
+ Expiration Date: + + + + + + + + + +
+ +
+ +
+ + + + diff --git a/mozilla/cmd/dialup/as_html/billing.js b/mozilla/cmd/dialup/as_html/billing.js new file mode 100644 index 00000000000..550c4b7e848 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/billing.js @@ -0,0 +1,319 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/clayer.htm b/mozilla/cmd/dialup/as_html/clayer.htm new file mode 100644 index 00000000000..0da089bbcf6 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/clayer.htm @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HELP + + + + + + + + + + + + EXIT + + + + + + + + + + + BACK + + + + + + + + + + + NEXT + + + + + + + + + + + CONNECT NOW + + + + + + + + + + + CONNECT NOW + + + + + + + + + + + CONNECT AGAIN + + + + + + + + + + + CONNECT TO SERVER + + + + + + + + + + + DONE + + + + + + + + + + + RESTART + + + + + + + + + + + ACCOUNT SETUP + + + + + + + + + + + DONE + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/clayer1.js b/mozilla/cmd/dialup/as_html/clayer1.js new file mode 100644 index 00000000000..ff9f4f5d627 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/clayer1.js @@ -0,0 +1,908 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/clayer2.js b/mozilla/cmd/dialup/as_html/clayer2.js new file mode 100644 index 00000000000..83b579f6e4c --- /dev/null +++ b/mozilla/cmd/dialup/as_html/clayer2.js @@ -0,0 +1,856 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/config/ACCTSET.INI b/mozilla/cmd/dialup/as_html/config/ACCTSET.INI new file mode 100644 index 00000000000..ffdb3d2e48f --- /dev/null +++ b/mozilla/cmd/dialup/as_html/config/ACCTSET.INI @@ -0,0 +1,47 @@ +; Mode: INI; tab-width: 8; indent-tabs-mode: nil -*- +; +; 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. +; +[Mode Selection] +IntlMode=no +ForceNew=no +ForceExisting=no +ExistingSRFile= +Show_Intro_Screens=yes +Dialer_Disconnect_After= + +[New Acct Mode] +ShowNewPathInfo=yes +AskPersonalInfo=yes +AskBillingInfo=yes +CardTypes="AX,DC,MC,VI" +RegServer= +SavePasswords=yes +AskSaveAcctInfo=yes + +[Existing Acct Mode] +ShowNoneAbove=yes +ShowExistingPathInfo=yes +ShowPhones=no +AskName=yes +AskPhone=yes +AskLogin=yes +AskTTY=yes +AskEmail=yes +AskHosts=yes +AskDNS=yes +AskPublishing=yes +RegPodURL=http://home.netscape.com/home/register.html diff --git a/mozilla/cmd/dialup/as_html/config/Sample1.IAS b/mozilla/cmd/dialup/as_html/config/Sample1.IAS new file mode 100644 index 00000000000..8792a1bd5c7 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/config/Sample1.IAS @@ -0,0 +1,44 @@ +; Mode: INI; tab-width: 8; indent-tabs-mode: nil -*- +; +; 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. +; +[Dial-In Configuration] +ScriptFileName= +Phone=+1 (800) 638-8290 +Password=YWg0ZrhvamYLZix1ADRvdWpttnp3 +Name=mozillarama +Description=Internet Account Server (New UI) +SiteName=Internet Account Server (New UI) + +[IP] +RegCGI=https://reggie.netscape.com/DUE/reg.cgi +DNSAddress2=205.217.225.20 +DNSAddress=205.217.225.10 +DomainName=netscape.com +IPAddress=0.0.0.0 +Enabled=Yes + +[Configuration] +REG_SCRIPTING= + +[Security] +SecurityDevice=No + +; This is a sample registration file that logs into the +; Netscape Internet Account Server. +; New User Interface +; This file should be replaced with registration file(s) +; specific to your registration server. diff --git a/mozilla/cmd/dialup/as_html/config/Sample1.NCI b/mozilla/cmd/dialup/as_html/config/Sample1.NCI new file mode 100644 index 00000000000..a75b7220766 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/config/Sample1.NCI @@ -0,0 +1,52 @@ +; Mode: INI; tab-width: 8; indent-tabs-mode: nil -*- +; +; 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. +; +[Dial-In Configuration] +SupportPhone=+1 (800) 000-0000 +Phone=+1 (800) 000-0000 +Password= +Name= +Description=Company Name +SiteName=Company Name or Access Location (1) + +[Options] +EnableVJCompression=YES + +[IP] +DNSAddress2=000.000.000.002 +DNSAddress=000.000.000.001 +DomainName=companyname1.com +IPAddress= +Enabled=YES + +[Services] +Default_Mail_Protocol=POP +IMAP_Server=imap.companyname1.net +POP_Server=pop.companyname1.net +NNTP_Server=news.companyname1.net +SMTP_Server=mail.companyname1.net + +[Publishing] +View_URL= +Publish_Password= +Publish_URL= + +[Script] +ScriptFileName= + +[Configuration] +ConfigurationFileName=Sample (1) diff --git a/mozilla/cmd/dialup/as_html/config/Sample2.IAS b/mozilla/cmd/dialup/as_html/config/Sample2.IAS new file mode 100644 index 00000000000..13b30e486cc --- /dev/null +++ b/mozilla/cmd/dialup/as_html/config/Sample2.IAS @@ -0,0 +1,44 @@ +; Mode: INI; tab-width: 8; indent-tabs-mode: nil -*- +; +; 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. +; +[Dial-In Configuration] +ScriptFileName= +Phone=+1 (800) 638-8290 +Password=YWg0ZrhvamYLZix1ADRvdWpttnp3 +Name=mozillarama +Description=Internet Account Server (Old UI) +SiteName=Internet Account Server (Old UI) + +[IP] +RegCGI=https://reggie.netscape.com/DUK1/reg.cgi +DNSAddress2=205.217.225.20 +DNSAddress=205.217.225.10 +DomainName=netscape.com +IPAddress=0.0.0.0 +Enabled=Yes + +[Configuration] +REG_SCRIPTING= + +[Security] +SecurityDevice=No + +; This is a sample registration file that logs into the +; Netscape Internet Account Server. +; Old User Interface. +; This file should be replaced with registration file(s) +; specific to your registration server. diff --git a/mozilla/cmd/dialup/as_html/config/Sample2.NCI b/mozilla/cmd/dialup/as_html/config/Sample2.NCI new file mode 100644 index 00000000000..276b7e025de --- /dev/null +++ b/mozilla/cmd/dialup/as_html/config/Sample2.NCI @@ -0,0 +1,52 @@ +; Mode: INI; tab-width: 8; indent-tabs-mode: nil -*- +; +; 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. +; +[Dial-In Configuration] +SupportPhone=+1 (800) 000-0000 +Phone=+1 (800) 000-0000 +Password=PaSsWoRd +Name=ned pepper +Description=Company Name +SiteName=Company Name or Access Location (2) + +[Options] +EnableVJCompression=YES + +[IP] +DNSAddress2=000.000.000.002 +DNSAddress=000.000.000.001 +DomainName=companyname2.com +IPAddress= +Enabled=YES + +[Services] +Default_Mail_Protocol=IMAP +IMAP_Server=imap.companyname2.net +POP_Server=pop.companyname2.net +NNTP_Server=news.companyname2.net +SMTP_Server=mail.companyname2.net + +[Publishing] +View_URL= +Publish_Password= +Publish_URL= + +[Script] +ScriptFileName= + +[Configuration] +ConfigurationFileName=Sample (2) diff --git a/mozilla/cmd/dialup/as_html/connect1.htm b/mozilla/cmd/dialup/as_html/connect1.htm new file mode 100644 index 00000000000..947bf4f2249 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/connect1.htm @@ -0,0 +1,79 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + +

Connect to Server

+ +

Account Setup will now connect you to the Internet account server, where you can learn about the account plans available and create an account. After Account Setup dials your modem and makes a connection, the Internet account server screens are displayed here, in the Account Setup window.

+ +

When evaluating account plans, think about these questions:

+ +
    +
  • How much time do you think you'll spend on the Internet each month?
  • +
  • What are the monthly or hourly rates?
  • +
  • What technical support is offered?
  • +
+ + + +

Make sure your modem is properly connected and turned on, then click Connect to Server to begin.

+ +
+ +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/connect1.js b/mozilla/cmd/dialup/as_html/connect1.js new file mode 100644 index 00000000000..57197dbb03a --- /dev/null +++ b/mozilla/cmd/dialup/as_html/connect1.js @@ -0,0 +1,134 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/connect2.htm b/mozilla/cmd/dialup/as_html/connect2.htm new file mode 100644 index 00000000000..13c8773dffc --- /dev/null +++ b/mozilla/cmd/dialup/as_html/connect2.htm @@ -0,0 +1,63 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

You're Done!

+ +

You're now finished using Account Setup and can connect to the Internet after you click Connect Now or Done.

+ +

If you want to connect to the Internet now, click Connect Now. If you don't want to connect +to the Internet now, click Done. When you want to use the Internet, all you have to do is launch Communicator from the Netscape Communicator folder or program group.

+ + + diff --git a/mozilla/cmd/dialup/as_html/connect2.js b/mozilla/cmd/dialup/as_html/connect2.js new file mode 100644 index 00000000000..cde2450e23e --- /dev/null +++ b/mozilla/cmd/dialup/as_html/connect2.js @@ -0,0 +1,538 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/dial.htm b/mozilla/cmd/dialup/as_html/dial.htm new file mode 100644 index 00000000000..dc7792a4cbb --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dial.htm @@ -0,0 +1,98 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + +

Your Account Access Phone Number

+ +

Enter the number you dial to connect to your Internet account.

+ + + + + + + + + +
+ + Telephone Number: + + + + + + + + + + +
+ + + Number:  +
+ + + +
+
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/dial.js b/mozilla/cmd/dialup/as_html/dial.js new file mode 100644 index 00000000000..14139d17058 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dial.js @@ -0,0 +1,128 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/dialinf1.htm b/mozilla/cmd/dialup/as_html/dialinf1.htm new file mode 100644 index 00000000000..9058acfd903 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dialinf1.htm @@ -0,0 +1,154 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Dialing Settings for Your Location

+ +

Please specify any special dialing settings that apply to the location that you are connecting from.

+ +

If you have Call Waiting, you should turn it off before you connect. Select a code from the pop-up menu below, or enter one of your own in the text box.

+ + + + + + + + + + + +
+ + Turn off Call Waiting with:  + + + + + + + + + + +
+ + + + +

If you are connecting from a building with an internal phone network--such as from an office or a hotel--you need to access an outside line before you can connect.

+ + + + + + + + + +
+ + Access an outside line by dialing:  + + + + + + +
+ + + + + + + +

Which dialing method would you like to use?

+ + + + + + + +
+ + + Tone + Pulse + + +
+ +
+ + + + + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/dialinf1.js b/mozilla/cmd/dialup/as_html/dialinf1.js new file mode 100644 index 00000000000..ce87b9772ef --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dialinf1.js @@ -0,0 +1,275 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/dialinf2.htm b/mozilla/cmd/dialup/as_html/dialinf2.htm new file mode 100644 index 00000000000..0fc0f822500 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dialinf2.htm @@ -0,0 +1,112 @@ + + + + +Account Setup + + + + + + + + + +
+ACCOUNT SETUP +
+
+ +
+

Phone Number of Your Location

+

Please enter the phone number of the line that you are using to connect--the line that is now connected to your computer or modem. Account Setup uses this information to set up your connection software to access the Internet.

+ + + + + + +
+ + Telephone Number: + + + + + + + + + + + +
+ +
+ + + +
+
+

Please enter optional alternate area codes that you can call from your location to access and Internet service +provider.

+ + + + + + +
+ + + + + + + + + + + + + +
+ Alternate Area Code 1: + + + +
+ Alternate Area Code 2: + + + +
+ Alternate Area Code 3: + + + +
+
+ + + + diff --git a/mozilla/cmd/dialup/as_html/dialinf2.js b/mozilla/cmd/dialup/as_html/dialinf2.js new file mode 100644 index 00000000000..de5a12d7a9e --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dialinf2.js @@ -0,0 +1,171 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/dns.htm b/mozilla/cmd/dialup/as_html/dns.htm new file mode 100644 index 00000000000..0711e850a5b --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dns.htm @@ -0,0 +1,133 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + +
+ +

Your Provider's Domain and DNS Servers

+ +

Enter your provider's domain name and DNS server addresses. Your provider might have given you this information when you created your account. If you don't have the information, call your provider's technical support office before continuing.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Domain name: + + + + + + (For example,
+ providername.com) + +
+ + Primary DNS  +
+ Server Address: +
+ +
+ + + (For example, 0.0.0.0) +
+ +
+ + Secondary DNS  +
+ Server Address: +
+ +
+ + + (For example, 0.0.0.0) +
+
+ +
+ + + diff --git a/mozilla/cmd/dialup/as_html/dns.js b/mozilla/cmd/dialup/as_html/dns.js new file mode 100644 index 00000000000..c2e1d21932c --- /dev/null +++ b/mozilla/cmd/dialup/as_html/dns.js @@ -0,0 +1,98 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/download.htm b/mozilla/cmd/dialup/as_html/download.htm new file mode 100644 index 00000000000..be04498ab74 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/download.htm @@ -0,0 +1,80 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + +

Download

+ +

Account Setup will now connect you to the Internet account server, to download information about available account plans. + It may take as long as two minutes for the information to be retrieved.

+ +

When evaluating account plans, think about these questions:

+ +
    +
  • How much time do you think you'll spend on the Internet each month?
  • +
  • What are the monthly or hourly rates?
  • +
  • What technical support is offered?
  • +
+ + + +

Make sure your modem is properly connected and turned on, then click Download to begin.

+ +
+ +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/download.js b/mozilla/cmd/dialup/as_html/download.js new file mode 100644 index 00000000000..650aa2e75c2 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/download.js @@ -0,0 +1,153 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/editfour.htm b/mozilla/cmd/dialup/as_html/editfour.htm new file mode 100644 index 00000000000..fca85a03acc --- /dev/null +++ b/mozilla/cmd/dialup/as_html/editfour.htm @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + +
+ +

Other Account Setup Screens

+ +
+ +
+ + + + + +
+ + + + + +
+ The last few screens of the Account Setup's IAS mode are listed below. Account Setup displays these screens only in the specific circumstances described. You can edit these screens just as you would other screens of Account Setup. To load one of the screens, click the arrow corresponding to the screen.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + register.htm + + + + Displayed by Account Setup while it is in the process of connecting to the Internet account server. + +
+ +
+ + + ok.htm + + + + Displayed by Account Setup when the user has successfully completed the process of using your Internet account server to create an account. Account Setup receives the user's account information from your server, disconnects from the server, then loads this screen in the Account Setup window. + +
+ +
+ + + okreboot.htm + + + + Displayed in the same circumstances as above, if the users must restart his or her computer before connecting to the Internet. This is a situation which + will occur on Macintoshes running MacTCP only. Ignore this page if you are configuring for a Windows environment. + +
+ +
+ + + error.htm + + + + Displayed if Account Setup can't establish a connection with your Internet account server or the user connects to the Internet account server but exits without creating an account. + +
+ +
+ + + diff --git a/mozilla/cmd/dialup/as_html/editfour.js b/mozilla/cmd/dialup/as_html/editfour.js new file mode 100644 index 00000000000..600b82ec0c9 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/editfour.js @@ -0,0 +1,64 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/email.htm b/mozilla/cmd/dialup/as_html/email.htm new file mode 100644 index 00000000000..5d192dfbdf6 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/email.htm @@ -0,0 +1,119 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Your Email Login and Password

+ +

Enter your email name and password, if they are different from your account login name and password. If you are not sure about your email login and password, call your provider's technical support office.

+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + Email Login: + + + + + + (For example, jsmith) + +
+ +
+ + Password: + + + + +
+ +
+ + Type Password Again: + + + + +
+
+ +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/email.js b/mozilla/cmd/dialup/as_html/email.js new file mode 100644 index 00000000000..7cb35b4ca00 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/email.js @@ -0,0 +1,93 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/error.htm b/mozilla/cmd/dialup/as_html/error.htm new file mode 100644 index 00000000000..3fb61579cae --- /dev/null +++ b/mozilla/cmd/dialup/as_html/error.htm @@ -0,0 +1,106 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +

Connection Error...

+ + + + + + + + + + + +
+ +

Your connection to the Internet account server closed before you finished creating an account.

+ +

If you exited the Internet account server before you were finished creating an account, you can reconnect to the server later by launching Account Setup from the Netscape Communicator folder.

+ +

If Account Setup wasn't able to establish a connection with the Internet account server, make sure that your modem is installed properly, connected, and turned on. Also make sure that the telephone line you are using has an ordinary dial tone. When you're ready to try connecting again, click Connect Again.

+ +

For more troubleshooting tips, click Help.

+ +
+ +
+ + + + + + + + + + + +
+ +

Account Setup wasn't able to establish a connection to your account. Make sure that your modem is installed properly, connected, and turned on. Also make sure that the telephone line you are using has an ordinary dial tone. When you're ready to try connecting again, click Connect Again.

+ +

For more troubleshooting tips, click Help.

+ +
+ +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/error.js b/mozilla/cmd/dialup/as_html/error.js new file mode 100644 index 00000000000..758025f06e9 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/error.js @@ -0,0 +1,82 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/globals.htm b/mozilla/cmd/dialup/as_html/globals.htm new file mode 100644 index 00000000000..6c13a7897ee --- /dev/null +++ b/mozilla/cmd/dialup/as_html/globals.htm @@ -0,0 +1,142 @@ + + + + + + + + + + +
+
+ +Debug Mode:
+Edit Mode:
+QA Mode:
+International Mode:
+Startup File:
+Registration server:
+Reg Data:
+Reg Bookmark File:
+Reg Lock File:
+RegMode Active:

+Inited:
+Offline Mode:
+Warn on Cookies:
+Error, Try Again:
+Screen History:
+ +


+ +Path:
+ +First:
+Last:
+Company:
+Address1:
+Address2:
+Address3:
+City: +State: +Zip:
+Areacode: +Phonenumber:
+Country:
+CountryCode:
+ +Cardname:
+Cardtype:
+Cardcode:
+Cardnumber:
+Month:
+Year:
+ +Modem:
+ +Manufacturer:
+Model:
+Modem Port
+Printer Port
+ +Modem Areacode: +Modem Phonenumber:
+ +Accept Language: + +Alternate Area Code 1: +Alternate Area Code 2: +Alternate Area Code 3:
+ + +CallWaiting:
+ +Prefix:
+DialMethod:
+ +Providername:
+ProviderFilename:
+ +Account Areacode: +Account Phonenumber:
+ +Login Name:
+Password:
+Password Check:
+TTY Window:
+ +Email Name:
+Email Password:
+Email Password Check:
+ +Publish URL:
+Publish Password:
+Publish Password Check:
+View URL:
+ +SMTP server:
+Mail server:
+Mail protocol:
+NNTP server:
+LDAP server:
+ +Domain name:
+Primary DNS server:

+Secondary DNS server:

+Static IP address:

+ +Static IP address:

+Static IP address:

+ +Profile Lockfilename:

+ +External Editor:

+ +

+
+ + + + + + diff --git a/mozilla/cmd/dialup/as_html/globals1.js b/mozilla/cmd/dialup/as_html/globals1.js new file mode 100644 index 00000000000..adbefcf5016 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/globals1.js @@ -0,0 +1,881 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/globals2.js b/mozilla/cmd/dialup/as_html/globals2.js new file mode 100644 index 00000000000..a870a0e5de1 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/globals2.js @@ -0,0 +1,816 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/help/accounts.htm b/mozilla/cmd/dialup/as_html/help/accounts.htm new file mode 100644 index 00000000000..2e5e1b60562 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/accounts.htm @@ -0,0 +1,89 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Welcome to Account Setup

+ +

Account Setup is a utility that helps you quickly set up Communicator to access +the Internet. To use Account Setup properly, you must choose whether you want Account +Setup to:

+ +
    +
  • Help you create a new Internet account with your Internet service provider, or + + + +
  • Help you quickly set up Netscape Communicator and its connection software to + access an account that you already have. +
+ +

Select the option "I want to create a new Internet account" if:

+ +
    + +
  • You are new to the Internet, or + + + +
  • You want create a second or additional Internet account. +
+ +

Select the option "I already have an Internet account" if:

+ +
    + +
  • You want to set up access to an Internet account that you already have. Your account must be provided by an Internet service provider and must offer access to Internet services such as the World Wide Web, email, and newsgroups. +
+ +

To select one of the options described above, click the button to the left of the option in the Account Setup screen. +Then follow through the rest of the Account Setup screens, entering the appropriate information in each screen.

+ +

You can leave Account Setup at any time by clicking Exit in the Account Setup navigation bar.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/acctInfo.htm b/mozilla/cmd/dialup/as_html/help/acctInfo.htm new file mode 100644 index 00000000000..4744e2af086 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/acctInfo.htm @@ -0,0 +1,57 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Name and Company

+ +

Type your full name and, optionally, your organization name into the text boxes on +this screen. Account Setup then sets Communicator's Mail & Groups and Editor preferences +accordingly.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/ashelp.htm b/mozilla/cmd/dialup/as_html/help/ashelp.htm new file mode 100644 index 00000000000..77ffd578370 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/ashelp.htm @@ -0,0 +1,1328 @@ + + + + + + Account Setup Help + + + + +  + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Contents

+ +

What is Account Setup?

+ +

Creating a New Internet Account

+ + + +

Setting Up Access to An Internet Account You Already +Have

+ + + +

Troubleshooting

+ + + +

Glossary

+ + + + + + + + + +
+ +

What is Account Setup?

+ +

Account Setup is a tool that helps you quickly set up Communicator to access +the Internet. When you first install Communicator, you can use Account Setup in one of these ways:

+ +
    +
  • If you're new to the Internet, you can use Account Setup to help you create an Internet account and set up Communicator to access the account.
  • + + + +
  • If you already have an Internet account, you can use Account Setup to help you quickly set up Communicator to access your account.
  • +
+ +

Once you've set up Communicator to access your Internet account, you can use Account Setup to create additional Internet accounts. To do this, first use the Communicator's Profile Manager to create a new user profile for the account.

+ +

If you share your copy of Communicator with other users, or if you have more than one Internet account, read the document entitled "Working with Multiple User Profiles" in Communicator's Reference Library. The Reference Library is accessible from the Communicator folder or program group. The "Working with Multiple User Profiles" document provides full instructions on how to create multiple user profiles and associate them with specific Internet accounts.

+ +

To use Account Setup, follow through its screens and supply the information that Account +Setup requests. Account Setup uses the information you provide to automatically configure Communicator to access your account.

+ +

You can leave Account Setup at any time by clicking Exit in the Account Setup navigation bar.

+ + + + + + + + + + + +
+

What's next? +

Creating a New Account
+

See also: +

+ Glossary: Internet
+ Glossary: Internet Account
+ Glossary: Internet Service Provider + Glossary: User Profile
+ +

[CONTENTS]

+ + + + + +
+ + +

Creating a New Internet Account

+ + +

You can use Account Setup to quickly create a new Internet account. The process takes only a few minutes. All you need to do is follow through the Account Setup screens and enter the information that Account Setup asks you to provide.

+ +

After you've entered the information Accoaunt Setup needs, it uses your modem and phone line to temporarily connect you to a computer on the Internet called the Internet account server. The Internet account server is specially designed to provide you with easy access to information about the account plans available to you. You can use the Internet account server to "shop" for an Internet account that meets your needs and then create your new account.

+ +

When you are finished using the Internet account server to create your new Internet account, Account Setup disconnects you from the server and configures your computer and Communicator to access the account. Once you've used Account Setup to create your account, you can connect to the Internet just by launching Communicator from the Netscape Communicator folder or program group.

+ +

Before you begin using Account Setup, it's very important to make sure your modem is properly installed, connected to your computer and the phone jack, and turned on. Also, make sure that no other communications programs are using your modem when you use Account Setup. The modem must be available to Account Setup.

+ +

To use Account Setup to create a new Internet account, follow these steps:

+ +
    +
  1. If Account Setup isn't open already, launch it by double-clicking its icon in + the Netscape Communicator folder or program group. If you just finished installing + Communicator, Account Setup should already be open on your screen. In the welcome + screen, click the Start Account Setup button.
  2. + + + +
  3. The next screen offers you the choice of going straight to Account Setup or viewing + a short series of introductory screens that illustrate your connection to the Internet + and how you can use Account Setup. To view the introductory screens, click Next. + To go straight to Account Setup, click the Account Setup button in the navigation + bar.
  4. + + + +
  5. When you reach the first screen of Account Setup, click the button next to the option + "I want to create a new Internet account".
  6. + + + +
  7. In the screens that follow, supply the information that Account Setup requests. + If you don't understand what information Account Setup is asking you to provide or + aren't sure what action you are supposed to take, click the Help button.
  8. + + + +
  9. When you reach the last screen of Account Setup, click the Connect Now button + connect to the Internet account server, where you can learn about the + account plans available and create an account.
  10. + + + +
  11. After Account Setup connects, it loads the Internet Account Server screens in + the Account Setup window. Follow the instructions in the Internet Account Server + screens to create an account.
  12. + + + +
  13. When your account has been successfully created, Account Setup disconnects you from + the Internet account server and displays a "Congratulations!" screen. In this + screen, click the Save Account Information button if you want to save a record of your + account information to a text file on your computer. This includes such information as + your login, password, dial-up access number, provider domain name and DNS server + addresses, and so on.
  14. + + + +
  15. To finish using Account Setup, click Done in the navigation bar. Account Setup then + automatically sets up Communicator to access your account. Whenever you want to access + your account, all you have to do is launch Communicator from the Netscape Communicator + folder or program group.
  16. +
+ + + + + + + + + + +
+

What's next? +

Information You Need to Provide to Account Setup
+

See also: +

+ Setting Up Access to An Internet Account You Already Have
+ Glossary: Internet Account
+ Glossary: Internet Service Provider
+ Glossary: Modem
+ +

[CONTENTS]

+ + + + + + +
+ +

Information You Need to Provide to Account Setup

+ +

To use Account Setup to create a new Internet account, you need to provide some or +all of following information:

+ +
    +
  • Your name and address.
  • + + + +
  • A credit card number for billing.
  • + + + +
  • Your modem manufacturer and model.
  • + + + +
  • The phone number of the phone line at the location you are connecting from.
  • + + + +
  • Any special dialing settings specific to the location you are connecting from--to + turn off Call Waiting, access an outside line, or use pulse dialing.
  • +
+ +

Also, before you can create an Internet account, your modem must be installed +properly, connected, and turned on. If you haven't installed your modem yet, click +Exit to leave Account Setup.

+ +

After you've installed your modem, connected it to your computer and phone line, +and turned its power switch on, start Account Setup again by double-clicking its +icon in the Netscape Communicator folder or program group.

+ + + + + + + + + + + +
+

What's next? +

Arranging for Payment to your Internet Service Provider
+

See also:

+
+ Glossary: Internet Account
+ Glossary: Internet Service Provider
+ Glossary: Modem
+ + +

[CONTENTS]

+ + + + + + +
+ +

Arranging for Payment to Your Internet Service Provider

+ +

Internet accounts that you create using Account Setup are paid for by credit card. When Account Setup connects you to your provider's Internet account server, you can arrange for payment by providing your credit card number. Then, when your account is created, your provider automatically bills you each month for your account.This mechanism enables you to create an Internet account and use it right away.

+ +

To ensure your privacy, Account Setup scrambles your credit card number before +transmitting it to your provider. Your provider has a unique security key that allows +it to read your credit card number. In addition, Account Setup does not store your +credit card information anywhere on your computer.

+ + + + + + + + + + + +
+

What's next? +

Selecting a Modem
+

See also:

+ +
+ Glossary: Internet Account
+ Glossary: Internet Service Provider
+ +

[CONTENTS]

+ + + + + + +
+ +

Specifying What Kind of Modem You Are Using

+ +

Your modem is an important part of your Internet connection. Before you use Account +Setup, you must install your modem according to the manufacturer's instructions, +connect it properly to your computer and the phone jack, and turn its power switch +on.

+ +

Then, when you are using Account Setup, you must specify your modem's manufacturer (for example Hayes, US Robotics, Global Village, and so on) and model (for example, Sportster 28.8, Teleport Gold, Powerport Gold, and so on). This information lets Account Setup configure your connection software properly."

+ +

To specify your modem in Account Setup, follow these steps:

+ +
    +
  1. Select the modem you want to use from the pop-up up menu on the Account Setup + screen.
  2. + + + +
  3. Click Next to move to the next screen.
  4. +
+ +

If your modem is not listed in the pop-up menu, follow these steps:

+ +
    +
  1. Make sure that your modem is properly installed, connected, and turned on.
  2. + + + +
  3. Click the Modem Setup button, below the pop-up menu. On Windows systems, this opens the Modem Wizard, a tool that will help you specify your modem. Instructions for using the Modem Wizard are provided within that program. On Macintosh systems, clicking Modem Setup opens the Modem Setup tool. Instructions for using Modem Setup are provided in the next Help topic.
  4. +
+ +

On Macintosh systems, an item called "Generic" appears in the pop-up modem menu. You should select this item only if you are unable to specify your modem using Modem Setup. The "Generic" setting enables you to connect to your Internet account, but possibly not at optimal speed.

+ + + + + + + + + + +
+

What's next? +

Connecting to the Internet Account Server
+

See also:

+ +
+ Glossary: Internet Account
+ Glossary: Modem
+ +

[CONTENTS]

+ + + + + + +
+ +

Connecting to the Internet Account Server

+ +

When you reach the last screen of Account Setup, click the Connect Now button to +connect to the Internet account server, where you can learn about the account plans available and then create an account.

+ +

When you click Connect Now, Account Setup uses your modem, phone line, and connection software to establish a temporary connection with the Internet account server. +For this reason, your modem must be installed, connected properly, and turned on before you connect. When the connection is established, Account Setup displays the the Internet account server screens in the Account Setup window.

+ +

Follow the instructions on the Internet account server screens to create an account.

+ + + + + + + + + + + +
+

What's next? +

Saving Your Account Information
+

See also:

+ +
+ Glossary: Internet Account
+ Glossary: Internet Account Plan
+ Glossary: Internet Service Provider (ISP)
+ +

[CONTENTS]

+ + + + + + +
+ +

Saving Your Account Information

+ + +

When are done using the Internet account server and have successfully created a new +Internet account, Account Setup presents its final screen. This screen asks you whether +you want to save a record of your account information--your login name, password, +server addresses, and so on--to a text file.

+ +

Though it's optional, saving such a record of your account information can be very +useful. If you are concerned about the privacy of this information, print the text +file or copy it to a diskette, then delete it from your computer.

+ +

[CONTENTS]

+ + + + + + +
+ +

Setting Up Access to an Internet Account +You Already Have

+ +

If you already have an Internet account, you can use Account Setup to quickly +set up Communicator and its connection software to access the account. All you need +to do is follow through the Account Setup screens and enter information that Account +Setup asks you to provide.

+ +

Before you begin, it's very important to make sure your modem is properly installed, +connected to your computer and phone jack, and turned on. Also, make sure that no +other communications programs are using your modem when you run Account Setup. The +modem must be available to Account Setup.

+ +

To set up access to an account you already have, follow these steps:

+ +
    +
  1. If Account Setup isn't open already, launch it by double-clicking its icon in + the Netscape Communicator folder or program group. If you just finished installing + Communicator, Account Setup should already be open on your screen. In the welcome + screen, click the Start Account Setup button.
  2. + + + +
  3. The next screen offers you the choice of going straight to Account Setup or viewing + a short series of introductory screens that illustrate your connection to the Internet + and how you can use Account Setup. To view the introductory screens, click Next. + To go straight to Account Setup, click the Account Setup button in the navigation + bar.
  4. + + + +
  5. When you reach the first screen of Account Setup, click the button next to the option + "I already have an Internet account".
  6. + + + +
  7. In the screens that follow, supply the information that Account Setup requests. + If you don't understand what information Account Setup is asking you to provide or + aren't sure what action you are supposed to take, click the Help button.
  8. + + + +
  9. When you reach the last screen of Account Setup, entitled "You're Done!", + you have three options:
  10. + + + +
      +
    • You can click Connect Now, which tells Account Setup to configure your computer + with the information you just entered and then connect to your account right + away.
    • + + + +
    • You can click Done, which tells Account Setup to configure your computer with the + information you just entered, but without connecting you to your account.
    • + + + +
    • You can click Exit, which tells Account Setup to close without configuring your + computer.
    • +
    + +

    Once you've finished using Account Setup to configure your computer, you can access your account by launching Communicator from the Netscape Communicator folder or program group.

    + +
+ + + + + + + + + + + +
+

What's next? +

Information You Need to Provide to Account Setup
+

See also:

+ +
+ Creating a New Internet Account
+ Glossary: Internet Account
+ Glossary: Internet Service Provider
+ Glossary: Modem
+ +

[CONTENTS]

+ + + + + + +
+ +

Information You Need to Provide to Account Setup

+ +

To set up access to an Internet account you already have, you need to provide +some or all of the following information, depending on your provider:

+ +
    +
  • Your name and company.
  • + + + +
  • Your Internet service provider's company name.
  • + + + +
  • The phone number you dial to access your account.
  • + + + +
  • Your account login and password.
  • + + + +
  • Your email login and password (if applicable).
  • + + + +
  • Your provider's SMTP, POP, LDAP, IMAP, and NNTP server addresses (if + applicable).
  • + + + +
  • Your provider's domain name and DNS server addresses.
  • + + + +
  • The location where you can publish your Web pages (if applicable).
  • + + + +
  • Your modem manufacturer and model.
  • + + + +
  • The phone number of the phone line at the location you are connecting from.
  • + + + +
  • Any special dialing settings specific to the location you are connecting from--to + turn off Call Waiting, access an outside line, or use pulse dialing.
  • +
+ +

Your Internet service provider may have already supplied Account Setup with some +or all of the above information. Account Setup asks only for the information not +supplied by your provider.

+ +

You can probably find all the information that you need to provide in the forms given to you by your provider when you started your account. If you don't have the information you need, call your provider's technical support office.

+ +

If you aren't sure about what to enter into an Account Setup screen, click the +Help button.

+ +

For definitions of the terms above, refer to the Glossary.

+ + + + + + + + + + + +
+

What's next? +

Specifying Your Modem
+

See also:

+ +
+ Glossary: Internet Account
+ Glossary: NNTP Server
+ Glossary: DNS Server
+ Glossary: Domain Name
+ Glossary: Email Login
+ Glossary: POP and SMTP Servers
+ Glossary: Login Name (User Name)
+ Glossary: Internet Address
+ Glossary: Account Access Number
+ Glossary: Modem
+ +

[CONTENTS]

+ + + + + + +
+ +

Specifying Your Modem

+ + +

Your modem is an important part of your Internet connection. Before you use Account +Setup, you must install your modem according to the manufacturer's instructions, +connect it properly to your computer and the phone jack, and turn its power switch +on.

+ +

Then, when you are using Account Setup, you must specify your modem's manufacturer (for example Hayes, US Robotics, Global Village, and so on) and model (for example, Sportster 28.8, Teleport Gold, Powerport Gold, and so on). This information lets Account Setup configure your connection software properly."

+ +

To specify your modem in Account Setup, follow these steps:

+ +
    +
  1. Select the modem you want to use from the pop-up up menu on the Account Setup + screen.
  2. + + + +
  3. Click Next to move to the next screen.
  4. +
+ +

If your modem is not listed in the pop-up menu, follow these steps:

+ +
    +
  1. Make sure that your modem is properly installed, connected, and turned on. + + + +
  2. Click the Modem Setup button, below the pop-up menu. On Windows systems, this opens the Modem Wizard, a tool that will help you specify your modem. Instructions for using the Modem Wizard are provided within that program. On Macintosh systems, clicking Modem Setup opens the Modem Setup tool. Instructions for using Modem Setup are provided in the next Help topic.
  3. +
+ +

On Macintosh systems, an item called "Generic" appears in the pop-up modem menu. You should select this item only if you are unable to specify your modem using Modem Setup. The "Generic" setting enables you to connect to your Internet account, but possibly not at optimal speed.

+ + + + + + + + + + +
+

What's next? +

Connecting to Your Account
+

See also:

+ +
+ Glossary: Internet Account
+ Glossary: Modem
+ +

[CONTENTS]

+ + + + + + +
+ +

Connecting to Your Account

+ + +

When you reach the last screen of Account Setup, click the Connect Now button to +complete the setup process and connect to your account.

+ +

When you click Connect Now, Account Setup opens your connection software and dials +your modem to establish a connection. For this reason, your modem must be installed, +connected properly, and turned on.

+ +

After you've finished using Account Setup to configure your computer, you can connect to your account by launching Communicator from the Netscape Communicator folder or program group.

+ +

[CONTENTS]

+ + + + +
+ +

Troubleshooting

+ +

If you are having trouble using Account Setup successfully, refer to the topics +below for help isolating and resolving the problem.

+ + + + + + + +
+ +

I'm having trouble connecting to the Internet

+ +

These tips can help you resolve minor problems:

+ +
    +
  • Make sure your modem is installed, connected properly, and turned on. If you + are not sure whether your modem is set up correctly, see the "Modem Setup" + Troubleshooting topic.
  • + + + +
  • Go to the "Your Modem" screen in Account Setup. Verify that the correct modem type is selected in the pop-up menu. If necessary, look in your modem's documentation to confirm its manufacturer and model name. If your modem is not listed properly in the pop-up menu, click the Modem Detect button to launch Modem Setup, where you can specify your modem manually.
  • + + + +
  • If you need to use special dialing prefixes or codes--to turn off Call Waiting or to access an outside line before dialing, for example--be sure that you have entered the information correctly in the "Dialing Settings" for Your Location screen of Account Setup.
  • + + + +
  • Make sure that your phone line has a normal dial tone.
  • + + + +
  • Make sure that no other programs are using your connection software
  • +
+ +

Move to the last screen of Account Setup and try connecting again.

+ + +

[Troubleshooting]
+[CONTENTS]

+ + + + + + +
+ +

I'm having trouble with my modem

+ +

If Account Setup tells you that there is a problem with your modem, or if your modem won't dial, the problem is probably easy to correct: perhaps the wrong type of modem was specified in the "Your Modem" screen of Account Setup; perhaps the modem was not installed or connected properly or is not turned on. Here are some general tips:

+ +
    +
  • Verify that the power switch of your modem is on. You might even turn the modem off and then on again, just to make sure.
  • + + + +Go to the "Your Modem" screen in Account Setup. Verify that the correct modem type is selected in the pop-up menu. If necessary, look in your modem's documentation to confirm its manufacturer and model name. If your modem is not listed properly in the pop-up menu, click the Modem Detect button to launch Modem Setup, where you can specify your modem manually. + + + +
  • Make sure that your modem is connected properly. Look in your modem's documentation for details. In general, for external modems, one cable goes from the modem to the telephone wall jack, another cable goes from the modem to the telephone itself, and a third cable goes from the modem to the back of your computer, usually into the modem port (the modem port is sometimes marked by a telephone icon). On some modems, a power cord reaches from the modem to the wall power socket. Make sure all cables and the power cord are plugged in firmly.
  • + + + +
  • Verify that your modem was installed properly. Most internal modems include special software that needs to be installed on your computer. If you are not sure about whether your modem includes special software, look in the owner's manual of your modem. If you aren't sure whether the software is present on your computer, reinstall the software according to the manufacturer's instructions.
  • + + + +
  • If you have checked the other items in this list but are still having modem problems, try selecting the "Generic" item in the Modem Wizard (Windows) or Modem Setup (Macintosh), then use Account Setup again. If this does not help, there might be a problem with your modem itself (the modem isn't operating properly) or with your computer or phone line. Potential problems with phone lines are discussed in the next Help topic.
  • +
+ + + + + + +
+

See also:

+ +
Using Modem Setup
+ +

[Troubleshooting]
+[CONTENTS]

+ + + + + +
+ +

No Dial Tone Present on Telephone Line

+ +

If your connection software tells you that your phone line doesn't have a dial tone, +here are some tips:

+ +
    +
  • If you use a voice messaging system provided by a phone company and your modem + uses your regular phone line, you might need to get your messages before you can + connect to your Internet account.
  • + + + + Some voice messaging systems alert you to the fact that you have new messages + by changing the ordinary dial tone of your phone to a "flashing" dial tone + (an on-off-on-off dial tone). When this happens, your modem, not being able to detect + an ordinary dial tone, cannot dial out. The solution is to get your new messages. + + + + When you have heard and acted on all of your new messages, your normal, continuous + dial tone will be restored and you can connect to the Internet. + + + +
  • Pick up the receiver of your phone and see if you can hear the dial tone. If + you can't, then another telephone on the same line might be off the hook, or there + might be something wrong with your telephone line.
  • + + + +
  • Make sure that your phone line is plugged securely into your modem.
  • +
+ + +

[Troubleshooting]
+[CONTENTS]

+ + + + + +
+ +

Glossary

+ + + + + + + + + +
+ +

Internet

+ +

The Internet is a worldwide network of public and private computers that cooperate +to exchange information.

+ +

Many computers on the Internet are connected permanently together and function +as Internet "hubs." Millions of people take advantage of Internet services +either by connecting to these hubs directly--as when linked to a corporate or university +network--or by connecting indirectly, using a modem and an ordinary telephone line.

+ +

The first step in taking advantage of all that the Internet offers is setting +up an account with an Internet service provider.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Internet Service Provider (ISP)

+ +

An Internet service provider, sometimes called an ISP, is a type of company that +specializes in providing Internet access to individual users. It does this by maintaining +one or more computers with a permanent connection to the Internet, then offering +its customers access to that connection for a fee.

+ +

There are a variety of Internet service providers from which to choose--some large +companies, some small, some local companies, some national or even international. +These providers offer their services as packages, or account plans, which vary in +price and payment terms.

+ +

The first step in setting up access to the Internet is evaluating the account plans +of the various Internet service providers and selecting the one that best meets your +needs. Account Setup can help you do this.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Internet Account

+ +

An Internet account is your personal access point to the Internet--paid for by +you and registered in your name. You obtain an Internet account from an Internet +service provider, a type of company that maintains a computer with a permanent connection +to the Internet and offers its customers access to that connection for a fee.

+ +

When you start an Internet account, your Internet service provider authorizes you +to connect to its computer using your modem and phone line. This connection gives +you access to the World Wide Web, email, newsgroups, realtime audio and conferencing, +chatrooms, file transfer, and other Internet services. Your provider also creates +an email identity for you, so that you can send and receive email messages over the +Internet.

+ +

If you don't currently have an Internet account like the one just described, use +Account Setup to start one. Account Setup will let you compare the services and rates +of several top Internet service providers and choose the account plan that best meets +your needs.

+ +

On the other hand, if you already have an Internet account and can currently access +the World Wide Web, email, newsgroups, or other Internet services using your computer +and modem, then use Account Setup to help you set up Communicator to access your +existing account.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Internet Account Plan

+ +

An Internet account plan is a package of services offered by an Internet service +provider. All account plans offer access to the Internet for individual users, including +such popular Internet services as the World Wide Web, email, and newsgroups.

+ +

Aside from basic Internet services,all account plans are different. Some are designed +for people who access the Internet infrequently, while others are designed for people who +spend several hours on the Internet each day.

+ +

Account plans differ mainly in:

+ +
    +
  • The phone number you dial to + connect. + Some plans let you connect by dialing a local or regional phone number; + others, by dialing a toll-free number. Some plans offer many national or international + connection numbers, so you can connect while travelling. As shown on the previous + screen, you need to sign up with an Internet service provider before you can connect + to the Internet and use Communicator.
  • + + + +
  • Extra services and billing options. + Some plans include additional services, such as a place where you can publish your + own Web pages. Some plans are paid for at an hourly usage rate, while others give + you unlimited connection time for a flat monthly fee. Most plans also include a one-time + start-up fee, though the amount of the fee varies.
  • +
+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Modem

+ +

Your modem is a critical part of your dial-up connection. Without it, you could +not connect. A modem translates computer data into a stream of sounds that travel +along the phone line to your Internet service provider. Your Internet service provider +has another modem at its end of the phone line that translates the stream of sounds +back into computer data.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

NNTP Server

+ +

Your Internet service provider gives you access to the thousands of newsgroups +through its Network News Transport Protocol (NNTP) server.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

DNS Server

+ +

Your Internet service provider's Domain Name System (DNS) server enables you to use the Internet. It helps the messages you send and receive find their way to their proper destinations on the Internet. Sometimes a provider has an alternate (secondary) DNS server that can be used if the primary DNS server fails or is busy.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Domain Name

+ +

A domain name is the name of a computer as it is known to other computers on the +Internet. Domain names are unique and assigned according to the rules of the Domain +Name System (DNS).

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Email Login

+ +

Many Internet service providers let you use your Internet account login name and +password to access your email. Some providers, though, give you a different login +and password for email.

+ +

If you are unsure whether you need to use a special email login and password, +contact your provider.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

POP and SMTP Servers

+ +

Your provider has one or more servers dedicated to handling incoming and outgoing +email messages. A Post Office Protocol (POP or POP3) server handles the incoming +email, while a Simple Mail Transport Protocol (SMTP) server handles the outgoing +email. Sometimes POP and SMPT services are housed together on a single computer.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

IMAP Server

+ +

An Internet Message Access Protocol (IMAP) server is a type of mail server that is offered by some Internet service providers. Like a Post Office Protocol (POP) mail server, an IMAP mail server handles messages coming to you from the Internet.

+ +

If you are using an IMAP mail server, you always store your email messages on the server, rather than downloading them all each time you get your mail. When you check your mail, the server downloads only the message headers--subject, sender, date, and so on. When you want to read the message associated with the header, Netscape Messenger retrieves that message individually from the server.

+ +

If you are using a POP mail server, you can download all of your messages--including header and content--at once. You can also choose to leave the messages on the server.

+ +

Not all Internet service providers offer IMAP mail service. Contact your provider's technical support office if you're not sure whether you can use IMAP mail. In Communicator, you can choose IMAP or POP mail in the Communicator's Mail Preferences.

+ +

The advantages and disadvantages of IMAP and POP are described below.

+ +IMAP Mail + +
    +
  • Advantages: You can store your messages on the IMAP server, so that you can always get them, no matter where you are retriveing your mail from. When you open + your inbox, you download message headers only. When you open a message, + it's then downloaded to your local computer, so startup time is faster. + Also, because messages are stored on the server, and changes are copied + back from your local computer, you always have access to an updated + mailbox.
  • + + + +
  • Disadvantages: Unless you copy your messages to your local computer, if + your connection to your server goes down while you're working, you must + reestablish a connection before accessing messages, even though you can + browse the headers. Connect time can be longer, because you must either + be connected while you are browsing your messages, or you must + reconnect every time you access a message you haven't read.
  • + +
+ +POP Mail + +
    +
  • Advantages: Copies messages to your local computer all at once after + you connect to your server. If your connection goes down while you're + working, you have your messages.
  • + + + +
  • Disadvantages: You must synchronize your local inbox with your server's + mailbox. This can result in downloading new messages over and over (if + you save your messages on your server), each time you connect, or can + result in messages residing on computer's you've previously used, but + to which you may not currently have access. The end result is you are + sometimes unable to access all your messages when you need to.
  • + +
+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Login Name (User Name)

+ +

For security, your provider's computer asks for proof of your identity (login +name and password) before it lets you access your account. Your login name is often +used as the first part of your email address as well (for example, loginname@provider.com).

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Internet Address

+ +

Computers on the Internet each have a unique (one-of-a-kind) address. An address +consists of numbers separated by periods (for example, 123.233.234.244). Because +addresses are unique, computers on the Internet can exchange information successfully, +even if on opposite sides of the Earth.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Account Access Number

+ +

Your account access number is the telephone number that your computer dials to connect +to your account.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Server

+ +

In the lingo of the Internet, a server is a computer that is dedicated to performing +a specific job or set of jobs. For example, a DNS server is a computer that is dedicated +to the task of routing information to the proper location. "Server" can +also be used to mean the computer hardware that houses the server software.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + + +
+ +

Internet Account Server

+ +

Your provider's Internet account server gives you a convenient way to get started on the Internet. It lets you read about the Internet account plans available and choose the plan that suits you best. Once you've selected an account plan, the Internet Account Server enables you to create an account with the Internet service provider that you chose.

+ +

The process of using the Internet Account Server to create a new Internet account takes only a short time and, with most providers, you can begin using your account right away.

+ +

To use the Internet account server, run Account Setup and move to the "Welcome to Account Setup" screen. Click the "I want to create a new Internet account" option. Follow through the Account Setup screens, supplying information where necessary. Then, in the "Connect to Server" screen, click Connect Now to connect to the Internet account server.

+ +

To create an account, follow the instructions on the Internet account server screens.

+ +

[GLOSSARY]
+[CONTENTS]

+ + + + +
+ +

User Profile

+ +

Communicator lets you create different sets of bookmarks, address books, preferences, and and email identity. These sets of information are called user profiles. User profiles make it possible for several users--such as family members or coworkers--to use the same copy of Communicator on the same machine and maintain all of their personal settings separately from other users.

+ +

Communicator also allows you to associate each profile with a specific Internet account and dialing location, so that users who have more than one Internet account or who connect to their account from several locations can conveniently switch to the proper account or location when Communicator starts up.

+ +

For more information on Communicator user profiles, read the user profiles document in the Reference Library, accessible from the Netscape Communicator folder or program group. + + +

[GLOSSARY]
+[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/billing.htm b/mozilla/cmd/dialup/as_html/help/billing.htm new file mode 100644 index 00000000000..2bbc924cbc8 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/billing.htm @@ -0,0 +1,77 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Billing Information

+ +

Internet accounts that you create using Account Setup must be paid for by credit card. Account Setup assists you by forwarding the credit card information you provide on the screen to your provider. This mechanism enables you to create an Internet account and use it right away. + +

To ensure the privacy of your credit card information, Account Setup scrambles your credit card number before transmitting it to your provider. Your provider has a unique security key that allows it to read your credit card number. In addition, Account Setup does not store your credit card information anywhere on your computer.

+ +

Use the text boxes and pop-up menus to specify your credit card type, its number, +and its expiration date:

+ +
    +
  • Name on card: Your name as it appears on your credit card. + + + +
  • Type of card: The type of card you're using. You can use American Express, Discover, + MasterCard, or VISA. + + + +
  • Card number: The card number as it appears on the card. + + + +
  • Expiration date: The expiration date that appears on the card. +
+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/connect1.htm b/mozilla/cmd/dialup/as_html/help/connect1.htm new file mode 100644 index 00000000000..4fffa520222 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/connect1.htm @@ -0,0 +1,74 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Connect to Server

+ +

You've finished entering the information that Account Setup needs to connect you to the Internet account server. Click Connect Now to connect to the Internet account server, where you can learn about the account plans available and +create a new Internet account.

+ +

When you click Connect Now, Account Setup uses your modem, phone line, and the connection software installed with Communicator to initiate a connection with the Internet account server. For this reason, your modem must be properly installed and turned on, and your phone line must be available to Account Setup.

+ +

After Account Setup successfully connects, it loads the Internet account server screens in the Account Setup window. Follow the instructions on the Internet account server screens to learn about account plans available and create an account. Help is also available from the Internet account server screens.

+ +

When evaluating account plans, it helps to have some idea of how you will be using the Internet: +

    +
  • Will you always connect from home or will you also connect while traveling? Some plans offer a toll-free access number for travelers. Others offer a selection of many local access points so that you can always connect, wherever you are. However, these services might cost extra. + + + +
  • How many hours will you spend on the Internet each month? Some plans are designed for people who connect less often, letting you pay by the hour for Internet access. Other plans are designed for people who connect every day, giving you unlimited hours of connection time for a flat monthly fee. + +
+ +

Once you have chosen an account plan and created an account, Account Setup disconnects you from the Internet account server. It then automatically configures your computer to access your new account. + +

If you don't want to connect to the Internet account server right now, you don't need to. Account Setup saves the information you provided (except your credit card number), so that when you are ready to create an account, all you have to do is launch Account Setup and move to this screen to connect.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/connect2.htm b/mozilla/cmd/dialup/as_html/help/connect2.htm new file mode 100644 index 00000000000..91ca32536bc --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/connect2.htm @@ -0,0 +1,61 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

You're Done!

+ +

You've finished entering all the information that Account Setup needs to set up access to your Internet account. Account Setup configures your computer to access your account when you click either Connect Now or Done.

+ +

If you want Account Setup to configure your computer and then connect you to the Internet right now, click Connect Now.

+ +

If you want Account Setup to configure your computer but don't want it to connect you to your account right now, click Done. When you are ready to connect to the Internet, all you have to do is launch Netscape Communicator by double-clicking its icon in the Netscape Communicator folder or program group.

+ +

When you have more questions about using Communicator, you can find the information you need in Communicator's Help system, available from the Help menu, in and the Reference Library, available in the Netscape Communicator folder or program group.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/dial.htm b/mozilla/cmd/dialup/as_html/help/dial.htm new file mode 100644 index 00000000000..8468db0d99e --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/dial.htm @@ -0,0 +1,58 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Account Access Number

+ +

Enter the phone number your computer dials to connect to your Internet account. If dialing within the United States and Canada, be sure to include the area code.

+ +

If Account Setup already displays an access number in this screen, it is the access number recommended by your Internet service provider. It is best to use this number. + + +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/dialinf1.htm b/mozilla/cmd/dialup/as_html/help/dialinf1.htm new file mode 100644 index 00000000000..e78517f63fe --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/dialinf1.htm @@ -0,0 +1,98 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Dialing Settings for Your Location

+ +

Enter any of the dialing settings listed on this screen to enable Account Setup to successfully connect with the Internet account server:

+ +
    +
  • The code you dial to turn off Call Waiting (optional): + + + + If you have Call + Waiting, you should turn it off while you are connected to the Internet. Calls that come + in while you are connected might disturb the connection. + + + +From the pop-up menu on the screen, select the code you use to turn off Call Waiting during a call. If your code isn't listed, enter your code in the text box to the left of the menu. If you have Call Waiting but aren't sure what code to use to turn it off, call your telephone company. + + + + If you don't have Call Waiting, leave "Line Doesn't Have Call Waiting" selected in the + pop-up menu. + + + +
  • The number you dial to access an outside line (optional): + + + + If you are connecting from within an internal phone network, such as from an office building or hotel, enter the number that you dial access an outside line. + + + + If you don't need to access an outside line before dialing, leave the text box blank. + + + +
  • Your telephone's dialing method (if applicable): + + + + Choose either tone or pulse + dialing. Tone dialing, used by push-button telephones, is suitable for most phone + lines. However, some phone lines still use pulse dialing, the older method used by + rotary telephones. +
+ +

[CONTENTS]

+ + + + + + diff --git a/mozilla/cmd/dialup/as_html/help/dialinf2.htm b/mozilla/cmd/dialup/as_html/help/dialinf2.htm new file mode 100644 index 00000000000..762486fc432 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/dialinf2.htm @@ -0,0 +1,57 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Phone Number of Your Location

+ +

Enter the phone number of the line that is currently connected to your modem or computer. Account Setup uses this information to determine how to whether to dial an area code or other prefix. Therefore, don't enter your home phone number if you are connecting from another location.

+ + +

[CONTENTS]

+ + + + + + diff --git a/mozilla/cmd/dialup/as_html/help/dns.htm b/mozilla/cmd/dialup/as_html/help/dns.htm new file mode 100644 index 00000000000..cee33250535 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/dns.htm @@ -0,0 +1,67 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Provider's Domain Name and DNS Servers

+ +

Enter your provider's domain name and the internet addresses of your provider's DNS servers into the text boxes:

+ +
    +
  • Domain Name: Your provider's domain name is the internet identity of your provider's network of computers. It often looks something like providername.com or providername.net. + + + +
  • Primary and Secondary DNS Servers: Your provider's Domain Name System (DNS) servers route your email, requests for web pages, and other Internet traffic to their proper destinations on the Internet. The secondary DNS server is a backup to the primary server, in case the primary server goes offline or a part of the network is unavailable for some reason. +
+ +

Unlike the mail and news server information on the previous screen, Account Setup must have your provider's domain name and DNS server address before you can access the Internet. If you don't have this information or are unsure about the information +that you do have, call your provider before going on with Account Setup.

+ + +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/email.htm b/mozilla/cmd/dialup/as_html/help/email.htm new file mode 100644 index 00000000000..421d4cd5df3 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/email.htm @@ -0,0 +1,62 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Email Login and Password

+ +

Many Internet service providers let you use your account login name and +password to access your email. That way, you only have a single login and password to remember. Other providers, though, ask you to use a different login +and password for accessing email.

+ +

If your provider has given you a special login and password for email, enter them +into the appropriate text boxes. Account Setup configures Communicator's Mail & Groups preferences with the information you enter on this screen.

+ +

Account Setup automatically enters your account login and password into the text boxes on this screen. If you use a different login and password for email, enter the information into this screen. If you aren't sure whether you need a special email login and password, or aren't sure what yours is, call your provider's technical support office.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/error.htm b/mozilla/cmd/dialup/as_html/help/error.htm new file mode 100644 index 00000000000..566061c1990 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/error.htm @@ -0,0 +1,59 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Connection Error...

+ +

If you are having trouble connecting, retrace your steps in Account Setup to make sure that you entered the information correctly, then try connecting again.

+ +

Also, make sure your modem is properly connected and turned on. If you want to try connecting again now, click Connect Again.

+ +

For troubleshooting tips, use this link: Troubleshooting. + +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/fppphlp.htm b/mozilla/cmd/dialup/as_html/help/fppphlp.htm new file mode 100644 index 00000000000..d12082dd2a5 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/fppphlp.htm @@ -0,0 +1,1812 @@ + + + + + + + + FreePPP Dialer Help + + + + + +| + + +
+FreePPP Dialer Help + +
+ +
+ +

Contents

+

Getting Started

+ + + +

Using FreePPP

+ + + +

Customizing FreePPP

+ + + +

FreePPP Menus and Windows

+ + + + +

Troubleshooting

+ + + + + + +
+ +

Getting Started

+ +

To get started using FreePPP connection software and Netscape Communicator for the first time, follow +these steps:

+ +
    +
  1. Install the Internet Setup software suite from the Netscape Communicator CD, if you + haven't done so already. If you did an Easy Install of Netscape Communicator, the suite + is already installed.
  2. + +
  3. Make sure that you have a modem and that it is connected properly to your computer + and to a phone line. Make sure the modem is turned on.
  4. + +
  5. Run the Account Setup program, if you haven't done so already. Account Setup + helps you quickly configure FreePPP to access your Internet account. To run Account + Setup, double-click its icon in the Netscape Communicator folder. If you were already using + another version of FreePPP before you installed Communicator, your new version of + FreePPP imports all of your preferences and dialing settings.
  6. + +
  7. When you have successfully completed Account Setup, launch Communicator. FreePPP + is set to automatically connect to your account. When connecting, you can hear FreePPP + dialing your modem with the number of your provider. FreePPP also displays the Connection + Status window to inform you of the progress of the connection.
  8. +
+ +

If Netscape Communicator doesn't automatically launch FreePPP, or if you are having +trouble connecting, turn to the Troubleshooting section.

+ +

[CONTENTS]

+ + + + +
+ +

Your Internet Connection

+ +

With Netscape Communicator, you will be connecting to the Internet using a phone line and +modem--a very convenient, practical, and economical way to get what the Internet +has to offer.

+ +

+The essential parts of your connection to the Internet are: +

+ +
    +
  • Your personal computer. Your personal computer is where the Netscape Communicator + and your connection software--FreePPP--are running. FreePPP stores information about + what number you dial to connect to the Internet, as well as information about your + modem. When you connect to the Internet, your computer uses FreePPP and your modem + to dial the phone number of your Internet service provider's computer. FreePPP handles + the connection and lets you end the connection when you are ready.
  • + + + +
  • Your modem. Your modem is a critical part of your Internet connection. + Without it, you could not connect. A modem translates computer data into a stream + of sounds that travel along the phone line to your Internet service provider. Your + Internet service provider has another modem at its end of the phone line that translates + the stream of sounds back into computer data.
  • + + + +
  • A telephone line. To use the Internet, your personal computer needs a + way to exchange data with your Internet service provider's computer. In a dial-up + connection, this is accomplished using a phone line. Any ordinary phone line will + do: you can use your home phone line, a hotel phone line, or even, in some places, + a pay phone line.
  • + + + +
  • Your Internet service provider. Your Internet service provider is your + gateway to the Internet. Your provider's computer answers the phone call from your + personal computer. When it answers the call, the two computers can "talk" + to one another over the phone line. Your Internet service provider's computer takes + care of passing information back and forth between your computer and the Internet.
  • + + + +
  • The Internet. The Internet is a global network of computers that cooperate + to exchange information. Many of the computers on the Internet, such as your Internet + service provider's computer, are permanently connected together with fiber-optic + lines that can carry data at very high rates of speed. Using the Internet, you can + exchange information with any other user or computer linked to the network.
  • +
+ +

[CONTENTS]

+ + + + + + +
+ +

FreePPP and Account Setup

+ +

FreePPP features an easy-to-use, graphical interface that lets you configure it to +meet your needs. However, your version of Netscape Communicator includes Account Setup, a program that +handles configuring FreePPP for you, based on information you provide to it. Although +you can configure FreePPP manually, you do not need to do so.

+ +

If you want to configure FreePPP manually, instructions are provided in this Help +document. If you want to use Account Setup to configure FreePPP, simply launch Account +Setup by double-clicking its icon in the Netscape Communicator.

+ +

[CONTENTS]

+ + + + +
+ +

FreePPP and Multiple User Profiles

+ +

Netscape Communicator includes a feature called multiple user profiles that lets +several users share a single copy of Communicator. Each user can create his or her +own "profile", which is a complete set of Communicator preferences, an +email identity, a set of bookmarks, a set of mail and news server addresses, and a set +of email mailboxes and messages. A profile also includes a user's subscribed newsgroups and address book. By creating multiple profiles, each user can keep +his or her preferences, bookmarks, and email separate from those of other users.

+ +

Netscape Communicator lets you associate dialing information in FreePPP with specific +profiles, and in FreePPP you can store information about any number of Internet accounts +and modems. This gives you many ways to use profiles to make accessing the Internet +more convenient.

+ +

For example, you could create more than one profile for yourself, setting up one +profile for accessing your Internet account from work and another for accessing it +from home. Or, if you have more than one Internet account, you could create a profile +for each of your accounts, so that you would never need to reset your email identity +or mail and news server addresses or switch your dialer configuration when connecting.

+ +

To configure FreePPP with information about your Internet account--what number +you dial to connect, your login and password--you use Account Setup or configure +FreePPP manually. To create and manage profiles and associate them +with account configurations in FreePPP, you use the User Profile Manager, located in the +Netscape Communicator folder. The User Profile Manager lets you select which Internet account +you want to connect to when using a specific profile, and from what location you will +connect

+ +

If you share your copy of Communicator with other users, or if you have more than +one Internet account, read the document entitled "Working with Multiple User Profiles" +in the Communicator's Reference Library, accessible from the Netscape Communicator folder. That document provides full instructions on +how to create multiple user profiles and associate them with specific Internet accounts.

+ + + + + + + + + + +
+

What's next? +

Using FreePPP
+

See also: +

Account Setup Help
+ Setting Up Multiple User Profiles
+ +

[CONTENTS]

+ + + + +
+ +

System Requirements

+ +

The following hardware and software are necessary for FreePPP to function properly:

+ +
    +
  • 14.4 kbps or faster modem
  • + +
  • Open Transport version 1.1.1 or later (1.1.2 recommended), or MacTCP 2.0.6 or + later.
  • +
+ +

[CONTENTS]

+ + + +
+ +

Files Installed with FreePPP + +

FreePPP is part of a suite of connection software, consisting of the files listed +below. Of these files, you will use FreePPP Dialer most often.

+ +

+The Connection Software suite installed with Netscape Communicator includes: +

+ +
    +
  • FreePPP Dialer (installed in your system's Control Panels folder).
  • + + + +
  • FreePPP (installed in your system's Extensions folder).
  • + + + +
  • FreePPP Config Plugin (installed in your system's Extensions folder).
  • + + + +
  • MacTCP 2.0.6 (if you are not using Apple's Open Transport networking software, + MacTCP is installed in your system's Control Panels folder.)
  • +
+ +

[CONTENTS]

+ + + + + +
+ +

Using FreePPP

+ +

When you want to use Netscape Communicator to explore the Internet or send and +receive email, you first need to establish a connection with your Internet account +over your phone line and modem. There are two ways to establish this connection:

+ +
    +
  • Launch Netscape Communicator and link to a page on the web, check your email, + or read a newsgroup. When needed, Communicator automatically initiates a connection + to your account.
  • + + + +
  • Open FreePPP and initiate the connection manually +
+ +

Whether the connection is initiated by Communicator or by you, the role of your +connection software, FreePPP, is the same. Once it's told to connect, it dials your +modem, establishes data communication with your Internet service provider's computer, +and even passes along your account login and password, if you wish.

+ +

To control the way that FreePPP connects and the number it dials, you use a program +called FreePPP Dialer, installed on your Macintosh as a part of the Netscape Communicator +package. FreePPP Dialer also lets you store dialing information about multiple accounts +that you want to connect to and multiple locations that you connect from. This gives +you quick, automated access to the Internet from anywhere.

+ + + + + + + + + + +
+

What's next? +

Opening FreePPP
+

See also: +

Connecting to Your Account
+ Disconnecting from your Account
+ +

[CONTENTS]

+ + + +
+ +

Opening FreePPP

+ +

When you want to manually initiate a connection to your Internet account or work +with the account, location, and modem information stored in FreePPP, you must open +the FreePPP Dialer program.

+ +

To open FreePPP Dialer, launch the FreePPP Dialer application from your system's Control Panels folder. The FreePPP Dialer window opens on your screen. + +

Opening FreePPP is not the same as connecting to your Internet account. For information +on how to connect, see the next Help topic.

+ + + + + + + +
+

What's next? +

Connecting to Your Account
+ +

[CONTENTS]

+ + + + +
+ +

Connecting to Your Account

+ +

With Netscape Communicator, you don't need to manually launch the FreePPP Dialer program +and connect to the Internet. Instead, Communicator automatically initiates a connection +to your Internet account whenever you request a page from +the web, check your email, or read news. Communicator checks to see if you are connected +to your account. If you aren't, Communicator tells FreePPP to initiate the connection. +This convenient feature is called dial-on-demand. Most likely, you will use +dial-on-demand whenever you connect to the Internet.

+ +

However, if you wish to manually initiate a connection to your Internet account +using FreePPP Dialer, you can easily do so.

+ +

To manually initiate a connection to your Internet account, follow these steps:

+ +
    +
  1. Launch the FreePPP Dialer program from your system's Control Panels folder.
  2. + + + +
  3. From the pop-up menus in the FreePPP Dialer window, select the Account you want + to connect to, the Location you are connecting from, and the Modem you are using.
  4. + + + +
  5. Click the Connect button.
  6. +
+ +

When FreePPP begins connecting to your account, it opens the FreePPP Connection +Status dialog, shown here, to inform you of its progress.

+ + + + + +

FreePPP Connection Status dialog lets you observe as FreePPP Setup initializes +your modem, dials your account's access number, establishes communication, and provides +your account login name and password to your provider's computer.

+ +

When your connection is in place, FreePPP closes the FreePPP Connection Status dialog +box, leaving only the FreePPP Dialer window open, shown below.

+ + + + + +

FreePPP leaves the FreePPP Dialer window open while you are connected for three +reasons:

+ +
    +
  • To let you know if your connection fails for some reason while you are using + it. If this happens, reconnect by clicking the Connect button.
  • + + + +
  • To remind you that you are still connected. All the while you are connected, + the globe icon in the FreePPP Dialer window spins and the text to the right of the + Connect button informs you that your connection is still in place.
  • + + + +
  • To let you easily disconnect when you are ready to do so. To disconnect, you + must click the Disconnect button.
  • +
+ + + + + + +
+

What's next? +

Disconnecting from Your Account
+ +

[CONTENTS]

+ + + + +
+ +

Disconnecting from Your Account

+ +

When you are finished using the Internet, you need to terminate the telephone connection over which you connected to your Internet service provider.

+ +

To disconnect from your Internet account and end the phone call, follow these +steps:

+ +
    +
  1. Open FreePPP Dialer by double-clicking its icon in the Netscape Communicator folder.
  2. + + + +
  3. Click the Disconnect button.
  4. +
+ +

Important: Simply quitting Netscape Communicator does not end your connection +to your Internet account. To end your connection, you must use the Disconnect button +in the FreePPP Dialer window.

+ +

[CONTENTS]

+ + + + + +
+ +

Customizing FreePPP

+ +

If you have more than one account or modem, or want to access your account from +more than one location, you can customize FreePPP Dialer. You can store information +about additional accounts, locations, and modems in FreePPP Dialer, so that you can +always connect quickly.

+ +

There are two ways to add this information to FreePPP:

+ +
    +
  • Automatically, by using the Account Setup program (for account, location, and + modem information). If you simply want to change or upgrade the modem you are using, + you can use the Modem Setup program included with Netscape Communicator.
  • + + + +
  • Manually, using the FreePPP Dialer program (account, location, and modem information).
  • +
+ +

To use Account Setup to add information about accounts, locations, and modems, +all you have to do is launch Account Setup from the Netscape Communicator folder. The Account Setup screens guide you through the process of adding +the information. You can associate your new information with any Communicator user +profile.

+ +

Complete instructions for manually entering information in FreePPP Dialer are +provided in the Help topics that follow. The topics cover many of the most common +customization tasks that you might want to undertake. For more information about +FreePPP Dialer windows and settings, refer to the FreePPP Menus and Windows Help +section.

+ +

[CONTENTS]

+ + + + +
+ +

Expanding the FreePPP Dialer Window

+ +

Whenever you want to manually add, edit, or delete information about accounts, +dialing locations, or modems, you must open the FreePPP Dialer program and expand +its window. To do so, follow these steps:

+ +
    +
  1. Open the Netscape Communicator folder (the folder in which the Netscape Communicator + program resides).
  2. + + + +
  3. Double-click the FreePPP Dialer icon. When FreePPP launches, the FreePPP Dialer + window opens on your screen.
  4. + + + +
  5. Expand the FreePPP Dialer window by clicking the triangle icon in the lower left + corner of the FreePPP Dialer window.
  6. +
+ +

In lower half of the FreePPP Dialer expanded window, show below, you see four +"tabs" that divide the information stored in FreePPP.

+ + + + + +

To view the contents of one of the tabs, click the tab label. For more information +about how to add, edit, or remove information in the tabs, refer to the Help topics +below.

+ +

[CONTENTS]

+ + + + + +
+ +

Setting Connection Preferences

+ +

When connecting, FreePPP uses the selections in the Connect +To, From, and Using pop-up menus, shown below. If you have information about more +than one account, dialing location, or modem stored in FreePPP, be sure the proper +configurations are selected before connecting.

+ + + + + +

If you are using multiple Communicator user preferences, FreePPP changes to the +appropriate account, dialing location, and modem before connecting, as defined in +each user profile.

+
+ + +

[CONTENTS]

+ + + + +
+ +

Changing the Number that FreePPP Dials

+ +

When you tell FreePPP to connect to your account, it calculates the number that +it is supposed to dial by referring to information you have entered in the Accounts +and Locations tabs of the FreePPP Dialer expanded window.

+ +

First, FreePPP determines whether to dial the area code as part of the dial-up +access number. It does this by comparing the "Area Code" setting in the +Account Configuration Dialog of the Accounts tab--which represents where you are +calling to-- with the "Area Code" setting in the Locations tab--which represents +where you are calling from. If the two area codes match, FreePPP assumes that it +is not necessary to dial the area code when connecting. If the area codes do not +match, FreePPP follows the instructions you provide in the Location Configuration +Dialog.

+ +

After determining whether to dial the area code, FreePPP adds any special dialing +instructions to the number it will dial. These might include a dialing prefix, for +accessing an outside line or turning off Call Waiting, a telephone card or credit +card number, and a dialing suffix. These dialing instructions are found in the Location +Configuration Dialog of each dialing location.

+ +

You can change the number that FreePPP dials by editing the dialing information +in an account's Account Configuration Dialog or a dialing location's Location Configuration +Dialog.

+ +

Editing Your Account's Dialing Information

+ +

When you want to change information about your Internet account's dial-up access +number, edit an the account's Account Configuration Dialog. To do so, follow these +steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Accounts tab.
  2. + + + +
  3. In the Accounts tab, select the account you want to edit from the list on the + left. Then click Edit.
  4. + + + +
  5. In the Account Configuration Dialog that opens, click the Dialup subtab.
  6. + + + +
  7. In the Dialup subtab, add, edit, or remove dialing information as necessary.
  8. +
+ +

Editing Information about Your Dialing Location

+ +

When you want to change information about the location you are calling from or +want to provide special dialing instructions, edit a location's Location Configuration +Dialog. To do so, follow these steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Locations tab.
  2. + + + +
  3. In the Locations tab, select the dialing location you want to edit from the list + on the left. Then click Edit.
  4. + + + +
  5. In the Location Configuration Dialog that opens, add, edit, or remove dialing + information as necessary.
  6. +
+ + + + + + +
+

See also: +

Expanding the FreePPP Dialer window
+ Account Configuration Dialog
+ Location Configuration Dialog
+ Troubleshooting
+ +

[CONTENTS]

+ + + + +
+ +

Changing Your Account Login Name and Password

+ +

To change account login and password information stored +in FreePPP Dialer, follow these steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Accounts tab.
  2. + + + +
  3. In the Accounts tab, select the account you want to edit from the list on the + left. Then click Edit.
  4. + + + +
  5. In the Account Configuration Dialog that opens, click the Account subtab.
  6. + + + +
  7. In the Account subtab, edit your account login name in the User Name text box. + Edit your account password in the Password text box. For your security, FreePPP displays + your password as a set of dots, rather than as alpha-numeric characters. To edit + your password, you must reenter it.
  8. +
+ + + + + + + +
+

See also: +

Expanding the FreePPP Dialer window
+ Account Configuration Dialog
+ Troubleshooting
+ +

[CONTENTS]

+ + + + +
+ +

Setting Up Access to Multiple Dial-Up Accounts

+ +

If you have more than one dial-up account, you can set up +FreePPP with information about each account so that you can quickly switch between +accounts. To do so, you use the Accounts tab in the FreePPP Dialer expanded window +to create new account configurations.

+ +

To create a new account configuration, follow these steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Accounts tab.
  2. + + + +
  3. In the Accounts tab, click New if you want to create an entirely new configuration. + If you want to create a new configuration based on an existing configuration, select + the configuration from the list on the left and click Duplicate.
  4. + + + +
  5. In the Account Configuration Dialog that opens, fill in the Account, Dialup, + and Options subtabs.
  6. +
+ +

If you create more than one account configuration in FreePPP, be sure that you +use the Connect To pop-up menu in the FreePPP Dialer window to specify the account +that you want to connect to.
+
+ + + + + + +
+

See also: +

Expanding the FreePPP Dialer window
+ Account Configuration Dialog
+ +

[CONTENTS]

+ + + + +
+ +

Accessing an Account from Multiple Locations

+ +

If you want to access your account from more than one dialing +location--from home, work, and while travelling--you can set up FreePPP with information +about each dialing location so that you can quickly connect to your account. You +can also include special dialing instructions that let you bill your call to a telephone +card or credit card, dial a prefix for an outside line, and turn off call waiting, +for example. To set up multiple dialing locations in FreePPP, you use the Locations +tab in the FreePPP Dialer expanded window to create new dialing location configurations.

+ +

To create a new dialing location configuration, follow these steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Locations tab.
  2. + + + +
  3. In the Locations tab, click New if you want to create an entirely new configuration. + If you want to create a new configuration based on an existing configuration, select + the configuration from the list on the left and click Duplicate.
  4. + + + +
  5. In the Location Configuration Dialog that opens, fill in or edit the text boxes + as necessary.
  6. +
+ +

If you create more than one dialing location configuration in FreePPP, be sure +that you use the From pop-up menu in the FreePPP Dialer window to specify where you +are calling from.

+
+ + + + + + +
+

See also: +

Expanding the FreePPP Dialer window
+ Location Configuration Dialog
+ +

[CONTENTS]

+ + + + +
+ +

Changing or Upgrading a Modem

+ +

FreePPP lets you store information about multiple modems, +so that you can easily control what modem FreePPP will use when dialing to your account. +When you add a new modem or upgrade your modem, you use the Locations tab in the +FreePPP Dialer expanded window to create new dialing modem configurations. If you +upgrade your modem to a faster model, you must create a new modem configuration for +it, otherwise FreePPP won't be able to use the higher speeds your new modem offers.

+ +

To create a new modem configuration in FreePPP, you use the Modem Setup program included +with Netscape Communicator. To use Modem Setup to createa new modem configuration, follow these +steps:

+ +
    +
  1. Install the new modem according to the manufacturer's instructions. + Be sure that the modem is properly connected to your computer and that it is turned + on.
  2. + + + +
  3. In the Netscape Communicator folder, double-click the Modem Setup icon.
  4. + + + +
  5. When the Modem Setup window opens, the program automatically attempts to identify the modem installed on your computer.
  6. + + + +
  7. If Modem Setup identifies your modem correctly, click the + Use This Modem button.
  8. + + + +
  9. If Modem Setup incorrectly identifies your modem, click + the Choose From List button to specify your modem manually. Modem Setup presents you + with a list of modem manufacturers and a list of modem models and speeds. Select + your modem manufacturer and model from the lists and click Use This Modem. If your modem + manufacturer or model isn't displayed in the lists, select the manufacturer "Generic" + and the model that best approximates the speed of your new modem. Click Use This Modem.
  10. +
+ +

After you finish using Modem Setup, delete any modem configurations that you no +longer need from FreePPP. To delete a modem configuration, follow these steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Modems tab.
  2. + + + +
  3. In the Modems tab, select the configuration you want to delete from the list + on the left and click Delete.
  4. +
+ +

If you want to make changes to a modem configuration already in FreePPP, follow +these steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Modems tab.
  2. + + + +
  3. In the Modems tab, select the configuration you want to edit from the list on + the left and click Edit.
  4. + + + +
  5. In the Location Configuration Dialog that opens, fill in or edit the text boxes + as necessary.
  6. +
+ +

If you have more than one dialing location configuration stored FreePPP, be sure +that you use the Using pop-up menu in the FreePPP Dialer window to specify the modem +that is actually connected to your computer.

+ + + + + + + +
+

See also: +

Expanding the FreePPP Dialer window
+ Modem Configuration Dialog
+ +

[CONTENTS]

+ + + + +
+ +

Using a Connection Script

+ +

If your Internet service provider requires you to use a +connection script when connecting to your account, you can specify the script in +the Account Configuration Dialog. Your provider must provide you with the script +to use. The instructions below cover only how you enter the script into FreePPP.

+ +

To enter a connection script for an account, follow these +steps:

+ +
    +
  1. In the FreePPP Dialer expanded window, click the Accounts tab.
  2. + + + +
  3. In the Accounts tab, select the appropriate account configuration from the list + on the left and click Edit.
  4. + + + +
  5. In the Account Configuration Dialog that opens, click the Account subtab.
  6. + + + +
  7. From the Connect pop-up menu, select Using Connection Script. Then click the + Edit Connection Script button below the pop-up menu.
  8. + + + +
  9. In the dialog that opens, follow your provider's instructions for entering the + connection script.
  10. +
+ + + + + + + +
+

See also: +

Expanding the FreePPP Dialer window
+ Edit Connection Script Dialog
+ +

[CONTENTS]

+ + + + +
+ +

Entering TCP/IP Information

+ +

In FreePPP, there are two ways that you can enter TCP/IP +information.

+ +
    +
  • You can select Open TCP/IP from the Stuff Menu in the FreePPP Dialer window. + When you do so, FreePPP launches either MacTCP or the TCP/IP Control Panel used with + Open Transport.
  • + + + +
  • You can define a domain name and DNS server addresses for a specific account + in the FreePPP Account Configuration Dialog, in the Options subtab. If you use this + method, your system uses this domain and DNS information whenever you connect to + the associated account.
  • +
+ + +

[CONTENTS]

+ + + + +
+ +

FreePPP Menus and Windows

+ +

The Help topics in this section provide illustrations of +the various menus and windows found in FreePPP, and define the settings, text boxes, +checkboxes, and radio buttons found in each window.

+ + +

[CONTENTS]

+ + + + +
+ +

FreePPP Dialer Window

+ +

The FreePPP Dialer window lets you control all aspects of +your connection. When you first open FreePPP Dialer, the window shown below appears +on your screen.

+ + + + + +

Connect/Disconnect button.

+ +

Use this button to manually initiate a connection to your +account and disconnect from your account.

+ +

Status icon and status text

+ +

Refer to the status icon and status text to determine whether +you are currently connected to your account. When you are connected, the status icon, +a globe, starts to spin. The status text tells you that you are connected and how +long the connection has been in place.

+ +

Connection preference menus

+ +

Use these three pop-up menus to select what account you +want to connect to, what location you are connecting from, and what modem you want +to use when connecting. The items in each of the pop-up menus correspond to the account, +dialing location, and modem configurations stored in FreePPP.

+ +

Triangle icon

+ +

Click the triangle icon to expand the FreePPP Dialer window.

+ +

Information icon

+ +

Click the information icon to see details about your connection, +such as your current IP address, the IP address of the server you are connected to, +and your connection's throughput.

+ +

Help icon

+ +

Clicking the Help icon launches Communicator and opens this +help file in a browser window.

+ +

[CONTENTS]

+ + + + +
+ +

+FreePPP Dialer Window (Expanded) +

+ +

When you click the triangle icon in the FreePPP Dialer window, +the window expands to reveal the "tabs" where you can add, edit, or delete +information about account, dialing location, and modem configurations.

+ + + + + +

General Tab

+ +

The General tab lets you specify global connection settings for FreePPP.

+ +

Accounts Tab

+ +

The Accounts tab lets you edit information about specific account configurations.

+ +

Locations Tab

+ +

The Locations tab lets you edit information about specific dialing location configurations.

+ +

Modems Tab

+ +

The Modems tab lets you edit information about specific modem configurations.

+ + +

[CONTENTS]

+ + + + +
+ +

General Tab

+ +

The General tab lets you specify global connection settings for FreePPP. Each +is described below.

+ + + + + +

Allow applications to open connection

+ +

Check this setting's checkbox if you want to automatically connect to your Internet +account when you launch Netscape Navigator or another application. ("Checked" +recommended) + +

Disconnect if idle for...

+ +

Use this pop-up menu to select the amount of time that FreePPP allows your connection to remain open if you are not using it. FreePPP monitors whether data is being sent back and forth between your computer and the Internet and begins timing the "idle" time whenever no data is being sent or received. If the idle time reaches the interval you specify in the pop-up menu, FreePPP automatically disconnects. This feature can help you save money by minimizing the amount of time your phone line is being used.

+ +

Check line state when connected

+ +

Check this setting's checkbox if you want FreePPP to check the status of your +connection every two minutes. When this checkbox is checked, if FreePPP finds that your connection unexpectedly closed, it will try to reconnect automatically.("Checked" recommended)

+ +

Show alerts during connect and disconnect

+ +

Check this setting's checkbox if you want FreePPP to display alerts that inform +you of the status of your connection and confirm your actions in FreePPP.

+ +

On connect, open FreePPP Dialer application

+ +

Check this setting's checkbox if you want the FreePPP Dialer window to open whenever +a connection is established. ("Checked" recommended)

+ +

On connect, open "Netscape Communicator"

+ +

Check this setting's checkbox if you want FreePPP Dialer to open Communicator whenever it establishes a connection to your Internet account.

+ +

Open TCP/IP...

+ +

Click this button if you want tos open the Open Transport TCP/IP Control Panel to work with your TCP/IP configuratons.

+ +

[CONTENTS]

+ + + + +
+ +

+Accounts Tab +

+ +

The Accounts tab lets you edit information about specific account configurations. +To add, edit, or delete information about a specific account, select the account +from the list on the left of the tab and click the appropriate button on the right. +The tab is shown below.

+ + + + +

Accounts List

+ +

Select a configuration from the list. All of the account configurations currently +stored in FreePPP are displayed in this list.

+ +

Edit

+ +

Click Edit to open the selected configuration's Account Configuration Dialog.

+ +

New

+ +

Click New to open a blank Account Configuration Dialog.

+ +

Duplicate

+ +

Click Duplicate to open a copy of the selected configuration's Account Configuration +Dialog.

+ +

Delete

+ +

Click Delete to delete the selected configuration.

+ +

[CONTENTS]

+ + + + +
+ +

+FreePPP Account Configuration Dialog +

+ +

The Account Configuration Dialog displays all information +stored in FreePPP about a specific account configuration. The dialog is composed +of three subtabs: Account, Dialup, and Options.

+ +

Account Subtab

+ + + + +

Account Name

+ +

In the text box, enter a name for the account you are creating. If you are editing +an existing account, you can use this box to change the account's name, if you wish. +The name you choose appears as a list item in the Connect To pop-up menu in the FreePPP +Dialer window.

+ +

Connect: Directly

+ +

Choose this menu item if you want FreePPP to automatically log you in to your +account when it connects, using your account login name and password.

+ +

Connect: Using Connection Script

+ +

Choose this menu item if you want to connect to your account using a connection script.

+ +

To create or edit your connection script, click the "Edit connection script" +button. If you aren't sure how to create or edit your connection script for an account, +contact your Internet service provider.

+ +

Connect: Using Terminal Window

+ +

Choose this menu item if you want to connect to your account using a terminal-emulation +window. This allows you to manually log in to your account when connecting.

+ +

Connect: Manually

+ +

Choose this menu item if you want to connect to your account by dialing and logging +in manually.

+ +

Edit connection script

+ +

Click this button to open a dialog box where you can create or edit a connection +script. Not enabled unless you select Connection Script from the Connect pop-up menu, +above.

+ +

User name and Password

+ +

In these text boxes, enter your user name (login name) and password for your account. +Be sure to type carefully, using uppercase and lowercase letters as necessary, and +make sure Caps Lock is off.

+ +

If you leave this text box empty, FreePPP asks you to supply this information +when connecting to your account.

+ +

Reconnect automatically if connection drops

+ +

Check this checkbox if you want FreePPP Dialer to attempt to automatically reconnect to your account if the connection you are using is suddenly lost, or "dropped". Such sudden disconnections can happen because of noise on phone lines, problems on your provider's server, interruptions by services such as Call Waiting (if you have Call Waiting), or other causes.

+ + +

Dialup Subtab

+ + + + +

The dialup subtab lets you enter up to three dialing configurations for an account. FreePPP Dialer always dials the Main Number configuration first. If that number is busy, it dials the Alernate Number 1 configuration, followed by the Alternate Number 2 configuration.

+ +

The fields in each configuration are described below.

+ +

Area code

+ +

In the text box, enter the area code of the dial-up access number for the account +you selected. Do not include prefixes, dialing codes, or any special characters. +This field is for the area code only.

+ +

Phone number

+ +

In the text box, enter the phone number that you dial to connect with the account +(its dial-up access number).Do not include the area code, prefixes, or dialing codes +in this field. It is for the phone number only.

+ +

Dial area code

+ +

Check this setting's checkbox if you want FreePPP to dial the area code no matter +what, even if is the same area code as the Location from which you are dialing.

+ +

Dial as long distance

+ +

Check this setting's checkbox if you want FreePPP to dial a long distance prefix, +such as "1", before dialing the area code and number of your account.

+ +

To define the prefix, go to the Locations tab and select the Location you want +to use, then click the edit button. Enter the prefix in the text box labeled "Long +distance prefix.

+ +

Options Subtab

+ + + + +

Domain name

+ +

In the text box, enter the domain name of your provider's domain name server (for +example, dns.providername.com). If you aren't sure about the domain name, call your +provider. You must have this information to use the Internet.

+ +

Primary and Secondary DNS

+ +

In the text boxes, enter the addresses of your provider's primary and secondary +(optional) DNS servers. If you aren't sure about the DNS server addresses, call your +provider. You must have this information to use the Internet.

+ +

Configure OT TCP/IP for this Account

+ +

Check this checkbox if your system is using Apple's Open Transport networking software and you want FreePPP Dialer to automatically set up a TCP/IP configuration in Open Transport for this account.

+ +

If you have more than one Internet account, this feature enables you to automatically switch the active OT TCP/IP configuration when you switch accounts, so you don't need to open the TCP/IP Control Panel to do so.

+ +

IP address

+ +

Many providers assign IP addresses dynamically as users connect. If your provider +assigns IP addresses in this way, select the "Assigned by PPP server" radio +button.

+ +

If your provider already assigned you a permanent, unique IP address, (for example +123.45.123.45), select the lower radio button and enter your IP address into the +text box.

+ +

If you aren't sure about which radio button to select, choose "Assigned by PPP server" or contact your provider.

+ +

[CONTENTS]

+ + + + +
+ +

+Edit Connection Script Dialog +

+ +

Use the connection script dialog to enter a connection script +that you want FreePPP to use when connecting to the related account.

+ + + + +

Do

+ +

Use the Do pop-up menu items to select the action associated with the Text textboxes +on the right of the Do menu. Choices are Send and Wait For.

+ +

Text

+ +

Use the Text textboxes to specify the alpha-numeric characters subject to the +action defined in the Do menu to the left of each textbox.

+ +

Return

+ +

Check a Return checkbox to add a return character at the end of the line of text +specified in Text.

+ +

Wait Timeout

+ +

Set the Wait Timeout to the desired number of seconds.

+ +

[CONTENTS]

+ + + + +
+ +

+Locations Tab +

+ +

The Locations tab lets you edit information about specific dialing location configurations.

+ +

To add, edit, or delete information about a specific dialing location, select the +location from the list on the left of the tab and click the appropriate button on +the right. The tab is shown below.

+ + + + + +

Locations List

+ +

Select a configuration from the list. All of the dialing location configurations +currently stored in FreePPP are displayed in this list.

+ +

Edit

+ +

Click Edit to open the selected configuration's Location Configuration Dialog.

+ +

New

+ +

Click New to open a blank Location Configuration Dialog.

+ +

Duplicate

+ +

Click Duplicate to open a copy of the selected configuration's Location Configuration +Dialog.

+ +

Delete

+ +

Click Delete to delete the selected configuration.

+ +

[CONTENTS]

+ + + + +
+ +

+FreePPP Location Configuration Dialog +

+ +

The Location Configuration Dialog displays all information +stored in FreePPP about a specific dialing location configuration.

+ + + + + +

Location name

+ +

In the text box, enter a name for the location you are creating. If you are editing +an existing location, use this box to change the name of the location, if you wish. +The name you choose appears as a list item in the From pop-up menu in the FreePPP +Dialer window.

+ +

Area code

+ +

In the text box, enter the area code of the location that you are dialing from +or creating. Do not include prefixes, dialing codes, or any special characters. This +field is for the area code only.

+ +

Long distance prefix

+ +

In the text box, enter the prefix that you want FreePPP to dial, such as "1", +if the account you are connecting to is long distance. Do not include other prefixes +or numbers in this text box. It is for the long distance prefix only.

+ + +

When you tell FreePPP to connect to your account, it first determines whether to +dial the area code as part of the dial-up access number. It does this by comparing +the "Area code" setting in the Accounts tab--which represents where you +are calling-- with the "Area code" setting in the Locations tab--which +represents where you are calling from. If the two area codes match, FreePPP assumes +that it is not necessary to dial the area code when connecting.

+ +

This pop-up menu lets you control what action FreePPP takes if the two area codes +do not match.

+ +

Normally, the "Dial long distance prefix before account area code" menu +item would be selected. However, depending on your location, you might want to select +one of the other menu items.

+ +

Dial prefix

+ +

In this text box, enter any numbers that FreePPP is to dial before dialing the +account phone number, when connecting from this Location. Examples of such a prefixes +are a number for accessing an outside line and turning off Call Waiting.

+ +

Long distance access code

+ +

In this text box, enter any number that you want FreePPP to dial between the dial +prefix and the account phone number. This box can be used to enter the access number +of your long distance carrier, for example. If you wish the modem to pause, enter +a comma in the number string where you want the modem to pause.

+ +

Dial suffix

+ +

In this text box, enter any numbers that you want FreePPP to dial after dialing +your account dial-up access number. If you use a numerical code or authentication +PIN for your long distance calls, this is where you could enter that information.

+ +

[CONTENTS]

+ + + + +
+ +

+Modems Tab +

+ +

The Modems tab lets you edit information about specific dialing location configurations. +To add, edit, or delete information about a specific modem, select the modem from +the list on the left of the tab and click the appropriate button on the right. The +tab is shown below.

+ + + + +

Modem Configurations List

+ +

Select a configuration from the list. All of the dialing location configurations +currently stored in FreePPP are displayed in this list.

+ +

Edit

+ +

Click Edit to open the selected configuration's Modem Configuration Dialog.

+ +

New

+ +

Click New to open a blank Modem Configuration Dialog.

+ +

Duplicate

+ +

Click Duplicate to open a copy of the selected configuration's Modem Configuration +Dialog.

+ +

Delete

+ +

Click Delete to delete the selected configuration.

+ +

[CONTENTS]

+ + + + +
+ +

+FreePPP Modem Configuration Dialog +

+ +

The Location Configuration Dialog displays all information +stored in FreePPP about a specific dialing location configuration.

+ + + + + +

Modem config name

+ +

In the text box, enter the name of the modem configuration that you are creating. +If you are editing an existing modem configuration, you can use this box to change +the name of the modem configuration, if you wish. The name you choose appears as +a list item in the Using pop-up menu in the FreePPP Dialer window.

+ +

Connected to

+ +

In the pop-up menu, select the port to which your modem is connected. If you aren't +sure, look in the back of your Macintosh. The modem port is marked with a telephone +receiver icon. The printer port is marked with a printer icon.

+ +

Port speed

+ +

In the pop-up menu, select the port speed that you want to use when connected. +The port speed should be set as high as possible, but not higher than your Macintosh +and modem are capable of supporting.

+ +

The fastest port speed supported for most 14.4 Kbps modems is 57,600 bps. For +28.8K/33.6 Kbps modems, the fastest is 115,200 bps (some support 230,400 bps, but +most do not). Unless you have a Mac with the GeoPort Serial Architecture (Quadra +660AV/840AV or Power Macintosh 6100/7100/7200/7500/7600/8500/9500) or a serial board +capable of supporting faster speeds, do not select a port speed higher than 115,200 +bps.

+ +

Flow control

+ +

In the pop-up menu, select the method you want to use for handling flow control +(hardware handshaking) between your Macintosh and your modem.

+ +

CTS & RTS (DTR) is the most common setting. CTS Only is the second most common +setting. + +

Dial type

+ +

In the pop-up menu, select whether to use tone or pulse dialing when connecting. +Tone dialing, used by push-button telephones, is suitable for most phone lines. However, +some phone lines still require pulse dialing, an older dialing method used by rotary +telephones.

+ +

Speaker enabled

+ +

Check this setting's checkbox if you want your modem's speaker to be turned on +while connecting. ("Checked" recommended)

+ +

Hang up on disconnect

+ +

Check this setting's checkbox if you want FreePPP to hang up the phone when a +PPP session ends. ("Checked" recommended)

+ +

Performa internal modem

+ +

Check this setting's checkbox if you want to use the sound input channel on a +Performa 5xxx or 6xxx models while online (with an internal Global Village modem). +Note that this option turns off the sound on your modem while the modem is connecting.

+ +

Long re-dial delay

+ +

Check this setting's checkbox if you want FreePPP to wait one minute between redial +attempts (if the line that you are trying to connect to is busy). When the checkbox +is not checked, FreePPP attempts to redial after a few seconds.

+ +

Fast modem initialization

+ +

Check this setting's checkbox if you don't want FreePPP to pause for one second +after initializing the modem, before starting to dial.

+ +

If you are using an internal PowerBook modem or another modem that requires a +delay after initialization, do not check this box.

+ +

Modem init string settings

+ +

Select whether you want FreePPP to autodetect your modem's initialization string. +If you want to have FreePPP decide the initialization string, select the "AutoDetect +init string" radio button.

+ +

If you want to specify the initialization string manually, select the "Use" +radio button and enter the string your want to use in the text box.

+ +

[CONTENTS]

+ + + + +
+ +

+FreePPP Information Window +

+ +

The FreePPP Information window displays technical information +about your connection.

+ + + + + +

IP Address

+ +

Refer to this field to determine the current IP address +of your computer.

+ +

Server Address

+ +

Refer to this field to determine the IP address of the server +you are currently connected to.

+ +

Tx Activity and Rx Activity

+ +

Refer to these fields to see a graphical representation +of how fast data is being transmitted and received by your system.

+ +

Best Throughput

+ +

Refer to these fields to determine the best data-transfer +rate for transmit and receive in the current connection.

+ +

[CONTENTS]

+ + + + +
+ +

Troubleshooting

+ +

If you are having trouble using the FreePPP Dialer, refer to the topics +below for help isolating and resolving the problem.

+ + + + + + + + + +
+ +

I'm having trouble connecting to the Internet

+ +

These tips can help you resolve minor problems:

+ +
    +
  • Make sure your modem is installed, connected properly, and turned on. If you + are not sure whether your modem is set up correctly, set up your modem using the Netscape Modem Setup tool in the Netscape Communicator folder.
  • + + +

    Make sure that your modem is connected properly. Look in your modem's documentation for details. In general, for external modems, one cable goes from the modem to the telephone wall jack, another cable goes from the modem to the telephone itself, and a third cable goes from the modem to the back of your computer, usually into the modem port (the modem port is sometimes marked by a telephone icon). On some modems, a power cord reaches from the modem to the wall power socket. Make sure all cables and the power cord are plugged in firmly.

    + + +

    Verify that your modem was installed properly. Most internal modems include special software that needs to be installed on your computer. If you are not sure about whether your modem includes special software, look in the owner's manual of your modem. If you aren't sure whether the software is present on your computer, reinstall the software according to the manufacturer's instructions.

    + + + +
  • Check to make sure FreePPP Dialer is correctly dialing the phone number of your Internet service provider. You can see the number that FreePPP is dialing in the FreePPP Dialer window.
  • + +

    If FreePPP Dialer is not dialing correctly, first check to make sure the correct account, location, and modem are selected in the "Connect to:", "From:", and "Using" pop-up menus in the FreePPP Dialer window.

    + +

    Next, open the Locations tab in the FreePPP Dialer expanded window. Select the location you are connecting from and click Edit. Check the phone number and area code and the pop-up menu that tells FreePPP Dialer what to do if the area code of your location doesn't match the area code of your account. Normally, you would select "Dial long distance prefix before account area code" item.

    + +

    Finally, open the Accounts tab. Select the account you are connecting to and click Edit. Make sure you entered the phone number and area code correctly.

    + + + +
  • If you need to use special dialing prefixes or codes at your location--to turn off Call Waiting or to access an outside line before dialing, for example--be sure that the information is correctly entered for your current location.
  • + +

    Open the Locations tab in the FreePPP Dialer expanded window. Select the location you are connecting from and click Edit. Check the "Dial prefix" text box. The number you dial to access an outside line should be listed first, followed by a comma. Listed next should be the code you use to turn off Call Waiting, followed by a comma (a comma tells FreePPP Dialer to pause momentarily).

    + + + +
  • Make sure that your phone line has a normal dial tone. + + + +
  • Make sure that no other programs are using your connection software. +
+ +

If your modem is dialing correctly but you can't connect, your provider's server might be busy.

+ + +

[TROUBLESHOOTING]
+[CONTENTS]

+ + + + +
+ +

No Dial Tone Present on Telephone Line

+ +

If your connection software tells you that your phone line doesn't have a dial tone, +here are some tips:

+ +
    +
  • If you use a voice messaging system provided by a phone company and your modem + uses your regular phone line, you might need to get your messages before you can + connect to your Internet account.
  • + + +

    + Some voice messaging systems alert you to the fact that you have new messages + by changing the ordinary dial tone of your phone to a "flashing" dial tone + (an on-off-on-off dial tone). When this happens, your modem, not being able to detect + an ordinary dial tone, cannot dial out. The solution is to get your new messages. +

    + + +

    + When you have heard and acted on all of your new messages, your normal, continuous + dial tone will be restored and you can connect to the Internet. +

    + + + +
  • Pick up the receiver of your phone and see if you can hear the dial tone. If + you can't, then another telephone on the same line might be off the hook, or there + might be something wrong with your telephone line.
  • + + + +
  • Make sure that your phone line is plugged securely into your modem.
  • +
+ + +

[TROUBLESHOOTING]
+[CONTENTS]

+ + + + +
+ +

Repeated DNS Errors in Communicator

+ +

If you have more than one Internet account and are having trouble accessing Web sites or using email because of DNS errors, check to make sure the correct TCP/IP configuration is active in the TCP/IP Control Panel (for systems using Apple's Open Transport networking software only).

+ +

To check the active TCP/IP configuration, follow these steps:

+ +
    +
  1. Open your system's TCP/IP Control Panel.
  2. + + + +
  3. Choose Configurations from the File menu.
  4. + + + +
  5. Select the configuration you want to use--that of your Internet account--and click Make Active.
  6. + + + +
  7. Close the TCP/IP Control Panel.
  8. +
+ + +

[TROUBLESHOOTING]
+[CONTENTS]

+ + + + + + + diff --git a/mozilla/cmd/dialup/as_html/help/hsheet.htm b/mozilla/cmd/dialup/as_html/help/hsheet.htm new file mode 100644 index 00000000000..00e34f743fb --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/hsheet.htm @@ -0,0 +1,77 @@ + +//TAGS FOR ACCOUNT SETUP HELP + +tags.BODY.fontFamily="PrimaSans BT, Helvetica,Arial"; +tags.BODY.borderWidths(0, 0, 0, 0); +tags.BODY.paddings(0, 0, 0, 0); + +tags.P.fontFamily="PrimaSans BT, Helvetica,Arial"; +tags.P.fontSize="12"; +tags.P.lineHeight="1.1"; +tags.P.marginRight="3"; +tags.P.marginLeft="3"; + + +//Titles of Internet Preview screens + +classes.title.all.fontSize="23"; +classes.title.all.fontFamily="PrimaSans BT, Helvetica,Arial"; +classes.title.all.margins(34,0,0,43); + + +//Tables (for forms inputs, etc.) + +tags.TABLE.marginTop="6"; + +tags.TD.fontFamily="PrimaSans BT, Helvetica,Arial"; +tags.TD.fontSize="12"; +tags.TD.lineHeight="1.1" + + + +//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="12"; + +ids.smallleftmargin.margins(14,40,0,160); +ids.mediumleftmargin.margins(14,40,0,265); +ids.bulletssmallleftmargin.marginLeft="160"; + + +//Lists + +tags.UL.listStyleType="disc"; +tags.UL.fontFamily="PrimaSans BT, Helvetica,Arial"; +tags.UL.fontSize="12"; +tags.LI.fontSize="10"; +tags.OL.fontFamily="PrimaSans BT, Helvetica,Arial"; +tags.OL.fontSize="12"; + + +//Account Setup tag + +classes.helptag.all.fontSize="12"; +classes.helptag.all.paddingLeft="5"; +classes.helptag.all.color="white"; +classes.helptag.all.marginTop="0"; + + diff --git a/mozilla/cmd/dialup/as_html/help/images/license b/mozilla/cmd/dialup/as_html/help/images/license new file mode 100644 index 00000000000..947718beabb --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/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/as_html/help/modem1.htm b/mozilla/cmd/dialup/as_html/help/modem1.htm new file mode 100644 index 00000000000..c5f1f6c5bb3 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/modem1.htm @@ -0,0 +1,90 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Modem

+ +

To enable Account Setup to connect you to the Internet account server, you need to tell it what kind of modem is now connected to your computer.

+ +

To specify what modem you are using, follow these steps:

+ +
    +
  1. Select the modem connected to your computer from the pop-up up menu on the screen. + + + +
  2. Click Next to move to the next screen. +
+ +

If your modem is not listed in the pop-up menu, follow these steps:

+ +
    +
  1. Make sure that your modem is properly installed, connected, and turned on. + + + +
  2. Click the Modem Setup button, below the pop-up menu. (On Windows NT systems, there is no Modem Setup button.) + + + +On Windows systems, this opens the Modem Wizard, a tool that will help you specify your modem. Instructions for using the Modem Wizard are provided within that program. + + + +On Macintosh systems, clicking Modem Setup opens the Modem Setup tool. For assistance using Modem Setup, click this link: Using Modem Setup. + + + + Note that if you are using a Windows NT system, no Modem Setup button appears on this screen, as your modem has already been configured during installation.
  3. +
+ +

On Macintosh systems, an item called "Generic" appears in the pop-up modem menu. You should select this item only if you are unable to specify your modem using Modem Setup. The "Generic" setting enables you to connect to your Internet account, but possibly not at optimal speed.

+ +

[CONTENTS]

+ + + + + + diff --git a/mozilla/cmd/dialup/as_html/help/modwiz.htm b/mozilla/cmd/dialup/as_html/help/modwiz.htm new file mode 100644 index 00000000000..3ee3b6dca6d --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/modwiz.htm @@ -0,0 +1,100 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Using Modem Setup (Macintosh only)

+ +

The Modem Setup tool helps you specify the modem that you want to use when connecting +to your Internet account. Before you use Modem Setup, make sure that your modem is +properly installed, connected, and turned on.

+ +

To use Modem Setup, follow these steps:

+ +
    +
  1. Open Modem Setup from Account Setup or from the Netscape Communicator folder. + + + +
  2. When Modem Setup opens, wait as the program automatically tries to determine what modem is connected to the computer. + + + +
  3. If Modem Setup finds your modem and correctly identifies its manufacturer and + model, click Use This Modem. Modem Setup closes. +
+ +

If Modem Setup isn't able to find your modem, or if it finds your modem incorrectly, +follow these steps:

+ +
    +
  1. Check to make sure that your modem is installed correctly and that it is plugged securely into the Modem Port or Printer Port on the back of your Macintosh. Make sure the modem's power is on. + + + +
  2. In the Modem Setup window, click Detect Again to let Modem Setup try to determine what kind of modem is connected to your computer. If it finds your modem correctly, click Use This Modem. If it still doesn't identify your modem correctly, click Choose From List to specify your modem by hand. Two lists appear in the Modem Setup window. + + + +
  3. Select the your modem's manufacturer from the list on the left. If you don't see the manufacturer's name, choose "Hayes Compatible," a generic setting that supports most modem types. + + + +
  4. Next, choose the model number of your modem from the list on the right. If your model number isn't in the list, choose your modem's speed (for example 14.4 Kbps + or 28.8 Kbps). Add info about (enhanced)(regular) here... + + + +
  5. Specify the port (on the back of your computer) to which your modem is connected. You might double-check this on the back of your computer before specifying a port in Modem Setup. + + + +
  6. When you have selected from both lists and specified the port that your modem is connected to, click Use This Modem. Modem Setup closes. +
+ +

[CONTENTS] [Back]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/namepw.htm b/mozilla/cmd/dialup/as_html/help/namepw.htm new file mode 100644 index 00000000000..495d950e223 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/namepw.htm @@ -0,0 +1,61 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Account Login and Password

+ +

Enter your Internet account login name and password. When typing your password, +make sure to use uppercase and lowercase letters as necessary.

+ +

Your connection software will use this information to automatically log you into +your account whenever you connect.

+ +

If you are sharing a computer and a single copy of Communicator with other users, you might want to set your connection software to ask for your password every time you connect. To do this, enter only your login name--leave the password box blank.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/needs1.htm b/mozilla/cmd/dialup/as_html/help/needs1.htm new file mode 100644 index 00000000000..a270135031c --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/needs1.htm @@ -0,0 +1,80 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Preparing to Create a New Account

+ +

To use Account Setup to create a new Internet account, you need to provide the following information:

+ +
    +
  • Your name, address, and telephone number. + + + +
  • A credit card number for billing. + + + +
  • Your modem manufacturer and model. + + + +
  • The phone number of the phone line at the location you are connecting from. + + + +
  • Any special dialing settings specific to the location you are connecting from--to turn off Call Waiting, access an outside line, or use pulse dialing. +
+ +

To help you create a new account, Account Setup uses your modem, telephone line, and the connection software installed with Communicator to connect you to the Internet account server. The Internet account server presents you with specific information about account plans available to you, so that you can select the account plan that best meets your needs.

+ +

In the next few screens, Account Setup asks you to enter the information it needs to connect you to the Internet account server. If you aren't sure about what information to enter in an Account Setup screen, click the Help button in the Account Setup navigation bar.

+ +

When you have provided the information that Account Setup needs, Account Setup connects you to the Internet account server.

+ +

[CONTENTS]

+ + + + diff --git a/mozilla/cmd/dialup/as_html/help/needs2.htm b/mozilla/cmd/dialup/as_html/help/needs2.htm new file mode 100644 index 00000000000..d235eb98915 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/needs2.htm @@ -0,0 +1,104 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Preparing to Set Up Access

+ +

To set up access to your Internet account, you need to provide the following types +of information:

+ +
    +
  • Your name and company. + + + +
  • Your account access phone number. + + + +
  • Your account login and password. + + + +
  • Your email login and password (if applicable). + + + +
  • Your provider's mail and news server addresses (if applicable). + + + +
  • Your provider's domain name and DNS server addresses. + + + +
  • The location where you can publish your Web pages (if applicable). + + + +
  • Your modem manufacturer and model. + + + +
  • The phone number of the phone line at the location you are connecting from. + + + +
  • Any special dialing settings specific to the location you are connecting from--to turn off Call Waiting, access an outside line, or use pulse dialing. +
+ +

Depending on your Internet service provider, you might not need to enter all of this information--your Internet service provider might have already supplied Account Setup with some of it. Account Setup asks only for the information not supplied by your provider.

+ +

You can probably find the information that you need to provide in the forms given to you by your provider when you started your account. If you don't have the information you need, +call your provider's technical support office.

+ +

If you aren't sure about what to enter into an Account Setup screen, click the +Help button.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/newAcct.htm b/mozilla/cmd/dialup/as_html/help/newAcct.htm new file mode 100644 index 00000000000..22c8f5a4a03 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/newAcct.htm @@ -0,0 +1,73 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Information about Yourself

+ +

Type your name, organization, and full mailing address into the text boxes on the screen. Your Internet service provider will use this information to create your Internet account and send you a billing statement each month. + +

    +
  • Name: Your name as it appears on your credit card. + + + +
  • Organization (optional): Your full company name. + + + +
  • Address: The address that your monthly credit card statement is mailed to (your + credit card billing address). + + + +
  • Phone number: The telephone number associated with the address entered on this screen. +
+ +

[CONTENTS]

+ + + + + + diff --git a/mozilla/cmd/dialup/as_html/help/ok.htm b/mozilla/cmd/dialup/as_html/help/ok.htm new file mode 100644 index 00000000000..7207d2b87ac --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/ok.htm @@ -0,0 +1,63 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Congratulations!

+ +

You successfully created your new Internet account. Anytime you want to use it, just double-click the Netscape Communicator icon in the Netscape Communicator folder or program group. Communicator automatically connects you to your account.

+ +

Before you leave Account Setup, it's a good idea to click the Save Account Information +button to write all the particulars of your account to a text file. This includes +such information as your login, password, dial-up access number, provider domain +name and DNS server addresses, and so on.

+ +

If you are concerned about the privacy of the information in the text file, you +can print the file or copy it to a diskette, then delete the file from your computer.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/okreboot.htm b/mozilla/cmd/dialup/as_html/help/okreboot.htm new file mode 100644 index 00000000000..b9f16f84f18 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/okreboot.htm @@ -0,0 +1,63 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Congratulations!

+ +

You successfully created your new Internet account. Anytime you want to use it, just double-click the Netscape Communicator icon in the Netscape Communicator folder or program group. However, you must first restart your computer.

+ +

Before you leave Account Setup, it's a good idea to click the Save Account Information +button to write all the particulars of your account to a text file. This includes +such information as your login, password, dial-up access number, provider domain +name and DNS server addresses, and so on.

+ +

If you are concerned about the privacy of the information in the text file, you +can print the file or copy it to a diskette, then delete the file from your computer.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/publish.htm b/mozilla/cmd/dialup/as_html/help/publish.htm new file mode 100644 index 00000000000..1b3cef245e0 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/publish.htm @@ -0,0 +1,73 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Web Page Publishing Location

+ +

If your Internet account includes a place on your provider's server where you +can publish and view your Web pages, enter those locations in the text boxes in the +Account Setup screen: + +

    +
  • Publish URL: Enter the URL (web address) of the location on your provider's servers where you publish your own web pages. (for example, http://www.netscape.com/~user/publish/). Note that this is not the location that you enter into a web browser to view the pages (see View URL, below). + + + +
  • Publish password: Most providers ask you to provide a password before you can publish your files on their web servers. Many times, your publishing password is the same as your account password. Enter the publishing password given to you by your provider. + + + +
  • View URL. Enter the URL (web address) where you or others can view web pages that you've published (for example, http://www.netscape.com/~user/). +
+ +

If you aren't sure if your account includes a place where you can publish your web pages, or if you aren't sure of the URLs for publishing or viewing the pages or your password, call your provider's technical support office.

+ +

If you don't want to enter this information now, you don't need to. You can enter it after you're done using Account Setup, in Communicator's Editor preferences.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/register.htm b/mozilla/cmd/dialup/as_html/help/register.htm new file mode 100644 index 00000000000..837fc27ee5d --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/register.htm @@ -0,0 +1,57 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Connecting to the Internet account server...

+ +

Account Setup is now in the process of dialing your modem to establish a connection with your provider's Internet account server.

+ +

The process might take a minute, so please be patient. When Account Setup connects, it loads the Internet account server screens in the Account Setup window.

+ +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/help/servers.htm b/mozilla/cmd/dialup/as_html/help/servers.htm new file mode 100644 index 00000000000..77957e8c5a0 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/servers.htm @@ -0,0 +1,75 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Provider's Server Addresses

+ +

Enter the addresses of your provider's mail and news servers on this screen. Also use the POP/IMAP radio buttons to choose the type of incoming mail server you want to use.

+ +

You can find your provider's mail and news server addresses in the forms given to you by your provider when you started your account. If you don't have the information you need, call your provider's technical support office. If you aren't sure if you can use IMAP, select POP for now and contact your provider for more information.

+ +

If you want to supply your provider's mail server information later, you can leave the text boxes on this screen blank. However, you won't be able to send or receive email, or read or post to newsgroups, until you do so. When you're ready, you can enter the information in Communicator's Mail & Groups preferences.

+ +

Here's what the servers do:

+ +
    +
  • Your provider's SMTP and POP servers send out and bring in your email. Your provider + might use only one mail server for both functions, so the address might be the same + for both SMTP and POP. + + + +
  • Your provider's NNTP server delivers newsgroup information to your account. + + + +
  • Your provider's IMAP mail server handles your email using the IMAP protocol, which enables you to store and organize your mail on the server. + +
+ +

[CONTENTS]

+ + + + diff --git a/mozilla/cmd/dialup/as_html/help/useAcct.htm b/mozilla/cmd/dialup/as_html/help/useAcct.htm new file mode 100644 index 00000000000..b9bd800fe77 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/help/useAcct.htm @@ -0,0 +1,57 @@ + + + + + + + Account Setup Help + + + + + + + + + + + +
+ACCOUNT SETUP + +
+ +
+ + + + + +

Your Account Access Location

+ +

From the list on the screen, select an account access location that is suitable for the place from which you are connecting. Each location included on the screen includes a dial-up access phone number and other information supplied by your provider. The best access number is one in the same city or calling area as the phone line you are using to connect.

+ +

If you know the account access phone number you want to use and isn't in the list, select "None of the Above" from the list. You can enter the number later in Account Setup. + +

[CONTENTS]

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/images/license b/mozilla/cmd/dialup/as_html/images/license new file mode 100644 index 00000000000..947718beabb --- /dev/null +++ b/mozilla/cmd/dialup/as_html/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/as_html/intro/dummy.js b/mozilla/cmd/dialup/as_html/intro/dummy.js new file mode 100644 index 00000000000..90168bd2785 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/dummy.js @@ -0,0 +1,51 @@ +/* -*- Mode: HTML; tab-width: 8; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/intro/intro1.htm b/mozilla/cmd/dialup/as_html/intro/intro1.htm new file mode 100644 index 00000000000..13ebf098421 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/intro1.htm @@ -0,0 +1,81 @@ + + + + + Account Setup + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + + + + + + + + + +

Setting up Communicator

+ +

You are about to set up Netscape Communicator to access the Internet.

+ +

Account Setup guides you through the setup process. To use Account Setup right away, click Account Setup in the navigation bar. If you'd like to learn more about how you connect to the Internet first, click Next.

+ +

To leave Account Setup, click Exit. Then, when you're ready to finish setting up Communicator, you'll find the Account Setup icon in your Netscape Communicator folder or program group.

+ +
+ + + + diff --git a/mozilla/cmd/dialup/as_html/intro/intro2.htm b/mozilla/cmd/dialup/as_html/intro/intro2.htm new file mode 100644 index 00000000000..085dfc53fc3 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/intro2.htm @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + + + + + + + + + +

Connecting to the Internet

+ +
+ + + + + + +

Listed at left are the essential parts of your connection: your personal computer, your modem, a phone line, and your Internet service provider.

+ +

You can learn about the role of each part by placing your mouse pointer over the part you want to learn about.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Your Personal Computer

+ +

Your personal computer is where Netscape Communicator is running. When you want to use the Internet, your computer uses Communicator's connection software and your modem to dial the phone number of your Internet service provider's computer.

+ +
+ + + + + +

Your Modem

+ +

Your modem is a critical part of your connection to the Internet. Without it, you could not connect. A modem translates computer data into a stream of sounds that travel along the phone line to your Internet service provider. Your Internet service provider has another modem at its end of the phone line that translates the stream of sounds back into computer data.

+ +
+ + + + + +

A Telephone Line

+ +

To use the Internet, your personal computer needs a way to exchange data with your Internet service provider's computer. A telephone line provides this physical link to your Internet service provider's computer. You can use any ordinary phone line--your home phone line, a hotel phone line, or even, in some places, a pay phone line.

+ +
+ + + + + +

Internet Service Provider

+ +

An Internet service provider is your gateway to the Internet. Your provider's computer answers the phone call from your personal computer. When it answers the call, the two computers can "talk" to one another over the phone line. Your Internet service provider's computer is permanently conntected to the Internet and takes care of passing information back and forth between your computer and the Internet.

+ +
+ + + + + +

The Internet

+ +

The Internet is a global network of computers that cooperate to exchange information. Many of the computers on the Internet, such as your Internet service provider's computer, are permanently connected together with fiber-optic lines that can carry data at very high rates of speed. Using the Internet, you can exchange information with any other user or computer linked to the network.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Your Personal Computer +
+ Your Modem +
+ A Telephone Line +
+ Internet Service Provider +
+ The Internet +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ + + + + +
+ +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/intro/intro3.htm b/mozilla/cmd/dialup/as_html/intro/intro3.htm new file mode 100644 index 00000000000..1c92345066f --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/intro3.htm @@ -0,0 +1,90 @@ + + + + + Account Setup + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + + + + + + + + +ISP + + + + + + + + + +

What is an Internet Service Provider?

+ +

As you saw on the previous screen, you need an account with an Internet service provider before you can connect to the Internet and use Communicator.

+ +

An Internet service provider, sometimes called an ISP, is a company that specializes in providing Internet access to individual users who connect using their phone lines and modems. It maintains a permanent connection to the Internet, then lets its customers access that connection for a fee.

+ +

If you don't yet have an account with an Internet service provider, you can use Account Setup to create one right away. Account Setup lets you compare the account plans available to you and create an Internet account right away.

+ +
+ + + + diff --git a/mozilla/cmd/dialup/as_html/intro/intro4.htm b/mozilla/cmd/dialup/as_html/intro/intro4.htm new file mode 100644 index 00000000000..59b9a6ab962 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/intro4.htm @@ -0,0 +1,168 @@ + + + + + + + Account Setup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +ACCOUNT SETUP + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +account
plans
+ + + +
+ + + + + + + + + + + + + + + +

Comparing Account Plans

+ + + +

When you are comparing account plans, keep your needs in mind. Most account plans offer similar access to the World Wide Web, electronic mail (email), and newsgroups, but differ mainly in:

+ + + +
    + + + +
  • The phone number you dial to connect. Some plans let you connect by dialing a local or regional phone number; others, by dialing a toll-free number. Some plans even offer national or international connection numbers.
  • + + + + + + + +
  • Extra services and billing options. Some plans include extra services, such as a place where you can publish your own Web pages. Some plans are paid for at an hourly usage rate, while others give you unlimited connection time for a monthly fee.
  • + + + +
+ + + +
+ + + + + + + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/intro/intro5.htm b/mozilla/cmd/dialup/as_html/intro/intro5.htm new file mode 100644 index 00000000000..cd6ecc3d824 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/intro5.htm @@ -0,0 +1,92 @@ + + + + + Account Setup + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + + + + + + + + +creating + + + + + + + + + +

Creating an Internet Account

+ +

If you don't yet have an Internet account, you can use Account Setup to find out about the account plans available and sign up for the one that best meets your needs.

+ +

When you sign up, you are creating an Internet account in your name that gives you access to the World Wide Web, email, newsgroups, and other services offered in your account plan. Your provider gives you a unique user name, password, and email identity for your account. Account Setup automatically sets up Communicator with this information so that you can access your account immediately.

+ +

If you already have an Internet account, you can use Account Setup to quickly set up Communicator to access your account. To find out more, +click Next.

+ +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/intro/intro6.htm b/mozilla/cmd/dialup/as_html/intro/intro6.htm new file mode 100644 index 00000000000..fdc96c19559 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/intro6.htm @@ -0,0 +1,91 @@ + + + + + Account Setup + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + + + + + + + + +existing + + + + + + + + + +

If You Already Have an Account

+ +

If you already have an Internet account, you can use Account Setup to quickly set up Communicator and your dialer software to access it.

+ +

All you need to do is supply the information requested in Account Setup--such as the phone number you dial to connect, the type of modem you are using, your account login and password, and so on. When you have done so, Account Setup automatically configures Communicator and its connection software so that you can connect to your account right away.

+ +

To go to Account Setup, click Next.

+ +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/intro/isheet.js b/mozilla/cmd/dialup/as_html/intro/isheet.js new file mode 100644 index 00000000000..f27ec11bc99 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/intro/isheet.js @@ -0,0 +1,95 @@ +/* -*- Mode: HTML; tab-width: 8; indent-tabs-mode: nil -*- + * + * 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. + */ +//TAGS FOR INTERNET PREVIEW SCREENS + +document.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"; +document.tags.BODY.borderWidths(0, 0, 0, 0); +document.tags.BODY.paddings(0, 0, 0, 0); + +document.tags.P.fontFamily="PrimaSans BT, Helvetica,Arial"; +document.tags.P.fontSize="12px"; +document.tags.P.lineHeight="1.1"; +document.tags.P.margins(14,40,0,255); + + +//Titles of Internet Preview screens + +document.classes.title.all.fontSize="23px"; +document.classes.title.all.fontFamily="PrimaSans BT, Helvetica,Arial"; +document.classes.title.all.margins(34,0,0,43); + + +//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.2" + + + +//the entries below are exceptions to the standard definition + +document.ids.nospace.marginTop="0"; +document.ids.minspace.marginTop="6"; +document.ids.nomargins.margins(14,8,8,8); +document.ids.buttontext.fontSize="11px"; + +document.ids.smallleftmargin.margins(14,40,0,160); +document.ids.mediumleftmargin.margins(14,40,0,265); +document.ids.bulletssmallleftmargin.marginLeft="160"; + + +//Lists + +document.tags.UL.listStyleType="disc"; +document.tags.UL.fontFamily="PrimaSans BT, Helvetica,Arial"; +document.tags.UL.fontSize="12px"; +//tags.UL.lineHeight="1.2"; +document.tags.UL.margins(-6,40,0,255); +document.tags.LI.fontSize="10"; + + +//Account Setup tag + +document.classes.previewtag.all.fontSize="12px"; +document.classes.previewtag.all.paddingLeft="5"; +document.classes.previewtag.all.color="white"; + +document.classes.colorbartext.all.fontSize="11px"; +document.classes.colorbartext.all.color="white"; + + +//tags for intro screens callouts (intro3,intro4,intro5,intro6) + +document.classes.ispcallout.all.fontFamily="PrimaSans BT,Helvetica,Arial"; +document.classes.ispcallout.all.fontSize="29px"; +document.classes.ispcallout.all.color="FFFFFF"; + +document.classes.accountscallout.all.fontFamily="PrimaSans BT,Helvetica,Arial"; +document.classes.accountscallout.all.fontSize="13px"; +document.classes.accountscallout.all.color="FFFFFF"; + + diff --git a/mozilla/cmd/dialup/as_html/later.htm b/mozilla/cmd/dialup/as_html/later.htm new file mode 100644 index 00000000000..45e72096521 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/later.htm @@ -0,0 +1,67 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + +Connect Later... + + + + + + + + + + + + + + +
+ + +

You're finished using Account Setup but have chosen not to connect to the Internet right now. Click Exit to leave Account Setup. Before closing, Account Setup automatically sets up Communicator to access your Internet account.

+ +

When you are ready to connect to the Internet, all you have to do is launch Communicator by double-clicking its icon in the Netscape Communicator folder or program group. Communicator automatically initiates a connection to your Internet account.

+ +
+
+ + + + diff --git a/mozilla/cmd/dialup/as_html/later.js b/mozilla/cmd/dialup/as_html/later.js new file mode 100644 index 00000000000..5f03ec29ac4 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/later.js @@ -0,0 +1,82 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/main.htm b/mozilla/cmd/dialup/as_html/main.htm new file mode 100644 index 00000000000..a942c19861f --- /dev/null +++ b/mozilla/cmd/dialup/as_html/main.htm @@ -0,0 +1,155 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + + + + + + + + +
+NETSCAPE COMMUNICATOR
+
+ + + + + + + + + + + + +

Dial-Up Edition

+ +
+ + + + + + +

Netscape Communicator is your one solution for getting all that the Internet has to offer. Once you've set up Communicator to access the Internet, you can use it to browse the World Wide Web, send and receive electronic mail, publish your own web pages, and more.

+ +

+To set up Communicator, click Start Account Setup.

+ +
+ + + + + + +

You are about to use Account Setup to replace your Internet account with another account. While you can safely use Account Setup in this way, we recommend that you create a new user profile first, then use Account Setup.

+ +

+To continue, click Start Account Setup. To create a +
new profile, launch the User Profile Manager +
from the Netscape Communicator folder +
or program group.

+ +
+ + + + + + +

You are about to use Account Setup to create access to an Internet account and associate the account with your new user profile. To begin, click Start Account Setup.

+ +
+ + + + + + + + + + + + +
+ + + START +
+ ACCOUNT SETUP +
+ + + + + + + + + + + + + + + + +
 INTERNET PREVIEW'
Learn more about the Internet
and the World Wide Web.
 COMMUNICATOR PREVIEW'
Learn more about all the features
you get in Dial-Up Edition.
+ +
+ + + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/main.js b/mozilla/cmd/dialup/as_html/main.js new file mode 100644 index 00000000000..31b58857d23 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/main.js @@ -0,0 +1,159 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ +var captureString=""; +var thePath = ""; + +function go(msg) +{ + if (msg == thePath) { + return(checkData()); + } + return(false); +} + + + +function doGo() +{ + parent.controls.go("Next"); +} + + + +function setPath(msg) +{ + thePath = msg; + setTimeout("doGo()",1); +} + + + +function checkData() +{ + return(true); +} + + + +function doAbout() +{ + parent.controls.go("About"); +} + + + +function captureKeys(e) +{ + captureString = captureString + String.fromCharCode(e.which); + if (captureString.length>5) captureString = captureString.substring(captureString.length-5,captureString.length); + if (captureString == "about") { + captureString=""; + setTimeout("doAbout()",1); + } + return(true); +} + + + +function loadData() +{ + var cleanFlag=false; + var configuredFlag=false; + var newProfileFlag=false; + var configFilename=""; + + netscape.security.PrivilegeManager.enablePrivilege("AccountSetup"); + + + var acctSetupFile = parent.parent.globals.getAcctSetupFilename(self); + var editMode = parent.parent.globals.document.vars.editMode.value; + if (editMode != null && editMode != "") { + editMode = editMode.toLowerCase(); + } + + if (editMode != "yes") { + document.onkeydown = captureKeys; + + // get platform + + var thePlatform = new String(navigator.userAgent); + var x=thePlatform.indexOf("(")+1; + var y=thePlatform.indexOf(";",x+1); + thePlatform=thePlatform.substring(x,y); + + var profileDir = parent.parent.globals.document.setupPlugin.GetCurrentProfileDirectory(); + if (profileDir != null && profileDir != "") { + if (thePlatform == "Macintosh") { // Macintosh support + configFilename = profileDir + "Configuration"; + } + else { // Windows support + configFilename = profileDir + "CONFIG.INI"; + } + + // if a MUC file exists: re-using Account Setup against a profile that's been configured + // else, if "account_setup.upgraded" is true, but no MUC: upgrade from 3.x or earlier + + var accountName = parent.parent.globals.document.setupPlugin.GetNameValuePair(configFilename,"Account", "Account"); + if (accountName != null && accountName != "" && accountName != "Untitled" && accountName != "None") { + configuredFlag=true; + } + else { + var profileName = parent.parent.globals.document.setupPlugin.GetCurrentProfileName(); + if (profileName != null) { + profileName = profileName.toUpperCase(); + if (profileName == '911' || profileName == 'USER1') { + cleanFlag=true; + } + else { + newProfileFlag=true; + } + } + } + } + + // ensure that some descriptive layer is shown + + if (cleanFlag==false && configuredFlag==false && newProfileFlag==false) { + cleanFlag=true; + } + + if (document && document.layers) { + document.layers["Clean_Installation"].visibility = ((cleanFlag==true) ? "show":"hide"); + document.layers["Profile_Configured"].visibility = ((configuredFlag==true) ? "show":"hide"); + document.layers["Profile_Manager_Entrance"].visibility = ((newProfileFlag==true) ? "show":"hide"); + } + + parent.parent.globals.loadUserInput(); + } + + + + if (document && document.layers) { + document.layers["buttontext"].visibility = "show"; + } + + if (parent && parent.controls && parent.controls.generateControls) { + parent.controls.generateControls(); + } +} + + + +function saveData() +{ +} diff --git a/mozilla/cmd/dialup/as_html/makefile.win b/mozilla/cmd/dialup/as_html/makefile.win new file mode 100644 index 00000000000..e27de53e543 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/makefile.win @@ -0,0 +1,45 @@ +# 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=metadata + +JAVA_DESTPATH=$(MOZ_SRC)\ns\dist\classes +PACKAGE=netscape\asw + +!include <$(DEPTH)\config\rules.mak> + +export:: $(JAVA_DESTPATH)\$(PACKAGE) + copy *.htm $(JAVA_DESTPATH)\$(PACKAGE) + copy *.js $(JAVA_DESTPATH)\$(PACKAGE) + +install:: $(JAVA_DESTPATH)\$(PACKAGE) + -rm -rf $(JAVA_DESTPATH)\$(PACKAGE)\asw.arc + cd $(JAVA_DESTPATH)\$(PACKAGE) + $(PERL) $(MOZ_SRC)\ns\security\cmd\jar\signPages.pl \ +!ifdef MOZ_CERT_DIR + -d $(MOZ_CERT_DIR) \ +!endif +!ifdef MOZ_CERT_NAME + -k $(MOZ_CERT_NAME) \ +!endif +!ifdef MOZ_CERT_PWD + -p $(MOZ_CERT_PWD) \ +!endif + *.htm + $(ZIP) asw.jar * + +clobber:: + -rm -rf $(JAVA_DESTPATH)\$(PACKAGE) diff --git a/mozilla/cmd/dialup/as_html/metadata/config/features.cfg b/mozilla/cmd/dialup/as_html/metadata/config/features.cfg new file mode 100644 index 00000000000..57cc24ad807 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/metadata/config/features.cfg @@ -0,0 +1,8 @@ +feature1=hosting +feature2=freetime +feature3=promo +feature4= +feature5= +feature6= +feature7= +feature8= diff --git a/mozilla/cmd/dialup/as_html/metadata/images/license b/mozilla/cmd/dialup/as_html/metadata/images/license new file mode 100644 index 00000000000..947718beabb --- /dev/null +++ b/mozilla/cmd/dialup/as_html/metadata/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/as_html/metadata/makefile.win b/mozilla/cmd/dialup/as_html/metadata/makefile.win new file mode 100644 index 00000000000..01733172f29 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/metadata/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=html + +!include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/cmd/dialup/as_html/milan.htm b/mozilla/cmd/dialup/as_html/milan.htm new file mode 100644 index 00000000000..d62dbfbaf97 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/milan.htm @@ -0,0 +1,866 @@ + + + + + +Milan Test for QA (help feed rjc's cats, send $$$) + + + + + + + + +
+Instructions: Fill out the following form then click on the "Save Milan Data" button.

+ + + + + + + + + + + + + + + + + + + +
+ Element Field Color Legend +
+ To Be Implemented Soon +
+ Milan data used on all platforms +
+ Milan data used on some platforms
+ (probably Windows) +
+ Unused Milan data +
+ +

+


+

+Account Setup 4.x Milan Elements +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Element(s) + + Value + + Description +
+ Status: + + + + If OK, an account was successfully created.
+ If ERROR, a user cancelled out of Reggie. (Ignore other data).

+ (Milan Extension) If EXIT, quit Account Setup with no user prompt.

+

+ Site Name: + + + + A short textual name of the site used for identification purposes.

(Win3.1 Program Manager, Win95 Dial-Up Networking item name, Mac FreePPP Account Name) +

+ Site Description: + + + + A longer description of the site. +
+ Dialer Filename: + + .SR + + Limited to 8 characters so an 8.3 dialer filename can be derived.
+ ( ".SR" is the standard extension)
+ (Unused on Mac) +
+ Phone Number: + + + + The phone number to dial for the account with the ISP.
+ Use TAPI format. For example: +1 (415) 123-4567 +
+ Long Distance? + + + + If long-distance dialing is needed, YES; otherwise, NO. +
+ Dial Area Code? + + + + If area code is needed when dialing, YES; otherwise, NO. +
+ ISP Support Phone Number: + + + + Support number for the ISP. Use TAPI format.
+ For example: +1 (415) 123-4567

+ If the user clicks on "Save Account Info" at end of the new account path, the ISP's support number is included.
+

+ ISP URL: + + + + If specified, its appended onto the end of the profile's bookmark file with the name from "Site Name" field. +
+ Login: + + +
+ Password: + + +
+ Login Script: + + + + Login script. Format: waitstring | replystring | waitstring | replystring ...

+ Example:

 login:|%name|password:|%password 
+
+ Domain Name: + + + +
+ DNS Address #1: + + + + DNS address in 111.222.333.444 format. +
+ DNS Address #2 + + + + DNS address in 111.222.333.444 format. +
+ NNTP Host: + + + + The news host (either an IP address or host name). +
+ SMTP Host: + + + + The email host (either an IP address or host name). +
+ E-Mail Addr: + + + + Email return address for the user. +
+ POP Server: + + + + If an IMAP host (see below) is sent, it overrides any POP Server specified. +
+ POP Password: + + + + This password is used for either a POP or IMAP server. +
+ Home URL: + + + + If specified, this URL will be used as the default home page. Otherwise, "home.netscape.com" will be used. +
+ Publishing View URL: + + + +
+ Publishing Push URL: + + + +
+ Windows ICON + +
+ Binary data

+

+

+

+ (Unused on Mac) +
+ + +

+


+

+The following elements are extensions to the Milan protocol: +

+


+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ New Element(s) + + Value + + Description +
+ Bookmark File Data: + + + + Bookmark data is stored inside of the bookmark file in the current profile's directory only if a valid bookmark file does not already exist.

+ If specified, this data MUST be a valid bookmark file beginning with:

+

+
 <!DOCTYPE NETSCAPE-Bookmark-file-1> 
+
+
+ IMAP: + + Host:
+ Server Path: +
+ The IMAP host (either an IP address or host name) and IMAP server path (optional) to mailbox.

+ If an IMAP host is sent, it overrides any POP Server specified. +

+ LDAP Host(s): + + +

+ LDAP_HOST_[1...n] and LDAP_DESC_[1...n] specify URL and description. +

+

+
+
+ +
+

+

(See the "Sample LDAP URLs" section below.)
+

+

+ Lock File Data: + +
+ Binary data +
+

+ (Mac & Win) LCK_FILE = [binary data]

+

+ Lock File data is stored inside of a file named "PROFILE.CFG" in the current profile's directory.

+ Lock File data is sent down from Reggie only if Account Setup sends "AS_LCK_SUPPORT=YES". +

+ Animated "N" replacement images + +
+ Binary data

+

+ (Mac) ANIMATION_DAT = [binary data fork]
+ (Mac) ANIMATION_RES = [binary resource fork]

+ (Win) ANIMATION = [binary data]

+

+ On the Macintosh, the ANIMATION_DAT and ANIMATION_RES forks are combined into one file which is written + out to a file named "Custom Animation" in the current profile's directory.

+ On Windows, ANIMATION is written out to a file named "?????" in the current profile's directory.

+

+ + +

+


+

+ + + + + + +
+ + + Mime Type: + +

+

+ Note: V2 is an extension to the Milan MIME-type allowing data elements over 32K. +
+

+

+

+ +

+ +

+


+

+ + + + + + + + + + + + + + + +
+ Note(s) +
+ Sample LDAP URLs: +

+ + + + + + +
+ Generic LDAP:
+ LDAP URL:
+ LDAP URL with port #:
+ LDAP over SSL URL:
+ LDAP over SSL URL with port # & searchbase:
+
+ ldap1.netscape.com
+ ldap://ldap2.netscape.com/
+ ldap://ldap3.netscape.com:33/
+ sldap://ldap4.netscape.com/
+ sldap://ldap5.netscape.com:666/cn=Test
+
+

+

+ The ICON, LCK_FILE, and ANIMATION Milan fields are binary data and can't be specified on this screen. +
+ ISP_ACCT_ID and REG_ID as defined in the Milan spec are not being used. +
+

+Version 1.1 - June 3, 1997 by rjc +

+ +

+ + + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/modem1.htm b/mozilla/cmd/dialup/as_html/modem1.htm new file mode 100644 index 00000000000..0cc25dbd869 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/modem1.htm @@ -0,0 +1,120 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+
+ +

Your Modem

+ +

Please select the modem connected to your computer from the pop-up list below, so that Account Setup can use it when connecting to the Internet account server.

+ + + +
+ + + + + + + +
+ Current Modem: + + + + + +
+
+ + + + + +

If your modem was not listed, click the Modem Setup button to set up your modem and add it to the list.

+ + +
+ + + + + +
+ + + +

Modem
Setup

+
+ +
+ +

When you have selected your modem from the list, click Next.

+ +
+ +
+ + + diff --git a/mozilla/cmd/dialup/as_html/modem1.js b/mozilla/cmd/dialup/as_html/modem1.js new file mode 100644 index 00000000000..ca85c56e62d --- /dev/null +++ b/mozilla/cmd/dialup/as_html/modem1.js @@ -0,0 +1,235 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/namepw.htm b/mozilla/cmd/dialup/as_html/namepw.htm new file mode 100644 index 00000000000..1d25b79bcd0 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/namepw.htm @@ -0,0 +1,143 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Your Account Login and Password

+ +

Enter the name and password you use to log in to your Internet account. If you want to enter your password every time you connect, leave the password field blank.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Login Name: + + + + + + (For example, jsmith) + +
+ +
+ + Password: + + + + +
+ +
+ + Type Password Again: + + + + +
+ +
+ + +
+
+ + + +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/namepw.js b/mozilla/cmd/dialup/as_html/namepw.js new file mode 100644 index 00000000000..11892459610 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/namepw.js @@ -0,0 +1,131 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/needs1.htm b/mozilla/cmd/dialup/as_html/needs1.htm new file mode 100644 index 00000000000..6092e3bec6c --- /dev/null +++ b/mozilla/cmd/dialup/as_html/needs1.htm @@ -0,0 +1,89 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Preparing to Create a New Account

+ +

To help you create a new Internet account, Account Setup connects you to your provider's Internet account server, where you can learn about the various account plans available and create an account.

+

Before connecting, Account Setup asks you for information about: +

    + +
  • The modem you are using (note that you can't connect to the Internet Account Server using an ISDN modem.)
  • +
  • The phone line at the location you are connecting from.
  • +
+ +

When you are finished using the Internet account server, Account Setup disconnects you from the server and automatically sets up Communicator to access your new account.

+ + + + diff --git a/mozilla/cmd/dialup/as_html/needs1.js b/mozilla/cmd/dialup/as_html/needs1.js new file mode 100644 index 00000000000..8e2ab47a4b0 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/needs1.js @@ -0,0 +1,52 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/needs2.htm b/mozilla/cmd/dialup/as_html/needs2.htm new file mode 100644 index 00000000000..1bfd497e026 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/needs2.htm @@ -0,0 +1,84 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + +

Preparing to Set Up Access

+ +

To set up Communicator to access your Internet account, you need to provide some or all of the following information:

+ +
    +
  • Your account login name and password.
  • +
  • Your email login name and password, if different from your account login name and password.
  • +
  • Your Internet access phone number.
  • +
  • The Internet addresses of your provider's email, news, and DNS servers.
  • +
+ +

Your Internet service provider might have given you this information when you created your account. If you don't have the information you need, contact your provider's technical support office.

+ + + +

Click Next to continue.

+ + + + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/needs2.js b/mozilla/cmd/dialup/as_html/needs2.js new file mode 100644 index 00000000000..4297e9ed821 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/needs2.js @@ -0,0 +1,72 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + + diff --git a/mozilla/cmd/dialup/as_html/newAcct.htm b/mozilla/cmd/dialup/as_html/newAcct.htm new file mode 100644 index 00000000000..77aaa15c5cf --- /dev/null +++ b/mozilla/cmd/dialup/as_html/newAcct.htm @@ -0,0 +1,224 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + + +

Information About Yourself

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First:Last:
Name:
+ + Organization: + + + +
+ +
+ + Address: + + + + +
+ +
  + +
+ +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+ + + Telephone: + + + + + + + + + + + + +
+ + + Number: +
+ + + +
+ +
+
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/newAcct.js b/mozilla/cmd/dialup/as_html/newAcct.js new file mode 100644 index 00000000000..007f746cd1d --- /dev/null +++ b/mozilla/cmd/dialup/as_html/newAcct.js @@ -0,0 +1,304 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/ok.htm b/mozilla/cmd/dialup/as_html/ok.htm new file mode 100644 index 00000000000..4b1a6b6af29 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/ok.htm @@ -0,0 +1,90 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Congratulations!

+ +

You now have your own Internet account and email address, and you can use them immediately.

+ +

Click the Save Account Information button to save a record of your account +information as a text file on your computer. Your account information includes your +login and password, your provider's server addresses and technical support phone number, and other information.

+ + + + +

Click Done to leave Account Setup. When you're ready to connect to the Internet, all you have to do is launch Communicator from the Netscape Communicator folder or program group.

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/ok.js b/mozilla/cmd/dialup/as_html/ok.js new file mode 100644 index 00000000000..cd5d0a89f48 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/ok.js @@ -0,0 +1,102 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/okreboot.htm b/mozilla/cmd/dialup/as_html/okreboot.htm new file mode 100644 index 00000000000..22393004e4d --- /dev/null +++ b/mozilla/cmd/dialup/as_html/okreboot.htm @@ -0,0 +1,89 @@ + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + +

Congratulations!

+ +

You now have your own Internet account and email address, and you can use them after restarting your computer.

+ +

Click the Save Account Information button to save a record of your account +information as a text file on your computer. Your account information includes your login and password, your provider's server addresses and technical support phone number, and other information.

+ + + + +

Click Restart to leave Account Setup and restart your computer. When you're ready to connect to the Internet, all you have to do is launch Communicator from the Netscape Communicator folder or program group.

+ + + + + diff --git a/mozilla/cmd/dialup/as_html/okreboot.js b/mozilla/cmd/dialup/as_html/okreboot.js new file mode 100644 index 00000000000..1a5bc9de45b --- /dev/null +++ b/mozilla/cmd/dialup/as_html/okreboot.js @@ -0,0 +1,87 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/publish.htm b/mozilla/cmd/dialup/as_html/publish.htm new file mode 100644 index 00000000000..58d800fab80 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/publish.htm @@ -0,0 +1,123 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + + + +

Your Publishing Location

+ +

If your provider offers you a place where you can publish documents on the World Wide Web, enter the information below. If you want, you can enter this information later, in Communicator's Editor Preferences.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Publish Location URL: + + + + +
+ +
+ + Publishing Password: + + + + +
+ +
+ + View URL: + + + + +
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/publish.js b/mozilla/cmd/dialup/as_html/publish.js new file mode 100644 index 00000000000..7e84bbab14a --- /dev/null +++ b/mozilla/cmd/dialup/as_html/publish.js @@ -0,0 +1,79 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/register.htm b/mozilla/cmd/dialup/as_html/register.htm new file mode 100644 index 00000000000..73b7b07eaec --- /dev/null +++ b/mozilla/cmd/dialup/as_html/register.htm @@ -0,0 +1,106 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Connecting to the Internet
account server...

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/mozilla/cmd/dialup/as_html/register.js b/mozilla/cmd/dialup/as_html/register.js new file mode 100644 index 00000000000..c7c9380b27c --- /dev/null +++ b/mozilla/cmd/dialup/as_html/register.js @@ -0,0 +1,303 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/screen.htm b/mozilla/cmd/dialup/as_html/screen.htm new file mode 100644 index 00000000000..ecf398d749a --- /dev/null +++ b/mozilla/cmd/dialup/as_html/screen.htm @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/servers.htm b/mozilla/cmd/dialup/as_html/servers.htm new file mode 100644 index 00000000000..9207d30e19b --- /dev/null +++ b/mozilla/cmd/dialup/as_html/servers.htm @@ -0,0 +1,155 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Your Provider's Mail and News Servers

+ +

Enter the addresses of your provider's mail and news servers. If you want, you can enter this information later, in Communicator's Mail & Groups Preferences. If you aren't sure about what to enter in these text boxes, call your provider's technical support office.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Outgoing Mail  +
+ (SMTP) Server: +
+ +
+ + (For example,
+ smtp.providername.com) + +
+ +
+ + Incoming Mail  +
+ Server: +
+ +
+ + (For example,
+ mail.providername.com) + +
+ + + POP + IMAP + +
+ +
+ + Newsgroups  +
+ (NNTP) Server:
+ +
+ + (For example,
+ nntp.providername.com) + +
+
+ +
+ + + diff --git a/mozilla/cmd/dialup/as_html/servers.js b/mozilla/cmd/dialup/as_html/servers.js new file mode 100644 index 00000000000..a4d6342b7bd --- /dev/null +++ b/mozilla/cmd/dialup/as_html/servers.js @@ -0,0 +1,242 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/setup.htm b/mozilla/cmd/dialup/as_html/setup.htm new file mode 100644 index 00000000000..be6b194dc4e --- /dev/null +++ b/mozilla/cmd/dialup/as_html/setup.htm @@ -0,0 +1,31 @@ + + + + + + +Account Setup + + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/sheet.js b/mozilla/cmd/dialup/as_html/sheet.js new file mode 100644 index 00000000000..11818e27898 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/sheet.js @@ -0,0 +1,173 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + //TAGS FOR ACCOUNT SETUP SCREENS + + + +//tags.BODY.fontFamily="PrimaSans BT,Helvetica,Arial"; +//tags.BODY.fontSize="12px"; +//tags.BODY.textAlign="left"; +//tags.BODY.color="black"; +document.tags.BODY.marginTop="0"; +//tags.BODY.lineHeight="1.1"; +document.tags.BODY.marginBottom="0"; +//tags.BODY.marginLeft="72"; +//tags.BODY.borderWidths(0, 0, 0, 0); +//tags.BODY.paddings(0, 0, 0, 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="-6"; +document.tags.P.marginLeft="72"; + + + +//Titles of Account Setup screens + +document.classes.title.all.fontFamily="PrimaSans BT,Helvetica,Arial"; +document.classes.title.all.fontSize="23px"; +//classes.title.all.fontWeight="normal"; +document.classes.title.all.lineHeight="1"; +//classes.title.all.textAlign="left"; +document.classes.title.all.marginTop="29"; +document.classes.title.all.marginRight="40"; +//classes.title.all.marginBottom="16"; +document.classes.title.all.marginLeft="40"; + + + +//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="6"; +document.ids.nomargins.margins(14,8,8,8); +document.classes.buttontext.all.fontSize="11px"; +document.classes.buttontext.all.marginLeft="0"; +document.classes.tty.all.marginLeft="20"; +document.classes.tty.all.width="230"; +document.classes.tty.all.fontSize="11px"; +document.classes.tty.all.marginTop="-12"; +document.classes.clayer.all.fontFamily="PrimaSans BT,Helvetica,Arial"; +document.classes.clayer.all.fontSize="10"; +document.classes.clayer.all.color="#FFFFFF"; + + +//Lists + +document.tags.UL.listStyleType="disc"; +document.tags.UL.fontFamily="PrimaSans BT,Helvetica,Arial"; +document.tags.UL.fontSize="12px"; +document.tags.UL.marginTop="0"; +document.tags.UL.marginBottom="-6"; +document.tags.UL.marginLeft="72"; +document.tags.UL.marginRight="72"; + +//document.tags.LI.fontSize="11px"; +//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/as_html/start.htm b/mozilla/cmd/dialup/as_html/start.htm new file mode 100644 index 00000000000..84f1db8336d --- /dev/null +++ b/mozilla/cmd/dialup/as_html/start.htm @@ -0,0 +1,42 @@ + + + + +Account Setup + + + + + + + + +To use Account Setup, you must enable Java in the Communicator's preferences window. To open the preferences window, select Preferences... from the Edit menu. To enable Java, open the Advanced preference category and check the Enable Java checkbox.

+ +

After you have enabled Java, launch Account Setup again from the Communicator folder or program group.

+
+ + + + diff --git a/mozilla/cmd/dialup/as_html/start.js b/mozilla/cmd/dialup/as_html/start.js new file mode 100644 index 00000000000..0e130fbc06a --- /dev/null +++ b/mozilla/cmd/dialup/as_html/start.js @@ -0,0 +1,89 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/as_html/useAcct.htm b/mozilla/cmd/dialup/as_html/useAcct.htm new file mode 100644 index 00000000000..731e6082a42 --- /dev/null +++ b/mozilla/cmd/dialup/as_html/useAcct.htm @@ -0,0 +1,83 @@ + + + + + + + +Account Setup + + + + + + + + + + + + + + + + + + + +
+ACCOUNT SETUP +
+ +
+ + + + + +
+ +

Your Account Access Location

+ +

From the list below, select one of your provider's account access locations or phone numbers. If possible select a location or phone number that is local to the location you are now connecting from.

+ + + + + + + +
+ + + +
+ + + + + + + + diff --git a/mozilla/cmd/dialup/as_html/useAcct.js b/mozilla/cmd/dialup/as_html/useAcct.js new file mode 100644 index 00000000000..9ca6f118ddc --- /dev/null +++ b/mozilla/cmd/dialup/as_html/useAcct.js @@ -0,0 +1,323 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/java/applet/CPGeneratorProgress.java b/mozilla/cmd/dialup/java/applet/CPGeneratorProgress.java new file mode 100644 index 00000000000..95d5ce79a61 --- /dev/null +++ b/mozilla/cmd/dialup/java/applet/CPGeneratorProgress.java @@ -0,0 +1,129 @@ +/* -*- Mode: Java; 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. + */ + +package netscape.asw; + +import netscape.npasw.*; +import netscape.asw.ProgressApplet; +import java.lang.*; +//import AMDProgressBar; + +public class CPGeneratorProgress extends ProgressApplet +{ + final static String DOWNLOAD_STRING = "Downloading:"; + final static String UNJAR_STRING = "Uncompressing:"; + final static String DONE_STRING = "Done..."; + final static String CONTACTING_SERVER = "Contacting registration server..."; + final static String SENDING = "Sending registration information..."; + final static String WAITING = "Waiting for response..."; + final static String RECEIVING_RESPONSE = "Receiving server data..."; + final static String ABORT = "There were problems with the server connection..."; + + protected int getState() + { + if ( ServerDownload.getState() == ServerDownload.IDLE ) + return CPGenerator.getState(); + else + return ServerDownload.getState(); + } + + public void run() + { + try + { + int lastState = CPGenerator.DONE; + int thisState = CPGenerator.DONE; + String lastString = ""; + String thisString = ""; + + while ( !CPGenerator.done ) + { + thisState = getState(); + thisString = new String( CPGenerator.currentFile ); + + if ( thisState != lastState ) + { + String buffer = null; + + switch ( thisState ) + { + case ServerDownload.DOWNLOADING: + buffer = DOWNLOAD_STRING; + break; + + case ServerDownload.UNJARRING: + buffer = UNJAR_STRING; + break; + + case CPGenerator.CONTACTING_SERVER: + buffer = CONTACTING_SERVER; + break; + + case CPGenerator.SENDING: + buffer = SENDING; + break; + + case CPGenerator.WAITING: + buffer = WAITING; + break; + + case CPGenerator.RECEIVING_RESPONSE: + buffer = RECEIVING_RESPONSE; + break; + + case CPGenerator.DONE: + buffer = DONE_STRING; + break; + + case CPGenerator.ABORT: + buffer = ABORT; + break; + } + + status.setText( buffer ); + lastState = thisState; + } + + if ( thisString.compareTo( lastString ) != 0 ) + { + progress.setText( thisString ); + lastString = thisString; + } + + if ( ServerDownload.getBytesDownloaded() == 0 || CPGenerator.totalBytes == 0 ) + progressBar.setPercent( 0.0 ); + else + progressBar.setPercent( (double)ServerDownload.getBytesDownloaded() / (double)CPGenerator.totalBytes ); + + repaint(); + Thread.sleep( 100 ); + } + + progressBar.setPercent( 1.0 ); + progress.setText( "" ); + status.setText( DONE_STRING ); + + repaint(); + Thread.sleep( 2000 ); + } + catch (Exception e) + { + ; + } + } +} diff --git a/mozilla/cmd/dialup/java/applet/Progressapplet.java b/mozilla/cmd/dialup/java/applet/Progressapplet.java new file mode 100644 index 00000000000..14b91bd6f1b --- /dev/null +++ b/mozilla/cmd/dialup/java/applet/Progressapplet.java @@ -0,0 +1,127 @@ +/* -*- Mode: Java; 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. + */ +package netscape.asw; + +import netscape.npasw.*; +import java.awt.*; +import java.applet.*; +//import AMDProgressBar; + +public class ProgressApplet extends Applet implements Runnable +{ + Label status; + Label progress; + Button cancel; + + final String DIALING_STRING = "Calling registration server..."; + + final static Font TEXTFONT = new Font( "Dialog", Font.BOLD, 12 ); + final static Font BARFONT = new Font( "Helvetica", Font.PLAIN, 9 ); + final static Color BOXCOLOR = Color.darkGray; + final static Color BARCOLOR = Color.blue; + final static Color BACKCOLOR = Color.gray; + + AMDProgressBar progressBar; + int index = 0; + int loop1 = 1; + Thread thread = null; + + public void init() + { + super.init(); + Trace.TRACE( "applet got loaded" ); + //setBackground( Color.white ); + setLayout( null ); + //setResizable( false ); + //setModal( true ); + + addNotify(); + resize( insets().left + insets().right + 360, insets().top + insets().bottom + 120 ); + setFont( TEXTFONT ); + + status = new java.awt.Label( DIALING_STRING ); + status.reshape( insets().left + 12, insets().top + 8, 340, 24 ); + status.setFont( TEXTFONT ); + add( status ); + + progress = new java.awt.Label( "" ); + progress.reshape( insets().left + 12, insets().top + 32, 340, 20 ); + progress.setFont( BARFONT ); + add( progress ); + + cancel = new java.awt.Button( "Cancel" ); + cancel.reshape( insets().left + 240, insets().top + 80, 80, 20 ); + add( cancel ); + + // [canvas] + progressBar = new AMDProgressBar(); + progressBar.setFont( TEXTFONT ); + progressBar.reshape( 12, 80, 200, 21 ); + progressBar.setBoxColors( BOXCOLOR, BOXCOLOR ); + progressBar.setBarColor( BARCOLOR ); + progressBar.setBackgroundColors( BACKCOLOR, BACKCOLOR ); + add( progressBar ); + + show(); + enable(); + repaint(); + Trace.TRACE( "done initing applet" ); + } + + public boolean handleEvent( Event event ) + { + if ( event.target == cancel && event.id == Event.ACTION_EVENT ) + { + cancel_Clicked( event ); + return true; + } + return super.handleEvent( event ); + } + + void cancel_Clicked( Event event ) + { + //pm.UserCancelled(); + } + + + public void update( Graphics g ) + { + paint( g ); + } + + public void paint( Graphics g ) + { + super.paint( g ); + } + + public void run() + { + } + + public void start() + { + thread = new Thread( this ); + thread.start(); + } + + public void stop() + { + thread.stop(); + thread = null; + } +} diff --git a/mozilla/cmd/dialup/java/applet/makefile.win b/mozilla/cmd/dialup/java/applet/makefile.win new file mode 100644 index 00000000000..53068818038 --- /dev/null +++ b/mozilla/cmd/dialup/java/applet/makefile.win @@ -0,0 +1,31 @@ +# 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=..\..\..\.. + +JAVA_SOURCEPATH=$(MOZ_OUT)\x86Dbg\java\classes\java40.jar + +JSRCS= \ +!ifdef MOZ_PRIV + $(MOZ_SRC)\ns_priv\dialup\java\AMDProgressBar.java \ +!endif + ProgressApplet.java \ + CPGeneratorProgress.java \ + $(NULL) + +JAVA_DESTPATH=$(MOZ_SRC)\ns\dist\classes +PACKAGE=netscape\asw + +!include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/cmd/dialup/java/makefile.win b/mozilla/cmd/dialup/java/makefile.win new file mode 100644 index 00000000000..215b8f99256 --- /dev/null +++ b/mozilla/cmd/dialup/java/makefile.win @@ -0,0 +1,43 @@ +# 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=plugin applet + +PACKAGE=netscape\npasw +SIGNDIR=signed + +!include <$(DEPTH)\config\rules.mak> + + +install:: $(JAVA_DESTPATH)\$(PACKAGE) + -mkdir $(SIGNDIR)\$(PACKAGE) + copy $(JAVA_DESTPATH)\$(PACKAGE)\*.class $(SIGNDIR)\$(PACKAGE) + zigbert \ +!ifdef MOZ_CERT_DIR + -d $(MOZ_CERT_DIR) \ +!endif +!ifdef MOZ_CERT_NAME + -k $(MOZ_CERT_NAME) \ +!endif +!ifdef MOZ_CERT_PWD + -p $(MOZ_CERT_PWD) \ +!endif + $(SIGNDIR) + cd $(SIGNDIR) + $(ZIP) npasw.jar * + +clobber:: + -rm -r $(SIGNDIR) diff --git a/mozilla/cmd/dialup/java/plugin/CPGenerator.java b/mozilla/cmd/dialup/java/plugin/CPGenerator.java new file mode 100644 index 00000000000..13b3e6b257d --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/CPGenerator.java @@ -0,0 +1,578 @@ +/* -*- Mode: Java; 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. + */ +/* + compare page generator +*/ +package netscape.npasw; + +import netscape.npasw.*; +import java.io.*; +import java.net.*; +import java.lang.*; +import java.util.*; +import netscape.security.*; +//import Trace; + +public class CPGenerator +{ + public static final int SENDING = 4; + public static final int RECEIVING_RESPONSE = 5; + public static final int WAITING = 6; + public static final int CONTACTING_SERVER = 7; + public static final int DONE = 0; + public static final int ABORT = -1; + + public static final String FEATURE_STRING = "FEATURES"; + public static final int FEATURE_COUNT = 8; + + + public static final boolean DEBUG = true; + public static boolean done = false; + public static String currentFile = ""; + public static int totalBytes = 0; + static int state = DONE; + + static String ispDirectorySymbol = "isp_dir"; + static String comparePageTemplateFileName = "compare.tmpl"; + static String comparePageFileName = "compare.html"; + static String dataPath = "data"; + static String ispPath = dataPath + File.separator + "isp"; // ¥Êmight be platform dependent + static String metaDataPath = dataPath + File.separator + "metadata" + File.separator + "html"; + static String featuresConfigPath = dataPath + File.separator + "metadata" + File.separator + "config" + + File.separator + "features.cfg"; + + //static CPGeneratorProgress progress = null; + +// static final String regservMimeData = "http://seaspace.netscape.com:8080/programs/ias5/regserv/docs/reg.cgi"; + + public static int getState() + { + return state; + } + + public static String getJarFilePath( ISPDynamicData isp ) + { + return new String( ispPath + File.separator + isp.getLanguage() + File.separator + isp.getName() + + File.separator + isp.getName() + ".jar" ); + } + + public static String getConfigFilePath( ISPDynamicData isp ) + { + return new String( ispPath + File.separator + isp.getLanguage() + File.separator + isp.getName() + + File.separator + "info" + File.separator + "config" + File.separator + "config.ias" ); + } + + + + + /* + Takes the given inputFile and looks for strings in the form + "@@@string_to_replace@@@" and replaces them with the value + found in nvSet, writing the output into outputFile + + @return void + @param nvSet NameValueSet that contains the name/value pairs to use for replacement + @param inputFile file containing replacement strings in the form "@@@string_to_replace@@@" + @param outputFile file that is created + */ + public static void executeNameValueReplacement( NameValueSet nvSet, File inputFile, File outputFile ) + throws Exception + { + if ( outputFile.exists() ) + { + //Trace.TRACE( "deleting outputfile: " + outputFile.getPath() ); + outputFile.delete(); + } + + BufferedReader bufferedInputReader = new BufferedReader( new FileReader( inputFile ) ); + BufferedWriter bufferedOutputWriter = new BufferedWriter( new FileWriter( outputFile ) ); + + int c = bufferedInputReader.read(); + while ( c != -1 ) + { + if ( c == '@' ) + { + bufferedInputReader.mark( 1024 ); + + boolean successful = false; + int c1; + int c2 = -1; + + c1 = bufferedInputReader.read(); + if ( c1 != -1 ) + c2 = bufferedInputReader.read(); + if ( c1 == '@' && c2 == '@' ) + { + StringBuffer buffer = new StringBuffer( 256 ); + + int c3 = bufferedInputReader.read(); + + while ( c3 != -1 && c3 != '@' ) + { + buffer.append( (char)c3 ); + c3 = bufferedInputReader.read(); + } + //Trace.TRACE( "read identifier: " + buffer.toString() ); + + if ( c3 == '@' ) + { + c2 = -1; + c1 = bufferedInputReader.read(); + if ( c1 != -1 ) + c2 = bufferedInputReader.read(); + if ( c1 == '@' && c2 == '@' ) + { + //Trace.TRACE( "successful" ); + successful = true; + + String name = new String( buffer ); + //Trace.TRACE( "grepping nvSet for " + name ); + //nvSet.printNameValueSet(); + String value; + if ( nvSet == null ) + value = new String( "" ); + else + { + + value = nvSet.getValue( name ); + if ( value == null ) + value = new String( "" ); + } + + //Trace.TRACE( "value is: " + value ); + bufferedOutputWriter.write( value ); + } + } + } + if ( !successful ) + { + //Trace.TRACE( "not successful, backing up stream" ); + bufferedOutputWriter.write( c ); + bufferedInputReader.reset(); + } + } + else + { + bufferedOutputWriter.write( c ); + } + c = bufferedInputReader.read(); + } + + bufferedOutputWriter.flush(); + bufferedOutputWriter.close(); + bufferedInputReader.close(); + } + + /* + Takes the bufferedInputReader and reads the stream looking for instances + of ###filename_minus_extension###, then it will open "filename_minus_extension" + .mat + and parse the contents of that file as a NameValueSet. + + Then, it looks at each NameValueSet in the Vector nvSets and if a given set in + that vector is a superset of the .mat NameValueSet, a match is found, the file + "filename_minus_extension" + .tmpl is opened and executeNameValueReplacement + is called to create a file to be included in the bufferedOutputWriter (got that?) + + @return void + @param bufferedInputReader input file containing constraint template to be replaced + @param bufferedOutputWriter output file (html) + */ + public static void executeConstraintReplacement( Vector nameValueSets, BufferedReader bufferedInputReader, BufferedWriter bufferedOutputWriter ) + throws Exception + { + int c = bufferedInputReader.read(); + while ( c != -1 ) + { + if ( c == '#' ) + { + bufferedInputReader.mark( 1024 ); + + boolean successful = false; + int c1; + int c2 = -1; + + c1 = bufferedInputReader.read(); + if ( c1 != -1 ) + c2 = bufferedInputReader.read(); + if ( c1 == '#' && c2 == '#' ) + { + StringBuffer buffer = new StringBuffer( 128 ); + + int c3 = bufferedInputReader.read(); + + while ( c3 != -1 && c3 != '#' ) + { + buffer.append( (char)c3 ); + c3 = bufferedInputReader.read(); + } + + if ( c3 == '#' ) + { + c2 = -1; + c1 = bufferedInputReader.read(); + if ( c1 != -1 ) + c2 = bufferedInputReader.read(); + if ( c1 == '#' && c2 == '#' ) + { + successful = true; + + String criterionFileName = metaDataPath + File.separator + buffer.toString() + ".mat"; /* will be something like "template1.mat" */ + String templateFileName = metaDataPath + File.separator + buffer.toString() + ".tmpl"; /* will be something like "template1.tmpl" */ + String outputFileName = metaDataPath + File.separator + buffer.toString() + ".html"; + + Trace.TRACE( "criterionFile: " + criterionFileName ); + Trace.TRACE( "templateFile: " + templateFileName ); + Trace.TRACE( "outputFile: " + outputFileName ); + + File templateFile = new File( templateFileName ); + File criterionFile = new File( criterionFileName ); + File outputFile = new File( outputFileName ); + + NameValueSet criterionSet = new NameValueSet( criterionFile ); + + for ( int i = 0; i < nameValueSets.size(); i++ ) + { + NameValueSet nvSet = (NameValueSet)nameValueSets.elementAt( i ); + if ( criterionSet.isSubsetOf( nvSet ) ) + { + executeNameValueReplacement( nvSet, templateFile, outputFile ); + BufferedReader bufSubInputReader = new BufferedReader( new FileReader( outputFile ) ); + executeConstraintReplacement( nameValueSets, bufSubInputReader, bufferedOutputWriter ); + bufSubInputReader.close(); + } + } + } + } + } + if ( !successful ) + { + bufferedOutputWriter.write( c ); + bufferedInputReader.reset(); + } + } + else + { + bufferedOutputWriter.write( c ); + } + c = bufferedInputReader.read(); + } + + bufferedOutputWriter.flush(); + } + + + /* + Opens a connection to "sURL" and sends a POST with the data contained + in "reggieData". Each entry in "reggieData" should be a string of the + form "name=value". The result send back from the server is then + parsed into individual ISPDynamicData's which are put into a Vector + and returned + + @return Vector of ISPDynamicData's + @param sURL URL of the server to send the POST to + @param reggieData String array with entries of the form "name=value" to send to server as POST + */ + private static Vector parseMimeStream( String sURL, String reggieData[] ) throws Exception + { + + int nBuffSize = 0; + int count = 0; + URLConnection urlSrcConn = null; + URL urlSrc = null; + Vector ispList = new Vector(); + + state = CONTACTING_SERVER; + + //Trace.TRACE( "opening connection to registration server" ); + urlSrc = new URL( sURL ); + urlSrcConn = urlSrc.openConnection(); + + state = SENDING; + urlSrcConn.setDoOutput( true ); + urlSrcConn.setAllowUserInteraction( true ); + + Trace.TRACE( "sending POST to:" ); + Trace.TRACE( sURL ); + + // ¥ send the post + PrintWriter out = new PrintWriter( urlSrcConn.getOutputStream() ); + for ( count = 0; count < reggieData.length; count++ ) + { + if ( count > 0 ) + out.print( "&" ); + out.print( reggieData[ count ] ); + } + + out.println(); + out.close(); + + state = WAITING; + + InputStream origStream = urlSrcConn.getInputStream(); + + //Trace.TRACE( "creating reggie stream" ); + ReggieStream is = new ReggieStream( origStream ); + + String buffer; + try + { + state = RECEIVING_RESPONSE; + + buffer = is.nextToken(); + if ( buffer.compareTo( "STATUS" ) != 0 ) + throw new MalformedReggieStreamException( "no STATUS message sent" ); + + buffer = is.nextToken(); + if ( buffer.compareTo( "OK" ) != 0 ) + throw new MalformedReggieStreamException( "STATUS not OK" ); + + buffer = is.nextToken(); + if ( buffer.compareTo( "SIZE" ) != 0 ) + throw new MalformedReggieStreamException( "no SIZE value sent" ); + + totalBytes = new Integer( is.nextToken() ).intValue(); + + while ( true ) + { + //Trace.TRACE( "trying to create a new ISPDynamicData" ); + ISPDynamicData newData = new ISPDynamicData(); + newData.read( is ); + ispList.addElement( newData ); + } + } + catch ( EOFException e ) + { + state = DONE; + Trace.TRACE( "finished downloading dynamic data" ); + } + catch ( MalformedReggieStreamException e ) + { + state = ABORT; + Trace.TRACE( "malformed stream, saving partial dynamic data" ); + } + + //Trace.TRACE( "returning ispList" ); + return ispList; + } + + public static void main( String[] arg ) + { + // generateComparePage( "https://reggie.netscape.com/IAS5/docs/reg.cgi", + // new String[] { "CST__PHONE_NUMBER=6743552", "CLIENT_LANGUAGE=en", + // "REG_SOURCE=APL", "CST_AREA_CODE_1=415", "CST_AREA_CODE_2=650", + // "CST_AREA_CODE_3=408" } ); + } + + public static void parseFeatureSet( NameValueSet ispSet, NameValueSet featureMapping ) + { + String featureList = ispSet.getValue( FEATURE_STRING ); + //Trace.TRACE( "features: " + featureList ); + + for ( int i = 1; i <= FEATURE_COUNT; i++ ) + { + String featureName = "feature" + i; + String featureMappedName = featureMapping.getValue( featureName ); + + //Trace.TRACE( featureName + " mapped to " + featureMappedName ); + + // ¥ÊfeatureMappedName will be something like "hosting" or "freetime" + if ( featureMappedName != null && + featureList != null && + featureMappedName.compareTo( "" ) != 0 && + featureList.indexOf( featureMappedName ) != -1 ) + { + //Trace.TRACE( "going to show" ); + ispSet.addNameValuePair( featureName, "SHOW" ); + } + else + { + //Trace.TRACE( "going to hide" ); + ispSet.addNameValuePair( featureName, "HIDE" ); + } + } + } + + public static boolean generateComparePage( String sUrl, String reggieData[] ) + { + Trace.TRACE( "Hello" ); + + Vector nameValueSets = null; + Vector dynamicData = null; + NameValueSet featureMappings = null; + boolean result = false; + + done = false; + try + { + //if ( progress == null ) + // progress = new CPGeneratorProgress(); + + //progress.show(); + //progress.toFront(); + //new Thread( progress ).start(); + + // ¥ send "POST" to registration server and parse the returned MIME stream + dynamicData = parseMimeStream( sUrl, reggieData ); + + // ¥ download the ".jar" for each ISP + for ( int i = 0; i < dynamicData.size(); i++ ) + { + ISPDynamicData ispData; + ispData = (ISPDynamicData)dynamicData.elementAt( i ); + + String zipFileURL = "https://reggie.netscape.com/IAS5/docs/ISP/" + + ispData.getLanguage() + "/" + + ispData.getName() + "/" + + "data/" + + ispData.getName() + ".jar"; + + String ispLocalFileName = getJarFilePath( ispData ); + + currentFile = new String( ispData.name ); + + ServerDownload.downloadURL( zipFileURL, ispLocalFileName ); + } + + ServerDownload.resetBytesDownloaded(); + + // ¥ decompress the ".jar" for each ISP + for ( int i = 0; i < dynamicData.size(); i++ ) + { + ISPDynamicData ispData; + ispData = (ISPDynamicData)dynamicData.elementAt( i ); + + String ispLocalFileName = getJarFilePath( ispData ); + + currentFile = new String( ispLocalFileName ); + + ServerDownload.unJarFile( ispLocalFileName, true ); + } + + //Trace.TRACE( "features.cfg settings: " ); + featureMappings = new NameValueSet( new File( featuresConfigPath ) ); + //featureMappings.printNameValueSet(); + + // ¥ fill in the variables in each "config.ias" with the dynamic data from the server + for ( int i = 0; i < dynamicData.size(); i++ ) + { + ISPDynamicData ispData; + ispData = (ISPDynamicData)dynamicData.elementAt( i ); + + String inputFileName = getConfigFilePath( ispData ); + //Trace.TRACE( "inputFileName: " + inputFileName ); + String outputFileName = inputFileName + ".r"; + //Trace.TRACE( "outputFileName: " + outputFileName ); + + File inputFile = new File( inputFileName ); + File outputFile = new File( outputFileName ); + + executeNameValueReplacement( ispData.getDynamicData(), inputFile, outputFile ); + //if ( inputFile.delete() ) + //{ + // Trace.TRACE( "deleted ISP config file" ); + // if ( outputFile.renameTo( inputFile ) ) + // ; //Trace.TRACE( "rename succeeded" ); + //} + } + + nameValueSets = new Vector(); + + // ¥ create a name/value set for each ISP by parsing the "config.ias" files + for ( int i = 0; i < dynamicData.size(); i++ ) + { + ISPDynamicData ispData; + ispData = (ISPDynamicData)dynamicData.elementAt( i ); + + String ispConfigFileName = getConfigFilePath( ispData ) + ".r"; + + //Trace.TRACE( "ispConfigFileName: " + ispConfigFileName ); + + File ispConfigFile = new File( ispConfigFileName ); + + if ( ispConfigFile.exists() ) + { + NameValueSet nvSet = new NameValueSet( ispConfigFile ); + nvSet.setValue( ispDirectorySymbol, new String( ispData.language + "/" + ispData.name ) ); + parseFeatureSet( nvSet, featureMappings ); + nameValueSets.addElement( nvSet ); + //nvSet.printNameValueSet(); + } + } + + // ¥Êparse the feature list for each ISP + //for ( int i = 0; i < dynamicData.size(); i++ ) + //{ + // ISPDynamicData ispData; + // ispData = (ISPDynamicData)dynamicData.elementAt( i ); + // + // ispData.parseFeatureSet( featureMappings ); + // ispData.printISPDynamicData(); + // } + + // ¥ now, generate the compare page using the compare page template and the name/value pairs for each ISP + BufferedReader bufferedInputReader = new BufferedReader( new FileReader( new File( metaDataPath + File.separator + comparePageTemplateFileName ) ) ); + BufferedWriter bufferedOutputWriter = new BufferedWriter( new FileWriter( new File( dataPath + File.separator + comparePageFileName ) ) ); + + executeConstraintReplacement( nameValueSets, bufferedInputReader, bufferedOutputWriter ); + bufferedOutputWriter.close(); + bufferedInputReader.close(); + + done = true; + result = true; + //System.in.read(); // prevent console window from going away + } + +/* catch ( MalformedURLException e ) + { + System.err.println( sURL + " is NOT a valid URL" ); + e.printStackTrace(); + } + catch ( ConnectException e ) + { + System.err.println( "failed connecting to " + sURL ); + e.printStackTrace(); + } + catch ( UnknownHostException e ) + { + System.err.println( "invalid host: " + urlSrc.getHost() ); + e.printStackTrace(); + } + catch ( FileNotFoundException e ) + { + System.err.println( "failed finding file " + sDestFileName ); + e.printStackTrace(); + } + catch ( Exception e ) + { + System.err.println( e ); + e.printStackTrace(); + } +*/ + + catch ( Throwable e ) + { + done = true; + result = false; + Trace.TRACE( "caught an exception" ); + Trace.TRACE( e.getMessage() ); + e.printStackTrace(); + } + return result; + } +} + diff --git a/mozilla/cmd/dialup/java/plugin/ISPDynamicData.java b/mozilla/cmd/dialup/java/plugin/ISPDynamicData.java new file mode 100644 index 00000000000..b8e7cd13e78 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/ISPDynamicData.java @@ -0,0 +1,189 @@ +/* -*- Mode: Java; 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. + */ +package netscape.npasw; + +import netscape.npasw.*; +import java.io.*; +import java.lang.*; +//import Trace; + +public class ISPDynamicData +{ + static final String NAME_STRING = "NAME"; + static final String LANGUAGE_STRING = "LANGUAGE"; + static final String REG_SOURCE_STRING = "REG_SOURCE"; + static final String SERVICE_TYPE_STRING = "SERVICE_TYPE"; + static final String DYNAMIC_DATA_STRING = "DYNAMIC_DATA"; +// static final String zipFilesURL = "http://seaspace.netscape.com:8080/programs/ias5/regserv/docs/ISP/"; + + public NameValueSet reggieData = null; + protected String name = null; + protected String language = null; + protected String serviceType = null; + + static String lastName = null; + + protected NameValueSet dynamicData = null; + + public ISPDynamicData() + { + } + + public void read( ReggieStream is ) throws Exception + { + // this will need to be reworked a little once we get the reggie protocol fixed + String name; + String value; + boolean done = false; + boolean haveName = false; + + reggieData = new NameValueSet(); + + try + { + //Trace.TRACE( "creating ISPDynnamicData" ); + while ( !done ) + { + if ( lastName != null ) + { + //Trace.TRACE( "have lastName" ); + name = lastName; + lastName = null; + } + else + { + name = is.nextToken(); + } + + //Trace.TRACE( "name is: " + name ); + + if ( name.compareTo( NAME_STRING ) == 0 ) + { + if ( !haveName ) + { + //Trace.TRACE( "setting haveName" ); + haveName = true; + } + else + { + //Trace.TRACE( "haveName was set, setting lastName, we're done" ); + lastName = name; + done = true; + } + } + + if ( done == false && name.compareTo( "" ) != 0 ) + { + value = is.nextToken(); + //Trace.TRACE( "value is: " + value ); + reggieData.addNameValuePair( name, value ); + } + + if ( name.compareTo( "" ) == 0 ) + throw new EOFException( "done with reggie stream" ); + } + } + catch ( MalformedReggieStreamException e ) + { + lastName = null; + throw new EOFException( "done with reggie stream" ); + } + catch ( Exception e ) + { + lastName = null; + throw e; + } + } + + public String getName() + { + if ( name != null ) + return name; + else + { + if ( reggieData != null ) + { + String temp = reggieData.getValue( NAME_STRING ); + if ( temp != null && temp.compareTo( "" ) != 0 ) + { + name = temp; + return name; + } + } + } + return ""; + } + + public String getLanguage() + { + if ( language != null ) + { + //Trace.TRACE( "returning language" + language ); + return language; + } + else + { + if ( reggieData != null ) + { + //Trace.TRACE( "looking for language" ); + String temp = reggieData.getValue( LANGUAGE_STRING ); + if ( temp != null && temp.compareTo( "" ) != 0 ) + { + //Trace.TRACE( "language value found:" + temp ); + language = temp; + return language; + } + } + } + return ""; + } + + public NameValueSet getDynamicData() + { + if ( dynamicData != null ) + return dynamicData; + else + { + if ( reggieData != null ) + { + String temp = reggieData.getValue( DYNAMIC_DATA_STRING ); + if ( temp != null && temp.compareTo( "" ) != 0 ) + { + try + { + dynamicData = new NameValueSet( temp ); + return dynamicData; + } + catch ( Throwable e ) + { + return null; + } + } + } + } + return null; + } + + public final void printISPDynamicData() + { + if ( reggieData != null ) + reggieData.printNameValueSet(); + } + +} + diff --git a/mozilla/cmd/dialup/java/plugin/IniFileData.java b/mozilla/cmd/dialup/java/plugin/IniFileData.java new file mode 100644 index 00000000000..9f31e2c1962 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/IniFileData.java @@ -0,0 +1,96 @@ +/* -*- Mode: Java; 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. + */ + +package netscape.npasw; + +import netscape.npasw.*; +import java.io.*; +import java.lang.*; +import java.util.*; +import netscape.security.*; +//import Trace; + +public class IniFileData +{ + Hashtable sections; + final String sectionPrefix = "["; + + + public IniFileData( File inputFile ) throws Exception + { + sections = new Hashtable(); + + //Trace.TRACE( "reading file: " + inputFile.getPath() ); + + BufferedReader bufferedInputReader = new BufferedReader( new FileReader( inputFile ) ); + + String line = bufferedInputReader.readLine(); + + while ( line != null ) + { + //Trace.TRACE( "line: " + line ); + + while ( !line.startsWith( sectionPrefix ) ) + line = bufferedInputReader.readLine(); + + int closingBracketAt = line.indexOf( "]" ); + if ( closingBracketAt != -1 ) + { + String sectionName = new String( line.substring( 1, closingBracketAt ).trim() ); + NameValueSet nvSet = new NameValueSet(); + + //Trace.TRACE( "found section: " + sectionName ); + + nvSet.read( bufferedInputReader ); + sections.put( sectionName, nvSet ); + } + else + throw new MalformedIniFileException( "malformed file: " + inputFile.getPath() ); + + line = bufferedInputReader.readLine(); + } + } + + public String getValue( String sectionName, String name ) + { + //Trace.TRACE( "getting section: " + sectionName ); + + NameValueSet nvSet = (NameValueSet)sections.get( sectionName ); + + if ( nvSet == null ) + return null; + + String value = nvSet.getValue( name ); + //Trace.TRACE( "value: " + value ); + return value; + } + + public final void printIniFileData() + { + for ( Enumeration sectionList = sections.keys(); sectionList.hasMoreElements(); ) + { + String sectionName = (String)sectionList.nextElement(); + NameValueSet iniSection = (NameValueSet)sections.get( sectionName ); + + Trace.PrintToConsole( "section name: [ " + sectionName + " ] " ); + iniSection.printNameValueSet(); + } + } +} + + diff --git a/mozilla/cmd/dialup/java/plugin/MalformedIniFileException.java b/mozilla/cmd/dialup/java/plugin/MalformedIniFileException.java new file mode 100644 index 00000000000..6c9b5c1c350 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/MalformedIniFileException.java @@ -0,0 +1,34 @@ +/* -*- Mode: Java; 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. + */ + +package netscape.npasw; + +import java.io.*; +import java.lang.*; +import java.util.*; +import netscape.security.*; +//import Trace; +public class MalformedIniFileException extends Exception +{ + public MalformedIniFileException( String s ) + { + super( s ); + } +} + + diff --git a/mozilla/cmd/dialup/java/plugin/MalformedReggieStreamException.java b/mozilla/cmd/dialup/java/plugin/MalformedReggieStreamException.java new file mode 100644 index 00000000000..99d5a4f3932 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/MalformedReggieStreamException.java @@ -0,0 +1,33 @@ +/* -*- Mode: Java; 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. + */ + +package netscape.npasw; + +import netscape.npasw.*; +import java.io.*; +import java.lang.*; + +public class MalformedReggieStreamException extends Exception +{ + public MalformedReggieStreamException( String s ) + { + super( s ); + } +} + + diff --git a/mozilla/cmd/dialup/java/plugin/NameValuePair.java b/mozilla/cmd/dialup/java/plugin/NameValuePair.java new file mode 100644 index 00000000000..8ce0947341c --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/NameValuePair.java @@ -0,0 +1,44 @@ +/* -*- Mode: Java; 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. + */ +package netscape.npasw; + +import netscape.npasw.*; +//import Trace; +import java.io.*; +import java.lang.*; +import java.util.*; + +public class NameValuePair +{ + String name; + String value; + + public NameValuePair( String inputName, String inputValue ) + { + this.name = inputName; + this.value = inputValue; + } + + public NameValuePair( NameValuePair inputNVPair ) + { + this.name = inputNVPair.name; + this.value = inputNVPair.value; + } +} + + diff --git a/mozilla/cmd/dialup/java/plugin/NameValueSet.java b/mozilla/cmd/dialup/java/plugin/NameValueSet.java new file mode 100644 index 00000000000..a1f3106e93d --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/NameValueSet.java @@ -0,0 +1,236 @@ +/* -*- Mode: Java; 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. + */ +package netscape.npasw; + +import netscape.npasw.*; +//import Trace; +import java.io.*; +import java.lang.*; +import java.util.*; + +class FileCreationException extends Exception +{ + public FileCreationException( String s ) + { + super( s ); + } +} + +class MalformedNameValueStringException extends Exception +{ + public MalformedNameValueStringException( String s ) + { + super( s ); + } +} + +public class NameValueSet +{ + Hashtable nameValuePairs; + final String commentPrefix = "#"; + + + public NameValueSet() + { + // ¥ XXX + nameValuePairs = new Hashtable(); + } + + /* + @param nvPairs string in the form "name1=value2&name2=value2&..." to + be parsed into nameValuePairs + */ + public NameValueSet( String nvPairs ) throws Exception + { + nameValuePairs = new Hashtable(); + + StringReader stringReader = new StringReader( nvPairs ); + int ch = 0; + StringBuffer buffer = new StringBuffer(); + String name = null; + String value = null; + + ch = stringReader.read(); + while ( ch != -1 ) + { + buffer.setLength( 0 ); + while ( ch == ' ' ) + ch = stringReader.read(); + + while ( ch != -1 && ch != '=' && ch != ' ' ) + { + buffer.append( (char)ch ); + ch = stringReader.read(); + } + + if ( ch == ' ' ) + { + while ( ch == ' ' ) + ch = stringReader.read(); + } + + if ( ch == '=' ) + { + name = new String( buffer ); + buffer.setLength( 0 ); + ch = stringReader.read(); + + while ( ch == ' ' ) + ch = stringReader.read(); + + while ( ch != -1 && ch != ' ' ) + { + buffer.append( (char)ch ); + ch = stringReader.read(); + } + + value = new String( buffer ); + + nameValuePairs.put( name, value ); + if ( ch == ' ' ) + { + while ( ch == ' ' ) + ch = stringReader.read(); + } + } + } + } + + /* + @param inputFile file to be parsed into nameValuePairs + */ + public NameValueSet( File inputFile ) throws Exception + { + nameValuePairs = new Hashtable(); + + BufferedReader bufferedInputReader = new BufferedReader( new FileReader( inputFile ) ); + + String line = bufferedInputReader.readLine(); + while ( line != null ) + { + if ( !line.startsWith( commentPrefix ) ) + { + int equalsSignAt = line.indexOf( "=" ); + if ( equalsSignAt != -1 ) + { + String nameString = line.substring( 0, equalsSignAt ).trim(); + String valueString = line.substring( ++equalsSignAt ).trim(); + + if ( nameString.length() != 0 && valueString.length() != 0 ) + nameValuePairs.put( nameString, valueString ); + } + } + line = bufferedInputReader.readLine(); + } + } + + public void read( BufferedReader reader ) throws Exception + { + final String sectionPrefix = "["; + + reader.mark( 8192 ); + String line = reader.readLine(); + + while ( line != null ) + { + //Trace.TRACE( "line: " + line ); + if ( !line.startsWith( sectionPrefix ) ) + { + if ( !line.startsWith( commentPrefix ) ) + { + int equalsSignAt = line.indexOf( "=" ); + if ( equalsSignAt != -1 ) + { + String nameString = new String( line.substring( 0, equalsSignAt ).trim() ); + String valueString = new String( line.substring( ++equalsSignAt ).trim() ); + + //Trace.TRACE( "name: " + nameString + " value: " + valueString ); + + if ( nameString.length() != 0 && valueString.length() != 0 ) + nameValuePairs.put( nameString, valueString ); + } + } + reader.mark( 8192 ); + line = reader.readLine(); + } + else + { + reader.reset(); + break; + } + } + } + + public void addNameValuePair( String inputName, String inputValue ) + { + nameValuePairs.put( inputName, inputValue ); + } + + public boolean removeNameValuePair( String inputName ) + { + if ( nameValuePairs.remove( inputName ) != null ) + return true; + return false; + } + + public boolean containsNameValuePair( NameValuePair inputNVPair ) + { + String value = (String)nameValuePairs.get( inputNVPair.name ); + if ( value != null && ( value.compareTo( inputNVPair.value ) == 0 ) ) + return true; + return false; + } + + public boolean isSubsetOf( NameValueSet inputNVSet ) + { + for ( Enumeration names = nameValuePairs.keys(); names.hasMoreElements(); ) + { + String name = (String)names.nextElement(); + String value = (String)nameValuePairs.get( name ); + + if ( !inputNVSet.containsNameValuePair( new NameValuePair( name, value ) ) ) + return false; + } + return true; + } + + public String getValue( String name ) + { + String result; + result = (String)nameValuePairs.get( name ); + if ( result == null ) + return new String( "" ); + else + return result; + } + + public void setValue( String name, String value ) + { + nameValuePairs.put( name, value ); + } + + public final void printNameValueSet() + { + for ( Enumeration names = nameValuePairs.keys(); names.hasMoreElements(); ) + { + String name = (String)names.nextElement(); + String value = (String)nameValuePairs.get( name ); + Trace.PrintToConsole( "name: " + name + " value: " + value ); + } + } +} diff --git a/mozilla/cmd/dialup/java/plugin/ReggieStream.java b/mozilla/cmd/dialup/java/plugin/ReggieStream.java new file mode 100644 index 00000000000..ce472169ba9 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/ReggieStream.java @@ -0,0 +1,57 @@ +/* -*- Mode: Java; 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. + */ + +package netscape.npasw; + +import netscape.npasw.*; +import java.io.*; +import java.lang.*; + +public class ReggieStream extends DataInputStream +{ + public ReggieStream( InputStream is ) + { + super( is ); + } + + public String nextToken() throws Exception + { + byte buffer[] = null; + int nBuffSize = 0; + String string = null; + + //Trace.TRACE( "nextToken has:" + this.available() ); + nBuffSize = this.readInt(); + //Trace.TRACE( "nBuffSize: " + nBuffSize ); + if ( nBuffSize == 0 ) + string = ""; + else if ( nBuffSize > 0 && nBuffSize < 4096 ) + { + buffer = new byte[ nBuffSize ]; + //Trace.TRACE( "trying to read buffer" ); + this.readFully( buffer ); + //Trace.TRACE( "creating string" ); + string = new String( buffer ); + } + else + throw new MalformedReggieStreamException( "invalid length for identifier" ); + + //Trace.TRACE( string ); + return string; + } +} diff --git a/mozilla/cmd/dialup/java/plugin/ServerDownload.java b/mozilla/cmd/dialup/java/plugin/ServerDownload.java new file mode 100644 index 00000000000..e38518af2e4 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/ServerDownload.java @@ -0,0 +1,320 @@ +/* -*- Mode: Java; 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. + */ +package netscape.npasw; + +import java.io.*; +import java.util.zip.*; +import java.net.*; +import netscape.security.*; +//import Trace; + +class DownloadException extends Exception +{ + public DownloadException( String s ) + { + super( s ); + } +} + +class UnjarException extends Exception +{ + public UnjarException( String s ) + { + super( s ); + } +} + +public class ServerDownload +{ + public static final boolean SLEEP = false; + public static final int IDLE = 0; + public static final int DOWNLOADING = 1; + public static final int UNJARRING = 2; + + static int state = IDLE; + static int bytesDownloaded = 0; + + public static int getState() + { + return state; + } + + public static int getBytesDownloaded() + { + return bytesDownloaded; + } + + public static void resetBytesDownloaded() + { + bytesDownloaded = 0; + } + + /* public static void main(String[] arg) + { + final String sURL = "http://scuba.mcom.com/~racham/testisp2.jar"; + final String sLocalDir = "temp" + File.separator + "isp"; + + long startTime = System.currentTimeMillis(); + if ( !UnjarURL( sURL, sLocalDir, true ) ) + { + System.out.println( sURL + " failed download/unjar!" ); + } + else + { + try + { + long stopTime = System.currentTimeMillis(); + String str = "==> Download/Unjar elapsed time: " + ( stopTime - startTime ) + " ms\n"; + System.out.print( str ); + RandomAccessFile raf = new RandomAccessFile( "testisp.dat", "rw" ); + raf.seek( raf.length() ); + raf.writeBytes( str ); + raf.close(); + } + catch ( IOException e ) + { + System.out.println( e.getMessage() ); + } + } + } + */ + + /** + * download a compressed (zip/jar) file and uncompress it into + * the designated local directory + * + * @return true if download suceeds + * @param sURL URL of the file to be downloaded + * @param sLocalFolder name of the destination (local) file + * @param bDelTempFile delete downloaded file after file extractions + */ + public static boolean unjarURL( String sURL, String sLocalFolder, boolean bDelTempFile ) + throws Exception + { + state = IDLE; + + boolean bResult = false; + + // ¥ downloaded file name: append filename to provided local folder + StringBuffer localFile = new StringBuffer( sLocalFolder ); + int nIndex = sURL.lastIndexOf( '/' ); + String sFileName; + + if ( nIndex == -1 ) + throw new UnjarException( "Invalid folder" ); + + sFileName = new String( sURL.getBytes(), nIndex + 1, sURL.length() - nIndex - 1 ); + localFile.append( File.separator + sFileName ); + //Trace.TRACE( "localfile: "+ localFile ); + + if ( downloadURL( sURL, localFile.toString() ) ) + { + //Trace.TRACE( sURL + " successfully downloaded" ); + if ( unJarFile( localFile.toString(), bDelTempFile ) ) + { + //Trace.TRACE( sURL + " successfully decompressed" ); + bResult = true; + } + } + + return bResult; + } + + /** + * download URL/file + * + * @return true if download suceeds + * @param sURL URL of the file to be downloaded + * @param sLocalFileName name of the destination (local) file + */ + public static boolean downloadURL( String sURL, String sDestFileName ) + throws Exception + { + final int nBuffSize = 512; + boolean bResult = false; + DataInputStream is = null; + InputStream tis = null; + FileOutputStream out = null; + URL urlSrc = null; + int nIndex; + String sFolderName; + + //Trace.TRACE( "downloading " + sURL ); + + state = ServerDownload.DOWNLOADING; + + urlSrc = new URL( sURL ); + + // This is a really gross fix to a stupid little problem: + // The openStream call erroneously barfs when opening the second + // URL during the run of the app. Worse, it cleans up and throws an + // exception rather than restarting the operation. Since the cleanup + // appears to work, we're adding the restart at this level. + // ** Beware removing this hack since the appearance of the symptom was + // ** random - suggesting a garbage-collection related bug in openStream. + + try + { + is = new DataInputStream( urlSrc.openStream() ); + } + catch ( Exception e ) + { + ; + } + finally + { + is = new DataInputStream( urlSrc.openStream() ); + } + + nIndex = sDestFileName.lastIndexOf( File.separator ); + if ( nIndex != -1 ) + { + sFolderName = new String( sDestFileName.getBytes(), 0, nIndex ); + File localFolder = new File( sFolderName ); + + //Trace.TRACE( "localFolder: " + localFolder ); + + // ¥ create folder to store the downloaded file + if ( !localFolder.mkdirs() && CPGenerator.DEBUG ) + System.err.println( "FAILED making dirs for " + localFolder.getPath() ); + } + + out = new FileOutputStream( sDestFileName ); + byte buffer[] = new byte[ nBuffSize ]; + int nBytesRead = 0; + + while ( ( nBytesRead = is.read( buffer ) ) != -1 ) + { + bytesDownloaded += nBytesRead; + out.write( buffer, 0, nBytesRead ); + if ( SLEEP ) + Thread.sleep( 500 ); + else + Thread.yield(); + out.flush(); + } + + // ¥ close streams + is.close(); + out.close(); + + is = null; + out = null; + urlSrc = null; + //urlSrcConn = null; + + bResult = true; + + state = IDLE; + return bResult; + } + + /** + * Uncompress a JAR file + * + * @return true if file is decompressed successfully + * @param sCompFile name of the file to be decompressed + * @param sDeleteJarFile delete orig file after file extraction + */ + public static boolean unJarFile( String sCompFile, boolean bDeleteJarFile ) + throws Exception + { + state = UNJARRING; + + boolean bResult = false; + final int nBuffSize = 500; + + FileOutputStream fileout = null; + ZipInputStream inflaterin = null; + File comprFile = null; + + try + { + //Trace.TRACE( "sCompFile: " + sCompFile ); + + comprFile = new File( sCompFile ); + inflaterin = new ZipInputStream( new FileInputStream( sCompFile ) ); + + //Trace.TRACE( "unjaring file: " + comprFile.getPath() ); + + String comprFilePath = comprFile.getPath(); + // construct folder to store extracted files + String localFolderName = comprFile.getParent(); + //Trace.TRACE( "localFolderName: " + localFolderName ); + + byte[] buffer = new byte[ nBuffSize ]; + int nBytesRead = 0; + ZipEntry zEntry; + + while ( ( zEntry = inflaterin.getNextEntry() ) != null ) + { + String entryName = zEntry.getName(); + //Trace.TRACE( "next entry: " + entryName ); + + File zEntryFile = new File( localFolderName + File.separator + entryName ); + //Trace.TRACE( "constructed target file: " + zEntryFile.getPath() ); + + // ¥ entry is a directory, create local directories on the filesystem + if ( zEntry.isDirectory() ) + { + if ( !zEntryFile.mkdirs() && CPGenerator.DEBUG ) + System.err.println( "FAILED creating folder " + zEntryFile.getPath() ); + } + + // ¥ entry is a file: extract it + else + { + //Trace.TRACE( "--> extracting \"" + zEntry.getName() + "\" to " + zEntryFile.getPath() ); + + fileout = new FileOutputStream( zEntryFile.getPath() ); + while ( ( nBytesRead = inflaterin.read( buffer, 0, nBuffSize ) ) != -1 ) + { + bytesDownloaded += nBytesRead; + fileout.write( buffer, 0, nBytesRead ); + + if ( SLEEP ) + Thread.sleep( 500 ); + else + Thread.yield(); + } + + fileout.flush(); + inflaterin.closeEntry(); + } + } + + // ¥ delete original JAR file if specified + if ( bDeleteJarFile ) + { + //Trace.TRACE( "deleting " + comprFile.getPath() + " status: "+ comprFile.delete() ); + comprFile.delete(); + } + bResult = true; + } + finally + { + if ( fileout != null ) + fileout.close(); + if ( inflaterin != null ) + inflaterin.close(); + } + + state = IDLE; + return bResult; + } +} diff --git a/mozilla/cmd/dialup/java/plugin/SetupPlugin.java b/mozilla/cmd/dialup/java/plugin/SetupPlugin.java new file mode 100644 index 00000000000..388a752417b --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/SetupPlugin.java @@ -0,0 +1,414 @@ +/* -*- Mode: Java; 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. + */ + +package netscape.npasw; + +import netscape.plugin.Plugin; +import netscape.security.*; +import java.util.Hashtable; +import java.io.*; +import netscape.npasw.*; + +public class SetupPlugin extends Plugin +{ + static Hashtable iniFileCache = new Hashtable(); + + final public void debug( String s ) + { + System.out.println( s ); + } + + final public String[] newStringArray( int numElements ) + { + return new String[ numElements ]; + } + + final public void SetKiosk( boolean flag ) + { + if ( privilegeCheck() == true ) + SECURE_SetKiosk( flag ); + } + + + final public String GetNameValuePair( String filePath, String sectionName, String valueName ) + { + /* if ( privilegeCheck() == true ) + return SECURE_GetNameValuePair( filePath, sectionName, valueName); + else + return null; + */ + if ( privilegeCheck() == false ) + return new String( "" ); + + final String section1 = sectionName; + final String value1 = valueName; + + try + { + File file = new File( filePath ); + IniFileData iniFile = (IniFileData)iniFileCache.get( new Integer( file.hashCode() ) ); + + if ( iniFile == null ) + { + iniFile = new IniFileData( file ); + //iniFile.printIniFileData(); + iniFileCache.put( new Integer( file.hashCode() ), iniFile ); + } + + //Trace.TRACE( "getting file: " + filePath + " section: " + section1 + " value: " + value1 ); + String value = iniFile.getValue( section1, value1 ); + if ( value == null ) + return new String( "" ); + else + { + //Trace.TRACE( "returning: " + value ); + return new String( value ); + } + } + catch ( Throwable e ) + { + //Trace.TRACE( "caught an exception: " + e.getMessage() ); + return new String( "" ); + } + } + + + + final public void SetNameValuePair( String file, String section, String name, String value ) + { + // if ( privilegeCheck() == true ) + // SECURE_SetNameValuePair( file, section, name, value ); + } + + + + final public Object ReadFile( String file ) + { + if ( privilegeCheck() == true ) + return SECURE_ReadFile( file ); + else + return null; + } + + final public void WriteFile( String file, Object data ) + { + if ( privilegeCheck() == true ) + SECURE_WriteFile( file, data ); + } + + + final public String[] GetFolderContents( String path, String suffix ) + { + /* if ( privilegeCheck() == true ) + return SECURE_GetFolderContents( path, suffix ); + else + return null ; + */ + if ( privilegeCheck() == false ) + return null; + + try + { + File dir = new File( path ); + SuffixFilter filter = new SuffixFilter( suffix ); + String[] fileList = dir.list( filter ); + + return fileList; + } + catch ( Exception e ) + { + return null; + } + } + + + + final public String[] GetRegInfo( boolean flushDataFlag ) + { + if ( privilegeCheck() == true ) + return SECURE_GetRegInfo( flushDataFlag ); + else + return null; + } + + final public void DesktopConfig( String accountName, String iconFilename, String acctsetFilename ) + { + if ( privilegeCheck() == true ) + SECURE_DesktopConfig( accountName, iconFilename, acctsetFilename ); + } + + final public boolean SaveTextToFile( String suggestedFilename, String data, boolean promptFlag ) + { + if ( privilegeCheck() == true ) + return SECURE_SaveTextToFile( suggestedFilename, data, promptFlag ); + else + return false; + } + + final public String EncryptString( String cleartext ) + { + if ( privilegeCheck() == true ) + return SECURE_EncryptString( cleartext ); + else + return null; + } + + final public String EncryptPassword( String cleartext ) + { + if ( privilegeCheck() == true ) + return SECURE_EncryptPassword( cleartext ); + else + return null; + } + + final public void OpenModemWizard() + { + if ( privilegeCheck() == true ) + SECURE_OpenModemWizard(); + } + + final public void CloseModemWizard() + { + if ( privilegeCheck() == true ) + SECURE_CloseModemWizard(); + } + + final public boolean IsModemWizardOpen() + { + if ( privilegeCheck() == true ) + return SECURE_IsModemWizardOpen(); + else + return false; + } + + final public String[] GetModemList() + { + if ( privilegeCheck() == true ) + return SECURE_GetModemList(); + else + return null; + } + + final public String GetCurrentModemName() + { + if ( privilegeCheck() == true ) + return SECURE_GetCurrentModemName(); + else + return null; + } + + final public String GetModemType( String modem ) + { + if ( privilegeCheck() == true ) + return SECURE_GetModemType( modem ); + else + return null; + } + + final public boolean DialerConnect() + { + if ( privilegeCheck() == true ) + return SECURE_DialerConnect(); + else + return false; + } + + final public void DialerHangup() + { + if ( privilegeCheck() == true ) + SECURE_DialerHangup(); + } + + final public boolean IsDialerConnected() + { + if ( privilegeCheck() == true ) + return SECURE_IsDialerConnected(); + else + return false; + } + + final public void DialerConfig( String dialerData[], boolean regMode ) + { + if ( privilegeCheck() == true ) + SECURE_DialerConfig( dialerData, regMode ); + } + + final public boolean GenerateComparePage( String sUrl, String reggieData[] ) + { + return CPGenerator.generateComparePage( sUrl, reggieData ); + } + + + final public String GetCurrentProfileDirectory() + { + if ( privilegeCheck() == true ) + return SECURE_GetCurrentProfileDirectory(); + else + return null; + } + + final public String GetCurrentProfileName() + { + if ( privilegeCheck() == true ) + return SECURE_GetCurrentProfileName(); + else + return null; + } + + final public void SetCurrentProfileName( String profileName ) + { + if ( privilegeCheck() == true ) + SECURE_SetCurrentProfileName( profileName ); + } + + final public String GetExternalEditor() + { + if ( privilegeCheck() == true ) + return SECURE_GetExternalEditor(); + else + return null; + } + + final public void OpenFileWithEditor( String app, String file ) + { + if ( privilegeCheck() == true ) + SECURE_OpenFileWithEditor( app, file ); + } + + final public boolean NeedReboot() + { + if ( privilegeCheck() == true ) + return SECURE_NeedReboot(); + else + return false; + } + + final public void Reboot( String accountSetupPathname ) + { + if ( privilegeCheck() == true ) + SECURE_Reboot( accountSetupPathname ); + } + + final public void QuitNavigator() + { + // if ( privilegeCheck() == true ) + // SECURE_QuitNavigator(); + } + + final public boolean CheckEnvironment() + { + if ( privilegeCheck() == true ) + return SECURE_CheckEnvironment(); + else + return false; + } + + final public boolean Milan( String name, String value, boolean pushPullFlag, boolean extendedLengthFlag ) + { + if ( privilegeCheck() == true ) + return SECURE_Milan( name, value, pushPullFlag, extendedLengthFlag ); + else + return false; + } + + + +/* + Private methods: +*/ + + private boolean privilegeCheck() + { + boolean privilegeFlag = false; + + try + { + PrivilegeManager.checkPrivilegeEnabled( "AccountSetup" ); // All Hail The King !!! + privilegeFlag = true; + } + catch ( Exception e ) + { + System.out.println( "Account Setup Security Exception: " + e.toString() ); + e.printStackTrace(); + privilegeFlag = false; + } + + // un-comment the following line for testing: + //privilegeFlag = true; + + return privilegeFlag; + } + + + +/* + Private native methods: +*/ + + private native void SECURE_SetKiosk( boolean flag ); + + //private native String SECURE_GetNameValuePair( String file, String section, String name ); + private native void SECURE_SetNameValuePair( String file, String section, String name, String value ); + + private native Object SECURE_ReadFile( String file ); + private native void SECURE_WriteFile( String file,Object data ); + + //private native String[] SECURE_GetFolderContents( String path, String suffix ); + private native String[] SECURE_GetRegInfo( boolean flushDataFlag ); + + private native void SECURE_DesktopConfig( String accountName, String iconFilename, String acctsetFilename ); + private native boolean SECURE_SaveTextToFile( String suggestedFilename, String data, boolean promptFlag ); + private native String SECURE_EncryptString( String cleartext ); + private native String SECURE_EncryptPassword( String cleartext ); + + private native void SECURE_OpenModemWizard(); + private native void SECURE_CloseModemWizard(); + private native boolean SECURE_IsModemWizardOpen(); + + private native String[] SECURE_GetModemList(); + private native String SECURE_GetModemType( String modem ); + private native String SECURE_GetCurrentModemName(); + + private native boolean SECURE_DialerConnect(); + private native void SECURE_DialerHangup(); + private native boolean SECURE_IsDialerConnected(); + private native void SECURE_DialerConfig( String dialerData[], boolean regMode ); + + + private native String SECURE_GetCurrentProfileDirectory(); + private native String SECURE_GetCurrentProfileName(); + private native void SECURE_SetCurrentProfileName( String profileName ); + + private native String SECURE_GetExternalEditor(); + private native void SECURE_OpenFileWithEditor( String app, String file ); + + private native boolean SECURE_NeedReboot(); + private native void SECURE_Reboot( String accountSetupPathname ); + private native void SECURE_QuitNavigator(); + + private native boolean SECURE_CheckEnvironment(); + + private native boolean SECURE_Milan( String name, String value, boolean pushPullFlag, boolean extendedLengthFlag ); +} + + + + +/* + Note: routines passing/returning string arrays use the format: "VARIABLE=DATA" +*/ diff --git a/mozilla/cmd/dialup/java/plugin/SuffixFilter.java b/mozilla/cmd/dialup/java/plugin/SuffixFilter.java new file mode 100644 index 00000000000..703ee252145 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/SuffixFilter.java @@ -0,0 +1,40 @@ +/* -*- Mode: Java; 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. + */ +package netscape.npasw; + +import java.io.*; +import java.lang.*; + +public class SuffixFilter implements FilenameFilter +{ + String suffix; + + public SuffixFilter( String inSuffix ) + { + suffix = inSuffix; + } + + public boolean accept( File f, String s ) + { + if ( s.endsWith( suffix ) ) + return true; + return false; + } +} + + diff --git a/mozilla/cmd/dialup/java/plugin/Trace.java b/mozilla/cmd/dialup/java/plugin/Trace.java new file mode 100644 index 00000000000..da4b79e7bb1 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/Trace.java @@ -0,0 +1,55 @@ +/* -*- Mode: Java; 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. + */ + +package netscape.npasw; + +import java.io.*; +import java.lang.*; + +public class Trace +{ + public static final int TRACE_ON = 1; + + public static int traceLevel = 2; + + public static void SetTraceLevel( int newTraceLevel ) + { + traceLevel = newTraceLevel; + } + + public static void PrintToConsole( String printToConsole ) + { + System.out.println( printToConsole ); + } + + public static void TRACE_IF( int level, String printToConsole ) + { + if ( traceLevel >= level ) + System.err.println( printToConsole ); + } + + public static void TRACE( String printToConsole ) + { + if ( traceLevel >= TRACE_ON ) + System.err.println( printToConsole ); + } + +} + + + diff --git a/mozilla/cmd/dialup/java/plugin/makefile.win b/mozilla/cmd/dialup/java/plugin/makefile.win new file mode 100644 index 00000000000..9693e0d1d19 --- /dev/null +++ b/mozilla/cmd/dialup/java/plugin/makefile.win @@ -0,0 +1,36 @@ +# 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=..\..\..\.. + +JSRCS= \ + NameValuePair.java \ + NameValueSet.java \ + MalformedReggieStreamException.java \ + MalformedIniFileException.java \ + CPGenerator.java \ + ISPDynamicData.java \ + IniFileData.java \ + NameValue.java \ + ReggieStream.java \ + ServerDownload.java \ + SuffixFilter.java \ + Trace.java \ + SetupPlugin.java \ + $(NULL) + +PACKAGE=netscape\npasw + +!include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/cmd/dialup/mac/as_launch/AccountSetupLaunch.prefix b/mozilla/cmd/dialup/mac/as_launch/AccountSetupLaunch.prefix new file mode 100644 index 00000000000..5ca4f4ecae4 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_launch/AccountSetupLaunch.prefix @@ -0,0 +1,24 @@ +/* -*- 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. + */ + +// if building Account Setup Manager, set ACCOUNT_SETUP_BUILD to 1 and PROFILE_MANAGER_BUILD to 0 +#define ACCOUNT_SETUP_BUILD 1 +// #define ACCOUNT_SETUP_B3_HACK // create "Account Setup Manager" file in same folder as Communicator + +// if building Account Setup Manager, set ACCOUNT_SETUP_BUILD to 0 and PROFILE_MANAGER_BUILD to 1 +#define PROFILE_MANAGER_BUILD 0 diff --git a/mozilla/cmd/dialup/mac/as_launch/ProfileLaunch.prefix b/mozilla/cmd/dialup/mac/as_launch/ProfileLaunch.prefix new file mode 100644 index 00000000000..11ea05e4775 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_launch/ProfileLaunch.prefix @@ -0,0 +1,24 @@ +/* -*- 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. + */ + +// if building Account Setup Manager, set ACCOUNT_SETUP_BUILD to 1 and PROFILE_MANAGER_BUILD to 0 +#define ACCOUNT_SETUP_BUILD 0 +// #define ACCOUNT_SETUP_B3_HACK // create "Account Setup Manager" file in same folder as Communicator + +// if building Account Setup Manager, set ACCOUNT_SETUP_BUILD to 0 and PROFILE_MANAGER_BUILD to 1 +#define PROFILE_MANAGER_BUILD 1 diff --git a/mozilla/cmd/dialup/mac/as_launch/processRtns.c b/mozilla/cmd/dialup/mac/as_launch/processRtns.c new file mode 100644 index 00000000000..fdedf55ffc9 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_launch/processRtns.c @@ -0,0 +1,351 @@ +/* -*- 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 "startIncludes.h" + + + +/* + isAppRunning: return TRUE or FALSE depending upon whether a certain process is running +*/ + +Boolean +isAppRunning(OSType theSig, ProcessSerialNumber *thePSN, ProcessInfoRec *theProcInfo) +{ + Boolean flag=FALSE; + OSErr err=noErr; + ProcessInfoRec theProcessInfo; + + if (thePSN) { + if (theProcInfo == NULL) { + theProcInfo = &theProcessInfo; + theProcInfo->processInfoLength = sizeof(theProcessInfo); + theProcInfo->processName = NULL; + theProcInfo->processLocation = NULL; + theProcInfo->processAppSpec = NULL; + } + + thePSN->highLongOfPSN=0L; // start at beginning of process list + thePSN->lowLongOfPSN=kNoProcess; + + while(GetNextProcess(thePSN) != procNotFound) { // loop over all processes + GetProcessInformation(thePSN,theProcInfo); + if (theProcInfo->processSignature==theSig) { // if we found the appropriate process, we're done + flag=TRUE; + break; + } + } + } + return(flag); +} + + + +int +strlen(char *p) +{ + int len=0L; + + if (p) { + while (*p++) ++len; + } + return(len); +} + + + +void +modifyComponentDockPref(FSSpecPtr appFSSpecPtr) +{ + Handle h; + short refNum,saveResFile; + long theOffset=0L; + + if (appFSSpecPtr) { + saveResFile = CurResFile(); + SetResLoad(FALSE); + refNum=FSpOpenResFile(appFSSpecPtr, fsRdWrPerm); + SetResLoad(TRUE); + if (refNum != kResFileNotOpened) { + UseResFile(refNum); + + // check version resource + + if (h=Get1Resource(TEXT_RESOURCE,MAC_PREFS_TEXT_RES_ID)) { + HNoPurge(h); + HUnlock(h); + if ((theOffset=Munger(h,theOffset,DOCK_UNDOCKED,(long)strlen(DOCK_UNDOCKED),DOCK_DOCKED,(long)strlen(DOCK_DOCKED)))>=0L) { + ChangedResource(h); + WriteResource(h); + UpdateResFile(refNum); + } + } + + CloseResFile(refNum); + } + UseResFile(saveResFile); + } +} + + + +Boolean +checkVERS(FSSpecPtr appFSSpecPtr) +{ + Handle versH; + Boolean versionOKFlag=FALSE; + short refNum,saveResFile; + + if (appFSSpecPtr) { + saveResFile = CurResFile(); + SetResLoad(FALSE); + refNum=FSpOpenResFile(appFSSpecPtr, fsRdPerm); + SetResLoad(TRUE); + if (refNum != kResFileNotOpened) { + UseResFile(refNum); + + // check version resource + + if (versH=Get1Resource(VERS_RESOURCE,VERS_RESOURCE_ID)) { + HLock(versH); + if (*(char *)(*versH) >= MIN_NETSCAPE_VERSION) { + versionOKFlag=TRUE; + } + ReleaseResource(versH); + } + + CloseResFile(refNum); + } + UseResFile(saveResFile); + } + return(versionOKFlag); +} + + + +pascal Boolean +netscapeFileFilter(CInfoPBPtr pb, void *data) +{ + Boolean hideFlag=TRUE; + //*dataPtr; + + if (pb) { + if ((pb->hFileInfo.ioFlFndrInfo.fdType==APPLICATION_TYPE) && (pb->hFileInfo.ioFlFndrInfo.fdCreator==NETSCAPE_SIGNATURE)) { + hideFlag=FALSE; + } + } + return(hideFlag); +} + + + +OSErr +FindAppInCurrentFolder(OSType theSig, FSSpecPtr theFSSpecPtr) +{ + CInfoPBRec cBlock; + OSErr err=fnfErr; + ProcessInfoRec theProcInfo; + ProcessSerialNumber thePSN; + Str255 theName; + short ioFDirIndex=1; + + // get current process location + + if (err=GetCurrentProcess(&thePSN)) return(err); + theProcInfo.processInfoLength = sizeof(theProcInfo); + theProcInfo.processName = NULL; + theProcInfo.processLocation = NULL; + theProcInfo.processAppSpec = theFSSpecPtr; + if (err=GetProcessInformation(&thePSN,&theProcInfo)) return(err); + + // search folder for app with new enough version + + cBlock.hFileInfo.ioCompletion=NULL; + cBlock.hFileInfo.ioNamePtr=theFSSpecPtr->name; + cBlock.hFileInfo.ioVRefNum=theFSSpecPtr->vRefNum; + do { + cBlock.hFileInfo.ioDirID=theFSSpecPtr->parID; + cBlock.hFileInfo.ioFDirIndex=ioFDirIndex++; + if (err=PBGetCatInfoSync(&cBlock)) break; + if ((cBlock.hFileInfo.ioFlFndrInfo.fdType==APPLICATION_TYPE) && (cBlock.hFileInfo.ioFlFndrInfo.fdCreator==theSig)) { + if (checkVERS(theFSSpecPtr)==TRUE) { + break; + } + } + } while(!err); + return(err); +} + + + +/* + FindApp: search for an application in the current folder, then in the desktop database + + Assumption: isAppRunning has already checked that the application is not currently running +*/ + +OSErr +FindApp(OSType theSig, FSSpecPtr theFSSpecPtr) +{ + Boolean foundFlag=FALSE; + DTPBRec theDatabase; + FileFilterYDUPP netscapeFileFilterUPP; + GetVolParmsInfoBuffer volInfo; + HParamBlockRec hpb; + OSErr err=noErr; + OSType applType = {'APPL'}; + ParamBlockRec pb; + StandardFileReply theReply; + short volIndex=0,vRefNum; + long dirID; + Str255 fileString1; + Point centerPoint = {-1,-1}; + + if (!(err=FindAppInCurrentFolder(theSig,theFSSpecPtr))) { // look in folder of current process + foundFlag=TRUE; + } + else if (!(err=FindFolder(kOnSystemDisk,kSystemFolderType,FALSE,&vRefNum,&dirID))) { // look on startup volume + while (!err) { + hpb.ioParam.ioCompletion=NULL; + hpb.ioParam.ioNamePtr=NULL; + hpb.ioParam.ioVRefNum=vRefNum; + hpb.ioParam.ioBuffer=(Ptr)&volInfo; + hpb.ioParam.ioReqCount=sizeof(volInfo); + if (!(err=PBHGetVolParmsSync(&hpb))) { + if ((volInfo.vMAttrib & (1L << bHasDesktopMgr)) != 0) { // volume has desktop db? + theDatabase.ioCompletion=NULL; + theDatabase.ioNamePtr=NULL; + theDatabase.ioVRefNum=vRefNum; + if (!(err=PBDTGetPath(&theDatabase))) { // if so, open db + theDatabase.ioIndex=0; // most recent creation date + theDatabase.ioFileCreator=theSig; + theDatabase.ioNamePtr=(StringPtr)theFSSpecPtr->name; + + while (!(err=PBDTGetAPPL(&theDatabase,FALSE))) { + theFSSpecPtr->vRefNum=theDatabase.ioVRefNum; + theFSSpecPtr->parID=theDatabase.ioAPPLParID; + if (checkVERS(theFSSpecPtr)==TRUE) { + foundFlag=TRUE; + break; + } + ++theDatabase.ioIndex; + } + if (foundFlag == TRUE) break; + if (err==afpItemNotFound) { + err=noErr; + } + } + } + } + pb.volumeParam.ioCompletion=NULL; + pb.volumeParam.ioNamePtr=NULL; + pb.volumeParam.ioVolIndex=++volIndex; + if (!(err=PBGetVInfoSync(&pb))) { // search next mounted volume + vRefNum=pb.volumeParam.ioVRefNum; + } + else if (err==nsvErr) { // stop if no more volumes + err=fnfErr; + break; + } + } + + if (err==fnfErr) { // if not found, prompt for it + if (netscapeFileFilterUPP=NewFileFilterYDProc(netscapeFileFilter)) { + + GetIndString(fileString1, ERROR_STR_RESID, WHERE_IS_STR_ID); + + ParamText(fileString1,"\p", "\p", "\p"); + CustomGetFile(netscapeFileFilterUPP, 2, &applType, &theReply, CUSTOMGETFILE_RESID, centerPoint, nil, nil, nil, nil, (void *)NULL); // call StandardFile, tell it to list milan files + + DisposeRoutineDescriptor(netscapeFileFilterUPP); + if (theReply.sfGood == TRUE) { + theFSSpecPtr->vRefNum = theReply.sfFile.vRefNum; + theFSSpecPtr->parID = theReply.sfFile.parID; + BlockMove(theReply.sfFile.name, theFSSpecPtr->name, 1L+(unsigned)theFSSpecPtr->name[0]); + err=noErr; + foundFlag=TRUE; + } + else { + err=userCanceledErr; + } + } + } + + } + return(err); +} + + + +/* + LaunchApp: launch an application + + Assumption: isAppRunning has already checked that the application is not currently running +*/ + +OSErr +LaunchApp(FSSpecPtr theFSSpecPtr, AEDesc *launchDesc) +{ + LaunchParamBlockRec lBlock; + OSErr err=paramErr; + + if (theFSSpecPtr) { + lBlock.launchBlockID=extendedBlock; + lBlock.launchEPBLength=extendedBlockLen; + lBlock.launchFileFlags=0; + lBlock.launchControlFlags=launchContinue|launchNoFileFlags|launchUseMinimum; + lBlock.launchAppSpec=theFSSpecPtr; + if (launchDesc) { + HLock(launchDesc->dataHandle); + lBlock.launchAppParameters=(AppParametersPtr)*(launchDesc->dataHandle); + } + else { + lBlock.launchAppParameters=NULL; + } + err=LaunchApplication(&lBlock); + } + return(err); +} + + + +/* + QuitApp: send a kAEQuitApplication AppleEvent to quit a running application + + Assumption: isAppRunning has already checked that the application is currently running +*/ + +OSErr +QuitApp(ProcessSerialNumber *thePSN) +{ + AEAddressDesc theAddr={typeNull,NULL}; + AppleEvent theEvent={typeNull,NULL}, theReply={typeNull,NULL}; + OSErr err=paramErr; + + if (!thePSN) return(err); + + if (err=AECreateDesc(typeProcessSerialNumber,thePSN,sizeof(ProcessSerialNumber),&theAddr)) {} + else if (err=AECreateAppleEvent(kCoreEventClass, kAEQuitApplication,&theAddr,kAutoGenerateReturnID,kAnyTransactionID,&theEvent)) {} + else if (err=AESend(&theEvent,&theReply,kAENoReply+kAENeverInteract,kAENormalPriority,kAEDefaultTimeout,NULL,NULL)) {} + + if (theAddr.dataHandle) (void)AEDisposeDesc(&theAddr); + if (theEvent.dataHandle) (void)AEDisposeDesc(&theEvent); + if (theReply.dataHandle) (void)AEDisposeDesc(&theReply); + + return(err); +} diff --git a/mozilla/cmd/dialup/mac/as_launch/prototypes.h b/mozilla/cmd/dialup/mac/as_launch/prototypes.h new file mode 100644 index 00000000000..3280fddaee4 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_launch/prototypes.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. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +void main(void); + +void showError(short errStrIndex); + +extern Boolean isAppRunning(OSType theSig,ProcessSerialNumber *thePSN, ProcessInfoRec *theProcInfo); + +extern int strlen(char *p); + +extern void modifyComponentDockPref(FSSpecPtr appFSSpecPtr); + +extern Boolean checkVERS(FSSpecPtr appFSSpecPtr); + +pascal Boolean netscapeFileFilter(CInfoPBPtr pb, void *data); + +OSErr FindAppInCurrentFolder(OSType theSig, FSSpecPtr theFSSpecPtr); + +OSErr FindApp(OSType theSig, FSSpecPtr theFSSpecPtr); + +OSErr LaunchApp(FSSpecPtr theFSSpecPtr, AEDesc *launchDesc); + +extern OSErr QuitApp(ProcessSerialNumber *thePSN); + +#ifdef __cplusplus +} +#endif diff --git a/mozilla/cmd/dialup/mac/as_launch/start.c b/mozilla/cmd/dialup/mac/as_launch/start.c new file mode 100644 index 00000000000..6f082b5ee09 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_launch/start.c @@ -0,0 +1,212 @@ +/* -*- 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 "startIncludes.h" + + + +void +main(void) +{ + AEAddressDesc editorAddr={typeNull,NULL}; + AEDesc launchDesc={typeNull,NULL}; + AEDescList fileList={typeNull,NULL}; + AliasHandle docAliasH,theAliasH=NULL; + AppleEvent theAEEvent={typeNull,NULL}; + Boolean appRunningFlag,createdMagicFile=FALSE; + EventRecord theEvent; + FInfo fndrInfo; + FSSpec theAppFSSpec,theDocFSSpec; + Handle h; + OSErr err; + ProcessInfoRec theProcInfo; + ProcessSerialNumber thePSN; + Str255 theName; + short foundVRefNum,refNum,saveResFile; + long foundDirID,theTick; + + MaxApplZone(); + InitGraf(&qd.thePort); + InitFonts(); + InitMenus(); + InitWindows(); + TEInit(); + InitDialogs(0L); + InitCursor(); + + // if Netscape process is running, and its version 4.x or later, then quit it, then relaunch it + + theProcInfo.processInfoLength = sizeof(theProcInfo); + theProcInfo.processName = theName; + theProcInfo.processLocation = NULL; + theProcInfo.processAppSpec = &theAppFSSpec; + if (isAppRunning(NETSCAPE_SIGNATURE,&thePSN,&theProcInfo) == TRUE) { + if (checkVERS(&theAppFSSpec)==FALSE) { + showError(NETSCAPE_VERS_TOO_OLD_ERR); + ExitToShell(); + } + err=QuitApp(&thePSN); + + // wait for up to "TIME_TO_DIE" seconds for Netscape to die + + theTick=TickCount() + TIME_TO_DIE; + while (theTick > TickCount()) { + WaitNextEvent(everyEvent,&theEvent,TIME_TO_PAUSE,NULL); + if (!(appRunningFlag=isAppRunning(NETSCAPE_SIGNATURE,&thePSN,NULL))) { + break; + } + } + if (appRunningFlag) { + // Netscape didn't quit within "TIME_TO_DIE"... display an error maybe? Or just give up. + ExitToShell(); + } + } + else { + + // search desktop database, find Netscape 4.x or later + + if (err=FindApp(NETSCAPE_SIGNATURE,&theAppFSSpec)) { + if (err != userCanceledErr) { + showError(UNABLE_TO_LOCATE_NETSCAPE_APP_ERR); + } + ExitToShell(); + } + } + + + err=FindFolder(kOnSystemDisk, kPreferencesFolderType, kCreateFolder, &foundVRefNum, &foundDirID); + if (err) { + showError(UNABLE_TO_LOCATE_PREFS_FOLDER_ERR); + ExitToShell(); + } + +#if ACCOUNT_SETUP_BUILD + + // get alias to start.htm (Installer placed it in our binary) + + if (!(theAliasH=(AliasHandle)Get1IndResource(rAliasType,1))) { + showError(UNABLE_TO_LOCATE_ACCOUNT_SETUP_ERR); + ExitToShell(); + } + DetachResource((Handle)theAliasH); + + // create/find Account Setup file (with magic filetype) + +#ifdef ACCOUNT_SETUP_B3_HACK + err=FSMakeFSSpec(theAppFSSpec.vRefNum, theAppFSSpec.parID, START_ACCTSETUP_NAME_B3, &theDocFSSpec); + if (err==fnfErr) { + (void)FSpCreate(&theDocFSSpec, NETSCAPE_SIGNATURE, MAGIC_ACCTSETUP_SIGNATURE, smSystemScript); + FSpCreateResFile(&theDocFSSpec, NETSCAPE_SIGNATURE, MAGIC_ACCTSETUP_SIGNATURE, smSystemScript); + createdMagicFile=TRUE; + + // for B3 hack, make the magic file invisible if we created it + + if (err==fnfErr) { + if (!(err=FSpGetFInfo(&theDocFSSpec,&fndrInfo))) { + fndrInfo.fdFlags |= fInvisible; + err=FSpSetFInfo(&theDocFSSpec,&fndrInfo); + } + } + } +#else + err=FSMakeFSSpec(foundVRefNum, foundDirID, START_ACCTSETUP_NAME, &theDocFSSpec); + if (err==fnfErr) { + err=FSpCreate(&theDocFSSpec, NETSCAPE_SIGNATURE, MAGIC_ACCTSETUP_SIGNATURE, smSystemScript); + FSpCreateResFile(&theDocFSSpec, NETSCAPE_SIGNATURE, MAGIC_ACCTSETUP_SIGNATURE, smSystemScript); + } +#endif + + // add alias to start.htm into magic file (Netscape will use it) + + saveResFile = CurResFile(); + if ((refNum=FSpOpenResFile(&theDocFSSpec, fsRdWrPerm)) == kResFileNotOpened) { + // XXX display an error? Or just give up. + ExitToShell(); + } + UseResFile(refNum); + if (h=Get1Resource(rAliasType, 1)) { // if already exists, delete old before adding new + RemoveResource(h); + UpdateResFile(refNum); + } + AddResource((Handle)theAliasH, rAliasType, 1, "\p"); + WriteResource((Handle)theAliasH); + CloseResFile(refNum); + UseResFile(saveResFile); + + // hack to set default Component Dock pref to docked-state + + modifyComponentDockPref(&theAppFSSpec); + +#elif PROFILE_MANAGER_BUILD + + // create/find {Preferences}:Netscape Profiles Temp file (with magic filetype) + + err=FSMakeFSSpec(foundVRefNum, foundDirID, START_PROFILE_NAME, &theDocFSSpec); + if (err==fnfErr) { + err=FSpCreate(&theDocFSSpec, NETSCAPE_SIGNATURE, MAGIC_PROFILE_SIGNATURE, smSystemScript); + FSpCreateResFile(&theDocFSSpec, NETSCAPE_SIGNATURE, MAGIC_PROFILE_SIGNATURE, smSystemScript); + } + +#else + +#error Is this an Account Setup or Profile Manager build? + +#endif + + if (err) { + ExitToShell(); + } + + // create AppleEvent and launch app + + if (err=AECreateDesc(typeApplSignature,&fndrInfo.fdCreator,sizeof(OSType),&editorAddr)) {} + else if (err=AECreateList(NULL,0L,FALSE,&fileList)) {} // create list of aliases to file(s) + else if (err=NewAlias(NULL,&theDocFSSpec,&docAliasH)) {} + else HLock((Handle)docAliasH); + if (err) {} + else if (err=AEPutPtr(&fileList, 1L, typeAlias, *docAliasH, GetHandleSize((Handle)docAliasH))) {} + else if (err=AECreateAppleEvent(kCoreEventClass,kAEOpenDocuments,&editorAddr,kAutoGenerateReturnID,kAnyTransactionID,&theAEEvent)) {} + else if (err=AEPutParamDesc(&theAEEvent,keyDirectObject,&fileList)) {} + else if (err=AECoerceDesc(&theAEEvent,typeAppParameters,&launchDesc)) {} // coerce event to launch parameter + else if (err=LaunchApp(&theAppFSSpec, &launchDesc)) {} + +#ifdef ACCOUNT_SETUP_B3_HACK + // if created magic file, wait for up to "TIME_TO_STARTUP" seconds for Netscape to start and use it, then try to delete it + + else if (createdMagicFile==TRUE) { + theTick=TickCount() + TIME_TO_STARTUP; + while (theTick > TickCount()) { + WaitNextEvent(everyEvent,&theEvent,TIME_TO_PAUSE,NULL); + } + (void)FSpDelete(&theDocFSSpec); + } +#endif +} + + + +void +showError(short errStrIndex) +{ + Str255 appToLaunchNameString={0},errorString={0}; + + GetIndString(errorString, ERROR_STR_RESID, errStrIndex); + GetIndString(appToLaunchNameString, APP_NAME_STR_RESID, APP_NAME_STR_ID); + ParamText(errorString, appToLaunchNameString, "\p", "\p"); + StopAlert(ERROR_DIALOG_RESID, NULL); +} diff --git a/mozilla/cmd/dialup/mac/as_launch/startIncludes.h b/mozilla/cmd/dialup/mac/as_launch/startIncludes.h new file mode 100644 index 00000000000..3e852d46999 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_launch/startIncludes.h @@ -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. + */ + +#pragma once + +//#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +//#include +//#include +//#include +#include +#include +//#include +#include +#include +//#include +#include +//#include +#include +//#include +#include + +#include "prototypes.h" + +#ifndef FALSE +#define FALSE 0 +#define TRUE (!FALSE) +#endif + +#ifndef PtoCstr +#define PtoCstr P2CStr +#define CtoPstr C2PStr +#endif + +#define TIME_TO_PAUSE (30L) // WaitNextEvent time +#define TIME_TO_DIE (60L*60L) // how long to wait for Netscape to quit +#define TIME_TO_STARTUP (120L*60L) // how long to wait for Netscape to start + +#define START_ACCTSETUP_NAME "\p:Netscape Account Setup Temp" +#define START_ACCTSETUP_NAME_B3 "\p:Account Setup Manager" +#define START_PROFILE_NAME "\p:Netscape Profiles Temp" +#define CUSTOMGETFILE_RESID 6042 + +#define NETSCAPE_SIGNATURE 'MOSS' +#define MAGIC_ACCTSETUP_SIGNATURE 'ASWl' +#define MAGIC_PROFILE_SIGNATURE 'PRFL' +#define APPLICATION_TYPE 'APPL' + +#define VERS_RESOURCE 'vers' +#define VERS_RESOURCE_ID 1 + +#define TEXT_RESOURCE 'TEXT' +#define MAC_PREFS_TEXT_RES_ID 3015 + +#define MIN_NETSCAPE_VERSION 4 + +#define DOCK_UNDOCKED "pref(\"taskbar.mac.is_open\", true);" +#define DOCK_DOCKED "pref(\"taskbar.mac.is_open\", false);" + +#define APP_NAME_STR_RESID 128 +#define APP_NAME_STR_ID 1 + +#define ERROR_DIALOG_RESID 256 +#define ERROR_STR_RESID 256 +#define WHERE_IS_STR_ID 5 + +#define NETSCAPE_VERS_TOO_OLD_ERR 1 +#define UNABLE_TO_LOCATE_NETSCAPE_APP_ERR 2 +#define UNABLE_TO_LOCATE_PREFS_FOLDER_ERR 3 +#define UNABLE_TO_LOCATE_ACCOUNT_SETUP_ERR 4 diff --git a/mozilla/cmd/dialup/mac/as_plugin/ExpireBeta.c b/mozilla/cmd/dialup/mac/as_plugin/ExpireBeta.c new file mode 100644 index 00000000000..6e0ae4c1a98 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/ExpireBeta.c @@ -0,0 +1,135 @@ +/* -*- 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. + */ + +//Functions to check date and version info, and determine if Beta release is expired. + +#include "pluginIncludes.h" +#include +#include "ExpireBeta.h" +#include +#include + +extern short pluginResFile; + +//Gets the date of the file whose reference number is passed in. This is meant to be for the account setup file +unsigned long GetFileCreationDate(short refNum) +{ + FCBPBRec myFCB; + HParamBlockRec myHBR; + OSErr myErr; + //StringHandle myFileName; + Str32 name; + + //Whoops, the following line won't work if we last looked at a different res fork. + //short refNum = CurResFile(); + + myFCB.ioFCBIndx = 0; + myFCB.ioVRefNum = 0; + myFCB.ioNamePtr = name; + myFCB.ioRefNum = refNum; + myFCB.ioCompletion = nil; + + myErr = PBGetFCBInfoSync(&myFCB); + + /*if (myErr != 0) { + ErrorAlert(5005, myErr); + return false; + }*/ + + if (myErr == noErr) { + + if (myFCB.ioNamePtr != nil) { + myHBR.fileParam.ioNamePtr = myFCB.ioNamePtr; + myHBR.fileParam.ioVRefNum = myFCB.ioFCBVRefNum; + myHBR.fileParam.ioDirID = myFCB.ioFCBParID; + myHBR.fileParam.ioFDirIndex = 0; // use the dir & vRefNum; + + myErr = PBHGetFInfoSync(&myHBR); + + if (myErr == noErr) { + return (myHBR.fileParam.ioFlCrDat); + } + else + return (-1); + } + } + return -1; +} + + + + //Beta Expire Alert code. + //Added 8/16/95 by A. Tayyeb + // Checks the 'vers' resource to see if this is anything but a release version, if not, + //and if current date is at least 2 weeks more than the creation date of the app, exists the application + //with a stopalert +Boolean CheckIfExpired(void) +{ + + //LOCALS + Handle hVersResourceHandle; + char pDevStageByte; + unsigned long CreationDate, CurrDate; + int AcctSetupFileRefNum; + StringHandle stringDaysToExpire; + long daysToExpire, secsToExpire; + + short origFile = CurResFile(); + + //Open the resource, get the version info and creation date + UseResFile(pluginResFile); + hVersResourceHandle = (char **)GetResource('vers', 1); + HLock(hVersResourceHandle); + memcpy(&pDevStageByte,((char *)*hVersResourceHandle+2),1); + HUnlock(hVersResourceHandle); + + //We identify the home res file because it will be the one containing the vers resource we find. + //Therefore, we need this call to get the file reference number for Account Setup. We can then pass + //GetFileCreationDate a good number. + AcctSetupFileRefNum=HomeResFile(hVersResourceHandle); + ReleaseResource(hVersResourceHandle); + CreationDate = GetFileCreationDate(AcctSetupFileRefNum); + + //Current date + GetDateTime(&CurrDate); + + //Now get the resource which tells us how long till expiration + //UseResFile(pluginResFile); + stringDaysToExpire = (unsigned char **)GetString(NumDaysStrID); + + //Find seconds till expiration, if no resource was found, assume 0 secs (immediate expiration) + if (stringDaysToExpire != nil) + { + StringToNum(*stringDaysToExpire, &daysToExpire); + secsToExpire = (daysToExpire * 24 * 60 * 60); + } + else + { + daysToExpire = 0; secsToExpire = 0; + } + + UseResFile(origFile); + + //The real test - if the date is past expiration, and this is not a release version, return true. + if ((CurrDate > (CreationDate+secsToExpire)) && !(pDevStageByte & kVersRelease)) + { + return kIsExpired; + } + + return kIsNotExpired; +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/ExpireBeta.h b/mozilla/cmd/dialup/mac/as_plugin/ExpireBeta.h new file mode 100644 index 00000000000..4e2469bca38 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/ExpireBeta.h @@ -0,0 +1,37 @@ +/* -*- 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. + */ + +//========================================================================================= +//ExpireBeta.h header file +//========================================================================================= + +#pragma once + + +//unsigned long GetFileCreationDate(short refNum); +//Boolean CheckIfExpired(void); + +#define NumDaysStrID 7000 //the 'STR ' resource that holds the number of days until expiration - if not found, expires immediately +#define kVersDevelopment 0x20 +#define kVersAlpha 0x40 +#define kVersBeta 0x60 +#define kVersRelease 0x80 + +#define kIsExpired true +#define kIsNotExpired false + diff --git a/mozilla/cmd/dialup/mac/as_plugin/Setup.cp b/mozilla/cmd/dialup/mac/as_plugin/Setup.cp new file mode 100644 index 00000000000..444662bf37b --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/Setup.cp @@ -0,0 +1,972 @@ +/* -*- 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 "pluginIncludes.h" +#include "MUC.h" + +Boolean openedOurResFileFlag = false; +FSSpec pluginFSSpec; +TimerUPP initTimerProcUPP = NULL; +void* theArray = NULL; // array of data from Reg Server + +void* lckFileData = NULL; +void* animationDat = NULL; +void* animationRes = NULL; +long lckFileDataLen = 0L; +long animationDatLen = 0L; +long animationResLen = 0L; + +short pluginResFile = 0; +Boolean freePPPAutoConnectStateDetectedFlag = FALSE; +Boolean freePPPAutoConnectState; +extern Boolean cursorDirty; +extern Boolean connectedFlag; +//extern FreePPPPubInterfaceUPP pppPubUPP; +//extern PPPRequestUPP pppPluginUPP; +extern Str255 gRegAccountName; + + + +pascal void initTimer( TMTaskPtr tmTaskPtr ); +extern pascal OSErr __initialize( const CFragInitBlock* theInitBlock ); +extern pascal void __terminate( void ); + + +pascal OSErr initFragment( const CFragInitBlock* block ) +{ + OSErr err = noErr; + + err = __initialize( block ); + if ( err == noErr ) + { + if ( block ) + { + if ( block->fragLocator.where == kDataForkCFragLocator ) + { + if ( block->fragLocator.u.onDisk.fileSpec ) + { + pluginFSSpec.vRefNum = block->fragLocator.u.onDisk.fileSpec->vRefNum; + pluginFSSpec.parID = block->fragLocator.u.onDisk.fileSpec->parID; + BlockMove( block->fragLocator.u.onDisk.fileSpec->name, &pluginFSSpec.name, 1L+(unsigned)(block->fragLocator.u.onDisk.fileSpec->name[ 0 ] ) ); + if ( ( pluginResFile = FSpOpenResFile( &pluginFSSpec, fsRdPerm ) ) != kResFileNotOpened ) + { + openedOurResFileFlag = true; + } + } + } + } + if ( openedOurResFileFlag == false ) + { + // default to trying to use the current resfile if for some reason we can't open our resfile + pluginResFile = CurResFile(); + } + } + return err; +} + + + +pascal void terminateFragment( void ) +{ + __terminate(); + if ( openedOurResFileFlag == true ) + { + (void)CloseResFile( pluginResFile ); + openedOurResFileFlag = false; + } +} + + + +//------------------------------------------------------------------------------------ +// NPP_Initialize: +//------------------------------------------------------------------------------------ +NPError NPP_Initialize(void) +{ + initAsyncCursors(); + + // check for FreePPP + //if (err=Gestalt(gestaltFreePPPPubInterfaceSelector,(long *)&pppPubUPP)) { + // pppPubUPP=NULL; + // } + //if (pppPubUPP != NULL) { + // if (pppPubUPP = NewFreePPPPubInterfaceUPP(pppPubUPP)) { + // SETUP_PLUGIN_INFO_STR("\p NPP_Initialize: FreePPP is installed", NULL); + // } + // else { + // pppPubUPP=NULL; + // SETUP_PLUGIN_ERROR("\p NPP_Initialize: NewFreePPPPubInterfaceUPP error;g", err); + // } + // } + //else { + // SETUP_PLUGIN_ERROR("\p NPP_Initialize: FreePPP is not installed", err); + // } + + // check for FreePPP Config Plugin (how? gestaltFreePPPPluginSelector is registered by FreePPP) + + //if (err=Gestalt(gestaltFreePPPPluginSelector,(long *)&pppPluginUPP)) { + // pppPluginUPP=NULL; + // } + //if (pppPluginUPP != NULL) { + // if (pppPluginUPP = NewPPPRequestUPP(pppPluginUPP)) { + // SETUP_PLUGIN_INFO_STR("\p NPP_Initialize: FreePPP Config Plugin is installed", NULL); + // } + // else { + // pppPluginUPP=NULL; + // SETUP_PLUGIN_ERROR("\p NPP_Initialize: NewPPPRequestUPP error;g", err); + // } + // } + //else { + // SETUP_PLUGIN_ERROR("\p NPP_Initialize: FreePPP Config Plugin is not installed", err); + // } + + // get Java Environment reference + +// JRIEnv* env = NPN_GetJavaEnv(); +// if( env ) { +// SetupPlugin::_register( env ); // see NPP_GetJavaClass() +// netscape_plugin_Plugin::_use( env ); // only "use" other things, not ourself +// register_SetupPlugin(env); // don't "register" ourself (it happens elsewhere) +// use_SetupPlugin(env); +// register_java_lang_String(env); +// register_netscape_javascript_JSObject(env); +// use_netscape_javascript_JSObject(env); + +// use_java_lang_String(env); + +// } + return NPERR_NO_ERROR; +} + + + +//------------------------------------------------------------------------------------ +// NPP_Shutdown: +//------------------------------------------------------------------------------------ +void NPP_Shutdown(void) +{ +// patchPopUpMenuSelect(FALSE); + stopAsyncCursors(); +// disposeCache( FALSE ); + + // as onUnload handlers are broken, detect a quit (or window close) by + // noticing when plugin is unloaded. If a Reggie account has ever been created, + // and FreePPP is currently connected, then hangup and send Quit AppleEvent + // to Navigator + + if ( gRegAccountName[ 0 ] ) + { + if ( native_SetupPlugin_SECURE_0005fIsDialerConnected( NULL, NULL ) == TRUE ) + { + native_SetupPlugin_SECURE_0005fDialerHangup( NULL, NULL ); + native_SetupPlugin_SECURE_0005fQuitNavigator( NULL, NULL ); + } + } + + // reset FreePPP's "Allow Apps to open connections" option + if ( freePPPAutoConnectStateDetectedFlag == TRUE ) + CallMUCPlugin( kSetAutoConnectState, &freePPPAutoConnectState ); + + JRIEnv* env = NPN_GetJavaEnv(); + if ( env ) + { +// SetupPlugin::_unregister( env ); // see NPP_GetJavaClass() +// netscape_plugin_Plugin::_unuse( env ); // only "unuse" other things, not ourself +// unuse_SetupPlugin(env); +// unregister_SetupPlugin(env); // don't "unregister" ourself (it happens elsewhere) +// unregister_java_lang_String(env); +// unuse_netscape_javascript_JSObject( env); +// unregister_netscape_javascript_JSObject(env); + + unuse_java_lang_String( env ); + } +} + + + +#ifdef SECURITY_DIALOG_ENABLED + +void +blinkButton(DialogPtr theDialog,short itemNum) +{ + Handle itemH; + Rect box; + short itemType; + long theTick; + + if (theDialog) { + GetDItem(theDialog,itemNum,&itemType,&itemH,&box); + if (itemH) { + HiliteControl((ControlHandle)itemH, kInLabelControlPart); + Delay(10L,&theTick); + HiliteControl((ControlHandle)itemH, kNoHiliteControlPart); + } + } +} + + + +pascal Boolean +securityDialogFilter(DialogPtr theDialog, EventRecord *theEvent, short *itemHit) +{ + Boolean retVal=FALSE; + GrafPtr savePort; + Handle itemH; + Rect box; + short itemType; + + if (theDialog) { + GetPort(&savePort); + SetPort((GrafPtr)theDialog); + + switch(theEvent->what) { + case updateEvt: + GetDItem(theDialog,ok,&itemType,&itemH,&box); + InsetRect(&box,-4,-4); + PenSize(3,3); + FrameRoundRect(&box,16,16); + PenNormal(); + break; + + case keyDown: + switch(theEvent->message & charCodeMask) { + case 0x0D: + case 0x03: + blinkButton(theDialog,ok); + *itemHit=ok; + retVal=TRUE; + break; + + case 0x1B: + blinkButton(theDialog,cancel); + *itemHit=cancel; + retVal=TRUE; + break; + + case '.': + if (theEvent->modifiers & cmdKey) { + blinkButton(theDialog,cancel); + *itemHit=cancel; + retVal=TRUE; + } + break; + } + break; + } + + SetPort(savePort); + } + return(retVal); +} + +#endif SECURITY_DIALOG_ENABLED + + + +//------------------------------------------------------------------------------------ +// NPP_New: +//------------------------------------------------------------------------------------ +NPError NPP_New(NPMIMEType pluginType, + NPP instance, + uint16 mode, + int16 argc, + char* argn[], + char* argv[], + NPSavedData* saved) +{ + CursHandle theCursH=NULL; + DialogPtr theDialog=NULL; + short itemHit=0; + +#ifdef SECURITY_DIALOG_ENABLED + short saveRefNum; + ModalFilterUPP filterUPP; +#endif SECURITY_DIALOG_ENABLED + + if (instance == NULL) { + return NPERR_INVALID_INSTANCE_ERROR; + } + + instance->pdata = NPN_MemAlloc(sizeof(PluginInstance)); + PluginInstance* This = (PluginInstance*) instance->pdata; + + if (This != NULL) { + if (mode == NP_EMBED) { + useCursor(watchCursor); + cleanupStartupFolder(); // remove any alias to Account Setup in Startup Items folder + + // checkSystemSoftware is now done elsewhere +/* + if (checkSystemSoftware()) { // make sure that FreePPP and MacTCP/OpenTransport are installed + return(NPERR_MODULE_LOAD_FAILED_ERROR); + } +*/ + // check for expiration - quit if expired +// +// if (CheckIfExpired()) { +// showPluginError(BETAEXPIRED_STRINGID, true); +// return(NPERR_MODULE_LOAD_FAILED_ERROR); +// } + +#ifdef SECURITY_DIALOG_ENABLED + + // B3 security dialog + + saveRefNum=CurResFile(); + if (pluginResFile!=0) UseResFile(pluginResFile); + theDialog=GetNewDialog(PLUGIN_SECURITY_DIALOG_RESID,NULL,(WindowPtr)(-1L)); + UseResFile(saveRefNum); + if (!theDialog) { + return(NPERR_MODULE_LOAD_FAILED_ERROR); + } + if (!(filterUPP=NewModalFilterProc(securityDialogFilter))) { + return(NPERR_MODULE_LOAD_FAILED_ERROR); + } + + ShowWindow((WindowPtr)theDialog); + InitCursor(); + while(TRUE) { + ModalDialog(filterUPP,&itemHit); + if (itemHit==ok || itemHit==cancel) break; + } + DisposeDialog(theDialog); + DisposeRoutineDescriptor(filterUPP); + + if (itemHit==cancel) { + native_SetupPlugin_QuitNavigator(NULL,NULL); + return(NPERR_MODULE_LOAD_FAILED_ERROR); + } + +#endif SECURITY_DIALOG_ENABLED + + if (theCursH=GetCursor(watchCursor)) { + HLock((Handle)theCursH); + SetCursor(*theCursH); + HUnlock((Handle)theCursH); + } + +/* + JRIEnv* env = NPN_GetJavaEnv(); // if NP_EMBED, save JavaScript environment reference + jsWindow = netscape_plugin_Plugin_getWindow(env,NPN_GetJavaPeer(instance)); +*/ + } + This->fWindow = NULL; + This->regData = NULL; + This->fMode = mode; + + This->data = NULL; + + return(NPERR_NO_ERROR); + } + else { + return(NPERR_OUT_OF_MEMORY_ERROR); + } +} + + + +//------------------------------------------------------------------------------------ +// NPP_Destroy: +//------------------------------------------------------------------------------------ +NPError NPP_Destroy(NPP instance, NPSavedData** save) +{ + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + + PluginInstance* This = (PluginInstance*) instance->pdata; + + if (This != NULL) + { + if (This->regData) { + ::DisposeHandle(This->regData); + } + NPN_MemFree(instance->pdata); + instance->pdata = NULL; + + if (This->data) { + ::DisposeHandle(This->data); + } + } + + return NPERR_NO_ERROR; +} + + + +//------------------------------------------------------------------------------------ +// NPP_SetWindow: +//------------------------------------------------------------------------------------ +NPError NPP_SetWindow(NPP instance, NPWindow* window) +{ + + InitCursor(); + + if (instance == NULL) + return NPERR_INVALID_INSTANCE_ERROR; + + PluginInstance* This = (PluginInstance*) instance->pdata; + + // + // *Developers*: Before setting fWindow to point to the + // new window, you may wish to compare the new window + // info to the previous window (if any) to note window + // size changes, etc. + // + + This->fWindow = window; + + return NPERR_NO_ERROR; +} + + + +//------------------------------------------------------------------------------------ +// NPP_NewStream: +//------------------------------------------------------------------------------------ +NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype ) +{ + if ( instance == NULL ) + { + return NPERR_INVALID_INSTANCE_ERROR; + } + + PluginInstance* This = (PluginInstance*)instance->pdata; + + regStream* newStream = (regStream*)NPN_MemAlloc( sizeof( regStream ) ); + + if ( newStream != NULL ) + { + newStream->data = NULL; + newStream->dataLen = 0; + stream->pdata = newStream; + if ( type ) + { + newStream->extendedDataFlag = ( !strcmp( type, REG_STREAM_TYPE_V2 ) ) ? TRUE : FALSE; + } + } + else + { + return NPERR_OUT_OF_MEMORY_ERROR; + } + return NPERR_NO_ERROR; +} + + + + +// +// *Developers*: +// These next 2 functions are directly relevant in a plug-in which handles the +// data in a streaming manner. If you want zero bytes because no buffer space +// is YET available, return 0. As long as the stream has not been written +// to the plugin, Navigator will continue trying to send bytes. If the plugin +// doesn't want them, just return some large number from NPP_WriteReady(), and +// ignore them in NPP_Write(). For a NP_ASFILE stream, they are still called +// but can safely be ignored using this strategy. +// + +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: +//------------------------------------------------------------------------------------ +int32 NPP_WriteReady( NPP instance, NPStream* stream ) +{ + if ( instance != NULL ) + { + PluginInstance* This = (PluginInstance*)instance->pdata; + + } + + return STREAMBUFSIZE; // Number of bytes ready to accept in NPP_Write() +} + + + +//------------------------------------------------------------------------------------ +// NPP_Write: +//------------------------------------------------------------------------------------ +int32 NPP_Write( NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer ) +{ + if ( instance != NULL ) + { + if ( stream->pdata != NULL ) + { + regStream* pluginStream = (regStream*)stream->pdata; + AppendData( pluginStream, len, buffer ); + return len; // The number of bytes accepted + } + } + + return -1; // Something went wrong. Stop the stream. +} + + + + +/* + countRegItems: count the number of elements of Registration data +*/ + + +long +countRegItems(Handle regData, Boolean extendedDataFlag) +{ + unsigned short len; + unsigned long lenLong; + long numRegItems=0L,theSize; + char *p; + + theSize=GetHandleSize(regData); + p=*regData; + + while (theSize>0) { + if (extendedDataFlag == TRUE) { + BlockMove(p,&lenLong,sizeof(lenLong)); + p+=sizeof(lenLong); + theSize-=sizeof(lenLong); + if (theSize0 && theSize>0) { + if (extendedDataFlag==TRUE) { + BlockMove(p,&len,sizeof(len)); + p+=sizeof(len); + theSize-=sizeof(len); + } + else { + BlockMove(p,&lenShort,sizeof(lenShort)); + p+=sizeof(lenShort); + theSize-=sizeof(lenShort); + len=(unsigned long)lenShort; + } + if (theSize0) { + if (extendedDataFlag==TRUE) { + BlockMove(p,&len,sizeof(len)); + p+=sizeof(len); + theSize-=sizeof(len); + } + else { + BlockMove(p,&lenShort,sizeof(lenShort)); + p+=sizeof(lenShort); + theSize-=sizeof(lenShort); + len=(unsigned long)lenShort; + } + if (theSizepdata; + + if (printInfo->mode == NP_FULL) + { + // + // If weÕre fullscreen, we donÕt want to take over printing, + // so return false. NPP_Print will be called again with + // mode == NP_EMBED. + // + printInfo->print.fullPrint.pluginPrinted = false; + } + else // If not fullscreen, we must be embedded + { + NPWindow* printWindow = &(printInfo->print.embedPrint.window); + if (StartDraw(printWindow)) + { + DoDraw(This); + EndDraw(printWindow); + } + } + } + +} + + +//------------------------------------------------------------------------------------ +// NPP_HandleEvent: +// Mac-only. +//------------------------------------------------------------------------------------ +int16 NPP_HandleEvent(NPP instance, void* event) +{ + Boolean eventHandled = false; + OSErr err; + static Boolean spinningFlag = false; + static unsigned long staticReceivedPacketCount = 0L; + unsigned long receivedPacketCount = 0L; + static long lastChangeTick = 0L; + + if ( connectedFlag == TRUE ) + { + err = CallMUCPlugin( kGetReceivedIPPacketCount, &receivedPacketCount ); + if ( !err ) + { + if ( staticReceivedPacketCount != receivedPacketCount ) + { + staticReceivedPacketCount = receivedPacketCount; + lastChangeTick = TickCount(); + if ( spinningFlag == false ) + { + spinningFlag = true; + startAsyncCursors(); + } + } + } + if ( TickCount() > ( lastChangeTick + SPIN_TIMEOUT ) ) + { + if ( spinningFlag == true ) + { + spinningFlag = false; + stopAsyncCursors(); + } + } + } + else if ( spinningFlag == true ) + { + spinningFlag = false; + stopAsyncCursors(); + } + + if ( ( spinningFlag == false ) && ( cursorDirty == TRUE ) ) + useCursor( 0 ); + + if ( instance == NULL ) + return eventHandled; + + PluginInstance* This = (PluginInstance*) instance->pdata; + if (This != NULL && event != NULL) + { + EventRecord* ev = (EventRecord*) event; + switch (ev->what) + { + // + // Draw ourselves on update events + // + case updateEvt: +// DoDraw(This); + eventHandled = true; + break; + + default: + break; + } + + } + + return eventHandled; +} + +//------------------------------------------------------------------------------------ +// NPP_URLNotify: Currently just a stub for compatibility with the new API +//------------------------------------------------------------------------------------ +void NPP_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) +{ +} + +//------------------------------------------------------------------------------------ +// NPP_GetJavaClass: Currently just a stub for compatibility with the new API +//------------------------------------------------------------------------------------ +jref NPP_GetJavaClass( void ) +{ + JRIEnv* env; + jref theRef = NULL; + + if ( env = NPN_GetJavaEnv() ) + { +// theRef = SetupPlugin::_register( env ); + theRef = register_SetupPlugin( env ); +// netscape_plugin_Plugin::_use( env ); + + use_java_lang_String( env ); // ::_use( env ); // new + use_netscape_plugin_Plugin( env ); // ::_use( env ); // new + } + return theRef; +} + + +//------------------------------------------------------------------------------------ +// AppendData: +//------------------------------------------------------------------------------------ +void AppendData( regStream* This, unsigned long len, void* buffer ) +{ + if ( This->data == NULL ) + { + This->data = ::NewHandle( len ); + This->dataLen = 0; + } + else + { + SetHandleSize( This->data, GetHandleSize( This->data ) + len ); + } + BlockMove( buffer, (*This->data) + This->dataLen, len ); + This->dataLen += len; +} + + +//------------------------------------------------------------------------------------ +// StartDraw: +//------------------------------------------------------------------------------------ +Boolean StartDraw(NPWindow* window) +{ + return true; +} + + +//------------------------------------------------------------------------------------ +// EndDraw: +//------------------------------------------------------------------------------------ +void EndDraw(NPWindow* window) +{ +} + + +//------------------------------------------------------------------------------------ +// DoDraw: +//------------------------------------------------------------------------------------ +void DoDraw(PluginInstance* This) +{ +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/asyncCursors.c b/mozilla/cmd/dialup/mac/as_plugin/asyncCursors.c new file mode 100644 index 00000000000..5e4e607efe6 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/asyncCursors.c @@ -0,0 +1,179 @@ +/* -*- 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 "pluginIncludes.h" + + + + Boolean taskInstalled = FALSE; + acurHandle cursorsH = NULL; + VBLTaskWithA5Ptr cursorTask = NULL; + +extern short pluginResFile; + + + +OSErr +initAsyncCursors() +{ + CursHandle *workPtr; + OSErr err = noErr; + short cursorCount,saveResFile; + + if (cursorsH == NULL) { // only initialize once + saveResFile = CurResFile(); + UseResFile(pluginResFile); + cursorsH = (acurHandle)Get1Resource('acur', ACUR_RESID); + if (cursorsH != NULL) { + HNoPurge((Handle)cursorsH); + HUnlock((Handle)cursorsH); + HLockHi((Handle)cursorsH); + DetachResource((Handle)cursorsH); + cursorCount=(**cursorsH).numCursors; + (**cursorsH).index=0; + workPtr=(**cursorsH).cursors; + while(cursorCount--) { + *workPtr = (CursHandle)Get1Resource('CURS',*(short *)workPtr); + if (*workPtr != NULL) { + HNoPurge((Handle)*workPtr); + HUnlock((Handle)*workPtr); + HLockHi((Handle)*workPtr); + DetachResource((Handle)*workPtr); + } + ++workPtr; + } + } + else { + err = (err=ResError()) ? err:resNotFound; + } + UseResFile(saveResFile); + } + return(err); +} + + + +void +spinCursor(acurHandle cursorsH) +{ + short nextIndex,theIndex; + + if (cursorsH != NULL) { + theIndex = (**cursorsH).index; + nextIndex = theIndex + 1; + if (nextIndex >= (**cursorsH).numCursors) { + nextIndex = 0; + } + (**cursorsH).index = nextIndex; + if ((**cursorsH).cursors[theIndex]) { + SetCursor(*(**cursorsH).cursors[theIndex]); + } + } +} + + + +#if defined(powerc) || defined(__powerc) + +void +asyncCursorTask(VBLTaskWithA5Ptr theTaskPtr) + +#else + +void +asyncCursorTask(VBLTaskWithA5Ptr theTaskPtr:__A0) +#endif + +{ +#if defined(powerc) || defined(__powerc) +#else + long oldA5; +#endif + if (LMGetCrsrBusy() == 0) { + +#if defined(powerc) || defined(__powerc) +#else + oldA5 = SetA5(theTaskPtr->theA5); +#endif + spinCursor(theTaskPtr->cursorsH); + theTaskPtr->theTask.vblCount = SPIN_CYCLE; + if (--cursorTask->numSpins <= 0) { // max spin time expired, stop spinning + (void)VRemove((QElemPtr)cursorTask); + taskInstalled = FALSE; + } + +#if defined(powerc) || defined(__powerc) +#else + (void)SetA5(oldA5); +#endif + + } +} + + + +void +startAsyncCursors() +{ + if (initAsyncCursors() != noErr) return; +// if (LJ_GetJavaStatus() != LJJavaStatus_Enabled) return; // java enabled but not running? + + if (cursorTask == NULL) { + cursorTask = (VBLTaskWithA5Ptr)NewPtrClear(sizeof(VBLTaskWithA5)); + if (cursorTask != NULL) { + cursorTask->theTask.qType = vType; + cursorTask->theTask.vblAddr = (void *)NewVBLProc(asyncCursorTask); + cursorTask->theTask.vblCount = SPIN_CYCLE; + cursorTask->theTask.vblPhase = 0; + cursorTask->theA5 = (long)LMGetCurrentA5(); + cursorTask->cursorsH = cursorsH; + cursorTask->numSpins = MAX_NUM_SPINS; + + if (VInstall((QElemPtr)cursorTask) == noErr) { + taskInstalled = TRUE; + } + else { + taskInstalled = FALSE; + if (cursorTask->theTask.vblAddr) { + DisposeRoutineDescriptor(cursorTask->theTask.vblAddr); + } + DisposePtr((Ptr)cursorTask); + cursorTask = NULL; + } + } + } +} + + + +void +stopAsyncCursors() +{ + if (cursorTask) { + if (taskInstalled == TRUE) { + (void)VRemove((QElemPtr)cursorTask); + taskInstalled = FALSE; + } + if (cursorTask->theTask.vblAddr) { + DisposeRoutineDescriptor(cursorTask->theTask.vblAddr); + } + DisposePtr((Ptr)cursorTask); + cursorTask = NULL; + InitCursor(); + } +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/cacheRtns.c b/mozilla/cmd/dialup/mac/as_plugin/cacheRtns.c new file mode 100644 index 00000000000..ee53729ac99 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/cacheRtns.c @@ -0,0 +1,54 @@ +/* -*- 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 "pluginIncludes.h" + + + + static _fileCachePtr theCache=NULL; + + + +void +disposeCache(Boolean justPruneFlag) +{ + _fileCachePtr *cacheTree,tempItem; + +SETUP_PLUGIN_TRACE("\p disposeCache entered"); + + if (theCache) { + cacheTree=&theCache; + while(*cacheTree) { + if (justPruneFlag==FALSE || (*cacheTree)->dirtyFlag == TRUE) { + tempItem=*cacheTree; + *cacheTree=(*cacheTree)->next; + if (tempItem->dataH) { + DisposeHandle(tempItem->dataH); + tempItem->dataH=NULL; + } + DisposePtr((Ptr)tempItem); + } + else { + cacheTree=&((*cacheTree)->next); + } + } + theCache=NULL; + } + +SETUP_PLUGIN_TRACE("\p disposeCache exiting"); +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/editorRtns.c b/mozilla/cmd/dialup/mac/as_plugin/editorRtns.c new file mode 100644 index 00000000000..aa02c489fa6 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/editorRtns.c @@ -0,0 +1,169 @@ +/* -*- 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 "pluginIncludes.h" + + + +extern JRI_PUBLIC_API(struct java_lang_String *) +native_SetupPlugin_SECURE_0005fGetExternalEditor(JRIEnv* env, struct SetupPlugin* self) +{ + Boolean targetIsFolder,wasAliased; + Handle h=NULL; + OSErr err=noErr; + SFTypeList typeList; + StandardFileReply theReply; + java_lang_String *retVal=NULL; + Str255 fileString; // necessary to get the resource strings for the CustomGetFile + Point centerPoint = {-1,-1}; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_GetExternalEditor entered"); + + typeList[0] = 'APPL'; // look for applications and + typeList[1] = kApplicationAliasType; // application aliases + + GetIndString(fileString, CUSTOMGETFILE_RESID, CHOOSEEDITOR_STRINGID); + ParamText(fileString,"\p", "\p", "\p"); + CustomGetFile(NULL, 2, typeList, &theReply, CUSTOMGETFILE_RESID, centerPoint, NULL, NULL, NULL, NULL, NULL); // call StandardFile, tell it to list applications + if (theReply.sfGood == TRUE) { + if (!(err=ResolveAliasFile(&theReply.sfFile, TRUE, &targetIsFolder, &wasAliased))) { + SETUP_PLUGIN_INFO_STR("\p User selected;g", theReply.sfFile.name); + + if (h=pathFromFSSpec(&theReply.sfFile)) { + HNoPurge(h); + HLock(h); +// retVal=JRI_NewStringUTF(env, (char *)*h, (unsigned)GetHandleSize(h)); + retVal=cStr2javaLangString(env, (char *)*h, (unsigned)GetHandleSize(h)); + DisposeHandle(h); + } + else { + SETUP_PLUGIN_INFO_STR("\p GetExternalEditor: pathFromFSSpec returned NULL.", NULL); + } + + } + else { + SETUP_PLUGIN_ERROR("\p GetExternalEditor: ResolveAliasFile error;g", err); + } + } + else { + SETUP_PLUGIN_INFO_STR("\p User did not select an application.", NULL); + } + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_GetExternalEditor exiting"); + + return(retVal); +} + + + +extern JRI_PUBLIC_API(void) +native_SetupPlugin_SECURE_0005fOpenFileWithEditor(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *app, struct java_lang_String *file) +{ + AEDesc launchDesc={typeNull,NULL}; + AEAddressDesc editorAddr={typeNull,NULL}; + AEDescList fileList={typeNull,NULL}; + AliasHandle theAliasH=NULL; + AppleEvent theEvent={typeNull,NULL}, theReply={typeNull,NULL}; + Boolean appRunningFlag; + FInfo fndrInfo; + FSSpec theAppFSSpec,theDocFSSpec; + OSErr err=noErr; + ProcessSerialNumber editorPSN={0,kNoProcess}; + char *appName,*fileName; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_OpenFileWithEditor entered"); + +/* + const char *appName = javaLangString2Cstr( env, app ); + JRI_ThrowNew(env, JRI_FindClass(env, "java/io/NullPointerException"), appName); +*/ + + if (app == NULL) { + SETUP_PLUGIN_INFO_STR("\p OpenFileWithEditor: an app to use was not specified.", NULL); + return; + } + appName = (char *)javaLangString2Cstr( env, app ); + CtoPstr((char *)appName); + if (err = FSMakeFSSpec(0, 0L, (unsigned char *)appName, &theAppFSSpec)) { + SETUP_PLUGIN_ERROR("\p OpenFileWithEditor: app FSMakeFSSpec error;g", err); + return; + } + + if (err = FSpGetFInfo(&theAppFSSpec,&fndrInfo)) { + SETUP_PLUGIN_ERROR("\p OpenFileWithEditor: FSpGetFInfo error;g", err); + return; + } + + if (file == NULL) { + SETUP_PLUGIN_INFO_STR("\p OpenFileWithEditor: a file to open was not specified.", NULL); + return; + } + fileName = (char *)javaLangString2Cstr( env, file ); + CtoPstr((char *)fileName); + err = FSMakeFSSpec(0, 0L, (unsigned char *)fileName, &theDocFSSpec); + if (err) { + SETUP_PLUGIN_ERROR("\p OpenFileWithEditor: doc FSMakeFSSpec error;g", err); + return; + } + + appRunningFlag = isAppRunning(fndrInfo.fdCreator,&editorPSN, NULL); + if (appRunningFlag) { + SETUP_PLUGIN_INFO_STR("\p The selected editor is currently running.", NULL); + + err=AECreateDesc(typeProcessSerialNumber,&editorPSN,sizeof(ProcessSerialNumber),&editorAddr); // if app is running, reference by PSN + } + else { + SETUP_PLUGIN_INFO_STR("\p The selected editor is not currently running.", NULL); + + err=AECreateDesc(typeApplSignature,&fndrInfo.fdCreator,sizeof(OSType),&editorAddr); // if app is not running, reference by signature + } + + if (!err) { + if (err=AECreateList(NULL,0L,FALSE,&fileList)) {} // create list of aliases to file(s) + else if (err=NewAlias(NULL,&theDocFSSpec,&theAliasH)) {} + else HLock((Handle)theAliasH); + + if (err) {} + else if (err=AEPutPtr(&fileList, 1L, typeAlias, *theAliasH, GetHandleSize((Handle)theAliasH))) {} + else if (err=AECreateAppleEvent(kCoreEventClass,kAEOpenDocuments,&editorAddr,kAutoGenerateReturnID,kAnyTransactionID,&theEvent)) {} + else if (err=AEPutParamDesc(&theEvent,keyDirectObject,&fileList)) {} + } + if (!err) { + if (appRunningFlag) { // if app is running, send event + if (err=AESend(&theEvent,&theReply,kAENoReply+kAENeverInteract,kAENormalPriority,kAEDefaultTimeout,NULL,NULL)) {} + else SetFrontProcess(&editorPSN); + } + else { + if (err=AECoerceDesc(&theEvent,typeAppParameters,&launchDesc)) {} // if app is not running, coerce event to launch parameter + else LaunchApp(fndrInfo.fdCreator,TRUE,&launchDesc,FALSE); // and launch it + } + } + + if (err) { + SETUP_PLUGIN_ERROR("\p OpenFileWithEditor error;g", err); + } + + if (editorAddr.dataHandle) (void)AEDisposeDesc(&editorAddr); + if (fileList.dataHandle) (void)AEDisposeDesc(&fileList); + if (theEvent.dataHandle) (void)AEDisposeDesc(&theEvent); + if (theReply.dataHandle) (void)AEDisposeDesc(&theReply); + if (launchDesc.dataHandle) (void)AEDisposeDesc(&launchDesc); + if (theAliasH) DisposeHandle((Handle)theAliasH); + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_OpenFileWithEditor exiting"); +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/errorRtns.c b/mozilla/cmd/dialup/mac/as_plugin/errorRtns.c new file mode 100644 index 00000000000..7b2fdc159fb --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/errorRtns.c @@ -0,0 +1,44 @@ +/* -*- 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 "pluginIncludes.h" + + + +extern short pluginResFile; + + + +void +showPluginError(short errStrIndex, Boolean quitNavFlag) +{ + Str255 errorString={0}; + short saveResFile; + + saveResFile=CurResFile(); + UseResFile(pluginResFile); + GetIndString(errorString, PLUGIN_ERROR_STR_RESID, errStrIndex); + InitCursor(); + ParamText(errorString, "\p", "\p", "\p"); + StopAlert(PLUGIN_ERROR_DIALOG_RESID, NULL); + UseResFile(saveResFile); + + if (quitNavFlag) { + native_SetupPlugin_SECURE_0005fQuitNavigator(NULL,NULL); + } +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/fileFolderRtns.c b/mozilla/cmd/dialup/mac/as_plugin/fileFolderRtns.c new file mode 100644 index 00000000000..d58ae7bb444 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/fileFolderRtns.c @@ -0,0 +1,811 @@ +/* -*- 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 "pluginIncludes.h" + + + +extern JRI_PUBLIC_API(struct java_lang_Object *) +native_SetupPlugin_SECURE_0005fReadFile(JRIEnv* env, + struct SetupPlugin* self, + struct java_lang_String *file) +{ + CInfoPBRec cBlock; + Handle h; + FSSpec theFSSpec; + OSErr err=noErr; + jref retVal=NULL; + char *theFile; + short refNum; + long dataForkSize,resForkSize; + long theCount; + + theFile = (char *)javaLangString2Cstr( env, file ); + if (theFile && (*theFile)) { + CtoPstr((void *)theFile); + err=FSMakeFSSpec(0,0L,(void *)theFile,&theFSSpec); + PtoCstr((void *)theFile); + if (err) { + SETUP_PLUGIN_ERROR("\p ReadFile: FSMakeFSSpec error;g", err); + return(NULL); + } + + bzero((char *)&cBlock,sizeof(cBlock)); + cBlock.hFileInfo.ioCompletion=NULL; + cBlock.hFileInfo.ioNamePtr=(StringPtr)theFSSpec.name; + cBlock.hFileInfo.ioVRefNum=theFSSpec.vRefNum; + cBlock.hFileInfo.ioDirID=theFSSpec.parID; + cBlock.hFileInfo.ioFDirIndex=0; + if (err=PBGetCatInfoSync(&cBlock)) { + SETUP_PLUGIN_ERROR("\p ReadFile: PBGetCatInfoSync error;g", err); + return(NULL); + } + + useCursor(watchCursor); + + dataForkSize = cBlock.hFileInfo.ioFlLgLen; + resForkSize = cBlock.hFileInfo.ioFlRLgLen; + + if (h=NewHandleClear((2L*sizeof(long)) + dataForkSize + resForkSize)) { + HLock(h); + BlockMove(&dataForkSize,*h,(long)sizeof(long)); + BlockMove(&resForkSize,(*h + (long)sizeof(long)),(long)sizeof(long)); + + if (dataForkSize > 0L) { + if (!(err=FSpOpenDF(&theFSSpec, fsRdPerm, &refNum))) { + if (!(err=SetFPos(refNum,fsFromStart,0L))) { + theCount = dataForkSize; + if (!(err=FSRead(refNum,&theCount,(*h + (2L*sizeof(long)))))) { + if (theCount != dataForkSize) err=readErr; + } + else { + SETUP_PLUGIN_ERROR("\p ReadFile: FSRead (data fork) error;g", err); + } + } + (void)FSClose(refNum); + } + else { + SETUP_PLUGIN_ERROR("\p ReadFile: FSpOpenDF error;g", err); + } + } + if ((!err) && (resForkSize > 0L)) { + if (!(err=FSpOpenRF(&theFSSpec, fsRdPerm, &refNum))) { + if (!(err=SetFPos(refNum,fsFromStart,0L))) { + theCount = resForkSize; + if (!(err=FSRead(refNum,&theCount,(*h + (2L*sizeof(long)) + dataForkSize)))) { + if (theCount != resForkSize) err=readErr; + } + else { + SETUP_PLUGIN_ERROR("\p ReadFile: FSRead (res fork) error;g", err); + } + } + (void)FSClose(refNum); + } + else { + SETUP_PLUGIN_ERROR("\p ReadFile: FSpOpenRF error;g", err); + } + } + if (!err) { + retVal = JRI_NewByteArray(env, GetHandleSize(h), *h); + if (retVal != NULL) { + SETUP_PLUGIN_INFO_STR("\p ReadFile: JRI_NewByteArray success", NULL); + } + } + DisposeHandle(h); + } + else { + err=(err=MemError()) ? err:-1; + SETUP_PLUGIN_ERROR("\p ReadFile: NewHandleClear error;g", err); + } + } + return(retVal); +} + + + +OSErr +WriteFile(FSSpecPtr initialFSSpecPtr,void *data, long dataForkSize, void *res, long resForkSize) +{ + Boolean movedToTrash=false; + FSSpec theFSSpec,trashFSSpec; + OSErr err=paramErr; + short refNum,trashVRefNum; + long trashDirID,theCount; + + if (initialFSSpecPtr) { + + useCursor(watchCursor); + + err=FSMakeFSSpec(initialFSSpecPtr->vRefNum,initialFSSpecPtr->parID,initialFSSpecPtr->name,&theFSSpec); + if (!err) { + // file exists; it might be open/in-use by Communicator (for example, "Custom Animation" file), + // so might not be able to delete it. If so, try moving it to the trash. + // + // (Note: every volume may have a trash folder; look on that volume, not the system volume) + + if (err=FSpDelete(&theFSSpec)) { + if (!(err=FindFolder(theFSSpec.vRefNum, kWhereToEmptyTrashFolderType, kCreateFolder, &trashVRefNum, &trashDirID))) { // kTrashFolderType + err=FSMakeFSSpec(trashVRefNum,trashDirID,theFSSpec.name,&trashFSSpec); + if (err==noErr || err==fnfErr) { + (void)FSpDelete(&trashFSSpec); // if already in Trash, try and delete Trash item + if (!(err=FSpCatMove(&theFSSpec, &trashFSSpec))) { + movedToTrash=true; + SETUP_PLUGIN_INFO_STR("\p WriteFile: FSpCatMove succesfully moved file to trash folder",NULL); + } + else { + SETUP_PLUGIN_INFO_STR("\p WriteFile: FSpCatMove on file ;g",theFSSpec.name); + SETUP_PLUGIN_ERROR("\p WriteFile: FSpCatMove error;g", err); + } + } + + } + else { + SETUP_PLUGIN_INFO_STR("\p WriteFile: Unable to find Trash folder",NULL); + } + } + else { + SETUP_PLUGIN_INFO_STR("\p WriteFile: FSpDelete file ;g",theFSSpec.name); + } + } + + if ((!err) || (err==fnfErr)) { + (void)FSpCreate(&theFSSpec, NETSCAPE_SIGNATURE, UNKNOWN_SIGNATURE, smSystemScript); + FSpCreateResFile(&theFSSpec, NETSCAPE_SIGNATURE, UNKNOWN_SIGNATURE, smSystemScript); + + if (!(err=FSpOpenDF(&theFSSpec, fsRdWrPerm, &refNum))) { + if (!(err=SetEOF(refNum,dataForkSize))) { + if (data != NULL) { + if (!(err=SetFPos(refNum,fsFromStart,0L))) { + theCount = dataForkSize; + if (!(err=FSWrite(refNum,&theCount,data))) { + if (theCount != dataForkSize) err=readErr; + } + else { + SETUP_PLUGIN_ERROR("\p WriteFile: FSWrite (data fork) error;g", err); + } + } + } + } + else { + SETUP_PLUGIN_ERROR("\p WriteFile: SetEOF (data fork) error;g", err); + } + (void)FSClose(refNum); + } + else { + SETUP_PLUGIN_ERROR("\p WriteFile: FSpOpenDF error;g", err); + } + if (!err) { + if (!(err=FSpOpenRF(&theFSSpec, fsRdWrPerm, &refNum))) { + if (!(err=SetEOF(refNum,resForkSize))) { + if (res != NULL) { + if (!(err=SetFPos(refNum,fsFromStart,0L))) { + theCount = resForkSize; + if (!(err=FSWrite(refNum,&theCount,res))) { + if (theCount != resForkSize) err=readErr; + } + else { + SETUP_PLUGIN_ERROR("\p WriteFile: FSWrite (res fork) error;g", err); + } + } + } + } + else { + SETUP_PLUGIN_ERROR("\p WriteFile: SetEOF (res fork) error;g", err); + } + (void)FSClose(refNum); + } + else { + SETUP_PLUGIN_ERROR("\p WriteFile: FSpOpenRF error;g", err); + } + } + if (err) { + SETUP_PLUGIN_INFO_STR("\p WriteFile: Deleting invalid file ;g",theFSSpec.name); + (void)FSpDelete(&theFSSpec); + } + } + else { + SETUP_PLUGIN_ERROR("\p WriteFile: FSMakeFSSpec error;g", err); + } + } + return(err); +} + + + +extern JRI_PUBLIC_API(void) +native_SetupPlugin_SECURE_0005fWriteFile(JRIEnv* env, + struct SetupPlugin* self, + struct java_lang_String *file, + struct java_lang_Object *data) +{ + FSSpec theFSSpec; + OSErr err=noErr; + Ptr dataPtr=NULL; + char *theFile; + long dataLen; + long dataForkSize,resForkSize; + + theFile = (char *)javaLangString2Cstr( env, file ); + if (!theFile) return; + if (!data) return; + + dataLen = JRI_GetByteArrayLength(env,data); + if (!dataLen) return; + if (dataLen < (2L*sizeof(long))) { + SETUP_PLUGIN_INFO_STR("\p WriteFile: JRI_GetByteArrayLength on data too small", NULL); + return; + } + dataPtr = JRI_GetByteArrayElements(env,data); + if (!dataPtr) { + SETUP_PLUGIN_INFO_STR("\p WriteFile: JRI_GetByteArrayElements on data returned NULL", NULL); + return; + } + + dataForkSize = *(long *)dataPtr; + resForkSize = *(long *)(dataPtr+sizeof(long)); + if ((dataForkSize + resForkSize + (2*sizeof(long))) != dataLen) { + SETUP_PLUGIN_INFO_STR("\p WriteFile: data/res fork lengths are invalid", NULL); + return; + } + + CtoPstr((void *)theFile); + err=FSMakeFSSpec(0,0L,(void *)theFile,&theFSSpec); + PtoCstr((void *)theFile); + + err=WriteFile(&theFSSpec,(dataPtr + (2L*sizeof(long))), dataForkSize, (dataPtr + (2L*sizeof(long)) + dataForkSize), resForkSize); + if (err) { + SETUP_PLUGIN_ERROR("\p WriteFile error: ;g", err); + } +} + + + +/* + SetNameValuePair: + + 1) read in [file] contents + 2) if [section] exists, find [name=] and set to [value]; if [name=] not found, add [name=value] + 3) if [section] doesn't exist, add it and [name=] + + Note: file must be of type 'TEXT' +*/ + +extern JRI_PUBLIC_API(void) +native_SetupPlugin_SECURE_0005fSetNameValuePair(JRIEnv* env, + struct SetupPlugin* self, + struct java_lang_String *file, + struct java_lang_String *section, + struct java_lang_String *name, + struct java_lang_String *value) +{ + Boolean sectionFound=FALSE; + NPP instance; + PluginInstance *This; + FInfo fndrInfo; + OSErr err=noErr; + java_lang_String *sub=NULL; + char *theFile,*theName,*theSection,*theValue=NULL; + char buffer[512]; + short len,refNum; + long startSectionOffset,sectionEndOffset,startOffset,endOffset,theCount,theOffset,logEOF; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_SetNameValuePair entered"); + + if (file==NULL) return; // these parameters are required + if (section==NULL) return; + if (name==NULL) return; + + if ((theFile = (char *)javaLangString2Cstr( env, file )) == NULL) return; // and must convert to C strings + if ((theSection = (char *)javaLangString2Cstr( env, section )) == NULL) return; + if ((theName = (char *)javaLangString2Cstr( env, name )) == NULL) return; + + if (!(*theFile)) return; // and must not be empty strings + if (!(*theSection)) return; + if (!(*theName)) return; + + sprintf(buffer,"%s",theFile); + CtoPstr(buffer); + + instance = (NPP) (netscape_plugin_Plugin_getPeer(env,(struct netscape_plugin_Plugin *)self)); + This = (PluginInstance*)instance->pdata; + if (This==NULL) return; + + if (This->data) { + DisposeHandle(This->data); + This->data=NULL; + } + + if (This->data==NULL) { + (void)create(theFile, 0, SIMPLETEXT_SIGNATURE, TEXTFILE_TYPE); // make sure file exists + if (err=getfinfo(theFile,0, &fndrInfo)) return; // only make changes to 'TEXT' files + if (fndrInfo.fdType != TEXTFILE_TYPE) return; + + useCursor(watchCursor); + + // read in file contents + + if (err=HOpenDF(0, 0, (unsigned char *)buffer, fsRdWrPerm, &refNum)) return; + if (!(err=GetEOF(refNum,&logEOF))) { + if (!(err=SetFPos(refNum,fsFromStart,0L))) { + if (This->data = NewHandle(logEOF)) { + HNoPurge(This->data); + HLock(This->data); + theCount=logEOF; + if (!(err=FSRead(refNum,&theCount,*(This->data)))) { + if (theCount!=logEOF) err=readErr; + } + HUnlock(This->data); + + // convert CRLF runs to CRs + + theOffset=0L; + while ((theOffset=Munger(This->data,theOffset,"\r\n",2L,"\r",1L))>=0L) { + ++theOffset; // replace 2 chars (CRLF) with 1 (CR) so add (2-1) to theOffset + } + + // convert LFs to CRs + + theOffset=0L; + while ((theOffset=Munger(This->data,theOffset,"\n",1L,"\r",1L))>=0L) { + ++theOffset; + } + } + } + } + } + + if (!err && (This->data)) { + + // look for start of [section] + + startSectionOffset=0L; + sprintf(buffer,"[%s]",theSection); + len=strlen(buffer); + if ((startSectionOffset=Munger(This->data,startSectionOffset,buffer,len,NULL,0L))>=0L) { + startSectionOffset+=(long)len; + if ((sectionEndOffset=Munger(This->data,startSectionOffset,"\r[",2L,NULL,0L))>=0L) { + ++sectionEndOffset; // include first CR in section + } + else { + sectionEndOffset=GetHandleSize(This->data); + } + } + else { + PtrAndHand("\r\r",This->data,2L); // if section not found, append [section]\r + PtrAndHand(buffer,This->data,(long)len); + startSectionOffset = sectionEndOffset = GetHandleSize(This->data); + } + + // look for [name=] in this section (must be inside of section) + + sprintf(buffer,"\r%s=",theName); + len=strlen(buffer); + + if (value!=NULL) { + theValue = (char *)javaLangString2Cstr( env, value ); + } + + startOffset=startSectionOffset; + if ((startOffset=Munger(This->data,startOffset,buffer,(long)len,NULL,0L))>=0L) { + if (startOffsetdata,startOffset,"\r",1L,NULL,0L))<0L) { // find end of line + endOffset=GetHandleSize(This->data); + } + sprintf(buffer,"%s",(theValue!=NULL) ? theValue:""); // replace line + Munger(This->data,startOffset,NULL,endOffset-startOffset,buffer,(long)strlen(buffer)); + } + else if (startOffset == sectionEndOffset) { + sprintf(buffer,"%s",(theValue!=NULL) ? theValue:""); // insert line + Munger(This->data,startOffset,NULL,0L,buffer,(long)strlen(buffer)); + } + else { // insert line + sprintf(buffer,"\r%s=%s\r",theName,(theValue!=NULL) ? theValue:""); + Munger(This->data,startSectionOffset,NULL,0L,buffer,(long)strlen(buffer)); + } + } + else { // if [name=] not found, insert [name=value]\r + sprintf(buffer,"\r%s=%s",theName,(theValue!=NULL) ? theValue:""); + Munger(This->data,startSectionOffset,NULL,0L,buffer,(long)strlen(buffer)); + } + + // update file contents + + if (!(err = SetFPos(refNum, fsFromStart, 0L))) { // move to file beginning + err = SetEOF(refNum, 0L); // empty out file + } + if (!err) { + HLock(This->data); + theCount = GetHandleSize(This->data); + err=FSWrite(refNum, &theCount, *(This->data)); // write data + if (!err && (theCount != GetHandleSize(This->data))) { // ensure ALL data was written + err=writErr; + } + } + } + + (void)FSClose(refNum); + if (This->data) { + DisposeHandle(This->data); + This->data=NULL; + } + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_SetNameValuePair exiting"); +} + + + +/* + SaveTextToFile: save a long text string to a file + + Note: The file is saved as a SimpleText file, and a 'styl' resource + is added to force a monospaced font: "Monaco 9" +*/ + +extern JRI_PUBLIC_API(jbool) +native_SetupPlugin_SECURE_0005fSaveTextToFile(JRIEnv* env, + struct SetupPlugin* self, + struct java_lang_String *suggestedFilename, + struct java_lang_String *data, + jbool promptFlag) +{ + FSSpec navFSSpec; + OSErr err=noErr; + Point where={0,0}; + ProcessInfoRec netscapeProcInfo; + ProcessSerialNumber netscapePSN; + StandardFileReply theReply; + Str255 defaultName={0}; + short saveResFile,refNum; + long count,logEOF; + _styleDataH styleH; + char *theData; + jbool retVal = false; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_SaveTextToFile entered"); + + if (!data) return(retVal); + + if (suggestedFilename) { + const char *theData = javaLangString2Cstr( env, suggestedFilename ); + if (theData) { + strcpy((char *)defaultName,theData); // XXX should check string length + CtoPstr((char *)defaultName); + } + } + + if (promptFlag) { + + // if using Standard File, set initial location to be folder containing the running process (Netscape) + + netscapeProcInfo.processInfoLength = sizeof(ProcessInfoRec); + netscapeProcInfo.processName = NULL; + netscapeProcInfo.processLocation = NULL; + netscapeProcInfo.processAppSpec = &navFSSpec; + if (isAppRunning(NETSCAPE_SIGNATURE, &netscapePSN, &netscapeProcInfo) == true) { + LMSetSFSaveDisk(-navFSSpec.vRefNum); // note: set to negative of vRefNum + LMSetCurDirStore(navFSSpec.parID); + } + + InitCursor(); + StandardPutFile("\pSave Account Information:", defaultName, &theReply); + if (!theReply.sfGood) { + err=userCanceledErr; + } + } + else if (defaultName[0]) { + err=FSMakeFSSpec(0,0L,defaultName,&theReply.sfFile); + if (err==fnfErr) err=noErr; + } + else { + err=paramErr; + } + + theData = (char *)javaLangString2Cstr( env, data ); + if ((!err) && theData) { +// if (theReply.sfReplacing == true) { + /* err= */ (void)FSpDelete(&theReply.sfFile); +// } + if (!err) { + (void)FSpCreate(&theReply.sfFile, SIMPLETEXT_SIGNATURE, (promptFlag) ? SIMPLETEXT_TYPE:TEXTFILE_TYPE, theReply.sfScript); + FSpCreateResFile(&theReply.sfFile, SIMPLETEXT_SIGNATURE, (promptFlag) ? SIMPLETEXT_TYPE:TEXTFILE_TYPE, theReply.sfScript); + + if (!(err=FSpOpenDF(&theReply.sfFile, fsRdWrPerm, &refNum))) { + if (!(err=GetEOF(refNum, &logEOF))) { + if (logEOF>0L) { + err=SetEOF(refNum,0L); + } + } + if (!err) { + err=SetFPos(refNum, fsFromStart,0L); + } + if (!err) { + count = strlen(theData); + err=FSWrite(refNum, &count, theData); + } + FSClose(refNum); + + retVal=true; + } + if (!err) { + if (styleH = (_styleDataH)NewHandleClear((long)sizeof(_styleData))) { + HLock((Handle)styleH); + + (**styleH).numRuns=1; + (**styleH).lineHeight=11; + (**styleH).fontAscent=9; + (**styleH).fontFamily = kFontIDMonaco; + (**styleH).fontSize = 9; + + saveResFile = CurResFile(); + if ((refNum=FSpOpenResFile(&theReply.sfFile, fsRdWrPerm)) != kResFileNotOpened) { + UseResFile(refNum); + AddResource((Handle)styleH, 'styl', 128, "\p"); + WriteResource((Handle)styleH); + CloseResFile(refNum); + } + else { + DisposeHandle((Handle)styleH); + } + UseResFile(saveResFile); + } + } + } + } + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_SaveTextToFile exiting"); + + return(retVal); +} + + + +/* + GetFolderContents: returns a string array, each element being the name + of a visible 'TEXT' file matching a given suffix in + the specified directory +*/ +#if 0 +extern JRI_PUBLIC_API(jstringArray) +native_SetupPlugin_SECURE_0005fGetFolderContents(JRIEnv* env, + struct SetupPlugin* self, + struct java_lang_String *path, + struct java_lang_String *suffix) +{ + CInfoPBRec cBlock; +// FInfo fndrInfo; + FSSpec theFSSpec; + JRIGlobalRef globalRef=NULL; + OSErr err=noErr; + Str255 theName={0}; + _fileArrayPtr fileArray=NULL,*nextFile=&fileArray, tempFilePtr; + short ioFDirIndex,loop,numFilesFound=0,vRefNum; + long theDirID=0L; + java_lang_String *sub=NULL; + const char *theFolder,*theSuffix=NULL; + void *theArray=NULL; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_GetFolderContents entered"); + + theFolder = javaLangString2Cstr( env, path ); + if (!theFolder) return(NULL); + if (!theFolder[0]) return(NULL); + + strcpy((char *)theName,theFolder); + CtoPstr((char *)theName); + + if (suffix) { + theSuffix = javaLangString2Cstr( env, suffix ); + } + + // translate pathname to vRefNum/dirID + + if (err=FSMakeFSSpec(0,0L,theName,&theFSSpec)) { + SETUP_PLUGIN_ERROR("\p GetFolderContents: FSMakeFSSpec error;g", err); + return(NULL); + } + + bzero((char *)&cBlock,sizeof(cBlock)); + cBlock.hFileInfo.ioCompletion=NULL; + cBlock.hFileInfo.ioNamePtr=(StringPtr)theFSSpec.name; + cBlock.hFileInfo.ioVRefNum=theFSSpec.vRefNum; + cBlock.hFileInfo.ioDirID=theFSSpec.parID; + cBlock.hFileInfo.ioFDirIndex=0; + if (err=PBGetCatInfoSync(&cBlock)) { + SETUP_PLUGIN_ERROR("\p GetFolderContents: PBGetCatInfoSync error;g", err); + return(NULL); + } + + // XXX should verify that its a directory (i.e. not a file) + + vRefNum=cBlock.hFileInfo.ioVRefNum; + theDirID=cBlock.hFileInfo.ioDirID; + + // enumerate directory contents; + + ioFDirIndex=1; + bzero((char *)&cBlock,sizeof(cBlock)); + cBlock.hFileInfo.ioCompletion=NULL; + cBlock.hFileInfo.ioNamePtr=(StringPtr)theName; + cBlock.hFileInfo.ioVRefNum=vRefNum; + while(!err) { + cBlock.hFileInfo.ioDirID=theDirID; + cBlock.hFileInfo.ioFDirIndex=ioFDirIndex++; + if (err=PBGetCatInfoSync(&cBlock)) break; + +/* + // Make sure that the file is a 'TEXT' file and (XXX) visible + + if (FSMakeFSSpec(vRefNum,theDirID,theName,&theFSSpec)) continue; + if (FSpGetFInfo(&theFSSpec,&fndrInfo)) continue; + if (fndrInfo.fdType != TEXTFILE_TYPE) continue; +*/ + + // if a suffix has been specified, check for a match + + PtoCstr(theName); + if (theSuffix) { + if (strlen(theSuffix) > strlen((char *)theName)) continue; + if (!equalstring((char *)theSuffix, (char *)&theName[strlen((char *)theName)-strlen((char *)theSuffix)], false,false)) continue; + } + + if (!(*nextFile=(_fileArrayPtr)NPN_MemAlloc(sizeof(_fileArray)))) { + err=-1; + break; + } + bzero((char *)*nextFile,sizeof(fileArray)); + strcpy((char *)(*nextFile)->name,(char *)theName); + nextFile=&(*nextFile)->next; + ++numFilesFound; + } + if (err==fnfErr) err=noErr; // if fnfErr, we're done + + // create string array of filenames if no error + + if (!err) { + theArray = JRI_NewObjectArray( env, numFilesFound, class_java_lang_String(env), NULL ); + if (theArray) { + globalRef=JRI_NewGlobalRef(env, theArray); // locks the array + nextFile=&fileArray; + for (loop=0; loopnext) { +// sub=JRI_NewStringUTF(env,(char *)(*nextFile)->name,strlen((char *)(*nextFile)->name)); + sub=cStr2javaLangString(env,(char *)(*nextFile)->name,strlen((char *)(*nextFile)->name)); + JRI_SetObjectArrayElement(env, theArray, loop, sub); + } + if (globalRef) JRI_DisposeGlobalRef(env, globalRef); + } + } + + // free filename array using NPN_MemFree + + while (fileArray) { + tempFilePtr=fileArray->next; + NPN_MemFree((Ptr)fileArray); + fileArray=tempFilePtr; + } + + return((struct java_lang_String *)theArray); + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_GetFolderContents exiting"); +} + +#endif + + +/* + cleanupStartupFolder: when Account Setup starts, it will remove any aliases that + were created by Account Setup before requiring a reboot +*/ + +void +cleanupStartupFolder() +{ + OSErr err; + short startupVRefNum; + long startupDirID; + +SETUP_PLUGIN_TRACE("\p cleanupStartupFolder entered"); + + if (!(err=FindFolder(kOnSystemDisk, kStartupFolderType, kDontCreateFolder, &startupVRefNum, &startupDirID))) { + (void)HDelete(startupVRefNum, startupDirID, NAV_STARTUP_ALIAS_NAME); + (void)HDelete(startupVRefNum, startupDirID, ACCOUNT_SETUP_STARTUP_ALIAS_NAME); + } + +SETUP_PLUGIN_TRACE("\p cleanupStartupFolder exiting"); +} + + + +/* + createStartupFolderEntry: create an alias file (text file owned by Netscape) in the Startup Items folder +*/ + +OSErr +createStartupFolderEntry(FSSpec *startupFile, StringPtr startupName) +{ + AliasHandle theAliasH=NULL; + FInfo fndrInfo; + FSSpec aliasFileSpec; + Handle h; + OSErr err; + short refNum,saveResFile,startupVRefNum; + long startupDirID; + +SETUP_PLUGIN_TRACE("\p createStartupFolderEntry entered"); + + if (!(err=NewAliasMinimal(startupFile, &theAliasH))) { + HLock((Handle)theAliasH); + if (!(err=FindFolder(kOnSystemDisk, kStartupFolderType, kDontCreateFolder, &startupVRefNum, &startupDirID))) { + err = FSMakeFSSpec(startupVRefNum, startupDirID, startupName, &aliasFileSpec); + if (err==fnfErr) err=noErr; + + if (!err) { // create the file & set the Finder's kIsAlias bit for the file in the Startup Items folder + FSpCreateResFile(&aliasFileSpec, NETSCAPE_SIGNATURE, TEXTFILE_TYPE, smRoman); + if (!(err=FSpGetFInfo(&aliasFileSpec,&fndrInfo))) { + fndrInfo.fdFlags |= kIsAlias; + err=FSpSetFInfo(&aliasFileSpec,&fndrInfo); + } + else { + SETUP_PLUGIN_ERROR("\p createStartupFolderEntry: FSpGetFInfo error;g", err); + } + + saveResFile = CurResFile(); // add alias resource + if (!err && ((refNum=FSpOpenResFile(&aliasFileSpec, fsRdWrPerm)) != kResFileNotOpened)) { + UseResFile(refNum); + + SetResLoad(FALSE); + h=Get1Resource(rAliasType,0); // if it already exists, remove original before adding new alias + SetResLoad(TRUE); + if (h) { + RemoveResource(h); + UpdateResFile(refNum); + } + AddResource((Handle)theAliasH, rAliasType, 0, "\p"); + WriteResource((Handle)theAliasH); + CloseResFile(refNum); + theAliasH=NULL; + } + else { + SETUP_PLUGIN_ERROR("\p createStartupFolderEntry: FSpOpenResFile error;g", err); + } + UseResFile(saveResFile); + + if (err) { // if any error occurred, delete any reference to startup file + (void)FSpDelete(&aliasFileSpec); + } + } + else { + SETUP_PLUGIN_ERROR("\p createStartupFolderEntry: FSMakeFSSpec error;g", err); + } + } + else { + SETUP_PLUGIN_ERROR("\p createStartupFolderEntry: FindFolder (Startup Items folder) error;g", err); + } + if (theAliasH) { + DisposeHandle((Handle)theAliasH); + } + } + else { + SETUP_PLUGIN_ERROR("\p createStartupFolderEntry: NewAliasMinimal error;g", err); + } + +SETUP_PLUGIN_TRACE("\p createStartupFolderEntry exiting"); + + return(err); +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/javastubs.c b/mozilla/cmd/dialup/mac/as_plugin/javastubs.c new file mode 100644 index 00000000000..68454261998 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/javastubs.c @@ -0,0 +1,35 @@ +/* -*- 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 "jri_md.h" +#ifndef JRI_PUBLIC_VAR +#define JRI_PUBLIC_VAR JRI_PUBLIC_API +#endif + +#define IMPLEMENT_SetupPlugin +//#define IMPLEMENT_netscape_plugin_Plugin +//#define IMPLEMENT_java_lang_String +//#define IMPLEMENT_netscape_javascript_JSObject + +#define DEBUG + +#include "SetupPlugin.c" +#include "netscape_plugin_Plugin.c" +#define NO_JDK +#include "java_lang_String.c" +//#include "netscape_javascript_JSObject.c" diff --git a/mozilla/cmd/dialup/mac/as_plugin/misc.c b/mozilla/cmd/dialup/mac/as_plugin/misc.c new file mode 100644 index 00000000000..79e82e15f9d --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/misc.c @@ -0,0 +1,342 @@ +/* -*- 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 "pluginIncludes.h" + + +extern void* theArray; // array of data from Reg Server +extern void* lckFileData; +extern void* animationDat; +extern void* animationRes; +extern long lckFileDataLen; +extern long animationDatLen; +extern long animationResLen; + +Handle milanData = NULL; +Boolean cursorDirty = FALSE; + +void useCursor( short cursNum ) +{ + CursHandle theCursH = NULL; + static long theTick = 0L; + + if ( cursNum > 0 && ( theCursH = GetCursor( cursNum ) ) ) + { + HLock( (Handle)theCursH ); + SetCursor( *theCursH ); + HUnlock( (Handle)theCursH ); + cursorDirty = TRUE; + theTick = TickCount()+60L; + } + else if ( TickCount() > theTick ) + { + cursorDirty = FALSE; + InitCursor(); + } +} + + + +/* + javaLangString2Cstr: convert from java_lang_String to a C string + + Note: was using JRI_GetStringUTFChars(), which only worked for UTF7 characters - "ISO-LATIN-1" +*/ +const char* javaLangString2Cstr( JRIEnv* env, struct java_lang_String* string ) +{ + const char* c = NULL; + + if ( string ) + { + c = JRI_GetStringPlatformChars( env, string, NULL, 0 ); + // have to do this so JRI continues to work + JRI_ExceptionClear( env ); + } + return c; +} + + + +/* + cStr2javaLangString: convert from C string to a java_lang_String +*/ +java_lang_String* cStr2javaLangString( JRIEnv* env, char* string, long len ) +{ + java_lang_String* c = NULL; + + if ( string ) + { + c = JRI_NewStringPlatform( env, string, len, NULL, 0L ); + if ( JRI_ExceptionOccurred( env ) ) + { +// JRI_ExceptionDescribe(env); + // have to do this so JRI continues to work + JRI_ExceptionClear( env ); + } + } + return c; +} + + + +/* + bzero: zero out an array +*/ +void bzero( char* p,long num ) +{ + while ( num-- ) + *p++=0; +} + + + +/* + Milan: QA support for generating Milan data +*/ + +extern JRI_PUBLIC_API(jbool) +native_SetupPlugin_SECURE_0005fMilan(JRIEnv* env,struct SetupPlugin* self,struct java_lang_String *name,struct java_lang_String *value,jbool pushPullFlag,jbool extendedLengthFlag) +{ + Boolean extendedDataFlag; + FSSpec profileSpec; + OSErr err=noErr; + SFTypeList typeList; + StandardFileReply theReply; + jbool retVal=FALSE; + const char *nameStr; + const char *valueStr; + short refNum; + long numItems,theCount,logEOF,x; //y; + unsigned short nameLen,valueLen; + unsigned long nameLenLong,valueLenLong; + Str255 fileString; + Point centerPoint = {-1,-1}; + java_lang_String* tempStringObj; + void * refToArray; //WARNING - we need to reference our array with a stack based java object + //so that it does not get garbage collected! + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_Milan entered"); + + if (pushPullFlag == FALSE) { + + // saving Milan data + + if (name && value) { + nameStr = javaLangString2Cstr(env,name); + valueStr = javaLangString2Cstr(env,value); + + if (nameStr && valueStr) { + if (extendedLengthFlag==TRUE) { + nameLenLong=(unsigned long)strlen(nameStr); + valueLenLong=(unsigned long)strlen(valueStr); + } + else { + nameLen=(unsigned short)strlen(nameStr); + valueLen=(unsigned short)strlen(valueStr); + } + + if (milanData == NULL) { + if (!(milanData=NewHandle(0))) return(retVal); + HNoPurge(milanData); + HUnlock(milanData); + } + + // write out name length + + if (extendedLengthFlag==TRUE) { + if (err=PtrAndHand(&nameLenLong,milanData,(long)sizeof(nameLenLong))) { + SETUP_PLUGIN_ERROR("\p Milan nameLenLong PtrAndHand error;g", err); + } + } + else { + if (err=PtrAndHand(&nameLen,milanData,(long)sizeof(nameLen))) { + SETUP_PLUGIN_ERROR("\p Milan nameLen PtrAndHand error;g", err); + } + } + + // write out name + + if (!err) { + if (extendedLengthFlag==TRUE) { + if (err=PtrAndHand(nameStr,milanData,nameLenLong)) { + SETUP_PLUGIN_ERROR("\p Milan nameStr PtrAndHand error;g", err); + } + } + else if (err=PtrAndHand(nameStr,milanData,(long)nameLen)) { + SETUP_PLUGIN_ERROR("\p Milan nameStr PtrAndHand error;g", err); + } + } + + // write out value length + + if (!err) { + if (extendedLengthFlag==TRUE) { + if (err=PtrAndHand(&valueLenLong,milanData,(long)sizeof(valueLenLong))) { + SETUP_PLUGIN_ERROR("\p Milan valueLenLong PtrAndHand error;g", err); + } + } + else if (err=PtrAndHand(&valueLen,milanData,(long)sizeof(valueLen))) { + SETUP_PLUGIN_ERROR("\p Milan valueLen PtrAndHand error;g", err); + } + } + + // write out value + + if (!err) { + if (extendedLengthFlag==TRUE) { + if (err=PtrAndHand(valueStr,milanData,valueLenLong)) { + SETUP_PLUGIN_ERROR("\p Milan valueStr PtrAndHand error;g", err); + } + } + else if (err=PtrAndHand(valueStr,milanData,(long)valueLen)) { + SETUP_PLUGIN_ERROR("\p Milan valueStr PtrAndHand error;g", err); + } + } + + // if any errors, flush any milan data + + if (err) { + if (milanData) DisposeHandle(milanData); + milanData=NULL; + } + } + } + else if (name==NULL && value==NULL) { + if (milanData != NULL) { + + // save Milan Data + + StandardPutFile("\pSave Milan Data:", "\pDATA.MLN", &theReply); + if (theReply.sfGood) { + (void)FSpCreate(&theReply.sfFile, UNKNOWN_SIGNATURE, (extendedLengthFlag==TRUE) ? MILAN_TYPE_EXT:MILAN_TYPE, theReply.sfScript); + FSpCreateResFile(&theReply.sfFile, UNKNOWN_SIGNATURE, (extendedLengthFlag==TRUE) ? MILAN_TYPE_EXT:MILAN_TYPE, theReply.sfScript); + if (!(err=FSpOpenDF(&theReply.sfFile, fsRdWrPerm, &refNum))) { + if (!(err=GetEOF(refNum, &logEOF))) { + if (logEOF>0L) { + err=SetEOF(refNum,0L); + } + } + if (!err) { + err=SetFPos(refNum, fsFromStart,0L); + } + if (!err) { + theCount = GetHandleSize(milanData); + HLock(milanData); + err=FSWrite(refNum, &theCount, *milanData); + } + FSClose(refNum); + if (!err) retVal=TRUE; + } + } + DisposeHandle(milanData); + milanData=NULL; + } + } + } + else { + + // retrieving Milan data + + if (milanData) DisposeHandle(milanData); + milanData=NULL; + + + typeList[0] = MILAN_TYPE; + typeList[1] = MILAN_TYPE_EXT; + GetIndString(fileString, CUSTOMGETFILE_RESID, CHOOSEMILAN_STRINGID); + ParamText(fileString,"\p", "\p", "\p"); + CustomGetFile(NULL, 2, typeList, &theReply, CUSTOMGETFILE_RESID, centerPoint, nil, nil, nil, nil, nil); // call StandardFile, tell it to list milan files + + //StandardGetFile(NULL, 2, typeList, &theReply); // call StandardFile, tell it to list milan files + if (theReply.sfGood == TRUE) { + + // open file, read in contents + + if (!(err=FSpOpenDF(&theReply.sfFile, fsRdPerm, &refNum))) { + if (!(err=GetEOF(refNum,&logEOF))) { + if (!(err=SetFPos(refNum,fsFromStart,0L))) { + if (milanData = NewHandle(logEOF)) { + HNoPurge(milanData); + HLock(milanData); + theCount=logEOF; + if (!(err=FSRead(refNum,&theCount,*(milanData)))) { + if (theCount!=logEOF) err=readErr; + } + HUnlock(milanData); + } + else { + err=(err=MemError()) ? err:-1; + SETUP_PLUGIN_ERROR("\p Milan: NewHandle error;g", err); + } + } + else { + SETUP_PLUGIN_ERROR("\p Milan: SetFPos error;g", err); + } + } + else { + SETUP_PLUGIN_ERROR("\p Milan: GetEOF error;g", err); + } + (void)FSClose(refNum); + } + else { + SETUP_PLUGIN_ERROR("\p Milan: FSpOpenDF error;g", err); + } + + // if no error, parse data and save in global for GetRegInfo call later + + if (!err) { + extendedDataFlag=(theReply.sfType == MILAN_TYPE_EXT) ? TRUE:FALSE; + HLock(milanData); + + lckFileData = animationDat = animationRes = NULL; + lckFileDataLen = animationDatLen = animationResLen = 0L; + + numItems = countRegItems(milanData,extendedDataFlag); + + refToArray = JRI_NewObjectArray( env, numItems, class_java_lang_String(env), NULL ); + JRI_NewGlobalRef(env, refToArray); + theArray = refToArray; + for (x=0; x + +/* + * Callback Structures. + * + * These are used to pass additional platform specific information. + */ +enum { + NP_SETWINDOW = 1 +}; + +typedef struct +{ + int32 type; +} NPAnyCallbackStruct; + +typedef struct +{ + int32 type; + Display* display; + Visual* visual; + Colormap colormap; + unsigned int depth; +} NPSetWindowCallbackStruct; + +/* + * List of variable names for which NPP_GetValue shall be implemented + */ +typedef enum { + NPPVpluginNameString = 1, + NPPVpluginDescriptionString +} NPPVariable; + +/* + * List of variable names for which NPN_GetValue is implemented by Mozilla + */ +typedef enum { + NPNVxDisplay = 1, + NPNVxtAppContext +} NPNVariable; + +#endif /* XP_UNIX */ + + +typedef struct _NPWindow +{ + void* window; /* Platform specific window handle */ + uint32 x; /* Position of top left corner relative */ + uint32 y; /* to a netscape page. */ + uint32 width; /* Maximum window size */ + uint32 height; + NPRect clipRect; /* Clipping rectangle in port coordinates */ + /* Used by MAC only. */ +#ifdef XP_UNIX + void * ws_info; /* Platform-dependent additonal data */ +#endif /* XP_UNIX */ +} NPWindow; + + +typedef struct _NPFullPrint +{ + NPBool pluginPrinted; /* Set TRUE if plugin handled fullscreen */ + /* printing */ + NPBool printOne; /* TRUE if plugin should print one copy */ + /* to default printer */ + void* platformPrint; /* Platform-specific printing info */ +} NPFullPrint; + +typedef struct _NPEmbedPrint +{ + NPWindow window; + void* platformPrint; /* Platform-specific printing info */ +} NPEmbedPrint; + +typedef struct _NPPrint +{ + uint16 mode; /* NP_FULL or NP_EMBED */ + union + { + NPFullPrint fullPrint; /* if mode is NP_FULL */ + NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ + } print; +} NPPrint; + + +#ifdef XP_MAC +/* + * Mac-specific structures and definitions. + */ + +#include +#include + +typedef struct NP_Port +{ + CGrafPtr port; /* Grafport */ + int32 portx; /* position inside the topmost window */ + int32 porty; +} NP_Port; + +/* + * Non-standard event types that can be passed to HandleEvent + */ +#define getFocusEvent (osEvt + 16) +#define loseFocusEvent (osEvt + 17) +#define adjustCursorEvent (osEvt + 18) + +#endif /* XP_MAC */ + + +/* + * Values for mode passed to NPP_New: + */ +#define NP_EMBED 1 +#define NP_FULL 2 + +/* + * Values for stream type passed to NPP_NewStream: + */ +#define NP_NORMAL 1 +#define NP_SEEK 2 +#define NP_ASFILE 3 +#define NP_ASFILEONLY 4 + +#define NP_MAXREADY (((unsigned)(~0)<<1)>>1) + + + +/*----------------------------------------------------------------------*/ +/* Error and Reason Code definitions */ +/*----------------------------------------------------------------------*/ + +/* + * Values of type NPError: + */ +#define NPERR_BASE 0 +#define NPERR_NO_ERROR (NPERR_BASE + 0) +#define NPERR_GENERIC_ERROR (NPERR_BASE + 1) +#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) +#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) +#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) +#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) +#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) +#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) +#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) +#define NPERR_INVALID_PARAM (NPERR_BASE + 9) +#define NPERR_INVALID_URL (NPERR_BASE + 10) +#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) +#define NPERR_NO_DATA (NPERR_BASE + 12) +#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) + +/* + * Values of type NPReason: + */ +#define NPRES_BASE 0 +#define NPRES_DONE (NPRES_BASE + 0) +#define NPRES_NETWORK_ERR (NPRES_BASE + 1) +#define NPRES_USER_BREAK (NPRES_BASE + 2) + +/* + * Don't use these obsolete error codes any more. + */ + #define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR + #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR + #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK + +/* + * Version feature information + */ +#define NPVERS_HAS_STREAMOUTPUT 8 +#define NPVERS_HAS_NOTIFICATION 9 +#define NPVERS_HAS_LIVECONNECT 9 + + +/*----------------------------------------------------------------------*/ +/* Function Prototypes */ +/*----------------------------------------------------------------------*/ + +#if defined(_WINDOWS) && !defined(WIN32) +#define NP_LOADDS _loadds +#else +#define NP_LOADDS +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * NPP_* functions are provided by the plugin and called by the navigator. + */ + +#ifdef XP_UNIX +char* NPP_GetMIMEDescription(void); +NPError NPP_GetValue(void *instance, NPPVariable variable, + void *value); +#endif /* XP_UNIX */ +NPError NPP_Initialize(void); +void NPP_Shutdown(void); +NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, + uint16 mode, int16 argc, char* argn[], + char* argv[], NPSavedData* saved); +NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save); +NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window); +NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, + NPStream* stream, NPBool seekable, + uint16* stype); +NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, + NPReason reason); +int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream); +int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset, + int32 len, void* buffer); +void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, + const char* fname); +void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint); +int16 NPP_HandleEvent(NPP instance, void* event); +void NPP_URLNotify(NPP instance, const char* url, + NPReason reason, void* notifyData); +jref NPP_GetJavaClass(void); + + +/* + * NPN_* functions are provided by the navigator and called by the plugin. + */ + +#ifdef XP_UNIX +NPError NPN_GetValue(NPP instance, NPNVariable variable, + void *value); +#endif /* XP_UNIX */ +void NPN_Version(int* plugin_major, int* plugin_minor, + int* netscape_major, int* netscape_minor); +NPError NPN_GetURLNotify(NPP instance, const char* url, + const char* target, void* notifyData); +NPError NPN_GetURL(NPP instance, const char* url, + const char* target); +NPError NPN_PostURLNotify(NPP instance, const char* url, + const char* target, uint32 len, + const char* buf, NPBool file, + void* notifyData); +NPError NPN_PostURL(NPP instance, const char* url, + const char* target, uint32 len, + const char* buf, NPBool file); +NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); +NPError NPN_NewStream(NPP instance, NPMIMEType type, + const char* target, NPStream** stream); +int32 NPN_Write(NPP instance, NPStream* stream, int32 len, + void* buffer); +NPError NPN_DestroyStream(NPP instance, NPStream* stream, + NPReason reason); +void NPN_Status(NPP instance, const char* message); +const char* NPN_UserAgent(NPP instance); +void* NPN_MemAlloc(uint32 size); +void NPN_MemFree(void* ptr); +uint32 NPN_MemFlush(uint32 size); +void NPN_ReloadPlugins(NPBool reloadPages); +JRIEnv* NPN_GetJavaEnv(void); +jref NPN_GetJavaPeer(NPP instance); + + +#ifdef __cplusplus +} /* end extern "C" */ +#endif + +#endif /* _NPAPI_H_ */ diff --git a/mozilla/cmd/dialup/mac/as_plugin/npmac.cpp b/mozilla/cmd/dialup/mac/as_plugin/npmac.cpp new file mode 100644 index 00000000000..723b3742da7 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/npmac.cpp @@ -0,0 +1,613 @@ +/* -*- Mode: Java; 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. + */ +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +// +// npmac.cpp +// +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +#include +#include +#include +#include +#include +#include + +#define XP_MAC 1 + +// +// A4Stuff.h contains the definition of EnterCodeResource and +// EnterCodeResource, used for setting up the code resourceÕs +// globals for 68K (analagous to the function SetCurrentA5 +// defined by the toolbox). +// +#include + + +#include "npapi.h" + +// +// The Mixed Mode procInfos defined in npupp.h assume Think C- +// style calling conventions. These conventions are used by +// Metrowerks with the exception of pointer return types, which +// in Metrowerks 68K are returned in A0, instead of the standard +// D0. Thus, since NPN_MemAlloc and NPN_UserAgent return pointers, +// Mixed Mode will return the values to a 68K plugin in D0, but +// a 68K plugin compiled by Metrowerks will expect the result in +// A0. The following pragma forces Metrowerks to use D0 instead. +// +#ifdef __MWERKS__ +#ifndef powerc +#pragma pointers_in_D0 +#endif +#endif + +#include "npupp.h" + +#ifdef __MWERKS__ +#ifndef powerc +#pragma pointers_in_A0 +#endif +#endif + + +// +// Define PLUGIN_TRACE to 1 to have the wrapper functions emit +// DebugStr messages whenever they are called. +// +#define PLUGIN_TRACE 0 + +#if PLUGIN_TRACE +#define PLUGINDEBUGSTR(msg) ::DebugStr(msg) +#else +#define PLUGINDEBUGSTR +#endif + + + + + + +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +// +// Globals +// +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +QDGlobals* gQDPtr; // Pointer to NetscapeÕs QuickDraw globals +short gResFile; // Refnum of the pluginÕs resource file +NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin + + +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +// +// Wrapper functions for all calls from the plugin to Netscape. +// These functions let the plugin developer just call the APIs +// as documented and defined in npapi.h, without needing to know +// about the function table and call macros in npupp.h. +// +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + + +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 = gNetscapeFuncs.version >> 8; // Major version is in high byte + *netscape_minor = gNetscapeFuncs.version & 0xFF; // Minor version is in low byte +} + +NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData) +{ + int navMinorVers = gNetscapeFuncs.version & 0xFF; + NPError err; + + if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) + { + err = CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData); + } + else + { + err = NPERR_INCOMPATIBLE_VERSION_ERROR; + } + return err; +} + +NPError NPN_GetURL(NPP instance, const char* url, const char* window) +{ + return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window); +} + +NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData) +{ + int navMinorVers = gNetscapeFuncs.version & 0xFF; + NPError err; + + if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) + { + err = CallNPN_PostURLNotifyProc(gNetscapeFuncs.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 CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, url, window, len, buf, file); +} + +NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) +{ + return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, stream, rangeList); +} + +NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* window, NPStream** stream) +{ + int navMinorVers = gNetscapeFuncs.version & 0xFF; + NPError err; + + if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT ) + { + err = CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, type, window, stream); + } + else + { + err = NPERR_INCOMPATIBLE_VERSION_ERROR; + } + return err; +} + +int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer) +{ + int navMinorVers = gNetscapeFuncs.version & 0xFF; + NPError err; + + if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT ) + { + err = CallNPN_WriteProc(gNetscapeFuncs.write, instance, stream, len, buffer); + } + else + { + err = NPERR_INCOMPATIBLE_VERSION_ERROR; + } + return err; +} + +NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) +{ + int navMinorVers = gNetscapeFuncs.version & 0xFF; + NPError err; + + if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT ) + { + err = CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, instance, stream, reason); + } + else + { + err = NPERR_INCOMPATIBLE_VERSION_ERROR; + } + return err; +} + +void NPN_Status(NPP instance, const char* message) +{ + CallNPN_StatusProc(gNetscapeFuncs.status, instance, message); +} + +const char* NPN_UserAgent(NPP instance) +{ + return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance); +} + +void* NPN_MemAlloc(uint32 size) +{ + return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size); +} + +void NPN_MemFree(void* ptr) +{ + CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr); +} + +uint32 NPN_MemFlush(uint32 size) +{ + return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size); +} + +void NPN_ReloadPlugins(NPBool reloadPages) +{ + CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); +} + + +JRIEnv* NPN_GetJavaEnv(void) +{ + return CallNPN_GetJavaEnvProc( gNetscapeFuncs.getJavaEnv ); +} + +jref NPN_GetJavaPeer(NPP instance) +{ + return CallNPN_GetJavaPeerProc( gNetscapeFuncs.getJavaPeer, instance ); +} + + + +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +// +// Wrapper functions for all calls from Netscape to the plugin. +// These functions let the plugin developer just create the APIs +// as documented and defined in npapi.h, without needing to +// install those functions in the function table or worry about +// setting up globals for 68K plugins. +// +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +NPError Private_Initialize(void); +void Private_Shutdown(void); +NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); +NPError Private_Destroy(NPP instance, NPSavedData** save); +NPError Private_SetWindow(NPP instance, NPWindow* window); +NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); +NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason); +int32 Private_WriteReady(NPP instance, NPStream* stream); +int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); +void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname); +void Private_Print(NPP instance, NPPrint* platformPrint); +int16 Private_HandleEvent(NPP instance, void* event); +void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData); +jref Private_GetJavaClass(void); + + +NPError Private_Initialize(void) +{ + NPError err; + EnterCodeResource(); + PLUGINDEBUGSTR("\pInitialize;g;"); + err = NPP_Initialize(); + ExitCodeResource(); + return err; +} + +void Private_Shutdown(void) +{ + EnterCodeResource(); + PLUGINDEBUGSTR("\pShutdown;g;"); + NPP_Shutdown(); + ExitCodeResource(); +} + + +NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved) +{ + EnterCodeResource(); + NPError ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved); + PLUGINDEBUGSTR("\pNew;g;"); + ExitCodeResource(); + return ret; +} + +NPError Private_Destroy(NPP instance, NPSavedData** save) +{ + NPError err; + EnterCodeResource(); + PLUGINDEBUGSTR("\pDestroy;g;"); + err = NPP_Destroy(instance, save); + ExitCodeResource(); + return err; +} + +NPError Private_SetWindow(NPP instance, NPWindow* window) +{ + NPError err; + EnterCodeResource(); + PLUGINDEBUGSTR("\pSetWindow;g;"); + err = NPP_SetWindow(instance, window); + ExitCodeResource(); + return err; +} + +NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype) +{ + NPError err; + EnterCodeResource(); + PLUGINDEBUGSTR("\pNewStream;g;"); + err = NPP_NewStream(instance, type, stream, seekable, stype); + ExitCodeResource(); + return err; +} + +int32 Private_WriteReady(NPP instance, NPStream* stream) +{ + int32 result; + EnterCodeResource(); + PLUGINDEBUGSTR("\pWriteReady;g;"); + result = NPP_WriteReady(instance, stream); + ExitCodeResource(); + return result; +} + +int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer) +{ + int32 result; + EnterCodeResource(); + PLUGINDEBUGSTR("\pWrite;g;"); + result = NPP_Write(instance, stream, offset, len, buffer); + ExitCodeResource(); + return result; +} + +void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname) +{ + EnterCodeResource(); + PLUGINDEBUGSTR("\pStreamAsFile;g;"); + NPP_StreamAsFile(instance, stream, fname); + ExitCodeResource(); +} + + +NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason) +{ + NPError err; + EnterCodeResource(); + PLUGINDEBUGSTR("\pDestroyStream;g;"); + err = NPP_DestroyStream(instance, stream, reason); + ExitCodeResource(); + return err; +} + +int16 Private_HandleEvent(NPP instance, void* event) +{ + int16 result; + EnterCodeResource(); + PLUGINDEBUGSTR("\pHandleEvent;g;"); + result = NPP_HandleEvent(instance, event); + ExitCodeResource(); + return result; +} + +void Private_Print(NPP instance, NPPrint* platformPrint) +{ + EnterCodeResource(); + PLUGINDEBUGSTR("\pPrint;g;"); + NPP_Print(instance, platformPrint); + ExitCodeResource(); +} + +void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData) +{ + EnterCodeResource(); + PLUGINDEBUGSTR("\pURLNotify;g;"); + NPP_URLNotify(instance, url, reason, notifyData); + ExitCodeResource(); +} + + +jref Private_GetJavaClass(void) +{ + EnterCodeResource(); + PLUGINDEBUGSTR("\pGetJavaClass;g;"); + + jref clazz = NPP_GetJavaClass(); + ExitCodeResource(); + if (clazz) + { + JRIEnv* env = NPN_GetJavaEnv(); + return JRI_NewGlobalRef(env, clazz); + } + return NULL; +} + + +void SetUpQD(void); +void SetUpQD(void) +{ + ProcessSerialNumber PSN; + FSSpec myFSSpec; + Str63 name; + ProcessInfoRec infoRec; + OSErr result = noErr; + CFragConnectionID connID; + Str255 errName; + + // + // Memorize the pluginÕs resource file + // refnum for later use. + // + gResFile = CurResFile(); + + // + // Ask the system if CFM is available. + // + long response; + OSErr err = Gestalt(gestaltCFMAttr, &response); + Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent); + + if (hasCFM) + { + // + // GetProcessInformation takes a process serial number and + // will give us back the name and FSSpec of the application. + // See the Process Manager in IM. + // + infoRec.processInfoLength = sizeof(ProcessInfoRec); + infoRec.processName = name; + infoRec.processAppSpec = &myFSSpec; + + PSN.highLongOfPSN = 0; + PSN.lowLongOfPSN = kCurrentProcess; + + result = GetProcessInformation(&PSN, &infoRec); + if (result != noErr) + PLUGINDEBUGSTR("\pFailed in GetProcessInformation"); + } + else + // + // If no CFM installed, assume it must be a 68K app. + // + result = -1; + + if (result == noErr) + { + // + // Now that we know the app name and FSSpec, we can call GetDiskFragment + // to get a connID to use in a subsequent call to FindSymbol (it will also + // return the address of ÒmainÓ in app, which we ignore). If GetDiskFragment + // returns an error, we assume the app must be 68K. + // + Ptr mainAddr; + result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L, infoRec.processName, + kLoadCFrag, &connID, (Ptr*)&mainAddr, errName); + } + + if (result == noErr) + { + // + // The app is a PPC code fragment, so call FindSymbol + // to get the exported ÒqdÓ symbol so we can access its + // QuickDraw globals. + // + CFragSymbolClass symClass; + result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass); + if (result != noErr) + PLUGINDEBUGSTR("\pFailed in FindSymbol qd"); + } + else + { + // + // The app is 68K, so use its A5 to compute the address + // of its QuickDraw globals. + // + gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) - sizeof(GrafPtr))); + } + +} + + + +NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp); + +#if GENERATINGCFM +RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main); +#endif + + +NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp) +{ + EnterCodeResource(); + PLUGINDEBUGSTR("\pmain"); + + NPError err = NPERR_NO_ERROR; + + // + // Ensure that everything Netscape passed us is valid! + // + if ((nsTable == NULL) || (pluginFuncs == NULL) || (unloadUpp == NULL)) + err = NPERR_INVALID_FUNCTABLE_ERROR; + + // + // Check the ÒmajorÓ version passed in NetscapeÕs function table. + // We wonÕt load if the major version is newer than what we expect. + // Also check that the function tables passed in are big enough for + // all the functions we need (they could be bigger, if Netscape added + // new APIs, but thatÕs OK with us -- weÕll just ignore them). + // + if (err == NPERR_NO_ERROR) + { + if ((nsTable->version >> 8) > NP_VERSION_MAJOR) // Major version is in high byte + err = NPERR_INCOMPATIBLE_VERSION_ERROR; +// if (nsTable->size < sizeof(NPNetscapeFuncs)) +// err = NPERR_INVALID_FUNCTABLE_ERROR; +// if (pluginFuncs->size < sizeof(NPPluginFuncs)) +// err = NPERR_INVALID_FUNCTABLE_ERROR; + } + + + if (err == NPERR_NO_ERROR) + { + // + // Copy all the fields of NetscapeÕs function table into our + // copy so we can call back into Netscape later. Note that + // we need to copy the fields one by one, rather than assigning + // the whole structure, because the Netscape function table + // could actually be bigger than what we expect. + // + + int navMinorVers = nsTable->version & 0xFF; + + gNetscapeFuncs.version = nsTable->version; + gNetscapeFuncs.size = nsTable->size; + gNetscapeFuncs.posturl = nsTable->posturl; + gNetscapeFuncs.geturl = nsTable->geturl; + gNetscapeFuncs.requestread = nsTable->requestread; + gNetscapeFuncs.newstream = nsTable->newstream; + gNetscapeFuncs.write = nsTable->write; + gNetscapeFuncs.destroystream = nsTable->destroystream; + gNetscapeFuncs.status = nsTable->status; + gNetscapeFuncs.uagent = nsTable->uagent; + gNetscapeFuncs.memalloc = nsTable->memalloc; + gNetscapeFuncs.memfree = nsTable->memfree; + gNetscapeFuncs.memflush = nsTable->memflush; + gNetscapeFuncs.reloadplugins = nsTable->reloadplugins; + if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) + { + gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; + gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; + } + if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) + { + gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; + gNetscapeFuncs.posturlnotify = nsTable->posturlnotify; + } + + // + // Set up the plugin function table that Netscape will use to + // call us. Netscape needs to know about our version and size + // and have a UniversalProcPointer for every function we implement. + // + pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; + pluginFuncs->size = sizeof(NPPluginFuncs); + pluginFuncs->newp = NewNPP_NewProc(Private_New); + pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy); + pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow); + pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream); + pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream); + pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile); + pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady); + pluginFuncs->write = NewNPP_WriteProc(Private_Write); + pluginFuncs->print = NewNPP_PrintProc(Private_Print); + pluginFuncs->event = NewNPP_HandleEventProc(Private_HandleEvent); + if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) + { + pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify); + } + if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) + { + pluginFuncs->javaClass = (jref) Private_GetJavaClass(); + } + *unloadUpp = NewNPP_ShutdownProc(Private_Shutdown); + SetUpQD(); + err = Private_Initialize(); + } + + ExitCodeResource(); + return err; +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/npupp.h b/mozilla/cmd/dialup/mac/as_plugin/npupp.h new file mode 100644 index 00000000000..b5f09d4d624 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/npupp.h @@ -0,0 +1,1012 @@ +/* -*- Mode: Java; 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. + */ +/* -*- Mode: C; tab-width: 4; -*- */ +/* + * npupp.h $Revision: 1.1 $ + * function call mecahnics needed by platform specific glue code. + */ + + +#ifndef _NPUPP_H_ +#define _NPUPP_H_ + +#ifndef GENERATINGCFM +#define GENERATINGCFM 0 +#endif + +#ifndef _NPAPI_H_ +#include "npapi.h" +#endif + +#include "jri.h" + +/****************************************************************************************** + plug-in function table macros + for each function in and out of the plugin API we define + typedef NPP_FooUPP + #define NewNPP_FooProc + #define CallNPP_FooProc + for mac, define the UPP magic for PPC/68K calling + *******************************************************************************************/ + + +/* NPP_Initialize */ + +#if GENERATINGCFM +typedef UniversalProcPtr NPP_InitializeUPP; + +enum { + uppNPP_InitializeProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) + | RESULT_SIZE(SIZE_CODE(0)) +}; + +#define NewNPP_InitializeProc(FUNC) \ + (NPP_InitializeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_InitializeProcInfo, GetCurrentArchitecture()) +#define CallNPP_InitializeProc(FUNC) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_InitializeProcInfo) + +#else + +typedef void (*NPP_InitializeUPP)(void); +#define NewNPP_InitializeProc(FUNC) \ + ((NPP_InitializeUPP) (FUNC)) +#define CallNPP_InitializeProc(FUNC) \ + (*(FUNC))() + +#endif + + +/* NPP_Shutdown */ + +#if GENERATINGCFM +typedef UniversalProcPtr NPP_ShutdownUPP; + +enum { + uppNPP_ShutdownProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(0)) + | RESULT_SIZE(SIZE_CODE(0)) +}; + +#define NewNPP_ShutdownProc(FUNC) \ + (NPP_ShutdownUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_ShutdownProcInfo, GetCurrentArchitecture()) +#define CallNPP_ShutdownProc(FUNC) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_ShutdownProcInfo) + +#else + +typedef void (*NPP_ShutdownUPP)(void); +#define NewNPP_ShutdownProc(FUNC) \ + ((NPP_ShutdownUPP) (FUNC)) +#define CallNPP_ShutdownProc(FUNC) \ + (*(FUNC))() + +#endif + + +/* NPP_New */ + +#if GENERATINGCFM +typedef UniversalProcPtr NPP_NewUPP; + +enum { + uppNPP_NewProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPMIMEType))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(uint16))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int16))) + | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(char **))) + | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(char **))) + | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(NPSavedData *))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; + +#define NewNPP_NewProc(FUNC) \ + (NPP_NewUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewProcInfo, GetCurrentArchitecture()) +#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewProcInfo, \ + (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) +#else + +typedef NPError (*NPP_NewUPP)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved); +#define NewNPP_NewProc(FUNC) \ + ((NPP_NewUPP) (FUNC)) +#define CallNPP_NewProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ + (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) + +#endif + + +/* NPP_Destroy */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_DestroyUPP; +enum { + uppNPP_DestroyProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPSavedData **))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPP_DestroyProc(FUNC) \ + (NPP_DestroyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyProcInfo, GetCurrentArchitecture()) +#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyProcInfo, (ARG1), (ARG2)) +#else + +typedef NPError (*NPP_DestroyUPP)(NPP instance, NPSavedData** save); +#define NewNPP_DestroyProc(FUNC) \ + ((NPP_DestroyUPP) (FUNC)) +#define CallNPP_DestroyProc(FUNC, ARG1, ARG2) \ + (*(FUNC))((ARG1), (ARG2)) + +#endif + + +/* NPP_SetWindow */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_SetWindowUPP; +enum { + uppNPP_SetWindowProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPWindow *))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPP_SetWindowProc(FUNC) \ + (NPP_SetWindowUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_SetWindowProcInfo, GetCurrentArchitecture()) +#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_SetWindowProcInfo, (ARG1), (ARG2)) + +#else + +typedef NPError (*NPP_SetWindowUPP)(NPP instance, NPWindow* window); +#define NewNPP_SetWindowProc(FUNC) \ + ((NPP_SetWindowUPP) (FUNC)) +#define CallNPP_SetWindowProc(FUNC, ARG1, ARG2) \ + (*(FUNC))((ARG1), (ARG2)) + +#endif + + +/* NPP_NewStream */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_NewStreamUPP; +enum { + uppNPP_NewStreamProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPStream *))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPBool))) + | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(uint16 *))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPP_NewStreamProc(FUNC) \ + (NPP_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_NewStreamProcInfo, GetCurrentArchitecture()) +#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_NewStreamProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) +#else + +typedef NPError (*NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); +#define NewNPP_NewStreamProc(FUNC) \ + ((NPP_NewStreamUPP) (FUNC)) +#define CallNPP_NewStreamProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5) \ + (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5)) +#endif + + +/* NPP_DestroyStream */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_DestroyStreamUPP; +enum { + uppNPP_DestroyStreamProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPP_DestroyStreamProc(FUNC) \ + (NPP_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, GetCurrentArchitecture()) +#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_DestroyStreamProcInfo, (NPParg), (NPStreamPtr), (NPReasonArg)) + +#else + +typedef NPError (*NPP_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); +#define NewNPP_DestroyStreamProc(FUNC) \ + ((NPP_DestroyStreamUPP) (FUNC)) +#define CallNPP_DestroyStreamProc(FUNC, NPParg, NPStreamPtr, NPReasonArg) \ + (*(FUNC))((NPParg), (NPStreamPtr), (NPReasonArg)) + +#endif + + +/* NPP_WriteReady */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_WriteReadyUPP; +enum { + uppNPP_WriteReadyProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) + | RESULT_SIZE(SIZE_CODE(sizeof(int32))) +}; +#define NewNPP_WriteReadyProc(FUNC) \ + (NPP_WriteReadyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, GetCurrentArchitecture()) +#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ + (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteReadyProcInfo, (NPParg), (NPStreamPtr)) + +#else + +typedef int32 (*NPP_WriteReadyUPP)(NPP instance, NPStream* stream); +#define NewNPP_WriteReadyProc(FUNC) \ + ((NPP_WriteReadyUPP) (FUNC)) +#define CallNPP_WriteReadyProc(FUNC, NPParg, NPStreamPtr) \ + (*(FUNC))((NPParg), (NPStreamPtr)) + +#endif + + +/* NPP_Write */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_WriteUPP; +enum { + uppNPP_WriteProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(int32))) + | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(void*))) + | RESULT_SIZE(SIZE_CODE(sizeof(int32))) +}; +#define NewNPP_WriteProc(FUNC) \ + (NPP_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_WriteProcInfo, GetCurrentArchitecture()) +#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ + (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_WriteProcInfo, (NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) + +#else + +typedef int32 (*NPP_WriteUPP)(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer); +#define NewNPP_WriteProc(FUNC) \ + ((NPP_WriteUPP) (FUNC)) +#define CallNPP_WriteProc(FUNC, NPParg, NPStreamPtr, offsetArg, lenArg, bufferPtr) \ + (*(FUNC))((NPParg), (NPStreamPtr), (offsetArg), (lenArg), (bufferPtr)) + +#endif + + +/* NPP_StreamAsFile */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_StreamAsFileUPP; +enum { + uppNPP_StreamAsFileProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) + | RESULT_SIZE(SIZE_CODE(0)) +}; +#define NewNPP_StreamAsFileProc(FUNC) \ + (NPP_StreamAsFileUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, GetCurrentArchitecture()) +#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_StreamAsFileProcInfo, (ARG1), (ARG2), (ARG3)) + +#else + +typedef void (*NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, const char* fname); +#define NewNPP_StreamAsFileProc(FUNC) \ + ((NPP_StreamAsFileUPP) (FUNC)) +#define CallNPP_StreamAsFileProc(FUNC, ARG1, ARG2, ARG3) \ + (*(FUNC))((ARG1), (ARG2), (ARG3)) +#endif + + +/* NPP_Print */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_PrintUPP; +enum { + uppNPP_PrintProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPrint *))) + | RESULT_SIZE(SIZE_CODE(0)) +}; +#define NewNPP_PrintProc(FUNC) \ + (NPP_PrintUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_PrintProcInfo, GetCurrentArchitecture()) +#define CallNPP_PrintProc(FUNC, NPParg, voidPtr) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_PrintProcInfo, (NPParg), (voidPtr)) + +#else + +typedef void (*NPP_PrintUPP)(NPP instance, NPPrint* platformPrint); +#define NewNPP_PrintProc(FUNC) \ + ((NPP_PrintUPP) (FUNC)) +#define CallNPP_PrintProc(FUNC, NPParg, NPPrintArg) \ + (*(FUNC))((NPParg), (NPPrintArg)) + +#endif + + +/* NPP_HandleEvent */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_HandleEventUPP; +enum { + uppNPP_HandleEventProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) + | RESULT_SIZE(SIZE_CODE(sizeof(int16))) +}; +#define NewNPP_HandleEventProc(FUNC) \ + (NPP_HandleEventUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_HandleEventProcInfo, GetCurrentArchitecture()) +#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ + (int16)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_HandleEventProcInfo, (NPParg), (voidPtr)) + +#else + +typedef int16 (*NPP_HandleEventUPP)(NPP instance, void* event); +#define NewNPP_HandleEventProc(FUNC) \ + ((NPP_HandleEventUPP) (FUNC)) +#define CallNPP_HandleEventProc(FUNC, NPParg, voidPtr) \ + (*(FUNC))((NPParg), (voidPtr)) + +#endif + + +/* NPP_URLNotify */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_URLNotifyUPP; +enum { + uppNPP_URLNotifyProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) + | RESULT_SIZE(SIZE_CODE(SIZE_CODE(0))) +}; +#define NewNPP_URLNotifyProc(FUNC) \ + (NPP_URLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, GetCurrentArchitecture()) +#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPP_URLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) + +#else + +typedef void (*NPP_URLNotifyUPP)(NPP instance, const char* url, NPReason reason, void* notifyData); +#define NewNPP_URLNotifyProc(FUNC) \ + ((NPP_URLNotifyUPP) (FUNC)) +#define CallNPP_URLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ + (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) + +#endif + + + + +/* + * Netscape entry points + */ + +#ifdef XP_UNIX + +/* NPN_GetValue */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_GetValueUPP; +enum { + uppNPN_GetValueProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPNVariable))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_GetValueProc(FUNC) \ + (NPN_GetValueUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetValueProcInfo, GetCurrentArchitecture()) +#define CallNPN_GetURNotifyLProc(FUNC, ARG1, ARG2, ARG3) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetValueProcInfo, (ARG1), (ARG2), (ARG3)) +#else + +typedef NPError (*NPN_GetValueUPP)(NPP instance, NPNVariable variable, void *ret_alue); +#define NewNPN_GetValueProc(FUNC) \ + ((NPN_GetValueUPP) (FUNC)) +#define CallNPN_GetValueProc(FUNC, ARG1, ARG2, ARG3) \ + (*(FUNC))((ARG1), (ARG2), (ARG3)) +#endif + +#endif /* XP_UNIX */ + + + +/* NPN_GetUrlNotify */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_GetURLNotifyUPP; +enum { + uppNPN_GetURLNotifyProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_GetURLNotifyProc(FUNC) \ + (NPN_GetURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, GetCurrentArchitecture()) +#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4)) +#else + +typedef NPError (*NPN_GetURLNotifyUPP)(NPP instance, const char* url, const char* window, void* notifyData); +#define NewNPN_GetURLNotifyProc(FUNC) \ + ((NPN_GetURLNotifyUPP) (FUNC)) +#define CallNPN_GetURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4) \ + (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4)) +#endif + + +/* NPN_PostUrlNotify */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_PostURLNotifyUPP; +enum { + uppNPN_PostURLNotifyProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) + | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) + | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(void*))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_PostURLNotifyProc(FUNC) \ + (NPN_PostURLNotifyUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, GetCurrentArchitecture()) +#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLNotifyProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) +#else + +typedef NPError (*NPN_PostURLNotifyUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData); +#define NewNPN_PostURLNotifyProc(FUNC) \ + ((NPN_PostURLNotifyUPP) (FUNC)) +#define CallNPN_PostURLNotifyProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \ + (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6), (ARG7)) +#endif + + +/* NPN_GetUrl */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_GetURLUPP; +enum { + uppNPN_GetURLProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_GetURLProc(FUNC) \ + (NPN_GetURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetURLProcInfo, GetCurrentArchitecture()) +#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetURLProcInfo, (ARG1), (ARG2), (ARG3)) +#else + +typedef NPError (*NPN_GetURLUPP)(NPP instance, const char* url, const char* window); +#define NewNPN_GetURLProc(FUNC) \ + ((NPN_GetURLUPP) (FUNC)) +#define CallNPN_GetURLProc(FUNC, ARG1, ARG2, ARG3) \ + (*(FUNC))((ARG1), (ARG2), (ARG3)) +#endif + + +/* NPN_PostUrl */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_PostURLUPP; +enum { + uppNPN_PostURLProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(uint32))) + | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(const char*))) + | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(NPBool))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_PostURLProc(FUNC) \ + (NPN_PostURLUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_PostURLProcInfo, GetCurrentArchitecture()) +#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_PostURLProcInfo, (ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) +#else + +typedef NPError (*NPN_PostURLUPP)(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file); +#define NewNPN_PostURLProc(FUNC) \ + ((NPN_PostURLUPP) (FUNC)) +#define CallNPN_PostURLProc(FUNC, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \ + (*(FUNC))((ARG1), (ARG2), (ARG3), (ARG4), (ARG5), (ARG6)) +#endif + + +/* NPN_RequestRead */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_RequestReadUPP; +enum { + uppNPN_RequestReadProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPStream *))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPByteRange *))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_RequestReadProc(FUNC) \ + (NPN_RequestReadUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_RequestReadProcInfo, GetCurrentArchitecture()) +#define CallNPN_RequestReadProc(FUNC, stream, range) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_RequestReadProcInfo, (stream), (range)) + +#else + +typedef NPError (*NPN_RequestReadUPP)(NPStream* stream, NPByteRange* rangeList); +#define NewNPN_RequestReadProc(FUNC) \ + ((NPN_RequestReadUPP) (FUNC)) +#define CallNPN_RequestReadProc(FUNC, stream, range) \ + (*(FUNC))((stream), (range)) + +#endif + + +/* NPN_NewStream */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_NewStreamUPP; +enum { + uppNPN_NewStreamProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPMIMEType))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(const char *))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(NPStream **))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_NewStreamProc(FUNC) \ + (NPN_NewStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_NewStreamProcInfo, GetCurrentArchitecture()) +#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_NewStreamProcInfo, (npp), (type), (window), (stream)) + +#else + +typedef NPError (*NPN_NewStreamUPP)(NPP instance, NPMIMEType type, const char* window, NPStream** stream); +#define NewNPN_NewStreamProc(FUNC) \ + ((NPN_NewStreamUPP) (FUNC)) +#define CallNPN_NewStreamProc(FUNC, npp, type, window, stream) \ + (*(FUNC))((npp), (type), (window), (stream)) + +#endif + + +/* NPN_Write */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_WriteUPP; +enum { + uppNPN_WriteProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(int32))) + | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(void*))) + | RESULT_SIZE(SIZE_CODE(sizeof(int32))) +}; +#define NewNPN_WriteProc(FUNC) \ + (NPN_WriteUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_WriteProcInfo, GetCurrentArchitecture()) +#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ + (int32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_WriteProcInfo, (npp), (stream), (len), (buffer)) + +#else + +typedef int32 (*NPN_WriteUPP)(NPP instance, NPStream* stream, int32 len, void* buffer); +#define NewNPN_WriteProc(FUNC) \ + ((NPN_WriteUPP) (FUNC)) +#define CallNPN_WriteProc(FUNC, npp, stream, len, buffer) \ + (*(FUNC))((npp), (stream), (len), (buffer)) + +#endif + + +/* NPN_DestroyStream */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_DestroyStreamUPP; +enum { + uppNPN_DestroyStreamProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP ))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPStream *))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPReason))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPN_DestroyStreamProc(FUNC) \ + (NPN_DestroyStreamUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, GetCurrentArchitecture()) +#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ + (NPError)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_DestroyStreamProcInfo, (npp), (stream), (reason)) + +#else + +typedef NPError (*NPN_DestroyStreamUPP)(NPP instance, NPStream* stream, NPReason reason); +#define NewNPN_DestroyStreamProc(FUNC) \ + ((NPN_DestroyStreamUPP) (FUNC)) +#define CallNPN_DestroyStreamProc(FUNC, npp, stream, reason) \ + (*(FUNC))((npp), (stream), (reason)) + +#endif + + +/* NPN_Status */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_StatusUPP; +enum { + uppNPN_StatusProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(char *))) +}; + +#define NewNPN_StatusProc(FUNC) \ + (NPN_StatusUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_StatusProcInfo, GetCurrentArchitecture()) +#define CallNPN_StatusProc(FUNC, npp, msg) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_StatusProcInfo, (npp), (msg)) + +#else + +typedef void (*NPN_StatusUPP)(NPP instance, const char* message); +#define NewNPN_StatusProc(FUNC) \ + ((NPN_StatusUPP) (FUNC)) +#define CallNPN_StatusProc(FUNC, npp, msg) \ + (*(FUNC))((npp), (msg)) + +#endif + + +/* NPN_UserAgent */ +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_UserAgentUPP; +enum { + uppNPN_UserAgentProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | RESULT_SIZE(SIZE_CODE(sizeof(const char *))) +}; + +#define NewNPN_UserAgentProc(FUNC) \ + (NPN_UserAgentUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_UserAgentProcInfo, GetCurrentArchitecture()) +#define CallNPN_UserAgentProc(FUNC, ARG1) \ + (const char*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_UserAgentProcInfo, (ARG1)) + +#else + +typedef const char* (*NPN_UserAgentUPP)(NPP instance); +#define NewNPN_UserAgentProc(FUNC) \ + ((NPN_UserAgentUPP) (FUNC)) +#define CallNPN_UserAgentProc(FUNC, ARG1) \ + (*(FUNC))((ARG1)) + +#endif + + +/* NPN_MemAlloc */ +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_MemAllocUPP; +enum { + uppNPN_MemAllocProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) + | RESULT_SIZE(SIZE_CODE(sizeof(void *))) +}; + +#define NewNPN_MemAllocProc(FUNC) \ + (NPN_MemAllocUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemAllocProcInfo, GetCurrentArchitecture()) +#define CallNPN_MemAllocProc(FUNC, ARG1) \ + (void*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemAllocProcInfo, (ARG1)) + +#else + +typedef void* (*NPN_MemAllocUPP)(uint32 size); +#define NewNPN_MemAllocProc(FUNC) \ + ((NPN_MemAllocUPP) (FUNC)) +#define CallNPN_MemAllocProc(FUNC, ARG1) \ + (*(FUNC))((ARG1)) + +#endif + + +/* NPN__MemFree */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_MemFreeUPP; +enum { + uppNPN_MemFreeProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void *))) +}; + +#define NewNPN_MemFreeProc(FUNC) \ + (NPN_MemFreeUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFreeProcInfo, GetCurrentArchitecture()) +#define CallNPN_MemFreeProc(FUNC, ARG1) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFreeProcInfo, (ARG1)) + +#else + +typedef void (*NPN_MemFreeUPP)(void* ptr); +#define NewNPN_MemFreeProc(FUNC) \ + ((NPN_MemFreeUPP) (FUNC)) +#define CallNPN_MemFreeProc(FUNC, ARG1) \ + (*(FUNC))((ARG1)) + +#endif + + +/* NPN_MemFlush */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_MemFlushUPP; +enum { + uppNPN_MemFlushProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(uint32))) + | RESULT_SIZE(SIZE_CODE(sizeof(uint32))) +}; + +#define NewNPN_MemFlushProc(FUNC) \ + (NPN_MemFlushUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_MemFlushProcInfo, GetCurrentArchitecture()) +#define CallNPN_MemFlushProc(FUNC, ARG1) \ + (uint32)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_MemFlushProcInfo, (ARG1)) + +#else + +typedef uint32 (*NPN_MemFlushUPP)(uint32 size); +#define NewNPN_MemFlushProc(FUNC) \ + ((NPN_MemFlushUPP) (FUNC)) +#define CallNPN_MemFlushProc(FUNC, ARG1) \ + (*(FUNC))((ARG1)) + +#endif + + + +/* NPN_ReloadPlugins */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_ReloadPluginsUPP; +enum { + uppNPN_ReloadPluginsProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPBool))) + | RESULT_SIZE(SIZE_CODE(0)) +}; + +#define NewNPN_ReloadPluginsProc(FUNC) \ + (NPN_ReloadPluginsUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, GetCurrentArchitecture()) +#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ + (void)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_ReloadPluginsProcInfo, (ARG1)) + +#else + +typedef void (*NPN_ReloadPluginsUPP)(NPBool reloadPages); +#define NewNPN_ReloadPluginsProc(FUNC) \ + ((NPN_ReloadPluginsUPP) (FUNC)) +#define CallNPN_ReloadPluginsProc(FUNC, ARG1) \ + (*(FUNC))((ARG1)) + +#endif + + +/* NPN_GetJavaEnv */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_GetJavaEnvUPP; +enum { + uppNPN_GetJavaEnvProcInfo = kThinkCStackBased + | RESULT_SIZE(SIZE_CODE(sizeof(JRIEnv*))) +}; + +#define NewNPN_GetJavaEnvProc(FUNC) \ + (NPN_GetJavaEnvUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo, GetCurrentArchitecture()) +#define CallNPN_GetJavaEnvProc(FUNC) \ + (JRIEnv*)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaEnvProcInfo) + +#else + +typedef JRIEnv* (*NPN_GetJavaEnvUPP)(void); +#define NewNPN_GetJavaEnvProc(FUNC) \ + ((NPN_GetJavaEnvUPP) (FUNC)) +#define CallNPN_GetJavaEnvProc(FUNC) \ + (*(FUNC))() + +#endif + + +/* NPN_GetJavaPeer */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPN_GetJavaPeerUPP; +enum { + uppNPN_GetJavaPeerProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPP))) + | RESULT_SIZE(SIZE_CODE(sizeof(jref))) +}; + +#define NewNPN_GetJavaPeerProc(FUNC) \ + (NPN_GetJavaPeerUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, GetCurrentArchitecture()) +#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ + (jref)CallUniversalProc((UniversalProcPtr)(FUNC), uppNPN_GetJavaPeerProcInfo, (ARG1)) + +#else + +typedef jref (*NPN_GetJavaPeerUPP)(NPP instance); +#define NewNPN_GetJavaPeerProc(FUNC) \ + ((NPN_GetJavaPeerUPP) (FUNC)) +#define CallNPN_GetJavaPeerProc(FUNC, ARG1) \ + (*(FUNC))((ARG1)) + +#endif + + + + +/****************************************************************************************** + * The actual plugin function table definitions + *******************************************************************************************/ + +typedef struct _NPPluginFuncs { + uint16 size; + uint16 version; + NPP_NewUPP newp; + NPP_DestroyUPP destroy; + NPP_SetWindowUPP setwindow; + NPP_NewStreamUPP newstream; + NPP_DestroyStreamUPP destroystream; + NPP_StreamAsFileUPP asfile; + NPP_WriteReadyUPP writeready; + NPP_WriteUPP write; + NPP_PrintUPP print; + NPP_HandleEventUPP event; + NPP_URLNotifyUPP urlnotify; + JRIGlobalRef javaClass; +} NPPluginFuncs; + +typedef struct _NPNetscapeFuncs { + uint16 size; + uint16 version; + NPN_GetURLUPP geturl; + NPN_PostURLUPP posturl; + NPN_RequestReadUPP requestread; + NPN_NewStreamUPP newstream; + NPN_WriteUPP write; + NPN_DestroyStreamUPP destroystream; + NPN_StatusUPP status; + NPN_UserAgentUPP uagent; + NPN_MemAllocUPP memalloc; + NPN_MemFreeUPP memfree; + NPN_MemFlushUPP memflush; + NPN_ReloadPluginsUPP reloadplugins; + NPN_GetJavaEnvUPP getJavaEnv; + NPN_GetJavaPeerUPP getJavaPeer; + NPN_GetURLNotifyUPP geturlnotify; + NPN_PostURLNotifyUPP posturlnotify; +#ifdef XP_UNIX + NPN_GetValueUPP getvalue; +#endif /* XP_UNIX */ +} NPNetscapeFuncs; + + + +#ifdef XP_MAC +/****************************************************************************************** + * Mac platform-specific plugin glue stuff + *******************************************************************************************/ + +/* + * Main entry point of the plugin. + * This routine will be called when the plugin is loaded. The function + * tables are passed in and the plugin fills in the NPPluginFuncs table + * and NPPShutdownUPP for Netscape's use. + */ + +#if GENERATINGCFM + +typedef UniversalProcPtr NPP_MainEntryUPP; +enum { + uppNPP_MainEntryProcInfo = kThinkCStackBased + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NPNetscapeFuncs*))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(NPPluginFuncs*))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(NPP_ShutdownUPP*))) + | RESULT_SIZE(SIZE_CODE(sizeof(NPError))) +}; +#define NewNPP_MainEntryProc(FUNC) \ + (NPP_MainEntryUPP) NewRoutineDescriptor((ProcPtr)(FUNC), uppNPP_MainEntryProcInfo, GetCurrentArchitecture()) +#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ + CallUniversalProc((UniversalProcPtr)(FUNC), (ProcInfoType)uppNPP_MainEntryProcInfo, (netscapeFunc), (pluginFunc), (shutdownUPP)) + +#else + +typedef NPError (*NPP_MainEntryUPP)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownUPP*); +#define NewNPP_MainEntryProc(FUNC) \ + ((NPP_MainEntryUPP) (FUNC)) +#define CallNPP_MainEntryProc(FUNC, netscapeFunc, pluginFunc, shutdownUPP) \ + (*(FUNC))((netscapeFunc), (pluginFunc), (shutdownUPP)) + +#endif +#endif /* MAC */ + + +#ifdef _WINDOWS + +#ifdef __cplusplus +extern "C" { +#endif + +/* plugin meta member functions */ + +NPError WINAPI NP_GetEntryPoints(NPPluginFuncs* pFuncs); + +NPError WINAPI NP_Initialize(NPNetscapeFuncs* pFuncs); + +NPError WINAPI NP_Shutdown(); + +#ifdef __cplusplus +} +#endif + +#endif /* _WINDOWS */ + +#ifdef XP_UNIX + +#ifdef __cplusplus +extern "C" { +#endif + +/* plugin meta member functions */ + +char* NP_GetMIMEDescription(void); +NPError NP_Initialize(NPNetscapeFuncs*, NPPluginFuncs*); +NPError NP_Shutdown(void); + +#ifdef __cplusplus +} +#endif + +#endif /* XP_UNIX */ + +#endif /* _NPUPP_H_ */ diff --git a/mozilla/cmd/dialup/mac/as_plugin/pluginIncludes.h b/mozilla/cmd/dialup/mac/as_plugin/pluginIncludes.h new file mode 100644 index 00000000000..be1fdd15ddb --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/pluginIncludes.h @@ -0,0 +1,377 @@ +/* -*- 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 + +#define DEBUG + +#pragma once + +#ifndef _NPAPI_H_ +#include "npapi.h" +#endif + +// #include "jri.h" +//#define IMPLEMENT_java_lang_String +//#include "netscape_javascript_JSObject.h" + +#include "jri_md.h" +#ifndef JRI_PUBLIC_VAR +#define JRI_PUBLIC_VAR JRI_PUBLIC_API +#endif + +#ifdef __cplusplus +#define recplusplus +#undef __cplusplus +#endif + +#include "java_lang_String.h" +#include "netscape_plugin_Plugin.h" +#define IMPLEMENT_SetupPlugin +#include "SetupPlugin.h" + +#ifdef recplusplus +#define __cplusplus +#undef recplusplus +#endif + +#include +//#include +//#include +//#include +//#include +#include +//#include +//#include +//#include +//#include +#include +//#include +//#include +//#include +//#include +#include +//#include +//#include +#include +//#include +//#include +//#include +#include +//#include +//#include +//#include +//#include +//#include +#include +//#include + +#include +#include + +#ifndef PtoCstr +#define PtoCstr P2CStr +#define CtoPstr C2PStr +#endif + +#define kMacTCPDriverName "\p.ipp" +#define gestaltMacTCP 'mtcp' + +#include "ppp.h" +#include "ppp_prefs_types.h" +#include "FreePPPPubInterface.h" + +#define PAUSE_TIMEOUT (30L) +#define HANGUP_TIMEOUT (30L*60L) + +#include "RC4Encrypt.h" + + +// typedef long (*PPPRequestProcPtr)(long command, void* data, long refCon); + +#ifndef PPPRequestUPP +enum { + uppPPPRequest = kThinkCStackBased + | RESULT_SIZE(SIZE_CODE(sizeof(long))) + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) +}; + +#if GENERATINGCFM +typedef UniversalProcPtr PPPRequestUPP; +#define NewPPPRequestUPP( userRoutine ) \ + (PPPRequestUPP)NewRoutineDescriptor( (ProcPtr)(userRoutine), uppPPPRequest, kM68kISA ) // not GetCurrentArchitecture() +#else +typedef PPPRequestProcPtr PPPRequestUPP; +#define NewPPPRequestUPP( userRoutine ) \ + ( (PPPRequestUPP)( userRoutine ) ) +#endif + +#endif /* FreePPPPubInterfaceUPP*/ + + + +// typedef pascal long (*FreePPPPubInterfaceProcPtr)(long selector, void *parmData, long refCon); + +#ifndef FreePPPPubInterfaceUPP +enum { + uppFreePPPPubInterface = kPascalStackBased + | RESULT_SIZE(SIZE_CODE(sizeof(long))) + | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long))) + | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))) + | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))) +}; + +#if GENERATINGCFM +typedef UniversalProcPtr FreePPPPubInterfaceUPP; +#define NewFreePPPPubInterfaceUPP( userRoutine ) \ + (FreePPPPubInterfaceUPP)NewRoutineDescriptor( (ProcPtr)(userRoutine), uppFreePPPPubInterface, kM68kISA ) // not GetCurrentArchitecture() +#else +typedef FreePPPPubInterfaceProcPtr FreePPPPubInterfaceUPP; +#define NewFreePPPPubInterfaceUPP( userRoutine ) \ + ( (FreePPPPubInterfaceUPP)( userRoutine ) ) +#endif + +#endif /* FreePPPPubInterfaceUPP*/ + + +#define ACUR_RESID 256 +#define SPIN_CYCLE 8L // spin every 8/60ths of a second +#define SPIN_TIMEOUT 90L // stop spinning after 1.5 seconds +#define MAX_NUM_SPINS (8L*120L) // after two minutes, stop spinning + + +// options for kLprefixTwiddleSetting + +#define FREEPPP_LOCATION_DONOTHING 0 +#define FREEPPP_LOCATION_ADDPREFIX 1 +#define FREEPPP_LOCATION_STRIP_AREACODE_ADDPREFIX 2 +#define FREEPPP_LOCATION_DIAL_AREACODE_NO_PREFIX 3 + + + +#define REG_STREAM_TYPE "application/x-netscape-autoconfigure-dialer" +#define REG_STREAM_TYPE_V2 "application/x-netscape-autoconfigure-dialer-v2" + +#define CFG_FILENAME "\pPROFILE.CFG" +#define ANIMATION_FILENAME "\pCustom Animation" + +#define USERPROFILEDATABASE_NAME_B2 "\p:Netscape Ä:User Profiles" +#define USERPROFILEDATABASE_NAME_POSTB2 "\p:Netscape Users:User Profiles" +#define USERPROFILE_RESTYPE 'user' +#define USERPROFILE_RESID 128 + +#define FINDER_SIGNATURE 'MACS' +#define FREEPPP_SETUP_SIGNATURE 'FPPP' +#define MODEM_WIZARD_SIGNATURE 'MW”z' +#define TCPIP_CONTROL_PANEL_SIGNATURE 'ztcp' +#define UNKNOWN_SIGNATURE '????' +#define NETSCAPE_SIGNATURE 'MOSS' +#define KIOSK_MODE 'KOSK' + +#define TEXTFILE_TYPE 'TEXT' +#define MILAN_TYPE 'MLN1' +#define MILAN_TYPE_EXT 'MLN2' + +#define SIMPLETEXT_SIGNATURE 'ttxt' +#define SIMPLETEXT_TYPE 'ttro' // 'TEXT' for writeable file, 'ttro' for read-only file + +#define NAV_STARTUP_ALIAS_NAME "\pzzzz Account Setup 1" // magic alias name to use for Nav reference in Startup Items Folder +#define ACCOUNT_SETUP_STARTUP_ALIAS_NAME "\pzzzz Account Setup 2" // magic alias name to use for Account Setup reference in Startup Items Folder + +#define HOME_LOCATION "\pHome" + +#define SCRIPT_FILE_SEPARATOR "|" +#define SCRIPT_MAGIC_NAME "\p\%name" +#define SCRIPT_FREEPPP_NAME "\p\\A" +#define SCRIPT_MAGIC_PASSWORD "\p\%password" +#define SCRIPT_FREEPPP_PASSWORD "\p\\P" + +#define CUSTOMGETFILE_RESID 6042 //this is both the DLOG # and the STR# resource that contains custom strings +#define WHEREIS_STRINGID 1 +#define QUESTIONMARK_STRINGID 2 +#define CHOOSEEDITOR_STRINGID 3 +#define CHOOSEMILAN_STRINGID 4 + +typedef struct _PluginInstance +{ + NPWindow* fWindow; + uint16 fMode; + Handle regData; + Handle data; +} +PluginInstance; + + +typedef struct _regStream +{ + Handle data; + int32 dataLen; + Boolean extendedDataFlag; +} +regStream; + + +#if PRAGMA_ALIGN_SUPPORTED +#pragma options align=mac68k +#endif + +typedef struct _styleData +{ + short numRuns; + long runOffset; + short lineHeight; + short fontAscent; + short fontFamily; + short fontStyle; + short fontSize; + RGBColor theColor; +} +_styleData, **_styleDataH; + +typedef struct +{ + short numCursors; + short index; + CursHandle cursors[1]; +} +**acurHandle; + +typedef struct +{ + VBLTask theTask; + long theA5; + acurHandle cursorsH; + long numSpins; +} +VBLTaskWithA5, *VBLTaskWithA5Ptr; + +#if PRAGMA_ALIGN_SUPPORTED +#pragma options align=reset +#endif + +typedef struct _fileArray +{ + struct _fileArray *next; + Str63 name; +} +_fileArray, *_fileArrayPtr; + + +typedef struct _fileCache +{ + struct _fileCache *next; + Boolean dirtyFlag; + FSSpec theSpec; + unsigned long ioFlMdDat; + Handle dataH; +} +_fileCache, *_fileCachePtr; + +#define MAX_CACHE_ENTRY_SIZE_BYTES 2048 // don't cache files larger than this size + + +#define MIN_OPEN_TRANSPORT_VERSION_REQUIRED 0x01100000 // require Open Transport version 1.1 or later +#define OPEN_TRANSPORT_VERSION_TOO_NEW 0x01500000 // Open Transport version 1.5 and later require revs + +#define MIN_FREEPPP_VERSION_REQUIRED 0x0260 // require FreePPP version 2.6 or later + + +#include "prototypes.h" + + +// Following are positive error codes used by the plugin + +#define PLUGIN_ERROR_DIALOG_RESID 256 +#define PLUGIN_ERROR_STR_RESID 256 +#define PLUGIN_SECURITY_DIALOG_RESID 257 + +#define POPUP_MENU_ITEMNAME_STR_RESID 257 +#define POPUP_MENU_BACK_ID 1 +#define POPUP_MENU_FORWARD_ID 2 + +// #define SECURITY_DIALOG_ENABLED // comment this out to not use the security dialog + +#define FREEPPP_NOT_INSTALLED_ERROR_STR_ID 1 +#define FREEPPPCONFIGPLUGIN_NOT_INSTALLED_ERROR_STR_ID 2 +#define FREEPPP_TOO_OLD_ERROR_STR_ID 3 +#define OT_TOO_OLD_ERROR_STR_ID 4 +#define OT_TOO_NEW_ERROR_STR_ID 5 +#define OT_NEEDS_REINSTALL_ERROR_STR_ID 6 +#define UNABLE_TO_FIND_MODEM_WIZARD_STR_ID 7 +#define MODEM_WIZARD_LAUNCH_PROBLEM_STR_ID 8 +#define BETAEXPIRED_STRINGID 9 + + +// +// Define SETUP_PLUGIN_TRACE_SETTING to 1 to have the wrapper functions emit +// DebugStr messages whenever they are called. SETUP_PLUGIN_TRACE is used to +// display when a routine is entered or exited. +// +#define SETUP_PLUGIN_TRACE_SETTING 0 + +#if SETUP_PLUGIN_TRACE_SETTING +#define SETUP_PLUGIN_TRACE(msg) DebugStr( (void*)msg ) +#else +#define SETUP_PLUGIN_TRACE +#endif + + +// +// Define SETUP_PLUGIN_TRACE_ERRORS_SETTING to 1 to have the wrapper functions emit +// DebugStr messages whenever they are called. SETUP_PLUGIN_ERROR is used to display +// error information if an error occurs. +// +#define SETUP_PLUGIN_TRACE_ERRORS_SETTING 0 + +#if SETUP_PLUGIN_TRACE_ERRORS_SETTING +#define SETUP_PLUGIN_ERROR( msg, errNum )\ +if ( errNum != noErr ) \ +{\ + Str255 data;\ + DebugStr( (void*)msg );\ + NumToString( (long)errNum, data );\ + DebugStr( data );\ +} +#else +#define SETUP_PLUGIN_ERROR +#endif + + +// +// Define SETUP_PLUGIN_INFO_SETTING to 1 to have the wrapper functions emit +// DebugStr messages whenever they are called. SETUP_PLUGIN_INFO_STR is used +// to display status messages, values of variables, etc. +// +#define SETUP_PLUGIN_INFO_SETTING 0 + +#if SETUP_PLUGIN_INFO_SETTING +#define SETUP_PLUGIN_INFO_STR( msg, data )\ +if ( msg != NULL )\ + DebugStr( (void *)msg );\ +if ( data != NULL )\ + DebugStr( (void*)data); +#else +#define SETUP_PLUGIN_INFO_STR +#endif + + +// Defines for a couple of arbitrary things that are necessary for our IAS password encryption routines +// (native_SetupPlugin_SECURE_0005fEncryptPassword in dialerRtns.c) +#define kArbitraryMungedString "\pahsf73j1nf,ho482jsozlt0w" + diff --git a/mozilla/cmd/dialup/mac/as_plugin/processRtns.c b/mozilla/cmd/dialup/mac/as_plugin/processRtns.c new file mode 100644 index 00000000000..ab5b68d7dd4 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/processRtns.c @@ -0,0 +1,340 @@ +/* -*- 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 "pluginIncludes.h" + + + jbool rebootNowNeeded = FALSE; + + + +/* + isAppRunning: return TRUE or FALSE depending upon whether a certain process is running +*/ + +Boolean +isAppRunning(OSType theSig, ProcessSerialNumber *thePSN, ProcessInfoRec *theProcInfo) +{ + Boolean flag=FALSE; + OSErr err=noErr; + ProcessInfoRec theProcessInfo; + + if (theProcInfo == NULL) { + theProcInfo = &theProcessInfo; + theProcInfo->processInfoLength = sizeof(ProcessInfoRec); + theProcInfo->processName = NULL; + theProcInfo->processLocation = NULL; + theProcInfo->processAppSpec = NULL; + } + + thePSN->highLongOfPSN=0L; // start at beginning of process list + thePSN->lowLongOfPSN=kNoProcess; + + while(GetNextProcess(thePSN) != procNotFound) { // loop over all processes + GetProcessInformation(thePSN,theProcInfo); + if (theProcInfo->processSignature==theSig) { // if we found the appropriate process, we're done + flag=TRUE; + break; + } + } + return(flag); +} + + + +OSErr +FindAppInCurrentFolder(OSType theSig, FSSpecPtr theFSSpecPtr) +{ + CInfoPBRec cBlock; + OSErr err=fnfErr; + ProcessInfoRec theProcInfo; + ProcessSerialNumber thePSN; + short ioFDirIndex=1; + + // get current process location + + if (err=GetCurrentProcess(&thePSN)) return(err); + theProcInfo.processInfoLength = sizeof(theProcInfo); + theProcInfo.processName = NULL; + theProcInfo.processLocation = NULL; + theProcInfo.processAppSpec = theFSSpecPtr; + if (err=GetProcessInformation(&thePSN,&theProcInfo)) return(err); + + // search folder for app + + cBlock.hFileInfo.ioCompletion=NULL; + cBlock.hFileInfo.ioNamePtr=theFSSpecPtr->name; + cBlock.hFileInfo.ioVRefNum=theFSSpecPtr->vRefNum; + do { + cBlock.hFileInfo.ioDirID=theFSSpecPtr->parID; + cBlock.hFileInfo.ioFDirIndex=ioFDirIndex++; + if (err=PBGetCatInfoSync(&cBlock)) break; + if ((cBlock.hFileInfo.ioFlFndrInfo.fdType=='APPL') && (cBlock.hFileInfo.ioFlFndrInfo.fdCreator==theSig)) { + break; + } + } while(!err); + return(err); +} + + + +/* + LaunchApp: search for an application in the desktop database, and launch it if found + + Assumption: isAppRunning has already checked that the application is not currently running +*/ + +OSErr +LaunchApp(OSType theSig, Boolean appInForegroundFlag, AEDesc *launchDesc, Boolean searchAppFolderFlag) +{ + Boolean foundFlag=FALSE; + DTPBRec theDatabase; + FSSpec theFSSpec; + GetVolParmsInfoBuffer volInfo; + HParamBlockRec hpb; + LaunchParamBlockRec lBlock; + OSErr err=noErr; + OSType applType = {'APPL'}; + ParamBlockRec pb; +// StandardFileReply theReply; + short volIndex=0,vRefNum; + long dirID; + + if (searchAppFolderFlag==TRUE) { + if (!(err=FindAppInCurrentFolder(theSig,&theFSSpec))) { // look in folder of current process + foundFlag=TRUE; + } + } + if ((foundFlag==FALSE) && (!(err=FindFolder(kOnSystemDisk,kSystemFolderType,FALSE,&vRefNum,&dirID)))) { // look on startup volume first + while (!err) { + hpb.ioParam.ioCompletion=NULL; + hpb.ioParam.ioNamePtr=NULL; + hpb.ioParam.ioVRefNum=vRefNum; + hpb.ioParam.ioBuffer=(Ptr)&volInfo; + hpb.ioParam.ioReqCount=sizeof(volInfo); + if (!(err=PBHGetVolParmsSync(&hpb))) { + if ((volInfo.vMAttrib & (1L << bHasDesktopMgr)) != 0) { // volume has desktop db? + theDatabase.ioCompletion=NULL; + theDatabase.ioNamePtr=NULL; + theDatabase.ioVRefNum=vRefNum; + if (!(err=PBDTGetPath(&theDatabase))) { // if so, open db + theDatabase.ioIndex=0; // most recent creation date + theDatabase.ioFileCreator=theSig; + theDatabase.ioNamePtr=(StringPtr)theFSSpec.name; + if (!(err=PBDTGetAPPL(&theDatabase,FALSE))) { + theFSSpec.vRefNum=theDatabase.ioVRefNum; + theFSSpec.parID=theDatabase.ioAPPLParID; + foundFlag=TRUE; + break; + } + else if (err==afpItemNotFound) { + err=noErr; + } + } + } + } + pb.volumeParam.ioCompletion=NULL; + pb.volumeParam.ioNamePtr=NULL; + pb.volumeParam.ioVolIndex=++volIndex; + if (!(err=PBGetVInfoSync(&pb))) { // search next mounted volume + vRefNum=pb.volumeParam.ioVRefNum; + } + else if (err==nsvErr) { // stop if no more volumes + err=fnfErr; + break; + } + } +/* + if (err==fnfErr) { // if not found, prompt for it? + StandardGetFile(NULL, 1, &applType, &theReply); + if (theReply.sfGood == TRUE) { + theFSSpec.vRefNum = theReply.sfFile.vRefNum; + theFSSpec.parID = theReply.sfFile.parID; + BlockMove(theReply.sfFile.name, theFSSpec.name, 1L+(unsigned)theFSSpec.name[0]); + foundFlag=TRUE; + } + } +*/ + } + if (!err && foundFlag) { + lBlock.launchBlockID=extendedBlock; + lBlock.launchEPBLength=extendedBlockLen; + lBlock.launchFileFlags=0; + lBlock.launchControlFlags=launchContinue|launchNoFileFlags|launchUseMinimum; + if (!appInForegroundFlag) lBlock.launchControlFlags |= launchDontSwitch; + lBlock.launchAppSpec=&theFSSpec; + if (launchDesc) { + HLock(launchDesc->dataHandle); + lBlock.launchAppParameters=(AppParametersPtr)*(launchDesc->dataHandle); + } + else { + lBlock.launchAppParameters=NULL; + } + err=LaunchApplication(&lBlock); + } + return(err); +} + + + +/* + QuitApp: send a kAEQuitApplication AppleEvent to quit a running application + + Assumption: isAppRunning has already checked that the application is currently running +*/ + +OSErr +QuitApp(ProcessSerialNumber *thePSN) +{ + AEAddressDesc theAddr={typeNull,NULL}; + AppleEvent theEvent={typeNull,NULL}, theReply={typeNull,NULL}; + OSErr err=paramErr; + + if (!thePSN) return(err); + + if (err=AECreateDesc(typeProcessSerialNumber,thePSN,sizeof(ProcessSerialNumber),&theAddr)) {} + else if (err=AECreateAppleEvent(kCoreEventClass, kAEQuitApplication,&theAddr,kAutoGenerateReturnID,kAnyTransactionID,&theEvent)) {} + else if (err=AESend(&theEvent,&theReply,kAENoReply+kAENeverInteract,kAENormalPriority,kAEDefaultTimeout,NULL,NULL)) {} + + if (err) { + SETUP_PLUGIN_ERROR("\p QuitApp error;g", err); + } + + if (theAddr.dataHandle) (void)AEDisposeDesc(&theAddr); + if (theEvent.dataHandle) (void)AEDisposeDesc(&theEvent); + if (theReply.dataHandle) (void)AEDisposeDesc(&theReply); + + return(err); +} + + + +extern JRI_PUBLIC_API(jbool) +native_SetupPlugin_SECURE_0005fNeedReboot(JRIEnv* env,struct SetupPlugin* self) +{ +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_NeedReboot entered"); + if (rebootNowNeeded == TRUE) { + SETUP_PLUGIN_INFO_STR("\p NeedReboot: a reboot is needed", NULL); + } +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_NeedReboot exiting"); + return(rebootNowNeeded); +} + + + +/* + Reboot: send Restart AppleEvent to the Finder... if needed, created two aliases in the + Startup Items folder. Alias one restarts the current running Nav (just in case + more than one Nav is installed, use the current one). Alias two brings up the + specified HTML page. + + Note: Items in the Startup Items folder opened in alphanumeric order. + NAV_STARTUP_ALIAS_NAME and ACCOUNT_SETUP_STARTUP_ALIAS_NAME rely on this. + + The creator code for the HTML-page is forced to point to Netscape. +*/ + +extern JRI_PUBLIC_API(void) +native_SetupPlugin_SECURE_0005fReboot(JRIEnv* env,struct SetupPlugin* self, java_lang_String *AccountSetupPathname) +{ + AEAddressDesc finderAddr={typeNull,NULL}; + AppleEvent theEvent={typeNull,NULL}, theReply={typeNull,NULL}; + FInfo fndrInfo; + FSSpec theASFSSpec,navFSSpec; + OSErr err=noErr; + ProcessInfoRec netscapeProcInfo; + ProcessSerialNumber finderPSN, netscapePSN; + char *accountSetupName; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_Reboot entered"); + + if (AccountSetupPathname) { // do we need to create an alias in the Startup Items folder? + if (accountSetupName=(char *)javaLangString2Cstr( env, AccountSetupPathname )) { + if (*accountSetupName) { + CtoPstr(accountSetupName); + SETUP_PLUGIN_INFO_STR("\p Reboot: making alias for;g", accountSetupName); + + netscapeProcInfo.processInfoLength = sizeof(ProcessInfoRec); + netscapeProcInfo.processName = NULL; + netscapeProcInfo.processLocation = NULL; + netscapeProcInfo.processAppSpec = &navFSSpec; + if (isAppRunning(NETSCAPE_SIGNATURE, &netscapePSN, &netscapeProcInfo) == true) { + + SETUP_PLUGIN_INFO_STR("\p Reboot: processAppSpec->name is;g", netscapeProcInfo.processAppSpec->name); + + if (!(err=createStartupFolderEntry(netscapeProcInfo.processAppSpec,NAV_STARTUP_ALIAS_NAME))) { + SETUP_PLUGIN_INFO_STR("\p Reboot: Nav alias created", NULL); + + if (!(err = FSMakeFSSpec(0, 0L, (unsigned char *)accountSetupName, &theASFSSpec))) { + + // make sure the HTML file to load has a creator type of Netscape + if (!(err=FSpGetFInfo(&theASFSSpec,&fndrInfo))) { + fndrInfo.fdCreator = NETSCAPE_SIGNATURE; + if (err=FSpSetFInfo(&theASFSSpec,&fndrInfo)) { + SETUP_PLUGIN_ERROR("\p Reboot: FSpSetFInfo error;g", err); + } + } + else { + SETUP_PLUGIN_ERROR("\p Reboot: FSpGetFInfo error;g", err); + } + + if (!(err=createStartupFolderEntry(&theASFSSpec,ACCOUNT_SETUP_STARTUP_ALIAS_NAME))) { + SETUP_PLUGIN_INFO_STR("\p Reboot: Account Setup alias created", NULL); + } + else { + SETUP_PLUGIN_ERROR("\p Reboot: creating ACCOUNT_SETUP_STARTUP_ALIAS_NAME startup alias error;g", err); + } + } + else { + SETUP_PLUGIN_ERROR("\p Reboot: FSMakeFSSpec error;g", err); + } + } + else { + SETUP_PLUGIN_ERROR("\p Reboot: creating NAV_STARTUP_ALIAS_NAME startup alias error;g", err); + } + } + } + } + } + else { + SETUP_PLUGIN_INFO_STR("\p Reboot: AccountSetupPathname not specified so no startup alias was created", NULL); + } + + if (!err) { + if (isAppRunning(FINDER_SIGNATURE, &finderPSN, NULL) == true) { // if Finder is running, send it a Restart AppleEvent + SETUP_PLUGIN_INFO_STR("\p Reboot: Finder is running so sending kAERestart", NULL); + + if (err=AECreateDesc(typeProcessSerialNumber,&finderPSN,sizeof(ProcessSerialNumber),&finderAddr)) {} + else if (err=AECreateAppleEvent(kAEFinderEvents, kAERestart,&finderAddr,kAutoGenerateReturnID,kAnyTransactionID,&theEvent)) {} + else if (err=AESend(&theEvent,&theReply,kAENoReply,kAENormalPriority,kAEDefaultTimeout,NULL,NULL)) {} + + if (err) { + SETUP_PLUGIN_ERROR("\p Reboot error;g", err); + } + + if (finderAddr.dataHandle) (void)AEDisposeDesc(&finderAddr); + if (theEvent.dataHandle) (void)AEDisposeDesc(&theEvent); + if (theReply.dataHandle) (void)AEDisposeDesc(&theReply); + } + else { + SETUP_PLUGIN_INFO_STR("\p Reboot: Finder is not running so unable to reboot", NULL); + } + } + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_Reboot exiting"); +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/profileRtns.c b/mozilla/cmd/dialup/mac/as_plugin/profileRtns.c new file mode 100644 index 00000000000..0ed1dbb7c07 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/profileRtns.c @@ -0,0 +1,383 @@ +/* -*- 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 "pluginIncludes.h" + +extern OSErr getProfileDirectory( FSSpecPtr theFSSpecPtr ) +{ + AliasHandle aliasH; + Boolean wasChanged; + CInfoPBRec cBlock; + OSErr err = paramErr; + short profileID, refNum, saveResFile; + + if ( theFSSpecPtr ) + { + if ( !( err = findNetscapeUserProfileDatabase( theFSSpecPtr ) ) ) + { + saveResFile = CurResFile(); + if ( ( refNum = FSpOpenResFile( theFSSpecPtr, fsRdWrPerm ) ) != kResFileNotOpened ) + { + UseResFile( refNum ); + if ( !( err = findCurrentUserProfileID( refNum, &profileID ) ) ) + { + if ( aliasH = (AliasHandle)Get1Resource( rAliasType, profileID ) ) + { + HNoPurge( (Handle)aliasH ); + if ( !( err = ResolveAlias( NULL, aliasH, theFSSpecPtr, &wasChanged ) ) ) + { + bzero( (char*)&cBlock, sizeof( cBlock ) ); + cBlock.hFileInfo.ioCompletion = NULL; + cBlock.hFileInfo.ioNamePtr = (StringPtr)theFSSpecPtr->name; + cBlock.hFileInfo.ioVRefNum = theFSSpecPtr->vRefNum; + cBlock.hFileInfo.ioDirID = theFSSpecPtr->parID; + cBlock.hFileInfo.ioFDirIndex = 0; + if ( !( err = PBGetCatInfoSync( &cBlock ) ) ) + { + // XXX should verify that its a directory (i.e. not a file) + + theFSSpecPtr->vRefNum = cBlock.hFileInfo.ioVRefNum; + theFSSpecPtr->parID = cBlock.hFileInfo.ioDirID; + theFSSpecPtr->name[ 0 ] = 0; + } + else + { + SETUP_PLUGIN_ERROR( "\p getProfileDirectory: PBGetCatInfoSync error;g", err ); + } + } + } + } + CloseResFile( refNum ); + } + UseResFile( saveResFile ); + } + } + return err; +} + + + +extern JRI_PUBLIC_API(struct java_lang_String*) native_SetupPlugin_SECURE_0005fGetCurrentProfileDirectory( + JRIEnv* env, struct SetupPlugin* self) +{ + AliasHandle aliasH; + Boolean wasChanged; + FSSpec userProfileFSSpec, currentProfileFSSpec; + Handle h; + OSErr err; + java_lang_String* profileDir = NULL; + short profileID, refNum, saveResFile; + + SETUP_PLUGIN_TRACE( "\p native_SetupPlugin_GetCurrentProfileDirectory entered" ); + + useCursor( watchCursor ); + + if ( !( err = findNetscapeUserProfileDatabase( &userProfileFSSpec ) ) ) + { + saveResFile = CurResFile(); + if ( ( refNum = FSpOpenResFile( &userProfileFSSpec, fsRdWrPerm ) ) != kResFileNotOpened ) + { + UseResFile( refNum ); + if ( !( err = findCurrentUserProfileID( refNum, &profileID ) ) ) + { + if ( aliasH = (AliasHandle)Get1Resource( rAliasType, profileID ) ) + { + HNoPurge( (Handle)aliasH ); + if ( !( err = ResolveAlias( NULL, aliasH, ¤tProfileFSSpec, &wasChanged ) ) ) + { + if ( h = pathFromFSSpec( ¤tProfileFSSpec ) ) + { + HLock( h ); +// profileDir=JRI_NewStringUTF(env, (char *)(*h), (unsigned)GetHandleSize(h)); + profileDir = cStr2javaLangString( env, (char*)(*h), (unsigned)GetHandleSize( h ) ); + DisposeHandle( h ); + } + } + } + } + CloseResFile( refNum ); + } + else + SETUP_PLUGIN_ERROR( "\p GetCurrentProfileDirectory: FSpOpenResFile error;g", ResError() ); + UseResFile( saveResFile ); + } + else + SETUP_PLUGIN_ERROR( "\p GetCurrentProfileDirectory: findNetscapeUserProfileDatabase error;g", err ); + + SETUP_PLUGIN_TRACE( "\p native_SetupPlugin_GetCurrentProfileDirectory exiting" ); + return profileDir; +} + + + +extern JRI_PUBLIC_API(struct java_lang_String *) +native_SetupPlugin_SECURE_0005fGetCurrentProfileName(JRIEnv* env, + struct SetupPlugin* self) +{ + FSSpec userProfileFSSpec; + OSErr err; + StringHandle strH; + java_lang_String *profileName=NULL; + short profileID,refNum,saveResFile; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_GetCurrentProfileName entered"); + + useCursor(watchCursor); + + if (!(err=findNetscapeUserProfileDatabase(&userProfileFSSpec))) { + saveResFile = CurResFile(); + if ((refNum=FSpOpenResFile(&userProfileFSSpec, fsRdWrPerm)) != kResFileNotOpened) { + UseResFile(refNum); + if (!(err=findCurrentUserProfileID(refNum, &profileID))) { + if (strH=GetString(profileID)) { + HLock((Handle)strH); +// profileName=JRI_NewStringUTF(env, (char *)&((*strH)[1]), (unsigned)((*strH)[0])); + profileName=cStr2javaLangString(env, (char *)&((*strH)[1]), (unsigned)((*strH)[0])); + ReleaseResource((Handle)strH); + } + } + CloseResFile(refNum); + } + UseResFile(saveResFile); + } + else { + SETUP_PLUGIN_ERROR("\p GetCurrentProfileName: findNetscapeUserProfileDatabase error;g", err); + } + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_GetCurrentProfileName exiting"); + return(profileName); +} + + + +extern JRI_PUBLIC_API(void) +native_SetupPlugin_SECURE_0005fSetCurrentProfileName(JRIEnv* env, + struct SetupPlugin* self, + struct java_lang_String *profileName) +{ + FSSpec userProfileFSSpec; + OSErr err; + StringHandle strH; + const char *profileStr; + short profileID,refNum,saveResFile; + int len; + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_SetCurrentProfileName entered"); + + if (profileName==NULL) return; + profileStr = javaLangString2Cstr( env, profileName ); + if (profileStr==NULL) return; + len=strlen(profileStr); + if (len==0) return; + + useCursor(watchCursor); + + if (!(err=findNetscapeUserProfileDatabase(&userProfileFSSpec))) { + saveResFile = CurResFile(); + if ((refNum=FSpOpenResFile(&userProfileFSSpec, fsRdWrPerm)) != kResFileNotOpened) { + UseResFile(refNum); + if (!(err=findCurrentUserProfileID(refNum, &profileID))) { + if (strH=GetString(profileID)) { + HNoPurge((Handle)strH); + HUnlock((Handle)strH); + SetHandleSize((Handle)strH,1L+len); + if (GetHandleSize((Handle)strH) == 1L+len) { + HLock((Handle)strH); + (*strH)[0] = (unsigned)len; + BlockMove(profileStr,&(*strH)[1],len); + ChangedResource((Handle)strH); + WriteResource((Handle)strH); + } + } + } + CloseResFile(refNum); + } + UseResFile(saveResFile); + } + else { + SETUP_PLUGIN_ERROR("\p SetCurrentProfileName: findNetscapeUserProfileDatabase error;g", err); + } + +SETUP_PLUGIN_TRACE("\p native_SetupPlugin_SetCurrentProfileName exiting"); +} + + + +OSErr findNetscapeUserProfileDatabase( FSSpecPtr theFSSpecPtr ) +{ + OSErr err; + short vRefNum; + long dirID; + + if ( !( err = FindFolder( kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder, &vRefNum, &dirID ) ) ) + { + err = FSMakeFSSpec( vRefNum, dirID, USERPROFILEDATABASE_NAME_POSTB2, theFSSpecPtr ); + + // Note: FSMakeFSSpec can return fnfErr (documented) or dirNFErr (not documented) if file/dir/dir-in-path doesn't exist + + if ( ( err==fnfErr ) || ( err==dirNFErr ) ) + { + SETUP_PLUGIN_INFO_STR( "\p findNetscapeUserProfileDatabase: B2 fallback for User Profile database location", NULL ); + err = FSMakeFSSpec( vRefNum, dirID, USERPROFILEDATABASE_NAME_B2, theFSSpecPtr ); + } + } + return err; +} + +OSErr findCurrentUserProfileID( short refNum, short* profileID ) +{ + Handle h; + OSErr err = paramErr; + ResType theType; + Str255 resName; + short saveResFile, theCount; + + saveResFile = CurResFile(); + UseResFile( refNum ); + if ( h = Get1Resource( USERPROFILE_RESTYPE, USERPROFILE_RESID ) ) + { + if ( GetHandleSize( h ) == sizeof( short ) ) + { + BlockMove( *h, profileID, (long)sizeof( short ) ); + err = noErr; + } + else + { + SETUP_PLUGIN_ERROR( "\p findCurrentUserProfileID: user profile resource is incorrect size error;g", err ); + } + } + else + { + if ( ( theCount = Count1Resources( rAliasType ) ) == 1 ) + { + if ( h = Get1IndResource( rAliasType, 1 ) ) + { + HNoPurge( h ); + GetResInfo( h, profileID, &theType, resName ); + err = noErr; + } + } + } + UseResFile( saveResFile ); + return err; +} + + + +Handle pathFromFSSpec( FSSpecPtr theFSSpecPtr ) +{ + CInfoPBRec cBlock; + Handle h = NULL; + OSErr err; + Str255 name = { 0 }; + long initialLen = 0L, namelen, hlen; + + if ( theFSSpecPtr == NULL ) + return NULL; + + // start with cBlock.dirInfo.ioDrDirID + bzero( (char*)&cBlock, sizeof( cBlock ) ); + cBlock.dirInfo.ioCompletion = NULL; + cBlock.dirInfo.ioNamePtr = theFSSpecPtr->name; + cBlock.dirInfo.ioVRefNum = theFSSpecPtr->vRefNum; + cBlock.dirInfo.ioDrDirID = theFSSpecPtr->parID; + cBlock.dirInfo.ioFDirIndex = 0; + if ( err = PBGetCatInfoSync( &cBlock ) ) + { + SETUP_PLUGIN_ERROR( "\p pathFromFSSpec: PBGetCatInfoSync error;g", err ); + return NULL; + } + + + // ¥ the FSSpec is pointing to a file, so copy the name + if ( !( cBlock.dirInfo.ioFlAttrib & ioDirMask ) ) + { + SETUP_PLUGIN_INFO_STR( "\p PBGetCatInfoSync: file specified", NULL ); + initialLen = (unsigned)theFSSpecPtr->name[ 0 ] + 1; + cBlock.dirInfo.ioDrDirID = theFSSpecPtr->parID; + } + // ¥Êthe FSSpec is a directory, we'll fetch the name in a sec, but copy in the + // following "/" first + else + { + initialLen = 1; + SETUP_PLUGIN_INFO_STR( "\p PBGetCatInfoSync: folder specified", NULL ); + } + + h = NewHandle( initialLen ); + if ( h == NULL ) + { + SETUP_PLUGIN_ERROR( "\p pathFromFSSpec: NewHandle error;g", MemError() ); + return NULL; + } + + HNoPurge( h ); + + (*h)[ 0 ] = '/'; + + if ( initialLen > 1 ) + // ¥Êcopy the file name into the handle + BlockMove( &theFSSpecPtr->name[ 1 ], &(*h)[ 1 ],(unsigned long)( theFSSpecPtr->name[ 0 ] ) ); + + + // ¥ start with cBlock.dirInfo.ioDrDirID + cBlock.dirInfo.ioNamePtr = (StringPtr)name; + cBlock.dirInfo.ioFDirIndex = -1; + + while( !( err = PBGetCatInfoSync( &cBlock ) ) ) + { + + SETUP_PLUGIN_INFO_STR( "\p pathFromFSSpec: parent is;g", cBlock.dirInfo.ioNamePtr ); + + PtoCstr( name ); + namelen = strlen( (void*)name ); + hlen = GetHandleSize( h ); + HUnlock( h ); + SetHandleSize( h, namelen + hlen + 1 ); + if ( GetHandleSize( h ) != ( namelen + hlen + 1 ) ) + { + err = ( err = MemError() ) ? err : -1; + SETUP_PLUGIN_ERROR( "\p pathFromFSSpec: SetHandleSize error;g", err ); + break; + } + HLock( h ); + + // prepend name and a colon onto handle + if ( hlen ) + BlockMove( &(*h)[ 1 ], &(*h)[ namelen + 2 ], hlen ); + BlockMove( name, &(*h)[ 1 ], namelen ); + (*h)[ namelen + 1 ] = '/'; + + // stop when at root, else move up to parent directory + if ( cBlock.dirInfo.ioDrDirID == 2L ) + break; + + cBlock.dirInfo.ioDrDirID=cBlock.dirInfo.ioDrParID; + } + + if ( err ) + { + SETUP_PLUGIN_ERROR( "\p pathFromFSSpec: possible PBGetCatInfoSync error;g", err ); + if ( h ) + { + DisposeHandle( h ); + h = NULL; + } + } + return h; +} diff --git a/mozilla/cmd/dialup/mac/as_plugin/prototypes.h b/mozilla/cmd/dialup/mac/as_plugin/prototypes.h new file mode 100644 index 00000000000..adeb0740129 --- /dev/null +++ b/mozilla/cmd/dialup/mac/as_plugin/prototypes.h @@ -0,0 +1,132 @@ +/* -*- 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 __cplusplus +extern "C" { +#endif + + + + +// Setup.cp prototype(s) +extern void AppendData( regStream* This, unsigned long len, void* buffer ); +extern Boolean StartDraw( NPWindow* window ); +extern void EndDraw( NPWindow* window ); +extern void DoDraw( PluginInstance* This ); +extern void blinkButton( DialogPtr theDialog, short itemNum ); +pascal Boolean securityDialogFilter( DialogPtr theDialog, EventRecord* theEvent, short* itemHit ); +extern long countRegItems( Handle regData, Boolean extendedDataFlag ); +extern java_lang_String* getRegElement( JRIEnv *env, Handle regData, long elementNum, Boolean extendedDataFlag ); + +// asyncCursors.c prototype(s) +extern OSErr initAsyncCursors( void ); +void spinCursor( acurHandle cursorsH ); +void startAsyncCursors( void ); +void stopAsyncCursors( void ); + +// cacheRtns.c prototype(s) +extern OSErr addToCache( FSSpecPtr theFSSpecPtr, unsigned long ioFlMdDat, Handle dataH ); +extern OSErr findInCache( FSSpecPtr theFSSpecPtr, Handle *dataH ); +extern void disposeCache( Boolean justPruneFlag ); + +// dialerRtns.c prototype(s) +extern void* LoadMUCPlugin(); +extern long CallMUCPlugin( long selector, void* pb ); + +extern JRI_PUBLIC_API(jbool) native_SetupPlugin_SECURE_0005fCheckEnvironment( JRIEnv* env, struct SetupPlugin* self ); +extern OSErr checkSystemSoftware( void ); +extern JRI_PUBLIC_API(jbool) native_SetupPlugin_SECURE_0005fDialerConnect( JRIEnv* env, struct SetupPlugin* self ); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fDialerHangup( JRIEnv* env, struct SetupPlugin* self ); +extern JRI_PUBLIC_API(jbool) native_SetupPlugin_SECURE_0005fIsDialerConnected( JRIEnv* env, struct SetupPlugin* self ); +extern OSErr addPPPConfigRecord( PPPConfigureStruct **pppH, OSType typeCode, void *data ); +ip_addr convertToIPAddr( StringPtr IPaddress ); +OSErr processScriptFile( StringPtr autoSend, StringPtr scriptStr, StringPtr scriptFileName,ScriptLineDef* commands ); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fDialerConfig( JRIEnv* env, struct SetupPlugin* self, jstringArray dialerData, jbool regMode ); +extern JRI_PUBLIC_API(struct java_lang_String *) native_SetupPlugin_SECURE_0005fEncryptString( JRIEnv* env, struct SetupPlugin* self, struct java_lang_String* clearText ); +Boolean MacTCPIsOpen( void ); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fDesktopConfig( JRIEnv* env,struct SetupPlugin* self, java_lang_String *desktopData, java_lang_String *iconFilename, java_lang_String *acctsetFilename ); + +// editorRtns.c prototype(s) +extern JRI_PUBLIC_API(struct java_lang_String *) native_SetupPlugin_SECURE_0005fGetExternalEditor(JRIEnv* env, struct SetupPlugin* self); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fOpenFileWithEditor(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *app, struct java_lang_String *file); + +// errorRtns.c prototype(s) +void showPluginError( short errStrIndex, Boolean quitNavFlag ); + +// ExpireBeta.cp prototype(s) +extern Boolean CheckIfExpired( void ); + +// fileFolderRtns.c prototype(s) + +extern JRI_PUBLIC_API(struct java_lang_Object *) native_SetupPlugin_SECURE_0005fReadFile(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *file); +extern OSErr WriteFile( FSSpecPtr theFile,void *data, long dataLen, void *res, long resLen ); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fWriteFile(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *file, struct java_lang_Object *data); +extern JRI_PUBLIC_API(struct java_lang_String *) native_SetupPlugin_SECURE_0005fGetNameValuePair(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *file, struct java_lang_String *section, struct java_lang_String *name); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fSetNameValuePair(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *file, struct java_lang_String *section, struct java_lang_String *name, struct java_lang_String *value); +extern JRI_PUBLIC_API(jbool) native_SetupPlugin_SECURE_0005fSaveTextToFile(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *suggestedFilename, struct java_lang_String *data, jbool promptFlag); +extern JRI_PUBLIC_API(jstringArray) native_SetupPlugin_SECURE_0005fGetFolderContents(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *path, struct java_lang_String *suffix); +extern void cleanupStartupFolder( void ); +extern OSErr createStartupFolderEntry( FSSpec *startupFile, StringPtr startupName ); + +// misc.c prototype(s) +void useCursor( short cursNum ); +extern JRI_PUBLIC_API(jbool) native_SetupPlugin_SECURE_0005fMilan(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *name, struct java_lang_String *value, jbool pushPullFlag, jbool extendedLengthFlag); +extern const char * javaLangString2Cstr( JRIEnv *env, struct java_lang_String *string ); +extern java_lang_String * cStr2javaLangString( JRIEnv *env, char *string, long len ); +extern void bzero(char *p,long num); + + +// modemWizardRtns.c prototype(s) +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fOpenModemWizard(JRIEnv* env, struct SetupPlugin* self); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fCloseModemWizard(JRIEnv* env, struct SetupPlugin* self); +extern JRI_PUBLIC_API(jbool) native_SetupPlugin_SECURE_0005fIsModemWizardOpen(JRIEnv* env, struct SetupPlugin* self); +extern int CompareStringWrapper( const void *string1, const void *string2 ); +extern JRI_PUBLIC_API(jstringArray) native_SetupPlugin_SECURE_0005fGetModemList(JRIEnv* env, struct SetupPlugin* self); +extern JRI_PUBLIC_API(java_lang_String *) native_SetupPlugin_SECURE_0005fGetCurrentModemName(JRIEnv* env, struct SetupPlugin* self); + +// navigatorRtns.c prototype(s) +void patchPopUpMenuSelect( Boolean patchFlag ); +pascal long ourPopUpMenuSelect( MenuRef menu, short top, short left, short popUpItem ); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fSetKiosk(JRIEnv* env, struct SetupPlugin* self, jbool flag); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fQuitNavigator(JRIEnv* env,struct SetupPlugin* self); + +// passwordRtns.c prototype(s) +void ConvertPassword( char *lpBuf, char *lpszPassword ); +StringPtr MozillaSRDecrypt( StringPtr inOutStr ); + +// processRtnsRtns.c prototype(s) +extern Boolean isAppRunning( OSType theSig,ProcessSerialNumber *thePSN, ProcessInfoRec *theProcInfo ); +extern OSErr FindAppInCurrentFolder( OSType theSig, FSSpecPtr theFSSpecPtr ); +extern OSErr LaunchApp( OSType theSig, Boolean appInForegroundFlag, AEDesc* launchDesc, Boolean searchAppFolderFlag ); +extern OSErr QuitApp( ProcessSerialNumber* thePSN ); +extern JRI_PUBLIC_API(jbool) native_SetupPlugin_SECURE_0005fNeedReboot( JRIEnv* env,struct SetupPlugin* self ); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fReboot( JRIEnv* env,struct SetupPlugin* self, java_lang_String *AccountSetupPathname); + +// profileRtns.c prototype(s) +extern OSErr getProfileDirectory( FSSpecPtr theFSSpecPtr ); +extern JRI_PUBLIC_API(struct java_lang_String *) native_SetupPlugin_SECURE_0005fGetCurrentProfileDirectory(JRIEnv* env, struct SetupPlugin* self); +extern JRI_PUBLIC_API(struct java_lang_String *) native_SetupPlugin_SECURE_0005fGetCurrentProfileName(JRIEnv* env, struct SetupPlugin* self); +extern JRI_PUBLIC_API(void) native_SetupPlugin_SECURE_0005fSetCurrentProfileName(JRIEnv* env, struct SetupPlugin* self, struct java_lang_String *profileName); + +OSErr findNetscapeUserProfileDatabase( FSSpecPtr theFSSpecPtr ); +OSErr findCurrentUserProfileID( short refNum, short *profileID ); +Handle pathFromFSSpec( FSSpecPtr theFSSpecPtr ); + +#ifdef __cplusplus +} +#endif diff --git a/mozilla/cmd/dialup/mac/muc/LMUCDialog.cp b/mozilla/cmd/dialup/mac/muc/LMUCDialog.cp new file mode 100644 index 00000000000..170869aef67 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LMUCDialog.cp @@ -0,0 +1,371 @@ +/* -*- 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 "LMUCDialog.h" +#include "ListUtils.h" +#include +#include + +extern "C" { +#include "ppp.interface.h" +} + +// ¥ÊLSingleClickListBox +void* LSingleClickListBox::CreateSingleClickListBox( LStream* inStream ) +{ + return ( new LSingleClickListBox( inStream ) ); +} + +LSingleClickListBox::LSingleClickListBox( LStream* inStream ): LListBox( inStream ) +{ + mSingleClickMessage = msg_Nothing; +} + + +void LSingleClickListBox::ClickSelf( const SMouseDownEvent& inMouseDown ) +{ + if ( SwitchTarget( this ) ) + { + FocusDraw(this); + short modifiers = inMouseDown.macEvent.modifiers & ~(shiftKey | cmdKey ); + if ( ::LClick( inMouseDown.whereLocal, modifiers, mMacListH ) ) + BroadcastMessage( mDoubleClickMessage, this ); + else + BroadcastMessage( mSingleClickMessage, this ); + } +} + +Boolean LSingleClickListBox::HandleKeyPress( const EventRecord& inKeyEvent ) +{ + if ( LListBox::HandleKeyPress( inKeyEvent ) ) + { + BroadcastMessage( mSingleClickMessage, this ); + return true; + } + else + return false; +} + +void LSingleClickListBox::SetSingleClickMessage( MessageT inMessage ) +{ + mSingleClickMessage = inMessage; +} + +// ¥ÊLPPPListBox +void* LPPPListBox::CreatePPPListBox( LStream* inStream ) +{ + return new LPPPListBox( inStream ); +} + +LPPPListBox::LPPPListBox( LStream* inStream ): LSingleClickListBox( inStream ) +{ + mFunction = NULL; +} + +void LPPPListBox::SetPPPFunction( TraversePPPListFunc p ) +{ + mFunction = p; +} + +void LPPPListBox::UpdateList() +{ + if ( mFunction ) + { + ListHandle listH; + listH = this->GetMacListH(); + + OSErr err; + Str255* list; + int number; + + err = ( *mFunction )( &list ); + number = ::GetPtrSize( (Ptr)list ) / sizeof ( Str255 ); + SynchronizeRowsTo( listH, number ); + SynchronizeColumnsTo( listH, 1 ); + + Cell cell; + cell.h = 0; + for ( cell.v = 0; cell.v < number; cell.v++ ) + { + LStr255 text; + text = *list; + ::LSetCell( (Ptr)&text[ 1 ], text.Length(), cell, listH ); + list++; + } + if ( list ) + DisposePtr( (Ptr)list ); + // ¥ deselect all cells + this->SetValue( -1 ); + } +} + +void LPPPListBox::SetToNamedItem( LStr255& name ) +{ + Cell searchAt; + ListHandle listH; + + searchAt.v = searchAt.h = 0; + listH = this->GetMacListH(); + + if ( ::LSearch( (Ptr)&name[ 1 ], name.Length(), NULL, &searchAt, listH ) ) + this->SetValue( searchAt.v ); +} + +Boolean LPPPListBox::FocusDraw( LPane* pane ) +{ + const RGBColor rgbWhite = { 0xFFFF, 0xFFFF, 0xFFFF }; + const RGBColor rgbBlack = { 0x0000, 0x0000, 0x0000 }; + const RGBColor rgbGray = { 0xBBBB, 0xBBBB, 0xBBBB }; + + if ( LSingleClickListBox::FocusDraw( pane ) ) + { + ::RGBBackColor( &rgbWhite ); + ::RGBForeColor( &rgbBlack ); + if ( !this->IsEnabled() ) + ::RGBForeColor( &rgbGray ); + +// if ( this->IsEnabled() ) +// ::TextMode( srcCopy ); +// else +// ::TextMode( grayishTextOr ); + + return true; + } + return false; +} + + +void LPPPListBox::DrawSelf() +{ + Rect frame; + + this->CalcLocalFrameRect( frame ); + ::EraseRect( &frame ); + LSingleClickListBox::DrawSelf(); +} + +void LPPPListBox::EnableSelf() +{ + LSingleClickListBox::EnableSelf(); +// ::LSetDrawingMode( true, mMacListH ); + ::LActivate( true, mMacListH ); + this->Refresh(); + this->UpdatePort(); +// if ( FocusDraw() ) +// this->DrawSelf(); +} + +void LPPPListBox::DisableSelf() +{ + LSingleClickListBox::DisableSelf(); + ::LActivate( false, mMacListH ); +// ::LSetDrawingMode( false, mMacListH ); + this->Refresh(); + this->UpdatePort(); +// if ( FocusDraw() ) +// this->DrawSelf(); +} + +// ¥ÊLMUCDialog +void* LMUCDialog::CreateMUCDialogStream( LStream* inStream ) +{ + return new LMUCDialog( inStream ); +} + +LMUCDialog::LMUCDialog( LStream* inStream ): LGADialogBox( inStream ) +{ +} + +void LMUCDialog::SetPPPFunction( TraversePPPListFunc p ) +{ + if ( mListBox ) + mListBox->SetPPPFunction( p ); +} + +void LMUCDialog::GetNewValue( LStr255& str ) +{ + if ( mListBox ) + mListBox->GetDescriptor( str ); +} + +void LMUCDialog::UpdateList() +{ + if ( mListBox ) + { + mListBox->UpdateList(); + this->UpdateButtonState(); + } +} + +void LMUCDialog::UpdateButtonState() +{ + LButton* okButton; + okButton = (LButton*)this->FindPaneByID( mDefaultButtonID ); + if ( !okButton || !mListBox ) + return; + + if ( mListBox->GetValue() != -1 ) + { + if ( !okButton->IsEnabled() ) + okButton->Enable(); + } + else + { + if ( okButton->IsEnabled() ) + okButton->Disable(); + } +} + +void LMUCDialog::ListenToMessage( MessageT inMessage, void* ioParam ) +{ + LGADialogBox::ListenToMessage( inMessage, ioParam ); + + if ( inMessage == msg_SingleClick ) + this->UpdateButtonState(); +} + +void LMUCDialog::FinishCreateSelf() +{ + LGADialogBox::FinishCreateSelf(); + + mListBox = (LPPPListBox*)this->FindPaneByID( 'lstB' ); + + mListBox->AddListener( this ); + mListBox->SetSingleClickMessage( msg_SingleClick ); + + this->UpdateList(); +} + + + +void* LMUCEditDialog::CreateMUCEditDialogStream( LStream* inStream ) +{ + return new LMUCEditDialog( inStream ); +} + +LMUCEditDialog::LMUCEditDialog( LStream* inStream ): LGADialogBox( inStream ) +{ + mModemsList = NULL; + mAccountsList = NULL; + mLocationsList = NULL; + mDisabled = NULL; +} + +void LMUCEditDialog::UpdateLists() +{ + if ( mAccountsList ) + mAccountsList->UpdateList(); + if ( mModemsList ) + mModemsList->UpdateList(); + if ( mLocationsList ) + mLocationsList->UpdateList(); + this->UpdateButtonState(); +} + +void LMUCEditDialog::GetNewValues( LStr255& modem, LStr255& account, LStr255& location ) +{ + if ( mDisabled && mDisabled->GetValue() ) + { + modem = account = location = ""; + } + else + { + if ( mAccountsList ) + mAccountsList->GetNameValue( account ); + if ( mModemsList ) + mModemsList->GetNameValue( modem ); + if ( mLocationsList ) + mLocationsList->GetNameValue( location ); + } +} + +void LMUCEditDialog::SetInitialValue( const LStr255& modem, const LStr255& account, const LStr255& location ) +{ + if ( mAccountsList ) + mAccountsList->SetToNamedItem( account ); + if ( mModemsList ) + mModemsList->SetToNamedItem( modem ); + if ( mLocationsList ) + mLocationsList->SetToNamedItem( location ); + + LStr255 emptyString( "" ); + if ( modem == emptyString || account == emptyString || location == emptyString ) + mDisabled->SetValue( 1 ); + else + mDisabled->SetValue( 0 ); +} + +void LMUCEditDialog::UpdateButtonState() +{ + LButton* okButton; + okButton = (LButton*)this->FindPaneByID( mDefaultButtonID ); + if ( !okButton ) + return; + + if ( mDisabled && mDisabled->GetValue() ) + { + mModemsList->Disable(); + mAccountsList->Disable(); + mLocationsList->Disable(); + okButton->Enable(); + return; + } + else if ( mDisabled && !mDisabled->GetValue() ) + { + mModemsList->Enable(); + mAccountsList->Enable(); + mLocationsList->Enable(); + } + if ( mModemsList->GetValue() != -1 && + mAccountsList->GetValue() != -1 && + mLocationsList->GetValue() != -1 ) + okButton->Enable(); + else + okButton->Disable(); +} + +void LMUCEditDialog::ListenToMessage( MessageT inMessage, void* ioParam ) +{ + LGADialogBox::ListenToMessage( inMessage, ioParam ); + + if ( inMessage == msg_SingleClick || inMessage == 9181 ) + this->UpdateButtonState(); +} + +void LMUCEditDialog::FinishCreateSelf() +{ + LGADialogBox::FinishCreateSelf(); + + mAccountsList = (LPPPPopup*)this->FindPaneByID( 'popA' ); + mAccountsList->AddListener( this ); + //mAccountsList->SetSingleClickMessage( msg_SingleClick ); + mAccountsList->SetPPPFunction( GetAccountsList ); + + mModemsList = (LPPPPopup*)this->FindPaneByID( 'popM' ); + mModemsList->AddListener( this ); + //mModemsList->SetSingleClickMessage( msg_SingleClick ); + mModemsList->SetPPPFunction( GetModemsList ); + + mLocationsList = (LPPPPopup*)this->FindPaneByID( 'popL' ); + mLocationsList->AddListener( this ); + //mLocationsList->SetSingleClickMessage( msg_SingleClick ); + mLocationsList->SetPPPFunction( GetLocationsList ); + + mDisabled = (LControl*)this->FindPaneByID( 'disC' ); + mDisabled->AddListener( this ); +} diff --git a/mozilla/cmd/dialup/mac/muc/LMUCDialog.h b/mozilla/cmd/dialup/mac/muc/LMUCDialog.h new file mode 100644 index 00000000000..7b06165ce46 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LMUCDialog.h @@ -0,0 +1,116 @@ +/* -*- 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. + */ + +#pragma once +#include +#include + +#include +#include "MUC.h" +#include "LPPPPopup.h" + +#define msg_SingleClick 424 + +class LSingleClickListBox: public LListBox +{ +public: + enum { class_ID = 'Lsng' }; + + static void* CreateSingleClickListBox( LStream* inStream ); + LSingleClickListBox( LStream* inStream ); + + void ClickSelf( const SMouseDownEvent& inMouseDown ); + Boolean HandleKeyPress( const EventRecord& inKeyEvent ); + + void SetSingleClickMessage( MessageT inMessage ); +protected: + MessageT mSingleClickMessage; +}; + +class LPPPListBox: public LSingleClickListBox +{ +public: + enum { class_ID = 'LPPP' }; + + static void* CreatePPPListBox( LStream* inStream ); + LPPPListBox( LStream* inStream ); + + void SetPPPFunction( TraversePPPListFunc p ); + void UpdateList(); + + void SetToNamedItem( LStr255& name ); + + virtual Boolean FocusDraw( LPane* ); + virtual void DrawSelf(); + virtual void EnableSelf(); + virtual void DisableSelf(); + +protected: + TraversePPPListFunc mFunction; +}; + +class LMUCDialog: public LGADialogBox +{ +public: + enum { class_ID = 'Mccd' }; + + static void* CreateMUCDialogStream( LStream* inStream ); + LMUCDialog( LStream* inStream ); + + void SetPPPFunction( TraversePPPListFunc p ); + + void GetNewValue( LStr255& name ); + void UpdateList(); + void UpdateButtonState(); + + virtual void ListenToMessage( MessageT inMessage, void* ioParam ); + +protected: + virtual void FinishCreateSelf(); + LPPPListBox* mListBox; +}; + +class LMUCEditDialog: public LGADialogBox +{ +public: + enum { class_ID = 'Mcce' }; + + static void* CreateMUCEditDialogStream( LStream* inStream ); + LMUCEditDialog( LStream* inStream ); + + void GetNewValues( LStr255& outModemName, + LStr255& outAccountName, + LStr255& outLocationName ); + + void SetInitialValue( const LStr255& modem, + const LStr255& account, + const LStr255& location ); + + void UpdateLists(); + void UpdateButtonState(); + + virtual void ListenToMessage( MessageT inMessage, void* ioParam ); + +protected: + virtual void FinishCreateSelf(); + + LControl* mDisabled; + LPPPPopup* mModemsList; + LPPPPopup* mLocationsList; + LPPPPopup* mAccountsList; +}; diff --git a/mozilla/cmd/dialup/mac/muc/LMUCHandler.cp b/mozilla/cmd/dialup/mac/muc/LMUCHandler.cp new file mode 100644 index 00000000000..03b60a4c291 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LMUCHandler.cp @@ -0,0 +1,638 @@ +/* -*- 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 "LMUCHandler.h" +#include "LMUCDialog.h" +#include +#include +#include +#include +#include +#include +#include +#include "muc.h" +//#include "profile.h" +#include "ListUtils.h" + +extern "C" { +#include "ppp.interface.h" +} + + +#define MODEM_SECTION "[Modem]" +#define MODEM_KEY "Modem" +#define ACCOUNT_SECTION "[Account]" +#define ACCOUNT_KEY "Account" +#define LOCATION_SECTION "[Location]" +#define LOCATION_KEY "Location" + +const MessageT msg_RunAccountSetup = 1025; +const MessageT cmd_AdvancedSettings = 4009; + +const LStr255 kEmptyString( "" ); + +LMUCHandler::LMUCHandler(): LListener() +{ + mIniFile = NULL; + mDirty = false; + + mAutoConfigCheck = NULL; + mConfigSettings = NULL; + mAdvancedButton = NULL; + mConfigHelp = NULL; + mLocationPopup = NULL; + mAccountName = NULL; + mModemName = NULL; + mShowingHelp = false; +} + +LMUCHandler::~LMUCHandler() +{ +} + +void LMUCHandler::GetDefaultConfiguration() +{ + GetCurrentAccountName( &mConfiguration.mAccountName ); + GetCurrentModemName( &mConfiguration.mModemName ); + GetCurrentLocationName( &mConfiguration.mLocationName ); +} + +void LMUCHandler::ClearConfiguration() +{ + mConfiguration.mAccountName[ 0 ] = 0; + mConfiguration.mModemName[ 0 ] = 0; + mConfiguration.mLocationName[ 0 ] = 0; +} + +// ¥ makes sure all the settings read from the configuration exist inside PPP, +// displays alerts for those that don't and resets them +void LMUCHandler::SetCurrentConfiguration() +{ + LStr255 temp; + temp = mConfiguration.mModemName; + this->SetupEntry( temp, GetModemsList, 130 ); + LString::CopyPStr( temp, mConfiguration.mModemName ); + + temp = mConfiguration.mAccountName; + this->SetupEntry( temp, GetAccountsList, 129 ); + LString::CopyPStr( temp, mConfiguration.mAccountName ); + + temp = mConfiguration.mLocationName; + this->SetupEntry( temp, GetLocationsList, 131 ); + LString::CopyPStr( temp, mConfiguration.mLocationName ); +} + +// ¥Êdisplays the edit dialog and allows editing of the settings +ExceptionCode LMUCHandler::EditProfile( FSSpec* profileParSpec ) +{ + MessageT ret; + + Try_ + { + FSSpec profile; + this->GetDialConfigurationFile( *profileParSpec, profile ); + + if ( mIniFile ) + delete mIniFile; + + mIniFile = new LWinIniFile; + mIniFile->SetSpecifier( profile ); + LString::CopyPStr( profile.name, mConfiguration.mProfileName ); + + StDialogHandler handler( 133, NULL ); + LMUCEditDialog* dlog = (LMUCEditDialog*)handler.GetDialog(); + + dlog->UpdateLists(); + Try_ + { + this->ReadConfiguration(); + } + Catch_( inErr ) + { + // ¥Êif we get an fnfErr, it means we don't have an configuration + // file and we should create one + if ( inErr == fnfErr ) + { + mIniFile->CreateNewDataFile( 'MOSS', 'TEXT', smSystemScript ); + this->GetDefaultConfiguration(); + } + } + EndCatch_ + + dlog->SetInitialValue( mConfiguration.mModemName, mConfiguration.mAccountName, mConfiguration.mLocationName ); +top: + ret = handler.DoDialog(); + switch ( ret ) + { + case msg_OK: + { + LStr255 modemName; + LStr255 accountName; + LStr255 locationName; + dlog->GetNewValues( modemName, accountName, locationName ); + LString::CopyPStr( modemName, mConfiguration.mModemName ); + LString::CopyPStr( accountName, mConfiguration.mAccountName ); + LString::CopyPStr( locationName, mConfiguration.mLocationName ); + this->WriteConfiguration(); + return noErr; + } + break; + + case msg_Cancel: + return errUserCancelledLaunch; + break; + + case msg_RunAccountSetup: + return errNeedToRunAccountSetup; + break; + + default: + goto top; + } + } + Catch_( inErr ) + { + return inErr; + } + EndCatch_ + + return noErr; +} + +// ¥ this happens when the user clicks "ok" from the profile selector +ExceptionCode LMUCHandler::SelectProfile( FSSpec* profileParSpec, Boolean autoSelect ) +{ + Try_ + { + FSSpec profile; + + if ( !autoSelect && mAutoConfigCheck && mAutoConfigCheck->GetValue() ) + return noErr; + + this->GetDialConfigurationFile( *profileParSpec, profile ); + + ThrowIfNot_( this->ConnectionExists() == noErr ); + + if ( mIniFile ) + delete mIniFile; + + mIniFile = new LWinIniFile; + mIniFile->SetSpecifier( profile ); + LString::CopyPStr( profile.name, mConfiguration.mProfileName ); + + this->ReadConfiguration(); + + if ( !autoSelect && mLocationPopup ) + mLocationPopup->GetCurrentItemTitle( mConfiguration.mLocationName ); + + this->SetCurrentConfiguration(); + if ( mConfiguration.mAccountName != kEmptyString ) + this->UpdateConfiguration(); + + if ( mDirty ) + this->WriteConfiguration(); + } + Catch_( inErr ) + { + switch ( inErr ) + { + case errProfileNotFound: + case errNeedToRunAccountSetup: + case errCannotSwitchDialSettings: + case errUserCancelledLaunch: + return inErr; + case fnfErr: + { + mIniFile->CreateNewDataFile( 'MOSS', 'TEXT', smSystemScript ); + this->GetDefaultConfiguration(); + this->WriteConfiguration(); + } + default: + return errProfileNotFound; + } + } + EndCatch_ + + return noErr; +} + +// ¥Êread the configuration in "profileParSpec" into a configuration struct +ExceptionCode LMUCHandler::GetProfile( const FSSpec* profileParSpec, FreePPPInfo* buffer ) +{ + Try_ + { + FSSpec profile; + this->GetDialConfigurationFile( *profileParSpec, profile ); + + if ( mIniFile ) + delete mIniFile; + + mIniFile = new LWinIniFile; + mIniFile->SetSpecifier( profile ); + + this->ReadConfiguration(); + *buffer = mConfiguration; + } + Catch_( inErr ) + { + } + EndCatch_ + return noErr; +} + +ExceptionCode LMUCHandler::SetProfile( const FSSpec* /*profileParSpec*/, const FreePPPInfo* /*buffer*/) +{ +/* + Try_ + { + FSSpec profile; + this->GetDialConfigurationFile( *profileParSpec, profile ); + + if ( mIniFile ) + delete mIniFile; + + mIniFile = new LWinIniFile; + mIniFile->SetSpecifier( profile ); + + this->ReadConfiguration(); + mConfiguration = *buffer; + this->WriteConfiguration(); + } + Catch_( inErr ) + { + } + EndCatch_ + return noErr; +*/ +} + +// ¥ configure's PPP +void LMUCHandler::UpdateConfiguration() +{ + Str255 current; + + // ¥ go set the PPP prefs + GetCurrentAccountName( ¤t ); + if ( !::IdenticalString( current, mConfiguration.mAccountName, NULL ) ) + SetCurrentAccountName( &mConfiguration.mAccountName ); + + GetCurrentModemName( ¤t ); + if ( !::IdenticalString( current, mConfiguration.mModemName, NULL ) ) + SetCurrentModemName( &mConfiguration.mModemName ); + + GetCurrentLocationName( ¤t ); + if ( !::IdenticalString( current, mConfiguration.mLocationName, NULL ) ) + SetCurrentLocationName( &mConfiguration.mLocationName ); +} + + +ExceptionCode LMUCHandler::HandleDialog( TraversePPPListFunc inFunc, ResIDT inDlogID, + LStr255& outListItemPicked ) +{ + MessageT ret; + StDialogHandler handler( inDlogID, NULL ); + LMUCDialog* dlog = (LMUCDialog*)handler.GetDialog(); + + dlog->SetPPPFunction( inFunc ); + dlog->UpdateList(); + +top: + ret = handler.DoDialog(); + switch ( ret ) + { + case msg_OK: + dlog->GetNewValue( outListItemPicked ); + return noErr; + break; + + case msg_Cancel: + return errUserCancelledLaunch; + break; + + case msg_RunAccountSetup: + return errNeedToRunAccountSetup; + break; + + default: + goto top; + } + return noErr; +} + +// ¥Êreads the settings from the configuration file +void LMUCHandler::ReadConfiguration() +{ + this->ClearConfiguration(); + + ThrowIfNot_( mIniFile ); + + // ¥ÊOpenDataFile will throw if the file isn't foundÉ + mIniFile->OpenDataFork( fsRdPerm ); + + LStr255 temp; + + this->GetEntry( temp, ACCOUNT_SECTION, ACCOUNT_KEY ); + LString::CopyPStr( temp, mConfiguration.mAccountName ); + this->GetEntry( temp, MODEM_SECTION, MODEM_KEY ); + LString::CopyPStr( temp, mConfiguration.mModemName ); + this->GetEntry( temp, LOCATION_SECTION, LOCATION_KEY ); + LString::CopyPStr( temp, mConfiguration.mLocationName ); + mIniFile->CloseDataFork(); +} + +ExceptionCode LMUCHandler::WriteConfiguration() +{ + if ( !mIniFile ) + return -1; + + Try_ + { + mIniFile->CloseDataFork(); + } + Catch_( inErr ) + { + // ¥ don't need to do anything + } + + Try_ + { + mIniFile->OpenDataFork( fsWrPerm ); + mIniFile->SetLength( 0 ); + + *mIniFile << ACCOUNT_SECTION"\r" << ACCOUNT_KEY << "=" << (StringPtr)mConfiguration.mAccountName << "\r"; + *mIniFile << MODEM_SECTION << "\r" << MODEM_KEY << "=" << (StringPtr)mConfiguration.mModemName << "\r"; + *mIniFile << LOCATION_SECTION << "\r" << LOCATION_KEY << "=" << (StringPtr)mConfiguration.mLocationName << "\r"; + + mIniFile->CloseDataFork(); + mDirty = false; + } + Catch_( inErr ) + { + mIniFile->CloseDataFork(); + return errCannotSwitchDialSettings; + } + return noErr; +} + +// ¥Êcall this when you want to get the value for an entry out of the configuration file +ExceptionCode LMUCHandler::GetEntry( LStr255& outValue, const LStr255& inSectionName, const LStr255& inKeyName ) +{ + ExceptionCode err; + + ThrowIfNot_( mIniFile && ( mIniFile->GetDataForkRefNum() != refNum_Undefined ) ); + err = mIniFile->FindSection( inSectionName ); + if ( err != noErr ) + return err; + err = mIniFile->GetValueForName( inKeyName, outValue ); + return err; +} + +// ¥Êcall this when you want to make sure an entry exists inside PPP +ExceptionCode LMUCHandler::SetupEntry( LStr255& inOutEntry, TraversePPPListFunc inFunc, + ResIDT inDlogID ) +{ + if ( inOutEntry == kEmptyString ) + { + mDirty = true; + return noErr; + } + + if ( this->FindName( inFunc, inOutEntry ) != noErr ) + { + // ¥ the user's Config file specifies a configuration entry that + // doesn't existÉÊtry to update it by showing the existing + // entries and let them pick one + OSErr err; + LStr255 newString; + + err = this->HandleDialog( inFunc, inDlogID, newString ); + // ¥ err can be: noErr, errUserCancelled, errNeedToRunAS + if ( err != noErr ) + Throw_( err ); + + inOutEntry = newString; + mDirty = true; + } + return noErr; +} + +ExceptionCode LMUCHandler::ConnectionExists() +{ + if ( IsFreePPPOpen() ) + { + // ¥Êalert the user + LStr255 name; + LCaption* caption; + + MessageT ret; + StDialogHandler handler( 132, NULL ); + LDialogBox* dlog = (LDialogBox*)handler.GetDialog(); + + GetCurrentAccountName( (Str255*)&name ); + caption = (LCaption*)dlog->FindPaneByID( 'anam' ); + if ( caption ) + caption->SetDescriptor( name ); + GetCurrentModemName( (Str255*)&name ); + caption = (LCaption*)dlog->FindPaneByID( 'mnam' ); + if ( caption ) + caption->SetDescriptor( name ); + GetCurrentLocationName( (Str255*)&name ); + caption = (LCaption*)dlog->FindPaneByID( 'lnam' ); + if ( caption ) + caption->SetDescriptor( name ); + + do + { + ret = handler.DoDialog(); + if ( ret == msg_OK ) + return noErr; + else if ( ret == msg_Cancel ) + return errCannotSwitchDialSettings; + } + while ( 1 ); + } + return noErr; +} + + +ExceptionCode LMUCHandler::FindName( TraversePPPListFunc p, const LStr255& value ) +{ + Str255* list; + int number; + OSErr err; + + err = (*p)( &list ); + number = ::GetPtrSize( (Ptr)list ) / sizeof ( Str255 ); + + LStr255 name; + for ( int i = 0; i < number; i++ ) + { + name = *list; + if ( name == value ) + return noErr; + list++; + } + if ( list ) + DisposePtr( (Ptr)list ); + return -1; +} + + + +void LMUCHandler::InitDialog( LDialogBox* dialog ) +{ + Rect wFrame; + SDimension16 helpFrameSize; + SPoint32 helpFrameLoc; + + LView::SetDefaultView( dialog ); + UReanimator::ReadObjects( 'PPob', 135 ); + mConfigHelp = (LView*)dialog->FindPaneByID( 'Hcfg' ); + mConfigHelp->Enable(); + mConfigHelp->FinishCreate(); + + mAutoConfigCheck = (LStdCheckBox*)dialog->FindPaneByID( 'Cnet' ); + mAutoConfigCheck->AddListener( this ); + mAdvancedButton = (LControl*)dialog->FindPaneByID( 'Abut' ); + mAdvancedButton->AddListener( this ); + mLocationPopup = (LPPPPopup*)dialog->FindPaneByID( 'Ploc' ); + mLocationPopup->SetPPPFunction( GetLocationsList ); + mLocationPopup->UpdateList(); + + mAccountName = (LCaption*)dialog->FindPaneByID( 'Anam' ); + mModemName = (LCaption*)dialog->FindPaneByID( 'Mnam' ); + + mConfigHelp->GetFrameSize( helpFrameSize ); + mConfigHelp->GetFrameLocation( helpFrameLoc ); + dialog->CalcPortFrameRect( wFrame ); + mSizeToGrow = helpFrameSize.height - ( wFrame.bottom - helpFrameLoc.v ); +} + +void LMUCHandler::PrettyPrint( short resNum, const LStr255& string, LStr255& buffer ) +{ + LStr255 tmp; + + ::GetIndString( tmp, kMUCStrings, resNum ); + buffer += tmp; + buffer += string; + buffer += LStr255( "\r" ); +} + +ExceptionCode LMUCHandler::ProfileSelectionChanged( const FSSpec* profileSpec ) +{ + FreePPPInfo pppInfo; + LStr255 accDesc; + LStr255 modemDesc; + + if ( mAccountName && mModemName ) + { + if ( profileSpec && this->GetProfile( profileSpec, &pppInfo ) == noErr ) + { + PrettyPrint( kAccountString, pppInfo.mAccountName, accDesc ); + PrettyPrint( kModemString, pppInfo.mModemName, modemDesc ); + } + mAccountName->SetDescriptor( accDesc ); + mModemName->SetDescriptor( modemDesc ); + } + + if ( mLocationPopup ) + { + if ( !profileSpec || !mLocationPopup->SetToNamedItem( pppInfo.mLocationName ) ) + { + // ¥Êswitch to the default + + Str255 tmp; + GetCurrentLocationName( &tmp ); + mLocationPopup->SetToNamedItem( (LStr255)tmp ); + } + } + + + return noErr; +} + +void LMUCHandler::ListenToMessage( MessageT inMessage, void* /*ioParam*/ ) +{ + switch ( inMessage ) + { + case cmd_AdvancedSettings: + { + LWindow* window; + Rect wFrame; + + // ¥Êmake the window bigger + window = LWindow::FetchWindowObject( mAdvancedButton->GetMacPort() ); + if ( !window ) + return; + + window->CalcPortFrameRect( wFrame ); + window->PortToGlobalPoint( topLeft( wFrame ) ); + window->PortToGlobalPoint( botRight( wFrame ) ); + wFrame.bottom += mShowingHelp ? -mSizeToGrow : mSizeToGrow; + window->DoSetBounds( wFrame ); + mShowingHelp = !mShowingHelp; + } + break; + } +} + +void LMUCHandler::GetDialConfigurationFile( const FSSpec& inPrefsFolder, FSSpec& configFile ) +{ + CInfoPBRec pb; + + // ¥ this is the "Configuration" fileÉÊit sits inside the user's + // directory with his "Mail", "News", and other folders + configFile.vRefNum = inPrefsFolder.vRefNum; + + pb.hFileInfo.ioNamePtr = inPrefsFolder.name; + pb.hFileInfo.ioVRefNum = inPrefsFolder.vRefNum; + pb.hFileInfo.ioDirID = inPrefsFolder.parID; + pb.hFileInfo.ioFDirIndex = 0; + OSErr err = PBGetCatInfoSync( &pb ); + if ( err == noErr ) + configFile.parID = pb.dirInfo.ioDrDirID; + else + return; + + ::GetIndString( configFile.name, kMUCStrings, kConfigurationFileName ); +} + +void LMUCHandler::RegisterClasses() +{ + URegistrar::RegisterClass( + LMUCDialog::class_ID, + (ClassCreatorFunc)LMUCDialog::CreateMUCDialogStream ); + + URegistrar::RegisterClass( + LSingleClickListBox::class_ID, + (ClassCreatorFunc)LSingleClickListBox::CreateSingleClickListBox ); + + URegistrar::RegisterClass( + LPPPListBox::class_ID, + (ClassCreatorFunc)LPPPListBox::CreatePPPListBox ); + + URegistrar::RegisterClass( + LMUCEditDialog::class_ID, + (ClassCreatorFunc)LMUCEditDialog::CreateMUCEditDialogStream ); + + URegistrar::RegisterClass( + LPPPPopup::class_ID, + (ClassCreatorFunc)LPPPPopup::CreatePPPPopup ); +} + + diff --git a/mozilla/cmd/dialup/mac/muc/LMUCHandler.h b/mozilla/cmd/dialup/mac/muc/LMUCHandler.h new file mode 100644 index 00000000000..6471c8f7050 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LMUCHandler.h @@ -0,0 +1,89 @@ +/* -*- 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. + */ + +#pragma once +#include +#include +#include "LWinIniFile.h" +#include "MUC.h" +#include "LPPPPopup.h" + +typedef OSErr (*TraversePPPListFunc)( Str255** list ); + +class LMUCHandler: public LListener +{ +public: + LMUCHandler(); + virtual ~LMUCHandler(); + + ExceptionCode EditProfile( FSSpec* profileName ); + ExceptionCode SelectProfile( FSSpec* profileName, Boolean autoSelect ); + ExceptionCode GetProfile( const FSSpec* profileName, FreePPPInfo* buffer ); + ExceptionCode SetProfile( const FSSpec* profileName, const FreePPPInfo* buffer ); + ExceptionCode ProfileSelectionChanged( const FSSpec* profileSpec ); + + void RegisterClasses(); + + void InitDialog( LDialogBox* dialog ); + + virtual void ListenToMessage( MessageT inMessage, void* ioParam ); +protected: + enum { kMUCStrings = 901 }; + enum { kConfigurationFileName = 1, + kAccountString, + kModemString }; + + ExceptionCode ConnectionExists(); + ExceptionCode FindName( TraversePPPListFunc p, const LStr255& value ); + + void ReadConfiguration(); + ExceptionCode WriteConfiguration(); + + ExceptionCode HandleDialog( TraversePPPListFunc inFunc, + ResIDT inDlogID, + LStr255& outListItemPicked ); + + ExceptionCode GetEntry( LStr255& outValue, const LStr255& inSectionName, + const LStr255& inKeyName ); + ExceptionCode SetupEntry( LStr255& inOutEntry, + TraversePPPListFunc inFunc, + ResIDT inDlogID ); + + void GetDefaultConfiguration(); + void ClearConfiguration(); + void SetCurrentConfiguration(); + void UpdateConfiguration(); + + void GetDialConfigurationFile( const FSSpec& inPrefsFolder, FSSpec& configFile ); + void PrettyPrint( short resNum, const LStr255& string, LStr255& buffer ); + + FreePPPInfo mConfiguration; + Boolean mDirty; + LWinIniFile* mIniFile; + + LStdCheckBox* mAutoConfigCheck; + LCaption* mConfigSettings; + LControl* mAdvancedButton; + LView* mConfigHelp; + LPPPPopup* mLocationPopup; + LCaption* mAccountName; + LCaption* mModemName; + Int32 mSizeToGrow; + + Boolean mShowingHelp; +}; diff --git a/mozilla/cmd/dialup/mac/muc/LPPPPopup.cp b/mozilla/cmd/dialup/mac/muc/LPPPPopup.cp new file mode 100644 index 00000000000..aeb8752f767 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LPPPPopup.cp @@ -0,0 +1,77 @@ +/* -*- 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 "LPPPPopup.h" +#include "ListUtils.h" + +// ¥ LPPPPopup +void* LPPPPopup::CreatePPPPopup( LStream* inStream ) +{ + return new LPPPPopup( inStream ); +} + +LPPPPopup::LPPPPopup( LStream* inStream ): LGAPopup( inStream ) +{ + mFunction = NULL; +} + +void LPPPPopup::SetPPPFunction( TraversePPPListFunc p ) +{ + mFunction = p; +} + +void LPPPPopup::UpdateList() +{ + if ( mFunction ) + { + MenuHandle menuH; + menuH = this->GetMacMenuH(); + + OSErr err; + Str255* list; + int number; + + err = ( *mFunction )( &list ); + number = ::GetPtrSize( (Ptr)list ) / sizeof ( Str255 ); + SetMenuSize( this, number ); + + for ( short i = 1; i <= number; i++ ) + { + LStr255 text; + text = *list; + ::SetMenuItemText( menuH, i, text ); + list++; + } + if ( list ) + DisposePtr( (Ptr)list ); + } +} + +void LPPPPopup::GetNameValue( LStr255& value ) +{ + MenuHandle menuH; + menuH = this->GetMacMenuH(); + + ::GetMenuItemText( menuH, this->GetValue(), value ); +} + +Boolean LPPPPopup::SetToNamedItem( const LStr255& name ) +{ + return SetPopupToNamedItem( this, name ); +} + diff --git a/mozilla/cmd/dialup/mac/muc/LPPPPopup.h b/mozilla/cmd/dialup/mac/muc/LPPPPopup.h new file mode 100644 index 00000000000..ad30651a55c --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LPPPPopup.h @@ -0,0 +1,39 @@ +/* -*- 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. + */ + +#pragma once +#include "MUC.h" +#include + +class LPPPPopup: public LGAPopup +{ +public: + enum { class_ID = 'PPPP' }; + + static void* CreatePPPPopup( LStream* inStream ); + LPPPPopup( LStream* inStream ); + + void SetPPPFunction( TraversePPPListFunc p ); + void UpdateList(); + + Boolean SetToNamedItem( const LStr255& name ); + void GetNameValue( LStr255& value ); +protected: + TraversePPPListFunc mFunction; +}; + diff --git a/mozilla/cmd/dialup/mac/muc/LTextFile.cp b/mozilla/cmd/dialup/mac/muc/LTextFile.cp new file mode 100644 index 00000000000..22a5390af81 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LTextFile.cp @@ -0,0 +1,62 @@ +/* -*- 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 "LTextFile.h" + +LTextFile::LTextFile( const FSSpec& inFileSpec ): + LFileStream( inFileSpec ) +{ +} + +LTextFile::LTextFile(): LFileStream() +{ +} + +ExceptionCode LTextFile::ReadLine( unsigned char* outBuffer, Int32& inOutByteCount, + unsigned char inDelimiter ) +{ + ParamBlockRec pb; + ExceptionCode err; + Int32 inCount; + + // ¥Êset up the pb + inCount = inOutByteCount; + pb.ioParam.ioRefNum = this->GetDataForkRefNum(); + pb.ioParam.ioBuffer = (Ptr)outBuffer; + pb.ioParam.ioReqCount = inCount; + + // ¥Êcr in high byte, bit 7 = newLine mode + pb.ioParam.ioPosMode = ( inDelimiter << 8 ) | (0x80 | fsAtMark); + pb.ioParam.ioPosOffset = 0; + err = PBReadSync( &pb ); + if ( err != eofErr && err != noErr ) + return err; + + if ( err == eofErr && pb.ioParam.ioActCount == 0 ) + return eofErr; + + inOutByteCount = pb.ioParam.ioActCount; + + if ( inOutByteCount == inCount ) + return err_DelimiterNotRead; + if ( outBuffer[ inOutByteCount - 1 ] != inDelimiter ) + return err_NoEOL; + + return noErr; +} diff --git a/mozilla/cmd/dialup/mac/muc/LTextFile.h b/mozilla/cmd/dialup/mac/muc/LTextFile.h new file mode 100644 index 00000000000..5b53a75263a --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LTextFile.h @@ -0,0 +1,37 @@ +/* -*- 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. + */ + +#pragma once + +#include + + +const Int16 refNum_Undefined = -1; +enum { err_NotFound = 'notF', + err_DelimiterNotRead = 'notD', + err_NoEOL = 'notE', + err_NoValue = 'notV' }; + +class LTextFile: public LFileStream +{ +public: + LTextFile( const FSSpec& inFileSpec ); + LTextFile(); + virtual ExceptionCode ReadLine( unsigned char* outBuffer, Int32& inOutByteCount, + unsigned char inDelimiter = 0x0D /* CR */); +}; diff --git a/mozilla/cmd/dialup/mac/muc/LWinIniFile.cp b/mozilla/cmd/dialup/mac/muc/LWinIniFile.cp new file mode 100644 index 00000000000..daacac58225 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LWinIniFile.cp @@ -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. + */ + +#include "LWinIniFile.h" +#include "ctype.h" + +LWinIniFile::LWinIniFile( FSSpec& inFileSpec ): + LTextFile( inFileSpec ) +{ + mSectionPosition = 0; +} + +LWinIniFile::LWinIniFile(): LTextFile() +{ + mSectionPosition = 0; +} + +static void RemovePreceedingWhiteSpace( LStr255& string ) +{ + while ( string.Length() && isspace( string[ 1 ] ) ) + string.Remove( 1, 1 ); +} + +static void RemoveBracketDelimiters( LStr255& string ) +{ + // ¥ get rid of '[' + if ( string[ 1 ] == '[' ) + string.Remove( 1, 1 ); + + // ¥Êget rid of ']' + if ( string.EndsWith( ']' ) ) + string.Remove( string.Length(), 1 ); +} + +ExceptionCode LWinIniFile::FindSection( const LStr255& inSectionName ) +{ + if ( mDataForkRefNum == refNum_Undefined ) + this->OpenDataFork( fsRdPerm ); + + this->SetMarker( 0, streamFrom_Start ); + + LStr255 buffer; + LStr255 sectionName = inSectionName; + + while ( !this->AtEnd() ) + { + Int32 bytesToRead = 255; + ExceptionCode err; + + err = this->ReadLine( &buffer[ 1 ], bytesToRead ); + + if ( err != noErr && err != eofErr ) + return err; + + buffer[ 0 ] = bytesToRead - 1; + + if ( !bytesToRead || buffer[ 1 ] != '[' ) + continue; + + RemoveBracketDelimiters( buffer ); + RemoveBracketDelimiters( sectionName ); + if ( buffer.CompareTo( sectionName ) == 0 ) + { + mSectionPosition = this->GetMarker(); + return noErr; + } + } + + buffer[ 0 ] = 0; + mSectionPosition = 0; + return err_NotFound; +} + + +ExceptionCode LWinIniFile::GetNextNameValuePair( LStr255& pName, LStr255& pValue ) +{ + pValue[ 0 ] = 0; + + LStr255 pStr; + ExceptionCode err; + Int32 byteCount = 255; + + err = this->ReadLine( &pStr[ 1 ], byteCount ); + + if ( err != noErr ) + return err; + + pStr[ 0 ] = byteCount - 1; + + RemovePreceedingWhiteSpace( pStr ); + if ( pStr[ 0 ] == 0 ) + return err_NotFound; + + if ( pStr[ 1 ] == '[' ) + return err_NotFound; + + if ( pStr.Length() ) + { + long index = 1; + + while ( ( pStr[ index ] != '=' ) && + ( index <= pStr.Length() ) ) + index++; + + if ( index > pStr.Length() ) + return err_NotFound; + + while ( ( pStr[ index ] == '=' ) || + isspace( pStr[ index ] ) && + ( index > 1 ) ) + index--; + + long nameLen = index; + pName.Assign( pStr, 1, nameLen ); + + index++; + + while ( ( index <= pStr.Length() ) && + ( isspace( pStr[ index ] ) || + ( pStr[ index ] == '=' ) ) ) + index++; + + long valuePos = index; + long valueLen = pStr.Length() - valuePos + 1; + + while ( valueLen && isspace( pStr[ valuePos + valueLen - 1 ] ) ) + valueLen--; + + if ( valueLen <= 0 ) + return err_NoValue; + + pValue.Assign( pStr, valuePos, valueLen ); + } + return noErr; +} + +ExceptionCode LWinIniFile::GetValueForName( const LStr255& pName, LStr255& pValue ) +{ + LStr255 nextName; + LStr255 nextValue; + ExceptionCode err = noErr; + + pValue[ 0 ] = 0; + + if ( pName.Length() == 0 ) + return err_NotFound; + + this->SetMarker( mSectionPosition, streamFrom_Start ); + while ( err != eofErr ) + { + err = this->GetNextNameValuePair( nextName, nextValue ); + if ( err == noErr ) + { + if ( nextName == pName ) + { + if ( nextValue.Length() ) + { + unsigned short pos; + const LStr255 semiColon( ";" ); + pos = nextValue.Find( semiColon ); + if ( pos ) + nextValue.Remove( pos, nextValue.Length() - pos ); + pValue = nextValue; + } + return noErr; + } + } + } + return err_NotFound; +} + +Int16 LWinIniFile::OpenDataFork( Int16 inPermissions ) +{ + mSectionPosition = 0; + return LTextFile::OpenDataFork( inPermissions ); +} + +void LWinIniFile::CloseDataFork() +{ + mSectionPosition = 0; + LTextFile::CloseDataFork(); +} diff --git a/mozilla/cmd/dialup/mac/muc/LWinIniFile.h b/mozilla/cmd/dialup/mac/muc/LWinIniFile.h new file mode 100644 index 00000000000..88e55e1e169 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/LWinIniFile.h @@ -0,0 +1,39 @@ +/* -*- 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. + */ + +#pragma once + +#include "LTextFile.h" + +class LWinIniFile: public LTextFile +{ +public: + LWinIniFile( FSSpec& inFileSpec ); + LWinIniFile(); + + virtual ExceptionCode FindSection( const LStr255& inSectionName ); + virtual ExceptionCode GetValueForName( const LStr255& inName, LStr255& outValue ); + + virtual Int16 OpenDataFork( Int16 inPermissions ); + virtual void CloseDataFork(); +protected: + virtual ExceptionCode GetNextNameValuePair( LStr255& pName, LStr255& pValue ); + + Int32 mSectionPosition; +}; + diff --git a/mozilla/cmd/dialup/mac/muc/ListUtils.cp b/mozilla/cmd/dialup/mac/muc/ListUtils.cp new file mode 100644 index 00000000000..82e0857cca7 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/ListUtils.cp @@ -0,0 +1,104 @@ +/* -*- 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 "ListUtils.h" +void SynchronizeRowsTo( ListHandle list, int newRows ) +{ + int rows; + + if ( !list || !*list ) + return; + + rows = (**list).dataBounds.bottom - 1; + + if ( rows < 0 ) + rows = 0; + + if ( rows < newRows ) + ::LAddRow( newRows - rows, 1, list ); + if ( rows > newRows ) + ::LDelRow( rows - newRows, 1, list ); +} + +void SynchronizeColumnsTo( ListHandle list, int newColumns ) +{ + int columns; + + if ( !list || !*list ) + return; + + columns = (**list).dataBounds.right - 1; + + if ( columns < 0 ) + columns = 0; + + if ( columns < newColumns ) + ::LAddColumn( newColumns - columns, 1, list ); + if ( columns > newColumns ) + ::LDelColumn( columns - newColumns, 1, list ); +} + +void SetMenuSize( LGAPopup* popup, short shouldBe ) +{ + MenuHandle menu; + short count; + + Assert_( popup ); + menu = popup->GetMacMenuH(); + count = ::CountMItems( menu ); + + while ( shouldBe > count ) + { + InsertMenuItem( menu, "\p ", count ); + count++; + } + + while ( shouldBe < count ) + { + DeleteMenuItem( menu, count ); + count--; + } + + popup->SetMinValue( 1 ); + popup->SetMaxValue( shouldBe ); +} + +Boolean SetPopupToNamedItem( LGAPopup* whichMenu, const LStr255& itemText ) +{ + MenuHandle menuH; + short menuSize; + Str255 fontName; + + Assert_( whichMenu ); + menuH = whichMenu->GetMacMenuH(); + Assert_( menuH ); + + menuSize = CountMItems( menuH ); + + for ( short i = 1; i <= menuSize; i++ ) + { + ::GetMenuItemText( menuH, i, fontName ); + if ( itemText == (LStr255)fontName ) + { + whichMenu->SetValue( i ); + return true; + } + } + return false; +} + diff --git a/mozilla/cmd/dialup/mac/muc/ListUtils.h b/mozilla/cmd/dialup/mac/muc/ListUtils.h new file mode 100644 index 00000000000..3b686a0d6b1 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/ListUtils.h @@ -0,0 +1,26 @@ +/* -*- 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. + */ + +#pragma once +#include +#include + +void SynchronizeRowsTo( ListHandle list, int newRows ); +void SynchronizeColumnsTo( ListHandle list, int newColumns ); +void SetMenuSize( LGAPopup* popup, short shouldBe ); +Boolean SetPopupToNamedItem( LGAPopup* whichMenu, const LStr255& itemText ); diff --git a/mozilla/cmd/dialup/mac/muc/MUC.cp b/mozilla/cmd/dialup/mac/muc/MUC.cp new file mode 100644 index 00000000000..0e29f799329 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/MUC.cp @@ -0,0 +1,637 @@ +/* -*- 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 "MUC.h" +#include "LMUCHandler.h" +#include +#include +#include +#include +#include +#include +#include "ppp.h" +#include "ppp.interface.h" +#include "ppp_prefs_types.h" +#include "LNetworkPrefs.h" +#include "OTTCPPriv.h" // in the RestartTCP project + +// error codes that the OT configuration stub might report back to us +// undocumented from Apple +enum kOTConfigurationErrorCodes +{ + kOTErr_noErr = 0, + + kOTErr_UnsupportedSelector = -1, + // The specified selector code is not supported in this version + + kOTErr_SelectorInvalidWhileConnected = -2, + // Some operations are not supported while a connection is open + + kOTErr_UnknownConfigurationError = -3, + // Tried to select an unknown configuration + + kOTErr_PrefsAccessError = -4, + // Got an error trying to access the prefs file + + kOTErr_PrefsMemoryError = -5, + // Not enough memory to build the prefs name list + + kOTErr_OTConfigurationNotPresent = -6, + // The requested configuration is not present in OT. If the FreePPP Account + // is configured to switch OT settings automatically and this error is + // returned when selecting the Account it also means that FreePPP was not + // able to create the OT config. + + kOTErr_OTConfigurationInterrupts = -7, + // The configuration change will interrupt OT connections + + kOTErr_OTConfigurationRequiresReboot = -8, + // The configuration change will require a reboot + + kOTErr_CantLoadNeededResourcesError = -9, + // General error for when we can't find a needed resource (or resource file) + + kOTErr_OTConfigInfoMissingError = -10, + // Missing DNS or Search Domain info in the Account config so no OT config + // can be created + + kOTErr_EndSelector +}; + +LMUCHandler* gMUCHandler = NULL; +Int16 gRefNum = refNum_Undefined; +FSSpec gRsrcFile; + +static long MUC_DeleteDialConfiguration( PPPConfigureStruct* data ); +static long MUC_CreateModifyDialConfiguration( PPPConfigureStruct* data ); +static long MUC_OpenDialConnection( void* ); +static long MUC_CloseDialConnection( void* ); +static long MUC_GetActiveDialConfiguration( Str255* configName ); +static long MUC_SetActiveDialConfiguration( Str255* configName ); +static long MUC_GetActiveOTConfiguration( Str255* configName ); +static long MUC_SetActiveOTConfiguration( Str255* configName ); +static long MUC_GetDialConnectionState( Boolean* connected ); +static long MUC_GetAutoConnectState( Boolean* allowsAutoConnect ); +static long MUC_SetAutoConnectState( Boolean* allowsAutoConnect ); +static long MUC_GetModemsList( Str255** modemsList ); +static long MUC_GetActiveModemName( Str255* modemName ); +static long MUC_GetReceivedIPPacketCount( unsigned long* packetCount ); + + +static OSErr InitConfigStrList( configStringArray configStrList, PPPConfigureStruct* data, + Boolean* configureTCP, Boolean* configureIC ); +static void AddressToString( unsigned long address, StringPtr string ); +unsigned long AddressToLong( StringPtr addressStr ); +static Boolean OTAvailable(); + +extern pascal OSErr __muc_initialize( const CFragInitBlock* block ); +extern pascal void __muc_terminate( void ); +extern pascal OSErr __initialize( const CFragInitBlock *theInitBlock ); +extern pascal void __terminate( void ); + +long PE_PluginFunc( long selectorCode, void* pb, void* returnData ) +{ + long returnCode = 0; + + gRefNum = ::FSpOpenResFile( &gRsrcFile, fsRdPerm ); + switch ( selectorCode ) + { + // ¥Êfill in the version in pb + case kGetPluginVersion: + *(long*)pb = 0x00010000; + *(long*)returnData = NULL; + returnCode = 0; + break; + + case kCreateNewDialConfig: + case kModifyDialConfig: + returnCode = MUC_CreateModifyDialConfiguration( (PPPConfigureStruct*)pb ); + break; + + case kDeleteDialConfig: + returnCode = MUC_DeleteDialConfiguration( (PPPConfigureStruct*)pb ); + break; + + case kOpenConnection: + returnCode = MUC_OpenDialConnection( pb ); + break; + + case kCloseConnection: + returnCode = MUC_CloseDialConnection( pb ); + break; + + case kGetActivePPPConfig: + returnCode = MUC_GetActiveDialConfiguration( (Str255*)pb ); + break; + + case kSetActivePPPConfig: + returnCode = MUC_SetActiveDialConfiguration( (Str255*)pb ); + break; + + case kGetActiveOTConfig: + returnCode = MUC_GetActiveOTConfiguration( (Str255*)pb ); + break; + + case kSetActiveOTConfig: + returnCode = MUC_SetActiveOTConfiguration( (Str255*)pb ); + break; + + case kGetConnectionState: + returnCode = MUC_GetDialConnectionState( (Boolean*)pb ); + break; + + case kGetAutoConnectState: + returnCode = MUC_GetAutoConnectState( (Boolean*)pb ); + break; + + case kSetAutoConnectState: + returnCode = MUC_SetAutoConnectState( (Boolean*)pb ); + break; + + case kGetModemsList: + returnCode = MUC_GetModemsList( (Str255**)pb ); + break; + + case kGetActiveModemName: + returnCode = MUC_GetActiveModemName( (Str255*)pb ); + break; + + case kGetReceivedIPPacketCount: + returnCode = MUC_GetReceivedIPPacketCount( (unsigned long*)pb ); + break; + + case kSelectDialConfig: + if ( gMUCHandler ) + { + returnCode = gMUCHandler->SelectProfile( (FSSpec*)pb, false ); + if ( returnCode == errNeedToRunAccountSetup ) + { + // ¥Êcopy local file URL of AS into returnData + } + } + break; + + case kAutoSelectDialConfig: + if ( gMUCHandler ) + { + returnCode = gMUCHandler->SelectProfile( (FSSpec*)pb, true ); + if ( returnCode == errNeedToRunAccountSetup ) + { + } + } + break; + + case kEditDialConfig: + if ( gMUCHandler ) + returnCode = gMUCHandler->EditProfile( (FSSpec*)pb ); + break; + + case kGetDialConfig: + if ( gMUCHandler ) + returnCode = gMUCHandler->GetProfile( (FSSpec*)pb, (FreePPPInfo*)returnData ); + break; + + case kSetDialConfig: + if ( gMUCHandler ) + returnCode = gMUCHandler->SetProfile( (FSSpec*)pb, (FreePPPInfo*)returnData ); + break; + + case kNewProfileSelect: + if ( gMUCHandler ) + returnCode = gMUCHandler->ProfileSelectionChanged( (FSSpec*)pb ); + break; + + case kClearProfileSelect: + if ( gMUCHandler ) + returnCode = gMUCHandler->ProfileSelectionChanged( NULL ); + break; + + case kInitListener: + if ( gMUCHandler ) + gMUCHandler->InitDialog( (LDialogBox*)pb ); + break; + + } + ::CloseResFile( gRefNum ); + return returnCode; +} + +pascal OSErr __muc_initialize( const CFragInitBlock* block ) +{ + OSErr err; + + err = __initialize( block ); + + if ( err == noErr ) + { + if ( !gMUCHandler ) + gMUCHandler = new LMUCHandler; + + if ( !gMUCHandler ) + +#ifdef CWGOLD11 + return fragNoMem; +#else + return cfragInitFunctionErr; +#endif + + gMUCHandler->RegisterClasses(); + +#ifdef CWGOLD11 + CFragHFSLocator location; +#else + CFragSystem7Locator location; +#endif + location = block->fragLocator; + if ( location.where == kDataForkCFragLocator ) + gRsrcFile = *(location.u.onDisk.fileSpec); + } + return err; +} + +pascal void __muc_terminate() +{ + if ( gMUCHandler ) + delete gMUCHandler; + gMUCHandler = NULL; + __terminate(); +} + +static long MUC_CreateModifyDialConfiguration( PPPConfigureStruct* data ) +{ + long configError = noErr; + + Boolean configureTCP; + Boolean configureIC; + ConfigStringArray configStrList; + + if ( gRefNum == -1 ) + return fnfErr; + + configError = InitConfigStrList( configStrList, data, &configureTCP, &configureIC ); + if ( configError == noErr ) + { + Try_ + { + ThrowIfOSErr_( CallPPPRequest( eNewConfigureRequest, (void*)data ) ); + CreateModifyPrefs( configStrList, gRefNum, configureTCP, configureIC, OTAvailable() ); + } + Catch_( e ) + { + configError = e; + } + } + + if ( !OTAvailable() && configError == noErr ) + { + // No OpenTransport, we might need to reboot + if ( gMacTCPDirty ) + configError = 1; + } + // If configError < 0 (An error occured) + // If configError == 0 noError, no reboot required + // If configError > 0 and MacTCP is running, noError And Reboot required + return configError; +} + +static long MUC_DeleteDialConfiguration( PPPConfigureStruct* data ) +{ + Boolean dummy; + short configError = noErr; // This should be global + ConfigStringArray configStrList; + + if ( !OTAvailable() ) + return 0; + + configError = InitConfigStrList( configStrList, data, &dummy, &dummy ); + if ( configError == noErr ) + { + Try_ + { + ThrowIfOSErr_( CallPPPRequest( eDeleteConfiguration, (void*)data ) ); + DeleteConfig( configStrList ); + } + Catch_( e ) + { + configError = e; + } + } + + return configError; +} + +static long MUC_OpenDialConnection( void* ) +{ + return OpenFreePPP(); +} + +static long MUC_CloseDialConnection( void* ) +{ + return CloseFreePPP(); +} + +static long MUC_GetActiveDialConfiguration( Str255* pppConfig ) +{ + GetCurrentAccountName( pppConfig ); + return noErr; +} + +static long MUC_SetActiveDialConfiguration( Str255* pppConfig ) +{ + return SetCurrentAccountName( pppConfig ); +} + +static long MUC_GetActiveOTConfiguration( Str255* otConfig ) +{ + return noErr; +} + +static long MUC_SetActiveOTConfiguration( Str255* otConfig ) +{ + long err; + OTChangeConfigPB pb; + Handle resource; + OTConfigProcUPP thing; + + // ¥ this is our safe FAT resource (an 'sdes') + resource = ::Get1Resource( 'COTC', 128 ); + + if ( !resource ) + return errCantLoadNeededResources; + + DetachResource( resource ); + HLock( resource ); + + pb.selector = kOTChangeSelector_CheckChange; + LString::CopyPStr( (unsigned char*)&pb.configurationName, (unsigned char*)otConfig ); + thing = (OTConfigProcUPP)*resource; + err = CallOTConfigProc( thing, &pb ); + if ( err == noErr ) + { + // ¥Êassume it's benign to go bitch-slap OT + pb.selector = kOTChangeSelector_Reconfigure; + err = CallOTConfigProc( thing, &pb ); + } + else if ( err == kOTErr_OTConfigurationNotPresent ) + { + // ¥ fill in the OTChangeConfigPB with the rest of the relevant stuff from + // the AccountSpecDef, and call back into the code resource to create it + } + + DisposeHandle( resource ); // Get rid of the OT reconfig glue + + return err; + +} + +static long MUC_GetDialConnectionState( Boolean* connected ) +{ + *connected = IsFreePPPOpen(); + return noErr; +} + +static long MUC_GetAutoConnectState( Boolean* allowsAutoConnect ) +{ + *allowsAutoConnect = GetAutoConnectState(); + return noErr; +} + +static long MUC_SetAutoConnectState( Boolean* allowsAutoConnect ) +{ + return SetAutoConnectState( *allowsAutoConnect ); +} + +static long MUC_GetModemsList( Str255** modemsList ) +{ + return GetModemsList( modemsList ); +} + +static long MUC_GetActiveModemName( Str255* modemName ) +{ + GetCurrentModemName( modemName ); + return noErr; +} + +static long MUC_GetReceivedIPPacketCount( unsigned long* packetCount ) +{ + return GetReceivedIPPacketCount( packetCount ); +} + +static OSErr InitConfigStrList( ConfigStringArray configStrList, PPPConfigureStruct* data, + Boolean* configureTCP, Boolean* configureIC ) +{ + Str255 empty="\p"; + long dns1 = 0; + long dns2 = 0; // Used to avoid duplicate DNS settings + + int i; + + if ( ( configStrList == NULL ) || ( data == NULL ) ) + return fnfErr; + + *configureTCP = false; + *configureIC = false; + + // Initialize the data + for ( i = 0; i < eNumConfigStrings; i++ ) + LString::CopyPStr( empty, configStrList[ i ] ); + AddressToString( 0UL, configStrList[ eDNSAddress ] ); // These need to be initialized to 0.0.0.0 + AddressToString( 0UL, configStrList[ eAltDNSAddress ] ); // These need to be initialized to 0.0.0.0 + AddressToString( 0UL, configStrList[ eBackupDNSAddress ] ); // These need to be initialized to 0.0.0.0 + + i = 0; + while ( data[ i ].id != 0 ) + { + switch ( data[ i ].id ) + { + // TCP prefs + case kAccountID: + DebugNumStr( "\pAccountID", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eSiteName ] ); + break; + + case kAsearchDomain: + DebugNumStr( "\p kAsearchDomain", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eDomainName ] ); + *configureTCP = true; + break; + + case kAprimaryDNS: + DebugNumStr( "\p kAprimaryDNS", data[ i ].value ); + dns1 = (long)data[ i ].value; + AddressToString( (unsigned long)data[ i ].value, configStrList[ eDNSAddress ] ); + *configureTCP = true; + break; + + case kAsecondaryDNS: + dns2 = (long)data[ i ].value; + if ( (long)data[ i ].value == dns1 ) // Avoid the DNS duplicates + AddressToString( 0UL, configStrList[ eAltDNSAddress ] ); + else + AddressToString( (unsigned long)data[ i ].value, configStrList[ eAltDNSAddress ] ); + *configureTCP = true; + break; + + case kAbackupDNS: + DebugNumStr( "\p kAbackupDNS", data[ i ].value ); + if ( ( (long)data[ i ].value == dns1 ) || ( (long)data[ i ].value == dns2 ) ) + AddressToString( 0UL, configStrList[ eBackupDNSAddress ] ); + else + AddressToString( (unsigned long)data[ i ].value, configStrList[ eBackupDNSAddress ] ); + *configureTCP = true; + break; + + // IC prefs + case kConfigPluginLogin: + DebugNumStr( "\p kConfigPluginLogin", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eUserLogin ] ); + *configureIC = true; + break; + case kConfigPluginPassword: + DebugNumStr( "\p kConfigPluginPassword", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eUserPassword ] ); + *configureIC = true; + break; + case kConfigPluginPopLogin: + DebugNumStr( "\p kConfigPluginPopLogin", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eEMailLogin ] ); + *configureIC = true; + break; + case kConfigPluginPopPassword: + DebugNumStr( "\p kConfigPluginPopPassword", data[ i ].value); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eEMailPassword ] ); + *configureIC = true; + break; + case kConfigPluginReturnAddress: + DebugNumStr( "\p kConfigPluginReturnAddress", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eEMailReturnAddress ] ); + *configureIC = true; + break; + case kConfigPluginPopServer: + DebugNumStr( "\p kConfigPluginPopServer", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eEMailPOPServer ] ); + *configureIC = true; + break; + case kConfigPluginNNTPHost: + DebugNumStr( "\p kConfigPluginNNTPHost", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eNNTPHost ] ); + *configureIC = true; + break; + case kConfigPluginSMTPHost: + DebugNumStr( "\p kConfigPluginSMTPHost", data[ i ].value ); + LString::CopyPStr( (unsigned char*)data[ i ].value, configStrList[ eSMTPHost ] ); + *configureIC = true; + break; + default: + DebugNumStr("\p Dunno", data[i].value); + // It is OK, we ignore the unknown prefss + break; + } + i++; + } + + return noErr; +} + +void AddressToString( unsigned long address, StringPtr string ) +{ + Str255 aString; + unsigned char net; + unsigned char subnet1; + unsigned char subnet2; + unsigned char node; + + string[ 0 ] = 0; + + net = ( address & 0xff000000 ) >> 24; + subnet1 = ( address & 0x00ff0000 ) >> 16; + subnet2 = ( address & 0x0000ff00 ) >> 8; + node = address & 0x000000ff; + + NumToString( (long)net, aString ); + LString::CopyPStr( aString, string ); + + LString::AppendPStr( string,"\p." ); + + NumToString( (long)subnet1, aString); + LString::AppendPStr( string, aString ); + LString::AppendPStr( string, "\p." ); + + NumToString( (long)subnet2, aString ); + LString::AppendPStr( string, aString ); + LString::AppendPStr( string, "\p." ); + + NumToString( (long)node, aString ); + LString::AppendPStr( string, aString ); +} + +unsigned long AddressToLong( StringPtr addressStr ) +{ + unsigned long address = 0; + long offset = 1; + long i; + long count; + unsigned char buffer[ 5 ]; + long addressLen = addressStr[ 0 ]; + + long shiftValue = 24; + + for ( count = 0; count < 4; count++ ) + { + buffer[ 0 ] = 0; + for ( i = 1; i < 4 ; i++, offset++ ) + { + if ( offset > addressLen ) + break; + + if ( addressStr[ offset ] == '.' ) + break; + + buffer[ i ] = addressStr[ offset ] ; + buffer[ 0 ] += 1; + } + buffer[ i ] = 0; + offset++; + + ::StringToNum( (StringPtr)buffer, &i ); + address |= (unsigned char)i << shiftValue; + shiftValue -= 8; + } + + return address; +} + +static Boolean OTAvailable() +{ + // Does system have OpenTransport TCP? + OSErr error; + long response; + + // Check for Open Transport. + // gestaltOpenTpt = 'otan' + // gestaltOpenTptPresent = 0x00000001 + // gestaltOpenTptTCPPresent = 0x00000010 + error = Gestalt( gestaltOpenTpt, &response); + if ( !error ) + return ( ( response & 0x00000011 ) ? true : false ); + else + return false; +} + + + diff --git a/mozilla/cmd/dialup/mac/muc/MUC.h b/mozilla/cmd/dialup/mac/muc/MUC.h new file mode 100644 index 00000000000..1e005e919ef --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/MUC.h @@ -0,0 +1,93 @@ +/* -*- 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. + */ + +#pragma once + +enum MUCError +{ + errProfileNotFound = 1, + errNeedToRunAccountSetup, + errCannotSwitchDialSettings, + errUserCancelledLaunch, + errCantLoadNeededResources +}; + +enum MUCSelector +{ + kGetPluginVersion = 1, + kSelectDialConfig, + kAutoSelectDialConfig, + kEditDialConfig, + kGetDialConfig, + kSetDialConfig, + kNewProfileSelect, + kClearProfileSelect, + kInitListener, + kCreateNewDialConfig, + kModifyDialConfig, + kDeleteDialConfig, + kOpenConnection, + kCloseConnection, + kGetActivePPPConfig, + kSetActivePPPConfig, + kGetActiveOTConfig, + kSetActiveOTConfig, + kGetConnectionState, + kGetAutoConnectState, + kSetAutoConnectState, + kGetModemsList, + kGetActiveModemName, + kGetReceivedIPPacketCount + }; + +typedef struct +{ + Str255 mOTConfiguration; + Str255 mOTPPPConfiguration; + Str255 mOTModemConfiguration; +} +OTInfo, *OTInfoPtr; + +typedef struct +{ + Str255 mProfileName; + Str255 mAccountName; + Str255 mModemName; + Str255 mLocationName; +} +FreePPPInfo, *FreePPPInfoPtr; + +typedef struct +{ + OTInfo mOT; + FreePPPInfo mPPP; +} +MUCInfo, *MUCInfoPtr; + +typedef OSErr (*TraversePPPListFunc)( Str255** list ); + +#pragma export on +typedef long (*PE_PluginFuncType)(long selectorCode, void* pb, void* returnData ); +#ifdef __cplusplus +extern "C" { +#endif +long PE_PluginFunc( long selectorCode, void* pb, void* returnData ); +#ifdef __cplusplus +} +#endif +#pragma export off diff --git a/mozilla/cmd/dialup/mac/muc/MUC_Headers.pch++ b/mozilla/cmd/dialup/mac/muc/MUC_Headers.pch++ new file mode 100644 index 00000000000..d08bee2556e --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/MUC_Headers.pch++ @@ -0,0 +1,29 @@ +/* -*- 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 "IDE_Options.h" + +#ifdef powerc + #pragma precompile_target "MUC_HeadersPPC++" +#else + #pragma precompile_target "MUC_Headers68K++" +#endif + +#define PP_No_ObjectStreaming +#include +#include diff --git a/mozilla/cmd/dialup/mac/muc/MUC_Prefix.h b/mozilla/cmd/dialup/mac/muc/MUC_Prefix.h new file mode 100644 index 00000000000..f23db901cf3 --- /dev/null +++ b/mozilla/cmd/dialup/mac/muc/MUC_Prefix.h @@ -0,0 +1,27 @@ +/* -*- 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 __powerc +#ifdef __cplusplus +#include "MUC_HeadersPPC++" +#endif +#include "IDE_Options.h" +#include +#endif + +#define CWGOLD11 diff --git a/mozilla/cmd/dialup/makefile.win b/mozilla/cmd/dialup/makefile.win new file mode 100644 index 00000000000..b38c26860b0 --- /dev/null +++ b/mozilla/cmd/dialup/makefile.win @@ -0,0 +1,32 @@ +# 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=..\.. + +# java/applet produces contents needed in as_html +DIRS=java as_html win + +!include <$(DEPTH)\config\rules.mak> + +install:: + $(MAKE_INSTALL) \ + $(DEPTH)\dist\$(OBJDIR)\lib\np32asw.dll \ + $(DEPTH)\..\x86dbg\plugins + $(MAKE_INSTALL) \ + java\signed\npasw.jar \ + $(DEPTH)\..\x86Dbg\plugins + $(MAKE_INSTALL) \ + $(DEPTH)\dist\classes\netscape\asw\asw.jar \ + $(DEPTH)\..\x86dbg\asw diff --git a/mozilla/cmd/dialup/tools/cg/art/license b/mozilla/cmd/dialup/tools/cg/art/license new file mode 100644 index 00000000000..947718beabb --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/art/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/cg/docs/askserv.htm b/mozilla/cmd/dialup/tools/cg/docs/askserv.htm new file mode 100644 index 00000000000..fc3f234bc70 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/askserv.htm @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + Account Setup Configuration: Server Options + + + + +
+

+ + + + +
+ + + + + +
 Offline Mode Options +

Options and Settings for Account Setup +

+
+
+ + + + + +
+ + + + +
+ + + + + + + +
 Screen Options
+ + + + +
+ + + + + +
Don't display IMAP field in Account Setup.
+ Check this checkbox if you do not want Account Setup to display the text and + input field for IMAP.
+
+
+
+
+
+ + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/askserv.js b/mozilla/cmd/dialup/tools/cg/docs/askserv.js new file mode 100644 index 00000000000..fd1ae87c98f --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/askserv.js @@ -0,0 +1,77 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/asksvinf.htm b/mozilla/cmd/dialup/tools/cg/docs/asksvinf.htm new file mode 100644 index 00000000000..f3edf0b3ed5 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/asksvinf.htm @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Options for Saving Account Information

+ +
+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Let User Save Account Information, with Account Password +

Choose this setting to let users save a record of their account information to a + text file on their computer after disconnecting from your Internet account + server. The information includes account dial-up access number, their login and + password and email login and password, as well as network and server addresses.

+
+ +
+ + + + Let User Save Account Information, without Account Password +

Choose this setting to let users save a record of their account information to a + text file on their computer as described above, but without a record of their + account password.

+ +
+ +
+ + + + Don't Let User Save Account Information +

Choose this setting if you don't want to give users the option of saving a record + of their account information to a text file on their computer. Account Setup does + not display the "Save Account Info" button.

+ +
+ +
+ +

+ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/asksvinf.js b/mozilla/cmd/dialup/tools/cg/docs/asksvinf.js new file mode 100644 index 00000000000..1a78f382afe --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/asksvinf.js @@ -0,0 +1,125 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/asktty.htm b/mozilla/cmd/dialup/tools/cg/docs/asktty.htm new file mode 100644 index 00000000000..5c4336c632e --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/asktty.htm @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +

Login Options

+ +
+ +
+ + + + + +
+ + + + + + +
+ + + + Let Users Request a Terminal (TTY) Window for Connecting +

+ Check this checkbox to let users request a terminal window for connecting + to their accounts, so that they can log in manually each time. Account Setup + displays a checkbox and descriptive text. If you want to require users to use a + terminal window to log in manually whenever they connect, you can set that option + in each NCI configuration.

+ +
+ +
+ +
+ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/asktty.js b/mozilla/cmd/dialup/tools/cg/docs/asktty.js new file mode 100644 index 00000000000..9374bde61a7 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/asktty.js @@ -0,0 +1,96 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/editcc.htm b/mozilla/cmd/dialup/tools/cg/docs/editcc.htm new file mode 100644 index 00000000000..ed05afac7b0 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/editcc.htm @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +

Billing Options

+ +
+ +
+ + + + + +
+ + + + + +
+ Credit Cards Accepted for Billing:
+ + + + + + + + + + + + + + + + + + + + + + +
+ + American Express
+ + + Discover
+ + + MasterCard
+ + + Visa
+
+ +
+ + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/editcc.js b/mozilla/cmd/dialup/tools/cg/docs/editcc.js new file mode 100644 index 00000000000..3b64d39dfd4 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/editcc.js @@ -0,0 +1,98 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/editisps.htm b/mozilla/cmd/dialup/tools/cg/docs/editisps.htm new file mode 100644 index 00000000000..85431f1054f --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/editisps.htm @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + NCI Configuration Options + +
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + Use A Single NCI Configuration +

Select this option to preset Account Setup to use the NCI configuration + you select from the pop-up menu below.

+
+
+

+ +

+
+ +
+ + + + + Offer Multiple NCI Configurations in a List +

Select this option to let users choose from a scrolling list of all of your + NCI configurations.

+
+
+ + + + + + + + + + + + + + + +
+ + + List Configurations by Name +
+ + + List Configurations by Access Phone Number + +
+ + + Include "None of the Above" Option in List +
+
+ +
+ +
+
+ + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/editisps.js b/mozilla/cmd/dialup/tools/cg/docs/editisps.js new file mode 100644 index 00000000000..c2622b983e5 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/editisps.js @@ -0,0 +1,128 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/editregs.htm b/mozilla/cmd/dialup/tools/cg/docs/editregs.htm new file mode 100644 index 00000000000..dd1a6323c35 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/editregs.htm @@ -0,0 +1,124 @@ + + + + + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/addias.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/addias.htm new file mode 100644 index 00000000000..ecdf796a4bc --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/addias.htm @@ -0,0 +1,73 @@ + + + +Internet Account Server Configurations + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/ias.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/ias.htm new file mode 100644 index 00000000000..3c67c0f37d3 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/ias.htm @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + +
+ + + + + +
+

Edit IAS Configuration:

+ + + + + + + +
+ + + + +
+ +
+ +
+ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/ias.js b/mozilla/cmd/dialup/tools/cg/docs/ias/ias.js new file mode 100644 index 00000000000..d5723fa9d0b --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/ias.js @@ -0,0 +1,115 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/iasglob.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/iasglob.htm new file mode 100644 index 00000000000..739b7547946 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/iasglob.htm @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + untitled + + + + +
+


+
+ +


+ +

Temporary Globals frame for current IAS configuration.

+

(you should not be looking at this page directly, please close this window)

+
[Dial-In Configuration]
+
+SiteName: 		
+
+Description: 	
+
+Login Name:		
+
+Password: 		
+
+Phone: 			
+
+ScriptFileName:	
+
+//This flag does nothing - it's just here so that we are analogous to the 
+//nci file side as far as scripted logins are concerned - this way we can usethe same .js files.
+//(clever, huh?)
+
+ScriptEnabled:	
+
+[IP]
+Enabled: 		
+
+IPAddress: 		
+
+DomainName: 	
+
+DNSAddress: 	
+
+DNSAddress2: 	
+
+RegCGI: 		
+
+[Security]
+
+REG_SCRIPTING:	
+
+
+[Configuration]
+
+REG_SCRIPTING:	
+
+Internal use only:
+
+IASFileName:		
+
+GlobalsDirty: 		
+
+ScriptDirty:		
+ + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/iasglob.js b/mozilla/cmd/dialup/tools/cg/docs/ias/iasglob.js new file mode 100644 index 00000000000..ba9e61a7820 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/iasglob.js @@ -0,0 +1,577 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/iasnmtab.js b/mozilla/cmd/dialup/tools/cg/docs/ias/iasnmtab.js new file mode 100644 index 00000000000..a6c49b5390f --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/iasnmtab.js @@ -0,0 +1,80 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/iastabf.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/iastabf.htm new file mode 100644 index 00000000000..558fcc81600 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/iastabf.htm @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/iastabs.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/iastabs.htm new file mode 100644 index 00000000000..695651c5e26 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/iastabs.htm @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/isetting.js b/mozilla/cmd/dialup/tools/cg/docs/ias/isetting.js new file mode 100644 index 00000000000..5f357fda90b --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/isetting.js @@ -0,0 +1,402 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/nmtab.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/nmtab.htm new file mode 100644 index 00000000000..404a82c221a --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/nmtab.htm @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/othtab.js b/mozilla/cmd/dialup/tools/cg/docs/ias/othtab.js new file mode 100644 index 00000000000..260fe610ca5 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/othtab.js @@ -0,0 +1,57 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/satab.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/satab.htm new file mode 100644 index 00000000000..3b491f5407e --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/satab.htm @@ -0,0 +1,90 @@ + + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/sheet.js b/mozilla/cmd/dialup/tools/cg/docs/ias/sheet.js new file mode 100644 index 00000000000..4c3956665e8 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/sheet.js @@ -0,0 +1,183 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + //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/cg/docs/ias/siptab.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/siptab.htm new file mode 100644 index 00000000000..f806a803928 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/siptab.htm @@ -0,0 +1,103 @@ + + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/sltab.htm b/mozilla/cmd/dialup/tools/cg/docs/ias/sltab.htm new file mode 100644 index 00000000000..b17d929dc37 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/sltab.htm @@ -0,0 +1,104 @@ + + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/ias/tabsuprt.js b/mozilla/cmd/dialup/tools/cg/docs/ias/tabsuprt.js new file mode 100644 index 00000000000..562323d78c3 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/ias/tabsuprt.js @@ -0,0 +1,175 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ +//tabs.js +// a set of functions for making a set of tabs in one frame that control the content of another frame + + +//tab images have to have names like: +//tabnamea.gif (active) +//tabnamei.gif (inactive) + + + +//swaps the lowsrc and src images of an image reference +function swapSrcLowsrc(imageRef) +{ + //FIXME FIXME: THIS FUCNTION HAS A TEMPORARY FIX FOR A BUG IN DOGBERT. + //FIXME WHEN IT'S RESOLVED BUG # 69298 + + if ((imageRef) && (imageRef != null)) + { + if (imageRef.lowsrc && imageRef.src); + { + var lsrc = imageRef.lowsrc; + var src = imageRef.src; + + imageRef.lowsrc = src; + imageRef.src = lsrc; + } + } +} + + +//given a link object, tells you which link it is in the document. +function findLinkIndex(linkRef) +{ + + var curIdx = -1; + + if ((linkRef) && (linkRef != null)) + { + for (curIdx = 0; curIdx < document.links.length; curIdx++) + { + + if (document.links[curIdx] == linkRef) + return curIdx; + } + } + + return -1; + +} + + + +//THIS IS A FUCKED UP HACK. +// there was no good way to tell which image was last on, without making some sort of persistent data +//storage, so this is the hack. +// We already assume that there is a 1-to-1 correspondence between the links array and the +//image array in the document. +//SO, we go to the links array, check the target's location, and see +// if that is equivalent to the link location. IF SO, we assume it IS ON. +// else it is off. +function imageIsOn(imageRef) +{ + var out = false; + + var dot = imageRef.src.lastIndexOf("."); + + var indicator = imageRef.src.substring(dot-1, dot); + + //alert("dot: " + dot + " indicator: " + indicator + " src: " + imageRef.src); + + if (indicator == "a") + out = true; + + + return out; +} + + +//checks the name property of the passed in image object, if it is "ON", swaps the images. +// if it is anything else, does nothing +function swapImageIfOn(imageIndex, imageRef) +{ + if ((imageRef) && (imageRef != null)) + { + if ((imageRef.name)) + { + if (imageIsOn(imageRef)) + { + swapSrcLowsrc(imageRef); + //alert("Image " + imageIndex + " was on."); + + return true; + } + } + } + return false; +} + + + +function tabClicked(linkRef) +{ + + var theIndex = findLinkIndex(linkRef); + var onImage = document.images[theIndex]; + + //first see if the tab that was clicked is the currently active tab, if so, abort + //FIXME FIXME: THIS FUCNTION HAS A TEMPORARY FIX FOR A BUG IN DOGBERT. + //FIXME WHEN IT'S RESOLVED BUG # 69298 + if (imageIsOn(onImage)) + return false; + + + //second do a checkdata, if such a function exists in the tabbody + if (parent.tabbody && parent.tabbody.document && parent.tabbody.checkData) + { + var checkResult = parent.tabbody.checkData(); + if (checkResult != true) + return checkResult; + } + + + //alert("tabsuprt: checkresult was true"); + + + var wason = false; + var target = null; + + if ((theIndex >= 0) && (onImage) && (onImage != null)) + { + //found our image, + + //turn all images off + for (var curImageIndex = 0; curImageIndex < document.images.length; curImageIndex++) + { + wason = swapImageIfOn(curImageIndex, document.images[curImageIndex]); + + //this is the funny thing we do to save the data if a savedata event handler is there + if (wason == true) + { + target = eval("parent." + document.links[curImageIndex].target); + if ((target) && (target != null) && (target.saveData)) + { + //alert("tabsuprt: savedata"); + target.saveData(); + //alert("tabsuprt: savedata finished"); + } + + + } + } + + //turn this image visually on + swapSrcLowsrc(onImage); + } + + return true; +} diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/aatab.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/aatab.htm new file mode 100644 index 00000000000..806fd06c799 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/aatab.htm @@ -0,0 +1,107 @@ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Access Phone Number: + + + + +
+ + Account Login: + + + + +
+ + Password: + + + + +
+ + Registration Page URL: + + + + +
+ +
+ + + + Enable Van Jacobson Compression + + Uncheck this box only if your server does not support Van Jacobson (VJ) compression. + +
+ + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/aatab.js b/mozilla/cmd/dialup/tools/cg/docs/nci/aatab.js new file mode 100644 index 00000000000..a3a4bed5d64 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/aatab.js @@ -0,0 +1,105 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/addnci.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/addnci.htm new file mode 100644 index 00000000000..d407695ed88 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/addnci.htm @@ -0,0 +1,78 @@ + + + +Dialup Access Configurations + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/cfgtab.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/cfgtab.htm new file mode 100644 index 00000000000..5b43fdcbad4 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/cfgtab.htm @@ -0,0 +1,87 @@ + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + If you used the Configuration Editor tool to produce a custom configuration (.cfg) + file for Communicator and plan to include it in the same package as Account Setup, select the file from the pop-up menu below. + +
+ + + + + + + + + + +
+ + + Select a Configuration (.cfg) File: + + + + + +
+ + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/cfgtab.js b/mozilla/cmd/dialup/tools/cg/docs/nci/cfgtab.js new file mode 100644 index 00000000000..c0eea769f09 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/cfgtab.js @@ -0,0 +1,64 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/nci.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/nci.htm new file mode 100644 index 00000000000..404a6afba9a --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/nci.htm @@ -0,0 +1,70 @@ + + + + + + + + + + + + + +
+ + + + + + +
+

Edit NCI Configuration:

+ + + + + + + +
+ + + + +
+ +
+ +
+ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/nci.js b/mozilla/cmd/dialup/tools/cg/docs/nci/nci.js new file mode 100644 index 00000000000..ead0eec0336 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/nci.js @@ -0,0 +1,132 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/nciglob.js b/mozilla/cmd/dialup/tools/cg/docs/nci/nciglob.js new file mode 100644 index 00000000000..5735dc62071 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/nciglob.js @@ -0,0 +1,747 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/nciglobs.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/nciglobs.htm new file mode 100644 index 00000000000..d10793468b1 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/nciglobs.htm @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + untitled + + + + +
+


+
+ +


+ +

Temporary Globals frame for current NCI configuration.

+

(you should not be looking at this page directly, please close this window)

+
[Dial-In Configuration]
+SiteName: 		
+
+Description: 	
+
+Login Name:		
+
+Password: 		
+
+Phone: 			
+
+ISP Support Phone #: 
+
+[IP]
+
+Enabled: 
+
+IPAddress: 
+
+DomainName: 
+
+DNSAddress: 
+
+DNSAddress2: 
+
+[Options]
+EnableVJCompression: 
+
+
+[Services]
+
+
+SMTP_Server: 
+
+POP_Server: 
+
+IMAP_Server: 
+
+NNTP_Server: 
+
+Noi yet in use
+Default_Mail_Protocol: i.e. pop, imap, pop_only, imap_only
+
+[Script]
+ScriptEnabled: 		
+
+ScriptFileName: 		 
+
+
+
+[Publishing]
+
+Publish_URL:	
+
+Publish_Password:	
+
+View_URL:	
+
+[Configuration]
+
+ConfigurationFileName: 		 
+
+
+
+From ACCTSET.INI:
+
+RegPodURL:			 
+
+internal use only:
+
+ScriptDirty:		
+
+FileName:			
+
+GlobalsDirty:		
+ + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/ncitabf.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/ncitabf.htm new file mode 100644 index 00000000000..9427443eb27 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/ncitabf.htm @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/ncitabs.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/ncitabs.htm new file mode 100644 index 00000000000..7ea7c1cf406 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/ncitabs.htm @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/nmtab.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/nmtab.htm new file mode 100644 index 00000000000..3e295465b99 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/nmtab.htm @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Configuration Name: + + + +
+ Support Phone Number: + + + + + + (for End Users) + +
+ + + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/nmtab.js b/mozilla/cmd/dialup/tools/cg/docs/nci/nmtab.js new file mode 100644 index 00000000000..51849452994 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/nmtab.js @@ -0,0 +1,83 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/nsetting.js b/mozilla/cmd/dialup/tools/cg/docs/nci/nsetting.js new file mode 100644 index 00000000000..43bfd4ccfb6 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/nsetting.js @@ -0,0 +1,580 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/pubtab.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/pubtab.htm new file mode 100644 index 00000000000..90a4ba44885 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/pubtab.htm @@ -0,0 +1,76 @@ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + URL for Publishing Pages: + + + + +
+ + Password for Publishing: + + + + +
+ + URL for Viewing Pages: + + + + +
+ + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/pubtab.js b/mozilla/cmd/dialup/tools/cg/docs/nci/pubtab.js new file mode 100644 index 00000000000..e401a50cbe2 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/pubtab.js @@ -0,0 +1,65 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/sheet.js b/mozilla/cmd/dialup/tools/cg/docs/nci/sheet.js new file mode 100644 index 00000000000..4c3956665e8 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/sheet.js @@ -0,0 +1,183 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + //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/cg/docs/nci/sltab.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/sltab.htm new file mode 100644 index 00000000000..1306c76f11b --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/sltab.htm @@ -0,0 +1,104 @@ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + Select a Login Script: + + + + +
+ + Edit Script: + + + + +
+ + Script Filename: + + + + + + + + +
+ + + + + +
+
+ + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/sltab.js b/mozilla/cmd/dialup/tools/cg/docs/nci/sltab.js new file mode 100644 index 00000000000..517b0fb5d1f --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/sltab.js @@ -0,0 +1,352 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/svstab.htm b/mozilla/cmd/dialup/tools/cg/docs/nci/svstab.htm new file mode 100644 index 00000000000..efed57c12ef --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/svstab.htm @@ -0,0 +1,193 @@ + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + Domain name: + + + + +
+ + Primary DNS Server: + + + + +
+ + Secondary DNS Server: + + + + +
+ +
+ + + + Server Assigns Client IP Address Dynamically + + Assign Static IP Address: + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + NNTP Server: + + + + +
+ + SMTP Server: + + + + +
+ + POP Server: + + + + +
+ + IMAP Server: + + + + +
+ + Default: + + + + + + + + POP + + + + + + + + IMAP + +
+ +

The mail and news server information above can also be specified in a configuration (.cfg) file, created with the Configuration Editor tool. Values in a configuration (.cfg) file have priority over values defined in this NCI configuration.

+
+
+ +
+ + + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/svstab.js b/mozilla/cmd/dialup/tools/cg/docs/nci/svstab.js new file mode 100644 index 00000000000..385c7ad27a8 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/svstab.js @@ -0,0 +1,218 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/nci/tabsuprt.js b/mozilla/cmd/dialup/tools/cg/docs/nci/tabsuprt.js new file mode 100644 index 00000000000..89cf145bd4f --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/nci/tabsuprt.js @@ -0,0 +1,172 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ +//tabs.js +// a set of functions for making a set of tabs in one frame that control the content of another frame + + +//tab images have to have names like: +//tabnamea.gif (active) +//tabnamei.gif (inactive) + + + +//swaps the lowsrc and src images of an image reference +function swapSrcLowsrc(imageRef) +{ + + if ((imageRef) && (imageRef != null)) + { + if (imageRef.lowsrc && imageRef.src); + { + var lsrc = imageRef.lowsrc; + var src = imageRef.src; + + imageRef.lowsrc = src; + imageRef.src = lsrc; + } + } +} + + +//given a link object, tells you which link it is in the document. +function findLinkIndex(linkRef) +{ + + var curIdx = -1; + + if ((linkRef) && (linkRef != null)) + { + for (curIdx = 0; curIdx < document.links.length; curIdx++) + { + + if (document.links[curIdx] == linkRef) + return curIdx; + } + } + + return -1; + +} + + + +//THIS IS A FUCKED UP HACK. +// there was no good way to tell which image was last on, without making some sort of persistent data +//storage, so this is the hack. +// We already assume that there is a 1-to-1 correspondence between the links array and the +//image array in the document. +//SO, we go to the links array, check the target's location, and see +// if that is equivalent to the link location. IF SO, we assume it IS ON. +// else it is off. +function imageIsOn(imageRef) +{ + var out = false; + + var dot = imageRef.src.lastIndexOf("."); + + var indicator = imageRef.src.substring(dot-1, dot); + + //alert("dot: " + dot + " indicator: " + indicator + " src: " + imageRef.src); + + if (indicator == "a") + out = true; + + + return out; +} + + +//checks the name property of the passed in image object, if it is "ON", swaps the images. +// if it is anything else, does nothing +function swapImageIfOn(imageIndex, imageRef) +{ + if ((imageRef) && (imageRef != null)) + { + if ((imageRef.name)) + { + if (imageIsOn(imageRef)) + { + swapSrcLowsrc(imageRef); + //alert("Image " + imageIndex + " was on."); + + return true; + } + } + } + return false; +} + + + +function tabClicked(linkRef) +{ + + + var theIndex = findLinkIndex(linkRef); + var onImage = document.images[theIndex]; + + //first see if the tab that was clicked is the currently active tab, if so, abort + //FIXME FIXME: THIS FUCNTION HAS A TEMPORARY FIX FOR A BUG IN DOGBERT. + //FIXME WHEN IT'S RESOLVED BUG # 69298 + if (imageIsOn(onImage)) + { + return false; + } + + //second do a checkdata, if such a function exists in the tabbody + if (parent.tabbody && parent.tabbody.document && parent.tabbody.checkData) + { + var checkResult = parent.tabbody.checkData(); + if (checkResult != true) + return checkResult; + } + + + + + var wason = false; + var target = null; + + if ((theIndex >= 0) && (onImage) && (onImage != null)) + { + //found our image, + + //turn all images off + for (var curImageIndex = 0; curImageIndex < document.images.length; curImageIndex++) + { + wason = swapImageIfOn(curImageIndex, document.images[curImageIndex]); + + //this is the funny thing we do to save the data if a savedata event handler is there + if (wason == true) + { + target = eval("parent." + document.links[curImageIndex].target); + if ((target) && (target != null) && (target.saveData)) + { + target.saveData(); + } + + + } + } + + //turn this image visually on + swapSrcLowsrc(onImage); + } + + return true; +} diff --git a/mozilla/cmd/dialup/tools/cg/docs/settform.js b/mozilla/cmd/dialup/tools/cg/docs/settform.js new file mode 100644 index 00000000000..26a33bc3d61 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/settform.js @@ -0,0 +1,144 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/settings.htm b/mozilla/cmd/dialup/tools/cg/docs/settings.htm new file mode 100644 index 00000000000..74b8d419cc4 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/settings.htm @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +

Account Setup Global Options

+ +
+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Use Internet Account Server (IAS) Mode Only +

Select this option to run Account Setup in Internet Account Server (IAS) mode + only. Account Setup turns off the "Welcome to Account Setup" screen + and doesn't give users the option of using the NCI mode. To offer the IAS mode, + you must have an Internet account server that supports Netscape's + Internet Account Server Protocol.

+ +
+ +
+ + + + Use Network Configuration (NCI) Mode Only +

Select this option to run Account Setup in Network Configuration (NCI) mode only. + Account Setup turns off the "Welcome to Account Setup" screen and + doesn't give users the option of using the IAS mode.

+ +
+ +
+ + + + Offer Both Modes (user chooses mode) +

Account Setup displays the "Welcome to Account Setup" screen and lets + users choose IAS or NCI mode. + +

+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + Support International Name, Address, and Phone Number Formats + + +
+ + + Show Account Setup Introduction Screens + +
+ + Set Dialer Idle Timeout Interval to: + + + + minutes. + +
+ +
+ + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/settings.js b/mozilla/cmd/dialup/tools/cg/docs/settings.js new file mode 100644 index 00000000000..8e3706eafba --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/settings.js @@ -0,0 +1,625 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/cg/docs/sheet.js b/mozilla/cmd/dialup/tools/cg/docs/sheet.js new file mode 100644 index 00000000000..4c3956665e8 --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/sheet.js @@ -0,0 +1,183 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + //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/cg/docs/showphon.htm b/mozilla/cmd/dialup/tools/cg/docs/showphon.htm new file mode 100644 index 00000000000..a313c0df58d --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/showphon.htm @@ -0,0 +1,100 @@ + + +Account Setup Configuration: ISP List Options + + + + + + + + + + + + + + + + +
+ + + + + + + +
 Offine Mode OptionsOptions and Settings for Account Setup
+ +
+ + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + +
 List Options
+ +
+ + + + + + + + + + +
List Dial-Up Configurations by Phone Number
List Dial-Up Configurations by Name
+ +
+ +
+ +
+ +
+ + + diff --git a/mozilla/cmd/dialup/tools/cg/docs/showphon.js b/mozilla/cmd/dialup/tools/cg/docs/showphon.js new file mode 100644 index 00000000000..99adab90e8b --- /dev/null +++ b/mozilla/cmd/dialup/tools/cg/docs/showphon.js @@ -0,0 +1,98 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*- + * + * 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. + */ + diff --git a/mozilla/cmd/dialup/tools/kit/cfghelp/aatab.htm b/mozilla/cmd/dialup/tools/kit/cfghelp/aatab.htm new file mode 100644 index 00000000000..dcb9f6db21d --- /dev/null +++ b/mozilla/cmd/dialup/tools/kit/cfghelp/aatab.htm @@ -0,0 +1,104 @@ + + + + + + + + Account Setup Editor Help + + + + + + + +

Account Access Tab

+ +

This tab lets you to provide information about the account accessed by a user or user group.

+ + + + + + + + + + + + + + + + + + + + + +
+ Access Phone Number: + + The telephone number that the user's computer is to dial to connect to the account. Enter the phone number in TAPI format. For example: +1 415 555 1212. +
+ Account Login: + + The account login of the user or user group. +
+ Password: + + The password of the user or user group. +
+ Registration Page URL: + + The URL of the page you want users to connect to when they click Connect Now in the last screen of Account Setup. +
+ Enable Van Jacobson Compression + + Uncheck this box only if your server does not support Van Jacobson (VJ) compression. +
+ + + +
+ + + + + + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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:

+ +
    +
  1. From the pop-up menu in the upper-left corner of the dialog, select the configuration you want to edit.
  2. + +
  3. Provide all of the information in each tab.
  4. + +
  5. Click the Save Configuration button in the upper-right corner of the dialog to save your changes.
  6. +
+ +

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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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:

+ +
    +
  1. From the pop-up menu in the upper-left corner of the dialog, select the configuration you want to edit.
  2. + +
  3. Provide any information in any tab.
  4. + +
  5. Click the Save Configuration button in the upper-right corner of the dialog to save your changes.
  6. +
+ +

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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[BACK]

+ +
+
+ + + + 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:

+ +
    +
  1. Create one or more local configuration files using the Configuration Editor tool.
  2. + +
  3. Copy the local configuration files into the Config folder, located inside the dialup package that you are now customizing with the Account Setup Editor.
  4. + +
  5. 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.
  6. +
+ +

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.

+ + + + +
+ + +

[BACK]

+ +
+
+ + + 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:

+ +
    +
  1. You can't change any of the JavaScript in Account Setup.
  2. + +
  3. You can't add any JavaScript to Account Setup.
  4. +
+ +

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: + +

    +
  1. Each file has a <SCRIPT SRC=... ARCHIVE=...> </SCRIPT> tag in the header that must remain intact.
  2. + +
  3. Many of the files have an ID=... attribute in the <BODY> tag that must remain intact.
  4. + +
  5. Most forms inputs and some hypertext links also have an ID=... attribute that can't be changed.
  6. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +

[MORE HELP]

+ + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +

[MORE HELP]

+ +
+
+ + + + 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.

+ + + + +
+ + +

[MORE HELP]

+ +
+
+ + + 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.

+ + + + +
+ + +

[MORE HELP]

+ +
+
+ + + + 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.

+ + + + +
+ + +

[MORE HELP]

+ +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +

[BACK]

+ +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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:

+ +
    +
  1. Move to the Account Setup screen for which you want to edit the Help file.
  2. + +
  3. Click Choose Editor in the Toolbar and specify your text editor.
  4. + +
  5. Click Edit Help in the Toolbar. The Account Setup Editor opens the screen's HTML-based Help file in your text editor.
  6. + +
  7. Save your changes to the HTML file, then click Reload Screen in the Toolbar to see your changes in the Account Setup Help window.
  8. +
+ +

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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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:

+ +
    +
  1. Move to the Account Setup screen you want to edit.
  2. + +
  3. Click Choose Editor in the Toolbar and specify your text editor.
  4. + +
  5. Click Edit Screen in the Toolbar. The Account Setup Editor opens the screen's HTML file in your text editor.
  6. + +
  7. Save your changes to the HTML file, then click Reload Screen in the Toolbar to see your changes in Account Setup.
  8. +
+ +

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.

+ + + + +
+ + +[BACK] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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:

+ +
    +
  1. 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.
  2. + +
  3. Click Screen Options in the Toolbar to load the global options dialog into the Account Setup window.
  4. + +
  5. Use the radio buttons and checkboxes in the dialog to set global options.
  6. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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

+ + + + + + +
+ + +[MORE HELP]  [BACK]

+ +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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:

+ +
    +
  1. Using the Account Setup navigation pane, move back to the first screen of Account Setup.
  2. + +
  3. Click Choose Editor in the Toolbar to specify your text or HTML editor (if you haven't already).
  4. + +
  5. Click Edit Screen in the Toolbar. The Account Setup Editor opens the screen's HTML file in your text or HTML editor.
  6. + +
  7. In the HTML file, locate the <!-- Previews --> comment. It identifies the table that contains the links to the Previews.
  8. + +
  9. Delete the appropriate rows from the table, as explained in the comments embedded in the table.
  10. +
+ + + + + +
+ + +[BACK] + +
+
+ + + 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. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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. +
+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[BACK] + +
+
+ + + 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.

+ + + + +
+ + +[MORE HELP] + +
+
+ + + 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
+ +
+  + + + + + + + + + + + + + + +
Show
Screen
+  +
+ + + + + + + + + + + + +
Editor
Help
+  +
+ + + + + + + + + + + +
Exit
+  +
+ + + + + + + + + + + +
Exit
+  +
+ + + +
+ + + + +
+ +Expose
Layer:   +
+
+ + +
+ + + + +
+ + +Hide other layers +
+ +
+ + + +
+ + + + + + 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 // MFC extensions +/* +#ifdef WIN32 + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC OLE classes +#include // MFC OLE dialog classes +#include // MFC OLE automation classes +#endif // _AFX_NO_OLE_SUPPORT + + +#ifndef _AFX_NO_DB_SUPPORT +#include // MFC ODBC database classes +#endif // _AFX_NO_DB_SUPPORT + +#ifndef _AFX_NO_DAO_SUPPORT +#include // MFC DAO database classes +#endif // _AFX_NO_DAO_SUPPORT + +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + +#endif + +*/ + + diff --git a/mozilla/cmd/dialup/win/muc/src/dialshr.cpp b/mozilla/cmd/dialup/win/muc/src/dialshr.cpp new file mode 100644 index 00000000000..ddd1faf6511 --- /dev/null +++ b/mozilla/cmd/dialup/win/muc/src/dialshr.cpp @@ -0,0 +1,1040 @@ +/* -*- 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 "stdafx.h" +#include +#include +#include +#include "dos.h" + +#ifdef WIN32 +#include +#include +#include +#include +#include +#endif + +#include "dialshr.h" + +HINSTANCE m_hRasInst; + +RASSETENTRYPROPERTIES m_lpfnRasSetEntryProperties; +RASGETCOUNTRYINFO m_lpfnRasGetCountryInfo; +RASENUMDEVICES m_lpfnRasEnumDevices; +RASGETENTRYPROPERTIES m_lpfnRasGetEntryProperties; +RASVALIDATEENTRYNAME m_lpfnRasValidateEntryName; +RASDELETEENTRY m_lpfnRasDeleteEntry; +RASHANGUP m_lpfnRasHangUp; +RASDIAL m_lpfnRasDial; +RASENUMCONNECTIONS m_lpfnRasEnumConnections; +RASSETENTRYDIALPARAMS m_lpfnRasSetEntryDialParams; +RASENUMENTRIES m_lpfnRasEnumEntries; + +#ifdef WIN32 +// for NT40 +RASSETAUTODIALENABLE m_lpfnRasSetAutodialEnable; +RASSETAUTODIALADDRESS m_lpfnRasSetAutodialAddress; +RASGETAUTODIALADDRESS m_lpfnRasGetAutodialAddress; +RASSETAUTODIALPARAM m_lpfnRasSetAutodialParam; +RASSETCREDENTIALS m_lpfnRasSetCredentials; +RASENUMAUTODIALADDRESSES m_lpfnRasEnumAutodialAddresses; +#else +#define LocalFree free +#define MAX_PATH 100 +#endif + +#define MAX_ENTRIES 20 +void *ReggieScript; //Ptr to Script data from Reggie + +//******************************************************************************** +// +// LoadRasFunctions() +// +//******************************************************************************** +BOOL LoadRasFunctions(LPCSTR lpszLibrary) +{ + // ASSERT(!m_hRasInst); + m_hRasInst = ::LoadLibrary(lpszLibrary); + if ((UINT)m_hRasInst > 32) + { + 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"); + + m_lpfnRasHangUp = (RASHANGUP)::GetProcAddress(m_hRasInst, "RasHangUpA"); + m_lpfnRasDial = (RASDIAL)::GetProcAddress(m_hRasInst, "RasDialA"); + m_lpfnRasEnumConnections = (RASENUMCONNECTIONS)::GetProcAddress(m_hRasInst, + "RasEnumConnectionsA"); + m_lpfnRasSetEntryDialParams = (RASSETENTRYDIALPARAMS)::GetProcAddress(m_hRasInst, + "RasSetEntryDialParamsA"); + m_lpfnRasEnumEntries = (RASENUMENTRIES)::GetProcAddress(m_hRasInst, + "RasEnumEntriesA"); + + return TRUE; + + } + else + { +#ifdef WIN32 // win95 + MessageBox(NULL,"Please install Dial-up Networking", "Netscape", MB_ICONSTOP); +#else // win16 + MessageBox(NULL,"Please install Shiva Remote Dialer", "Netscape", MB_ICONSTOP); +#endif + ::FreeLibrary(m_hRasInst); + m_hRasInst = NULL; + return FALSE; + } +} + + + +#ifdef WIN32 +//******************************************************************************** +// +// LoadRasFunctionsNT() +// +//******************************************************************************** +BOOL LoadRasFunctionsNT(LPCSTR lpszLibrary) +{ + m_hRasInst = ::LoadLibrary(lpszLibrary); + + if ((UINT)m_hRasInst > 32) + { + m_lpfnRasSetEntryProperties = (RASSETENTRYPROPERTIES)::GetProcAddress(m_hRasInst, + "RasSetEntryPropertiesA"); + + 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"); + m_lpfnRasEnumEntries = (RASENUMENTRIES)::GetProcAddress(m_hRasInst, + "RasEnumEntriesA"); + m_lpfnRasHangUp = (RASHANGUP)::GetProcAddress(m_hRasInst, "RasHangUpA"); + m_lpfnRasDial = (RASDIAL)::GetProcAddress(m_hRasInst, "RasDialA"); + m_lpfnRasEnumConnections = (RASENUMCONNECTIONS)::GetProcAddress(m_hRasInst, + "RasEnumConnectionsA"); + m_lpfnRasSetEntryDialParams = (RASSETENTRYDIALPARAMS)::GetProcAddress(m_hRasInst, + "RasSetEntryDialParamsA"); + + // AUTODIAL + m_lpfnRasSetAutodialEnable = (RASSETAUTODIALENABLE)::GetProcAddress(m_hRasInst, + "RasSetAutodialEnableA"); + m_lpfnRasSetAutodialAddress = (RASSETAUTODIALADDRESS)::GetProcAddress(m_hRasInst, + "RasSetAutodialAddressA"); + m_lpfnRasGetAutodialAddress = (RASGETAUTODIALADDRESS)::GetProcAddress(m_hRasInst, + "RasGetAutodialAddressA"); + m_lpfnRasSetAutodialParam = (RASSETAUTODIALPARAM)::GetProcAddress(m_hRasInst, + "RasSetAutodialParamA"); + m_lpfnRasSetCredentials = (RASSETCREDENTIALS)::GetProcAddress(m_hRasInst, + "RasSetCredentialsA"); + m_lpfnRasEnumAutodialAddresses = (RASENUMAUTODIALADDRESSES)::GetProcAddress(m_hRasInst, + "RasEnumAutodialAddressesA"); + + } + + else + { + MessageBox(NULL, "Please install Dial-up Networking", "Netscape", MB_ICONSTOP); + ::FreeLibrary(m_hRasInst); + m_hRasInst = NULL; + return FALSE; + } + return TRUE; +} + +#endif +//******************************************************************************** +// +// FreeRasFunctions() +// +//******************************************************************************** +void FreeRasFunctions() +{ + if((UINT)m_hRasInst > 32) + FreeLibrary(m_hRasInst); +} +//******************************************************************************** +// +// 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). +//******************************************************************************** +BOOL GetModemList(char ***resultModemList, int *numDevices) +{ + DWORD dwBytes = 0, dwDevices; + LPRASDEVINFO lpRnaDevInfo; + + // First find out how much memory to allocate + (*m_lpfnRasEnumDevices)(NULL, &dwBytes, &dwDevices); + lpRnaDevInfo = (LPRASDEVINFO)malloc(dwBytes); + + if(!lpRnaDevInfo) + return (FALSE); + + lpRnaDevInfo->dwSize = stRASDEVINFO; + (*m_lpfnRasEnumDevices)(lpRnaDevInfo, &dwBytes, &dwDevices); + + // copy all entries to the char array + *resultModemList = new char* [dwDevices+1]; + if(*resultModemList == NULL) + return FALSE; + + *numDevices = dwDevices; + for (unsigned short i=0; idwSize = stRASDEVINFO; + (*m_lpfnRasEnumDevices)(lpRnaDevInfo, &dwBytes, &dwDevices); + + // If match the modem given from JS then return the associated Type + for (unsigned short i=0; imkid.cb; + return (LPITEMIDLIST)lpMem; +} + + +//******************************************************************************** +// utility function +// +// GetSize +// +//******************************************************************************** +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 +// +//******************************************************************************** +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 +// +//******************************************************************************** +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); + } + + return pidlNew; +} + + +//******************************************************************************** +// +// GetMyComputerFolder +// +// This routine returns the ISHellFolder for the virtual My Computer folder, +// and also returns the PIDL. +//******************************************************************************** +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. +//******************************************************************************** +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"; + //CString strText; + //strText.LoadString(IDS_DIAL_UP_NW); + 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( NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &pEnumIDList); + if (SUCCEEDED(hres)) { + LPITEMIDLIST pidl; + + int flag = 1; + STRRET name; + while ((NOERROR == (hres = pEnumIDList->Next(1, &pidl, NULL))) && (flag)) + { + memset(&name, 0, sizeof(STRRET)); + + 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); + int rtn = GetLastError(); + pMalloc->Free(pidl); + flag = 0; + //break; + } + + if (flag) + pMalloc->Free(pidl); + } + + pEnumIDList->Release(); + } + + pmcf->Release(); + pMalloc->Free(pidlmc); + } + + pMalloc->Release(); + + + return hres; +} + +//******************************************************************************** +// +// GetDialUpConnection +// +//******************************************************************************** +BOOL GetDialUpConnection95(CONNECTIONPARAMS **connectionNames, int *numNames) +{ + HRESULT hres; + + IMalloc* pMalloc = NULL; + IShellFolder* pshf = NULL; + LPITEMIDLIST pidldun; + LPITEMIDLIST pidl; + STRRET name; + char temp[MAX_PATH]; + int flag=1; + int i =0; + + + // Initialize out parameter + hres = SHGetMalloc(&pMalloc); + if (FAILED(hres)) + return FALSE; + + // 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(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, &pEnumIDList); + + if (SUCCEEDED(hres)) + { + *numNames = 0; + while (NOERROR == (hres = pEnumIDList->Next(1, &pidl, NULL))) + (*numNames) ++; + + pEnumIDList->Reset(); + + *connectionNames = new CONNECTIONPARAMS [*numNames]; + if(*connectionNames == NULL) + return FALSE; + + while ((NOERROR == (hres = pEnumIDList->Next(1, &pidl, NULL))) && (flag)) + { + name.uType = STRRET_CSTR; // preferred choice + hres = pshf->GetDisplayNameOf(pidl, SHGDN_INFOLDER, &name); + + if (FAILED(hres)) + { + pMalloc->Free(pidl); + flag = 0; + //break; + } + + ProcStrings(pidl, name, temp); + if(strcmp(temp, "Make New Connection") !=0) + { + strcpy((*connectionNames)[i].szEntryName, temp); + (*connectionNames)[i].pidl = ConcatPidls(pidldun, pidl); + i++; + } + + + if (flag) + pMalloc->Free(pidl); + } + + pEnumIDList->Release(); + } + + pshf->Release(); + pMalloc->Free(pidldun); + } + + pMalloc->Release(); + *numNames = i; + + return TRUE; +} +//******************************************************************************** +// +// GetDialUpConnection +// +//******************************************************************************** +BOOL GetDialUpConnectionNT(CONNECTIONPARAMS **connectionNames, int *numNames) +{ + RASENTRYNAME *rasEntryName; + DWORD cb; + DWORD cEntries; + int i; + char *szPhoneBook; + + szPhoneBook = NULL; + rasEntryName = new RASENTRYNAME[MAX_ENTRIES]; + + if(rasEntryName == NULL) + return FALSE; + + memset(rasEntryName, 0, MAX_ENTRIES); + rasEntryName[0].dwSize = sizeof(RASENTRYNAME); + cb = sizeof(RASENTRYNAME) * MAX_ENTRIES; + + int rtn = (*m_lpfnRasEnumEntries)(NULL, szPhoneBook, rasEntryName, &cb, &cEntries); + if( rtn !=0 ) + return FALSE; + + *numNames = cEntries; + + *connectionNames = new CONNECTIONPARAMS [*numNames + 1]; + + for(i=0; i<*numNames; i++) + { + strcpy((*connectionNames)[i].szEntryName, rasEntryName[i].szEntryName); + } + + delete []rasEntryName; + return TRUE; +} + +#else +//******************************************************************************** +// +// EnableDialOnDemand16 +// +//******************************************************************************** +#define SHIVA_CONNFILE_EXT ".sr" // Shiva connection file extension +#define SHIVA_ALL_CONNFILES "*.sr" // all Shiva connection files +#define SHIVA_INI_DIALER_SECTION "ConnectW Config" // Shiva INI section name +#define SHIVA_INI_FILENAME_KEY "preferred file" // Shiva INI section name + +void EnableDialOnDemand16(char *AccountName, BOOL flag) +{ + 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 + + GetProfileString(SHIVA_INI_DIALER_SECTION, SHIVA_INI_FILENAME_KEY, "", szIniFName, sizeof(szIniFName)); + GetProfileString(SHIVA_INI_DIALER_SECTION, szIniFName, "", szIniPath, sizeof(szIniPath)); + + // construct sremote.ini path and isp.sr path names + strcat(szIniPath, "\\"); // (c:\netscape\program\) + strcpy(szFilePath, szIniPath); // (c:\netscape\program\) + strcpy(szTemplate, szFilePath); + strcat(szTemplate, SHIVA_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? shiva 4.0 or above checks the description in .sr file + if ((!strcmpi(szCurrEntryName, AccountName)) || (strstr(szCurrEntryName, AccountName))) + bEntryFound = TRUE; + // shiva 3.0 or below checks the .sr file name + else if(strstr(c_file.name, AccountName)) + bEntryFound = TRUE; + } while (!bEntryFound && (_dos_findnext(&c_file) == 0)); + } + + if(flag) + { + WritePrivateProfileString("DialOnDemand", "Enable", "Yes", szIniPath); + WritePrivateProfileString("DialOnDemand", "DialOnDemand", szEntryFName, szIniPath); + } + else + { + WritePrivateProfileString("DialOnDemand", "Enable", "No", szIniPath); + WritePrivateProfileString("DialOnDemand", "DialOnDemand", "", szIniPath); + } + } + +//******************************************************************************** +// +// GetDialUpConnection16 +// +//******************************************************************************** +BOOL GetDialUpConnection16(CONNECTIONPARAMS **connectionNames, int *numNames) +{ + 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 + + GetProfileString(SHIVA_INI_DIALER_SECTION, SHIVA_INI_FILENAME_KEY, "", szIniFName, sizeof(szIniFName)); + GetProfileString(SHIVA_INI_DIALER_SECTION, szIniFName, "", szIniPath, sizeof(szIniPath)); + + // construct sremote.ini path and isp.sr path names + strcat(szIniPath, "\\"); // (c:\netscape\program\) + strcpy(szFilePath, szIniPath); // (c:\netscape\program\) + strcpy(szTemplate, szFilePath); + strcat(szTemplate, SHIVA_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; + int nResult, i; + + // count number of .sr files + i = 0; + if ((hFile = _dos_findfirst(szTemplate, _A_NORMAL, &c_file)) == 0) + { + do // seek thru connection files to match entry name + { + i ++; + } while (_dos_findnext(&c_file) == 0); + } + else + return FALSE; + + *numNames = i; + *connectionNames = new CONNECTIONPARAMS [*numNames + 1]; + char szCurrEntryName[RAS_MaxEntryName]; + + // get the file name list + int j; + char temp_fname[MAX_PATH]; + + i = 0; + if ((hFile = _dos_findfirst(szTemplate, _A_NORMAL, &c_file)) == 0) + { + do // seek thru connection files to match entry name + { + strcpy(szEntryFName, szFilePath); // (c:\netscape\program\) + strcat(szEntryFName, c_file.name); // (c:\netscape\program\current.sr) + + // get Shiva entry description (name) + nResult = GetPrivateProfileString("Dial-In Configuration", "Description", "", + szCurrEntryName, RAS_MaxEntryName, szEntryFName); + if(nResult != 0) + strcpy((*connectionNames)[i].szEntryName, szCurrEntryName); + else + { + strcpy(temp_fname, c_file.name); + for(j=strlen(temp_fname); temp_fname[j]!='.' && j>0; j--) ; + temp_fname[j] = '\0'; + strcpy((*connectionNames)[i].szEntryName, temp_fname); + } + i++; + + } while (_dos_findnext(&c_file) == 0); + } + + return TRUE; +} + +#endif + +//******************************************************************************** +// +// IsDialerConnected +// +// checks if the dialer is still connected +//******************************************************************************** +BOOL IsDialerConnected() +{ + RASCONN *Info = NULL, *lpTemp = NULL; + DWORD code, count = 0; + DWORD dSize = stRASCONN; + char szMessage[256]=""; + + // try to get a buffer to receive the connection data + if(!(Info = (RASCONN *)LocalAlloc(LPTR, dSize))) + // Err: trouble allocating buffer + return (FALSE); + + // see if there are any open connections + Info->dwSize = stRASCONN; + code = (*m_lpfnRasEnumConnections) (Info, &dSize, &count); + + if (/*ERROR_BUFFER_TOO_SMALL*/ 0 != code) + { + // free the old buffer + LocalFree(Info); + + // allocate a new bigger one + Info = (RASCONN *)LocalAlloc(LPTR, dSize); + if(!Info) + // Err: trouble allocating buffer + return (FALSE); + + // try to enumerate again + Info->dwSize = dSize; + if((*m_lpfnRasEnumConnections)(Info, &dSize, &count) != 0) { + LocalFree(Info); + // can't enumerate connections, assume none is active + return (FALSE); + } + } + + // check for no connections + if (0 == count) { + LocalFree(Info); + return (FALSE); + } + + LocalFree(Info); + + return (TRUE); + +} diff --git a/mozilla/cmd/dialup/win/muc/src/dialshr.h b/mozilla/cmd/dialup/win/muc/src/dialshr.h new file mode 100644 index 00000000000..dff4fc66bde --- /dev/null +++ b/mozilla/cmd/dialup/win/muc/src/dialshr.h @@ -0,0 +1,178 @@ +/* -*- 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 WIN32 +#include "ras.h" +#include "shlobj.h" +#include "winerror.h" +#else +#include "ras16.h" +#endif + +#ifndef WIN32 +#define MAX_PATH 100 +#endif + +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, LPRASENTRY, LPDWORD, LPBYTE, LPDWORD); +typedef DWORD (WINAPI* RASVALIDATEENTRYNAME)(LPSTR, LPSTR); +typedef DWORD (WINAPI* RASDELETEENTRY)(LPSTR, LPSTR); +typedef DWORD (WINAPI* RASHANGUP)(HRASCONN); +typedef DWORD (WINAPI* RASDIAL)(LPRASDIALEXTENSIONS,LPTSTR,LPRASDIALPARAMS,DWORD, + LPVOID,LPHRASCONN); +typedef DWORD (WINAPI* RASENUMCONNECTIONS)(LPRASCONN,LPDWORD,LPDWORD); +typedef DWORD (WINAPI* RASSETENTRYDIALPARAMS)(LPTSTR,LPRASDIALPARAMS,BOOL); +typedef DWORD (WINAPI* RASENUMENTRIES)(LPTSTR,LPTSTR,LPRASENTRYNAME,LPDWORD,LPDWORD); + +#ifdef WIN32 +// for NT40 only +typedef DWORD (WINAPI* RASSETAUTODIALADDRESS)(LPSTR, DWORD, LPRASAUTODIALENTRYA, DWORD, DWORD); +typedef DWORD (WINAPI* RASGETAUTODIALADDRESS)(LPSTR, DWORD, LPRASAUTODIALENTRYA, LPDWORD, LPDWORD); +typedef DWORD (WINAPI* RASSETAUTODIALENABLE)(DWORD, BOOL); +typedef DWORD (WINAPI* RASSETAUTODIALPARAM)(DWORD, LPVOID, DWORD); +typedef DWORD (WINAPI* RASENUMAUTODIALADDRESSES)(LPTSTR *,LPDWORD,LPDWORD); +typedef DWORD (WINAPI* RASSETCREDENTIALS)(LPTSTR, LPTSTR, LPRASCREDENTIALS, BOOL); +#endif + +extern HINSTANCE m_hRasInst; +extern RASSETENTRYPROPERTIES m_lpfnRasSetEntryProperties; +extern RASGETCOUNTRYINFO m_lpfnRasGetCountryInfo; +extern RASENUMDEVICES m_lpfnRasEnumDevices; +extern RASGETENTRYPROPERTIES m_lpfnRasGetEntryProperties; +extern RASVALIDATEENTRYNAME m_lpfnRasValidateEntryName; +extern RASDELETEENTRY m_lpfnRasDeleteEntry; +extern RASHANGUP m_lpfnRasHangUp; +extern RASDIAL m_lpfnRasDial; +extern RASENUMCONNECTIONS m_lpfnRasEnumConnections; +extern RASSETENTRYDIALPARAMS m_lpfnRasSetEntryDialParams; +extern RASENUMENTRIES m_lpfnRasEnumEntries; + +#ifdef WIN32 +// for NT40 only +extern RASSETAUTODIALENABLE m_lpfnRasSetAutodialEnable; +extern RASSETAUTODIALADDRESS m_lpfnRasSetAutodialAddress; +extern RASSETAUTODIALPARAM m_lpfnRasSetAutodialParam; +extern RASENUMAUTODIALADDRESSES m_lpfnRasEnumAutodialAddresses; +extern RASSETCREDENTIALS m_lpfnRasSetCredentials; + +extern int platformOS; // platform OS (95 or NT40) +#endif + +extern HINSTANCE DLLinstance; // dll instance + +// account parameters +typedef struct ACCOUNTPARAMS +{ + char ISPName[32]; + char FileName[16]; + 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; +} LOCATIONPARAMS; + +// connection name parameters +typedef struct CONNECTIONPARAMS +{ + char szEntryName[MAX_PATH]; +#ifdef WIN32 + LPITEMIDLIST pidl; +#endif +} CONNECTIONPARAMS; + + +extern size_t stRASENTRY; +extern size_t stRASCONN; +extern size_t stRASCTRYINFO; +extern size_t stRASDIALPARAMS; +extern size_t stRASDEVINFO; +extern size_t stRASCREDENTIALS; + +#ifdef WIN32 +void SizeofRAS95(); +void SizeofRASNT40(); +#else +void SizeofRAS16(); +#endif + +BOOL LoadRasFunctions(LPCSTR lpszLibrary); +void FreeRasFunctions(); +BOOL GetModemList(char ***, int*); +BOOL GetModemType( char *strModemName, char *strModemType); +BOOL GetDialUpConnection16(CONNECTIONPARAMS **connectionNames, int *numNames); +void EnableDialOnDemand16(LPSTR lpProfileName, BOOL flag); +BOOL IsDialerConnected(); + +#ifdef WIN32 +BOOL LoadRasFunctionsNT(LPCSTR lpszLibrary); +BOOL GetDialUpConnection95(CONNECTIONPARAMS **connectionNames, int *numNames); +BOOL GetDialUpConnectionNT(CONNECTIONPARAMS **connectionNames, int *numNames); +BOOL SameStrings(LPITEMIDLIST pidl, STRRET& lpStr1, LPCTSTR lpStr2); + +LPITEMIDLIST Next(LPCITEMIDLIST pidl); +UINT GetSize(LPCITEMIDLIST pidl); +LPITEMIDLIST Create(UINT cbSize); +LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); + +HRESULT GetMyComputerFolder(LPSHELLFOLDER *ppshf, LPITEMIDLIST *ppidl); + +HRESULT GetDialUpNetworkingFolder(LPSHELLFOLDER *ppshf, LPITEMIDLIST *ppidl); + +void FAR PASCAL lineCallbackFuncNT(DWORD /* hDevice */, + DWORD /* dwMsg */, + DWORD /* dwCallbackInstance */, + DWORD /* dwParam1 */, + DWORD /* dwParam2 */, + DWORD /* dwParam3 */); + +void EnableDialOnDemandNT(LPSTR lpProfileName, BOOL flag); +void EnableDialOnDemand95(LPSTR lpProfileName, BOOL flag); + +#endif + diff --git a/mozilla/cmd/dialup/win/muc/src/muc.def b/mozilla/cmd/dialup/win/muc/src/muc.def new file mode 100644 index 00000000000..de9e1bd6bc5 --- /dev/null +++ b/mozilla/cmd/dialup/win/muc/src/muc.def @@ -0,0 +1,34 @@ +; -*- 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 MUC +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE SINGLE +HEAPSIZE 8192 +EXPORTS + PEPluginFunc @1 + + 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; +; } + diff --git a/mozilla/cmd/dialup/win/muc/src/ras95.cpp b/mozilla/cmd/dialup/win/muc/src/ras95.cpp new file mode 100644 index 00000000000..c11b5b63d73 --- /dev/null +++ b/mozilla/cmd/dialup/win/muc/src/ras95.cpp @@ -0,0 +1,40 @@ +/* -*- 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 "stdafx.h" + +size_t stRASENTRY = 0; +size_t stRASCONN = 0; +size_t stRASCTRYINFO = 0; +size_t stRASDIALPARAMS = 0; +size_t stRASDEVINFO = 0; + +#ifdef WINVER +#undef WINVER +#endif +#define WINVER 0x0400 + +#include +#include + +void SizeofRAS95() { + stRASENTRY = sizeof(RASENTRY); + stRASCONN = sizeof(RASCONN); + stRASCTRYINFO = sizeof(RASCTRYINFO); + stRASDIALPARAMS = sizeof(RASDIALPARAMS); + stRASDEVINFO = sizeof(RASDEVINFO); +} diff --git a/mozilla/cmd/dialup/win/muc/src/rasnt40.cpp b/mozilla/cmd/dialup/win/muc/src/rasnt40.cpp new file mode 100644 index 00000000000..9534081775c --- /dev/null +++ b/mozilla/cmd/dialup/win/muc/src/rasnt40.cpp @@ -0,0 +1,40 @@ +/* -*- 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 "stdafx.h" + +extern size_t stRASENTRY; +extern size_t stRASCONN; +extern size_t stRASCTRYINFO; +extern size_t stRASDIALPARAMS; +extern size_t stRASDEVINFO; + +#ifdef WINVER +#undef WINVER +#endif +#define WINVER 0x0401 + +#include +#include + +void SizeofRASNT40() { + stRASENTRY = sizeof(RASENTRY); + stRASCONN = sizeof(RASCONN); + stRASCTRYINFO = sizeof(RASCTRYINFO); + stRASDIALPARAMS = sizeof(RASDIALPARAMS); + stRASDEVINFO = sizeof(RASDEVINFO); +} diff --git a/mozilla/cmd/dialup/win/muc/win16/Muc.mak b/mozilla/cmd/dialup/win/muc/win16/Muc.mak new file mode 100644 index 00000000000..811bc54b6e4 --- /dev/null +++ b/mozilla/cmd/dialup/win/muc/win16/Muc.mak @@ -0,0 +1,125 @@ +# -*- Mode: Makefile -*- +# +# 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 Visual C++ generated build script - Do not modify + +PROJ = MUC +DEBUG = +PROGTYPE = 1 +CALLER = +ARGS = +DLLS = +D_RCDEFINES = -d_DEBUG +R_RCDEFINES = -dNDEBUG +ORIGIN = MSVC +ORIGIN_VER = 1.00 +PROJPATH = E:\NS\CMD\DIALUP4\WIN\MUC\WIN16\ +USEMFC = 1 +CC = cl +CPP = cl +CXX = cl +CCREATEPCHFLAG = +CPPCREATEPCHFLAG = +CUSEPCHFLAG = +CPPUSEPCHFLAG = +FIRSTC = +FIRSTCPP = STDAFX.CPP +RC = rc +CFLAGS_D_WDLL = /nologo /G2 /W3 /Zi /ALw /YX /Od /D "_DEBUG" /D "_USRDLL" /D "WIN16" /GD /Fd"Muc.PDB" /Fp"Muc.PCH" +CFLAGS_R_WDLL = /nologo /W3 /ALw /YX /O1 /D "NDEBUG" /D "_USRDLL" /D "WIN16" /GD /Fp"Muc.PCH" +LFLAGS_D_WDLL = /NOLOGO /NOD /NOE /PACKC:61440 /ALIGN:16 /ONERROR:NOEXE /CO /MAP /MAP:FULL +LFLAGS_R_WDLL = /NOLOGO /NOD /NOE /PACKC:61440 /ALIGN:16 /ONERROR:NOEXE /MAP:FULL +LIBS_D_WDLL = lafxdwd oldnames libw ldllcew commdlg.lib olecli.lib olesvr.lib shell.lib +LIBS_R_WDLL = lafxdw oldnames libw ldllcew commdlg.lib olecli.lib olesvr.lib shell.lib +RCFLAGS = /nologo +RESFLAGS = /nologo +RUNFLAGS = +DEFFILE = ..\src\MUC.DEF +OBJS_EXT = +LIBS_EXT = +!if "$(DEBUG)" == "1" +CFLAGS = $(CFLAGS_D_WDLL) +LFLAGS = $(LFLAGS_D_WDLL) +LIBS = $(LIBS_D_WDLL) +MAPFILE = nul +RCDEFINES = $(D_RCDEFINES) +!else +CFLAGS = $(CFLAGS_R_WDLL) +LFLAGS = $(LFLAGS_R_WDLL) +LIBS = $(LIBS_R_WDLL) +MAPFILE = nul +RCDEFINES = $(R_RCDEFINES) +!endif +!if [if exist MSVC.BND del MSVC.BND] +!endif +SBRS = RAS16.SBR \ + DIALSHR.SBR \ + MUC.SBR \ + STDAFX.SBR + + +RAS16_DEP = + +DIALSHR_DEP = + +MUC_DEP = + +STDAFX_DEP = + +all: $(PROJ).DLL + +RAS16.OBJ: ..\src\RAS16.CPP $(RAS16_DEP) + $(CPP) $(CFLAGS) $(CPPUSEPCHFLAG) /c ..\src\RAS16.CPP + +DIALSHR.OBJ: ..\src\DIALSHR.CPP $(DIALSHR_DEP) + $(CPP) $(CFLAGS) $(CPPUSEPCHFLAG) /c ..\src\DIALSHR.CPP + +MUC.OBJ: ..\src\MUC.CPP $(MUC_DEP) + $(CPP) $(CFLAGS) $(CPPUSEPCHFLAG) /c ..\src\MUC.CPP + +STDAFX.OBJ: ..\src\STDAFX.CPP $(STDAFX_DEP) + $(CPP) $(CFLAGS) $(CPPCREATEPCHFLAG) /c ..\src\STDAFX.CPP + + +$(PROJ).DLL:: RAS16.OBJ DIALSHR.OBJ MUC.OBJ STDAFX.OBJ $(OBJS_EXT) $(DEFFILE) + echo >NUL @<<$(PROJ).CRF +RAS16.OBJ + +DIALSHR.OBJ + +MUC.OBJ + +STDAFX.OBJ + +$(OBJS_EXT) +$(PROJ).DLL +$(MAPFILE) +c:\TOOLS\VC152\LIB\+ +c:\TOOLS\VC152\MFC\LIB\+ +$(LIBS) +$(DEFFILE); +<< + link $(LFLAGS) @$(PROJ).CRF + $(RC) $(RESFLAGS) $@ + implib /nowep $(PROJ).LIB $(PROJ).DLL + + +run: $(PROJ).DLL + $(PROJ) $(RUNFLAGS) + + +$(PROJ).BSC: $(SBRS) + bscmake @<< +/o$@ $(SBRS) +<< diff --git a/mozilla/cmd/dialup/win/muc/win32/Muc.mak b/mozilla/cmd/dialup/win/muc/win32/Muc.mak new file mode 100644 index 00000000000..84a9bde66d6 --- /dev/null +++ b/mozilla/cmd/dialup/win/muc/win32/Muc.mak @@ -0,0 +1,326 @@ +# -*- Mode: Makefile -*- +# +# 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 NMAKE File, Format Version 4.20 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +!IF "$(CFG)" == "" +CFG=muc - Win32 Debug +!MESSAGE No configuration specified. Defaulting to muc - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "muc - Win32 Release" && "$(CFG)" != "muc - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Muc.mak" CFG="muc - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "muc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "muc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +# PROP Target_Last_Scanned "muc - Win32 Debug" +CPP=cl.exe +RSC=rc.exe +MTL=mktyplib.exe + +!IF "$(CFG)" == "muc - Win32 Release" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\Muc.dll" + +CLEAN : + -@erase "$(INTDIR)\dialshr.obj" + -@erase "$(INTDIR)\MUC.OBJ" + -@erase "$(INTDIR)\ras95.obj" + -@erase "$(INTDIR)\rasnt40.obj" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(OUTDIR)\Muc.dll" + -@erase "$(OUTDIR)\Muc.exp" + -@erase "$(OUTDIR)\Muc.lib" + -@erase "$(OUTDIR)\Muc.map" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /D WINVER=0x401 /YX /c +CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\ + "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /D WINVER=0x401\ + /Fp"$(INTDIR)/Muc.pch" /YX /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Release/ +CPP_SBRS=.\. +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" /d "_USRDLL" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Muc.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 /nologo /subsystem:windows /dll /map /machine:I386 /export:PEPluginFunc=_PEPluginFunc@12 +LINK32_FLAGS=/nologo /subsystem:windows /dll /incremental:no\ + /pdb:"$(OUTDIR)/Muc.pdb" /map:"$(INTDIR)/Muc.map" /machine:I386\ + /out:"$(OUTDIR)/Muc.dll" /implib:"$(OUTDIR)/Muc.lib"\ + /export:PEPluginFunc=_PEPluginFunc@12 +LINK32_OBJS= \ + "$(INTDIR)\dialshr.obj" \ + "$(INTDIR)\MUC.OBJ" \ + "$(INTDIR)\ras95.obj" \ + "$(INTDIR)\rasnt40.obj" \ + "$(INTDIR)\StdAfx.obj" \ + "E:\mstools\lib\TAPI32.LIB" + +"$(OUTDIR)\Muc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "muc - Win32 Debug" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\Muc.dll" + +CLEAN : + -@erase "$(INTDIR)\dialshr.obj" + -@erase "$(INTDIR)\MUC.OBJ" + -@erase "$(INTDIR)\ras95.obj" + -@erase "$(INTDIR)\rasnt40.obj" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(INTDIR)\vc40.idb" + -@erase "$(INTDIR)\vc40.pdb" + -@erase "$(OUTDIR)\Muc.dll" + -@erase "$(OUTDIR)\Muc.exp" + -@erase "$(OUTDIR)\Muc.ilk" + -@erase "$(OUTDIR)\Muc.lib" + -@erase "$(OUTDIR)\Muc.map" + -@erase "$(OUTDIR)\Muc.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /D WINVER=0x401 /YX /c +CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS"\ + /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /D WINVER=0x401\ + /Fp"$(INTDIR)/Muc.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS=.\. +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" /d "_USRDLL" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Muc.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 /nologo /subsystem:windows /dll /map /debug /machine:I386 /export:PEPluginFunc=_PEPluginFunc@12 +LINK32_FLAGS=/nologo /subsystem:windows /dll /incremental:yes\ + /pdb:"$(OUTDIR)/Muc.pdb" /map:"$(INTDIR)/Muc.map" /debug /machine:I386\ + /out:"$(OUTDIR)/Muc.dll" /implib:"$(OUTDIR)/Muc.lib"\ + /export:PEPluginFunc=_PEPluginFunc@12 +LINK32_OBJS= \ + "$(INTDIR)\dialshr.obj" \ + "$(INTDIR)\MUC.OBJ" \ + "$(INTDIR)\ras95.obj" \ + "$(INTDIR)\rasnt40.obj" \ + "$(INTDIR)\StdAfx.obj" \ + "E:\mstools\lib\TAPI32.LIB" + +"$(OUTDIR)\Muc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "muc - Win32 Release" +# Name "muc - Win32 Debug" + +!IF "$(CFG)" == "muc - Win32 Release" + +!ELSEIF "$(CFG)" == "muc - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=.\ReadMe.txt + +!IF "$(CFG)" == "muc - Win32 Release" + +!ELSEIF "$(CFG)" == "muc - Win32 Debug" + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\src\StdAfx.cpp +DEP_CPP_STDAF=\ + "..\src\stdafx.h"\ + + +"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\src\MUC.CPP +DEP_CPP_MUC_C=\ + "..\src\dialshr.h"\ + "..\src\muc.h"\ + "..\src\ras16.h"\ + "..\src\stdafx.h"\ + + +"$(INTDIR)\MUC.OBJ" : $(SOURCE) $(DEP_CPP_MUC_C) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\src\ras95.cpp +DEP_CPP_RAS95=\ + "..\src\stdafx.h"\ + + +"$(INTDIR)\ras95.obj" : $(SOURCE) $(DEP_CPP_RAS95) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\src\rasnt40.cpp +DEP_CPP_RASNT=\ + "..\src\stdafx.h"\ + + +"$(INTDIR)\rasnt40.obj" : $(SOURCE) $(DEP_CPP_RASNT) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\src\dialshr.cpp +DEP_CPP_DIALS=\ + "..\src\dialshr.h"\ + "..\src\ras16.h"\ + "..\src\stdafx.h"\ + + +"$(INTDIR)\dialshr.obj" : $(SOURCE) $(DEP_CPP_DIALS) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=E:\mstools\lib\TAPI32.LIB + +!IF "$(CFG)" == "muc - Win32 Release" + +!ELSEIF "$(CFG)" == "muc - Win32 Debug" + +!ENDIF + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/mozilla/cmd/dialup/win/ntras/dllmain.cpp b/mozilla/cmd/dialup/win/ntras/dllmain.cpp new file mode 100644 index 00000000000..3efea0e9840 --- /dev/null +++ b/mozilla/cmd/dialup/win/ntras/dllmain.cpp @@ -0,0 +1,262 @@ +/* -*- 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 "resource.h" + +BOOL IsDUNSetup(void); +BOOL IsAdmin(void); +HINSTANCE hDLLinstance=NULL; + +//************************************************************************ +// IsNetworkSetupNT() +// +// return 1, if we're Win95 +// return 2, if NT4.0 and DUN is setup properly +// return 3, if NT4.0 w/o DUN, or NT3.51 +// +//************************************************************************ +__declspec(dllexport) +int WINAPI +IsNetworkSetupNT(HWND hInstallerWnd) +{ + int platformOS; // platform OS (95 or NT40) + int rtnVal; + + OSVERSIONINFO *lpOsVersionInfo = (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO)); + lpOsVersionInfo->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + if (GetVersionEx(lpOsVersionInfo)) { + platformOS = (int)lpOsVersionInfo->dwPlatformId; + } else { + free(lpOsVersionInfo); + return -1; + } + + switch (platformOS) { + + case VER_PLATFORM_WIN32_WINDOWS: + rtnVal = 1; + break; + + case VER_PLATFORM_WIN32_NT: + + // if we are running in WinNT, make sure we are in NT4.0 not in NT3.x + + if (lpOsVersionInfo->dwMajorVersion < 4) { + + // running in NT3.x !!! need to warn users. + // "Accout Setup does not work in NT3.x" + char buf[255]; + int ret = LoadString(hDLLinstance, OS_NT351, buf, 255); + MessageBox(hInstallerWnd, (char *)&buf, NULL, MB_OK | MB_ICONEXCLAMATION); + + } else { + + // we're in NT4.x or later version + // check if Network is setup already + BOOL setup = IsDUNSetup(); + if (!setup) { + + BOOL isAdmin = IsAdmin(); + + if (isAdmin) { + + char buf[255]; + int ret = LoadString(hDLLinstance, NO_DUN, buf, 255); + MessageBox(hInstallerWnd, (char *)&buf, NULL, MB_OK | MB_ICONEXCLAMATION); + + } else { + + char buf[255]; + int ret = LoadString(hDLLinstance, NO_ADMIN, buf, 255); + MessageBox(hInstallerWnd, (char *)&buf, NULL, MB_OK | MB_ICONEXCLAMATION); + + } + } + } + + rtnVal = 2; + break; + } + + free(lpOsVersionInfo); + + return rtnVal; + +} + + + +//******************************************************************************** +// +// Check if user has proper Network setup for PE +// +//******************************************************************************** + +/* +__declspec(dllexport) +BOOL WINAPI +IsNetworkSetupNT() +{ + + BOOL rtn; + BOOL isAdmin; + BOOL setup; + + // check if Network is setup already + rtn = IsDUNSetup(); + + // check for user's logon premission, if Network + // is not setup properly. + if (rtn == FALSE) { + isAdmin = IsAdmin(); + + if (isAdmin) + setup = rtn; + else + setup = -999; + + } else { + + setup = rtn; + } + + return setup; +} +*/ + + +//******************************************************************************** +// +// 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; +} + + +//******************************************************************************** +// +// check if Dial-Up Networking is installed +// +//******************************************************************************** +BOOL IsDUNSetup(void) { + + BOOL bInstall = FALSE; + BOOL bAdmin = FALSE; + HKEY hKey; + LONG rtn; + char szBuf[MAX_PATH]; + char *buf = NULL; + + + // Let's see if its installed + // "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\RemoteAccess" + if (rtn = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\RemoteAccess", 0, KEY_QUERY_VALUE, &hKey)) + if (rtn != ERROR_SUCCESS) + return (FALSE); + + // the key is there, was it actually installed though... + // look for some RAS keys + + szBuf[0] = '\0'; + if(!bInstall) { + DWORD cbData = sizeof(szBuf); + rtn = RegQueryValueEx(hKey, "DisplayName", NULL, NULL, (LPBYTE)szBuf, &cbData); + if(strlen(szBuf) == 0) + return (FALSE); + + RegCloseKey(hKey); + + // how about autodial manager.... + // "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\RasAuto" + if(ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\RasAuto", 0, KEY_QUERY_VALUE, &hKey)) + return (FALSE); + + RegCloseKey(hKey); + + } + + return (TRUE); +} + + +//************************************************************************ +// DllEntryPoint +//************************************************************************ +HINSTANCE g_hDllInstance = NULL; + +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: + { + hDLLinstance = hinstDLL; // keeps DLL instance + break; + } + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + break; + } + return TRUE; +} diff --git a/mozilla/cmd/dialup/win/ntras/ntras.def b/mozilla/cmd/dialup/win/ntras/ntras.def new file mode 100644 index 00000000000..56f72837645 --- /dev/null +++ b/mozilla/cmd/dialup/win/ntras/ntras.def @@ -0,0 +1,21 @@ +; -*- 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 NTRAS + +EXPORTS + IsNetworkSetupNT diff --git a/mozilla/cmd/dialup/win/ntras/ntras.mak b/mozilla/cmd/dialup/win/ntras/ntras.mak new file mode 100644 index 00000000000..1e1bad687ee --- /dev/null +++ b/mozilla/cmd/dialup/win/ntras/ntras.mak @@ -0,0 +1,253 @@ +# -*- Mode: Makefile -*- +# +# 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 NMAKE File, Format Version 4.20 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +!IF "$(CFG)" == "" +CFG=ntras - Win32 Debug +!MESSAGE No configuration specified. Defaulting to ntras - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "ntras - Win32 Release" && "$(CFG)" != "ntras - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ntras.mak" CFG="ntras - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ntras - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "ntras - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +# PROP Target_Last_Scanned "ntras - Win32 Debug" +CPP=cl.exe +MTL=mktyplib.exe +RSC=rc.exe + +!IF "$(CFG)" == "ntras - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\ntras.dll" + +CLEAN : + -@erase "$(INTDIR)\dllmain.obj" + -@erase "$(INTDIR)\ntras.res" + -@erase "$(OUTDIR)\ntras.dll" + -@erase "$(OUTDIR)\ntras.exp" + -@erase "$(OUTDIR)\ntras.lib" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\ + /Fp"$(INTDIR)/ntras.pch" /YX /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Release/ +CPP_SBRS=.\. +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +RSC_PROJ=/l 0x409 /fo"$(INTDIR)/ntras.res" /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/ntras.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ + odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\ + /pdb:"$(OUTDIR)/ntras.pdb" /machine:I386 /def:".\ntras.def"\ + /out:"$(OUTDIR)/ntras.dll" /implib:"$(OUTDIR)/ntras.lib" +DEF_FILE= \ + ".\ntras.def" +LINK32_OBJS= \ + "$(INTDIR)\dllmain.obj" \ + "$(INTDIR)\ntras.res" + +"$(OUTDIR)\ntras.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "ntras - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\ntras.dll" + +CLEAN : + -@erase "$(INTDIR)\dllmain.obj" + -@erase "$(INTDIR)\ntras.res" + -@erase "$(INTDIR)\vc40.idb" + -@erase "$(INTDIR)\vc40.pdb" + -@erase "$(OUTDIR)\ntras.dll" + -@erase "$(OUTDIR)\ntras.exp" + -@erase "$(OUTDIR)\ntras.ilk" + -@erase "$(OUTDIR)\ntras.lib" + -@erase "$(OUTDIR)\ntras.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\ + /Fp"$(INTDIR)/ntras.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS=.\. +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +RSC_PROJ=/l 0x409 /fo"$(INTDIR)/ntras.res" /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/ntras.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ + odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes\ + /pdb:"$(OUTDIR)/ntras.pdb" /debug /machine:I386 /def:".\ntras.def"\ + /out:"$(OUTDIR)/ntras.dll" /implib:"$(OUTDIR)/ntras.lib" +DEF_FILE= \ + ".\ntras.def" +LINK32_OBJS= \ + "$(INTDIR)\dllmain.obj" \ + "$(INTDIR)\ntras.res" + +"$(OUTDIR)\ntras.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "ntras - Win32 Release" +# Name "ntras - Win32 Debug" + +!IF "$(CFG)" == "ntras - Win32 Release" + +!ELSEIF "$(CFG)" == "ntras - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=.\dllmain.cpp + +"$(INTDIR)\dllmain.obj" : $(SOURCE) "$(INTDIR)" + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\ntras.def + +!IF "$(CFG)" == "ntras - Win32 Release" + +!ELSEIF "$(CFG)" == "ntras - Win32 Debug" + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\ntras.rc + +"$(INTDIR)\ntras.res" : $(SOURCE) "$(INTDIR)" + $(RSC) $(RSC_PROJ) $(SOURCE) + + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/mozilla/cmd/dialup/win/ntras/ntras.rc b/mozilla/cmd/dialup/win/ntras/ntras.rc new file mode 100644 index 00000000000..514a6dbed91 --- /dev/null +++ b/mozilla/cmd/dialup/win/ntras/ntras.rc @@ -0,0 +1,135 @@ +/* -*- 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 + +#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 + + +#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 "040904e2" + BEGIN + VALUE "CompanyName", " \0" + VALUE "FileDescription", "ntras\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "ntras\0" + VALUE "LegalCopyright", "Copyright © 1997\0" + VALUE "OriginalFilename", "ntras.dll\0" + VALUE "ProductName", " ntras\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1250 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + OS_NT351 "Account Setup will not work on machines running NT3.x versions.\nYou will need to manually configure your network or dialer settings in order to run Netscape Communicator." + NO_ADMIN "Dial-Up Networking has not been installed on this machine.\n\nPlease make sure you have administrator premission first in order to install Dial-Up Networking manually.\nAccout Setup will not work until Dial-Up Networking is installed." + NO_DUN "Dial-Up Networking has not been installed on this machine.\n\nPlease install Dial-Up Networking on your NT machine first.\nAccout Setup will not work until Dial-Up Networking is installed. " +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/ntras/resource.h b/mozilla/cmd/dialup/win/ntras/resource.h new file mode 100644 index 00000000000..20cb1f94f5b --- /dev/null +++ b/mozilla/cmd/dialup/win/ntras/resource.h @@ -0,0 +1,35 @@ +/* -*- 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 ntras.rc +// +#define OS_NT351 6000 +#define NO_ADMIN 6001 +#define NO_DUN 6002 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/mozilla/cmd/dialup/win/rasexit/MainFrm.cpp b/mozilla/cmd/dialup/win/rasexit/MainFrm.cpp new file mode 100644 index 00000000000..9b6b76b60a9 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/MainFrm.cpp @@ -0,0 +1,124 @@ +/* -*- 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. + */ +// MainFrm.cpp : implementation of the CMainFrame class +// + +#include "stdafx.h" +#include "rasexit.h" + +#include "MainFrm.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame + +IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) + +BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) + //{{AFX_MSG_MAP(CMainFrame) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code ! + ON_WM_CREATE() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +static UINT indicators[] = +{ + ID_SEPARATOR, // status line indicator + ID_INDICATOR_CAPS, + ID_INDICATOR_NUM, + ID_INDICATOR_SCRL, +}; + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame construction/destruction + +CMainFrame::CMainFrame() +{ + // TODO: add member initialization code here + +} + +CMainFrame::~CMainFrame() +{ +} + +int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CFrameWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + if (!m_wndToolBar.Create(this) || + !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) + { + TRACE0("Failed to create toolbar\n"); + return -1; // fail to create + } + + if (!m_wndStatusBar.Create(this) || + !m_wndStatusBar.SetIndicators(indicators, + sizeof(indicators)/sizeof(UINT))) + { + TRACE0("Failed to create status bar\n"); + return -1; // fail to create + } + + // TODO: Remove this if you don't want tool tips or a resizeable toolbar + m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | + CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); + + // TODO: Delete these three lines if you don't want the toolbar to + // be dockable + m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); + EnableDocking(CBRS_ALIGN_ANY); + DockControlBar(&m_wndToolBar); + + return 0; +} + +BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) +{ + // TODO: Modify the Window class or styles here by modifying + // the CREATESTRUCT cs + + return CFrameWnd::PreCreateWindow(cs); +} + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame diagnostics + +#ifdef _DEBUG +void CMainFrame::AssertValid() const +{ + CFrameWnd::AssertValid(); +} + +void CMainFrame::Dump(CDumpContext& dc) const +{ + CFrameWnd::Dump(dc); +} + +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame message handlers diff --git a/mozilla/cmd/dialup/win/rasexit/MainFrm.h b/mozilla/cmd/dialup/win/rasexit/MainFrm.h new file mode 100644 index 00000000000..c5ff23d5fbd --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/MainFrm.h @@ -0,0 +1,62 @@ +/* -*- 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. + */ +// MainFrm.h : interface of the CMainFrame class +// +///////////////////////////////////////////////////////////////////////////// + +class CMainFrame : public CFrameWnd +{ +protected: // create from serialization only + CMainFrame(); + DECLARE_DYNCREATE(CMainFrame) + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMainFrame) + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMainFrame(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: // control bar embedded members + CStatusBar m_wndStatusBar; + CToolBar m_wndToolBar; + +// Generated message map functions +protected: + //{{AFX_MSG(CMainFrame) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/cmd/dialup/win/rasexit/Resource.h b/mozilla/cmd/dialup/win/rasexit/Resource.h new file mode 100644 index 00000000000..419e58d1709 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/Resource.h @@ -0,0 +1,37 @@ +/* -*- 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 Visual C++ generated include file. +// Used by RASEXIT.RC +// +#define IDR_MAINFRAME 128 +#define IDR_RASEXITYPE 129 +#define IDD_ABOUTBOX 100 +#define IDP_OLE_INIT_FAILED 100 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 32771 +#endif +#endif diff --git a/mozilla/cmd/dialup/win/rasexit/Shutdown.cpp b/mozilla/cmd/dialup/win/rasexit/Shutdown.cpp new file mode 100644 index 00000000000..8850e2d9b85 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/Shutdown.cpp @@ -0,0 +1,165 @@ +/* -*- 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. + */ +// Shutdown.cpp : implementation file +// + +#include "stdafx.h" +#include "rasexit.h" +#include "Shutdown.h" +#include +#include + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// Shutdown + +IMPLEMENT_DYNCREATE(Shutdown, CCmdTarget) + +Shutdown::Shutdown() +{ + EnableAutomation(); + + // To keep the application running as long as an OLE automation + // object is active, the constructor calls AfxOleLockApp. + TRACE("Createing Shudown\n"); + AfxOleLockApp(); +} + +Shutdown::~Shutdown() +{ + // To terminate the application when all objects created with + // with OLE automation, the destructor calls AfxOleUnlockApp. + TRACE("Destroying shutdown\n"); + AfxOleUnlockApp(); +} + + +void Shutdown::OnFinalRelease() +{ + // When the last reference for an automation object is released + // OnFinalRelease is called. The base class will automatically + // deletes the object. Add additional cleanup required for your + // object before calling the base class. + + CCmdTarget::OnFinalRelease(); +} + + +BEGIN_MESSAGE_MAP(Shutdown, CCmdTarget) + //{{AFX_MSG_MAP(Shutdown) + // NOTE - the ClassWizard will add and remove mapping macros here. + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +BEGIN_DISPATCH_MAP(Shutdown, CCmdTarget) + //{{AFX_DISPATCH_MAP(Shutdown) + DISP_FUNCTION(Shutdown, "Initialize", Initialize, VT_EMPTY, VTS_I4) + //}}AFX_DISPATCH_MAP +END_DISPATCH_MAP() + +// Note: we add support for IID_IShutdown to support typesafe binding +// from VBA. This IID must match the GUID that is attached to the +// dispinterface in the .ODL file. + +// {54680788-CB5B-11CF-893E-0800091AC64E} +static const IID IID_IShutdown = +{ 0x54680788, 0xcb5b, 0x11cf, { 0x89, 0x3e, 0x8, 0x0, 0x9, 0x1a, 0xc6, 0x4e } }; + +// do we need to change this too? +// {7C851530-EC12-11d0-A36B-00805F36BC04} +// static const IID IID_IShutdown = +// { 0x7c851530, 0xec12, 0x11d0, { 0xa3, 0x6b, 0x0, 0x80, 0x5f, 0x36, 0xbc, 0x4 } }; + + +BEGIN_INTERFACE_MAP(Shutdown, CCmdTarget) + INTERFACE_PART(Shutdown, IID_IShutdown, Dispatch) +END_INTERFACE_MAP() + + +//*************************/ +// PE 3.0 guid! +// {CB452A09-CB55-11CF-893E-0800091AC64E} +// IMPLEMENT_OLECREATE(Shutdown, "NNPE.SHUTDOWN.1", 0xcb452a09, 0xcb55, 0x11cf, 0x89, 0x3e, 0x8, 0x0, 0x9, 0x1a, 0xc6, 0x4e) +//**************************/ + +// PE 4.0 guid! +// {7C851530-EC12-11d0-A36B-00805F36BC04} +IMPLEMENT_OLECREATE(Shutdown, "NNPE.SHUTDOWN.1", 0x7c851530, 0xec12, 0x11d0, 0xa3, 0x6b, 0x0, 0x80, 0x5f, 0x36, 0xbc, 0x4); + + +///////////////////////////////////////////////////////////////////////////// +// Shutdown message handlers + +void Shutdown::Initialize(long instaceID) +{ + RASCONN *Info = NULL, *lpTemp = NULL; + DWORD code, count = 0; + DWORD dSize = sizeof (RASCONN); + int i; + char szMessage[256]=""; + + // try to get a buffer to receive the connection data + if(!(Info = (RASCONN *)LocalAlloc(LPTR, dSize))) + return; + + // see if there are any open connections + Info->dwSize = sizeof (RASCONN); + code = RasEnumConnections (Info, &dSize, &count); + + if(ERROR_BUFFER_TOO_SMALL == code) { + + // free the old buffer + LocalFree(Info); + + // allocate a new bigger one + Info = (RASCONN *)LocalAlloc(LPTR, dSize); + if(!Info) + return; + + // try to enumerate again + Info->dwSize = dSize; + if(RasEnumConnections(Info, &dSize, &count) != 0) { + LocalFree(Info); + return; + } + } + + // check for no connections + if(0 == count) { + LocalFree(Info); + return; + } + + // ask user if they want to hang up + if(IDNO == MessageBox(NULL, "There are open modem connections. Would you like to close them?", "Dial-Up Networking", MB_YESNO)) { + LocalFree(Info); + return; + } + + // just hang up everything + for(i = 0; i < (int) count; i++) + RasHangUp(Info[i].hrasconn); + + LocalFree (Info); + +} diff --git a/mozilla/cmd/dialup/win/rasexit/Shutdown.h b/mozilla/cmd/dialup/win/rasexit/Shutdown.h new file mode 100644 index 00000000000..21ef9a9963e --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/Shutdown.h @@ -0,0 +1,65 @@ +/* -*- 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. + */ +// Shutdown.h : header file +// + + + +///////////////////////////////////////////////////////////////////////////// +// Shutdown command target + +class Shutdown : public CCmdTarget +{ + DECLARE_DYNCREATE(Shutdown) + + Shutdown(); // protected constructor used by dynamic creation + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(Shutdown) + public: + virtual void OnFinalRelease(); + //}}AFX_VIRTUAL + +// Implementation +protected: + virtual ~Shutdown(); + + // Generated message map functions + //{{AFX_MSG(Shutdown) + // NOTE - the ClassWizard will add and remove member functions here. + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + DECLARE_OLECREATE(Shutdown) + + // Generated OLE dispatch map functions + //{{AFX_DISPATCH(Shutdown) + afx_msg void Initialize(long instaceID); + //}}AFX_DISPATCH + DECLARE_DISPATCH_MAP() + DECLARE_INTERFACE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/cmd/dialup/win/rasexit/StdAfx.cpp b/mozilla/cmd/dialup/win/rasexit/StdAfx.cpp new file mode 100644 index 00000000000..0ca30a9a18c --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/StdAfx.cpp @@ -0,0 +1,23 @@ +/* -*- 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. + */ +// stdafx.cpp : source file that includes just the standard includes +// rasexit.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + diff --git a/mozilla/cmd/dialup/win/rasexit/StdAfx.h b/mozilla/cmd/dialup/win/rasexit/StdAfx.h new file mode 100644 index 00000000000..827e860139a --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/StdAfx.h @@ -0,0 +1,34 @@ +/* -*- 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. + */ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include // MFC core and standard components +#include // MFC extensions +#include // MFC OLE automation classes +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows 95 Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + + + diff --git a/mozilla/cmd/dialup/win/rasexit/rasexit.cpp b/mozilla/cmd/dialup/win/rasexit/rasexit.cpp new file mode 100644 index 00000000000..673c92d8cb5 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexit.cpp @@ -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. + */ +// rasexit.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "rasexit.h" + +#include "MainFrm.h" +#include "rasexitDoc.h" +#include "rasexitView.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CRasexitApp + +BEGIN_MESSAGE_MAP(CRasexitApp, CWinApp) + //{{AFX_MSG_MAP(CRasexitApp) + ON_COMMAND(ID_APP_ABOUT, OnAppAbout) + // 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 + // Standard file based document commands + ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) + ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) + // Standard print setup command + ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CRasexitApp construction + +CRasexitApp::CRasexitApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CRasexitApp object + +CRasexitApp theApp; + +// This identifier was generated to be statistically unique for your app. +// You may change it if you prefer to choose a specific identifier. + +// {5468078E-CB5B-11CF-893E-0800091AC64E} +static const CLSID clsid = +{ 0x5468078e, 0xcb5b, 0x11cf, { 0x89, 0x3e, 0x8, 0x0, 0x9, 0x1a, 0xc6, 0x4e } }; + +///////////////////////////////////////////////////////////////////////////// +// CRasexitApp initialization + +BOOL CRasexitApp::InitInstance() +{ + // Initialize OLE libraries + if (!AfxOleInit()) + { + AfxMessageBox(IDP_OLE_INIT_FAILED); + return FALSE; + } + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + LoadStdProfileSettings(); // Load standard INI file options (including MRU) + + // Register the application's document templates. Document templates + // serve as the connection between documents, frame windows and views. + + CSingleDocTemplate* pDocTemplate; + pDocTemplate = new CSingleDocTemplate( + IDR_MAINFRAME, + RUNTIME_CLASS(CRasexitDoc), + RUNTIME_CLASS(CMainFrame), // main SDI frame window + RUNTIME_CLASS(CRasexitView)); + AddDocTemplate(pDocTemplate); + + // Connect the COleTemplateServer to the document template. + // The COleTemplateServer creates new documents on behalf + // of requesting OLE containers by using information + // specified in the document template. + m_server.ConnectTemplate(clsid, pDocTemplate, TRUE); + // Note: SDI applications register server objects only if /Embedding + // or /Automation is present on the command line. + + // Parse command line for standard shell commands, DDE, file open + CCommandLineInfo cmdInfo; + ParseCommandLine(cmdInfo); + + // Check to see if launched as OLE server + if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated) + { + // Register all OLE server (factories) as running. This enables the + // OLE libraries to create objects from other applications. + COleTemplateServer::RegisterAll(); + + // Application was run with /Embedding or /Automation. Don't show the + // main window in this case. + return TRUE; + } + + // When a server application is launched stand-alone, it is a good idea + // to update the system registry in case it has been damaged. + m_server.UpdateRegistry(OAT_DISPATCH_OBJECT); + COleObjectFactory::UpdateRegistryAll(); + + // Dispatch commands specified on the command line + if (!ProcessShellCommand(cmdInfo)) + return FALSE; + + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////// +// CAboutDlg dialog used for App About + +class CAboutDlg : public CDialog +{ +public: + CAboutDlg(); + +// Dialog Data + //{{AFX_DATA(CAboutDlg) + enum { IDD = IDD_ABOUTBOX }; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CAboutDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + //{{AFX_MSG(CAboutDlg) + // No message handlers + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) +{ + //{{AFX_DATA_INIT(CAboutDlg) + //}}AFX_DATA_INIT +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CAboutDlg) + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) + //{{AFX_MSG_MAP(CAboutDlg) + // No message handlers + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +// App command to run the dialog +void CRasexitApp::OnAppAbout() +{ + CAboutDlg aboutDlg; + aboutDlg.DoModal(); +} + +///////////////////////////////////////////////////////////////////////////// +// CRasexitApp commands diff --git a/mozilla/cmd/dialup/win/rasexit/rasexit.h b/mozilla/cmd/dialup/win/rasexit/rasexit.h new file mode 100644 index 00000000000..988ed6a5c75 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexit.h @@ -0,0 +1,57 @@ +/* -*- 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. + */ +// rasexit.h : main header file for the RASEXIT application +// + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CRasexitApp: +// See rasexit.cpp for the implementation of this class +// + +class CRasexitApp : public CWinApp +{ +public: + CRasexitApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CRasexitApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL + +// Implementation + COleTemplateServer m_server; + // Server object for document creation + + //{{AFX_MSG(CRasexitApp) + afx_msg void OnAppAbout(); + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/cmd/dialup/win/rasexit/rasexit.mak b/mozilla/cmd/dialup/win/rasexit/rasexit.mak new file mode 100644 index 00000000000..116500259d8 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexit.mak @@ -0,0 +1,446 @@ +# -*- Mode: Makefile -*- +# +# 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 NMAKE File, Format Version 4.20 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +!IF "$(CFG)" == "" +CFG=rasexit - Win32 Debug +!MESSAGE No configuration specified. Defaulting to rasexit - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "rasexit - Win32 Release" && "$(CFG)" !=\ + "rasexit - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Rasexit.mak" CFG="rasexit - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "rasexit - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "rasexit - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +# PROP Target_Last_Scanned "rasexit - Win32 Debug" +RSC=rc.exe +MTL=mktyplib.exe +CPP=cl.exe + +!IF "$(CFG)" == "rasexit - Win32 Release" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\Rasexit.exe" "$(OUTDIR)\rasexit.tlb" + +CLEAN : + -@erase "$(INTDIR)\MainFrm.obj" + -@erase "$(INTDIR)\rasexit.obj" + -@erase "$(INTDIR)\Rasexit.pch" + -@erase "$(INTDIR)\rasexit.res" + -@erase "$(INTDIR)\rasexit.tlb" + -@erase "$(INTDIR)\rasexitDoc.obj" + -@erase "$(INTDIR)\rasexitView.obj" + -@erase "$(INTDIR)\Shutdown.obj" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(OUTDIR)\Rasexit.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +"$(OUTDIR)" : + +"$(OUTDIR)\rasexit.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + +.c{$(CPP_OBJS)}.obj: + +.c{$(CPP_SBRS)}.sbr: + +.cpp{$(CPP_OBJS)}.obj: + +.cpp{$(CPP_SBRS)}.sbr: + +.cxx{$(CPP_OBJS)}.obj: + +.cxx{$(CPP_SBRS)}.sbr: + +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ + "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)/Rasexit.pch" /Yu"stdafx.h" /Fo"$(INTDIR)/"\ + /c +CPP_OBJS=.\Release/ +CPP_SBRS=.\. +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +RSC_PROJ=/l 0x409 /fo"$(INTDIR)/rasexit.res" /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Rasexit.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 rasapi32.lib /nologo /subsystem:windows /machine:I386 +LINK32_FLAGS=rasapi32.lib /nologo /subsystem:windows /incremental:no\ + /pdb:"$(OUTDIR)/Rasexit.pdb" /machine:I386 /out:"$(OUTDIR)/Rasexit.exe" +LINK32_OBJS= \ + "$(INTDIR)\MainFrm.obj" \ + "$(INTDIR)\rasexit.obj" \ + "$(INTDIR)\rasexit.res" \ + "$(INTDIR)\rasexitDoc.obj" \ + "$(INTDIR)\rasexitView.obj" \ + "$(INTDIR)\Shutdown.obj" \ + "$(INTDIR)\StdAfx.obj" + +"$(OUTDIR)\Rasexit.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "rasexit - Win32 Debug" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\Rasexit.exe" "$(OUTDIR)\rasexit.tlb" + +CLEAN : + -@erase "$(INTDIR)\MainFrm.obj" + -@erase "$(INTDIR)\rasexit.obj" + -@erase "$(INTDIR)\Rasexit.pch" + -@erase "$(INTDIR)\rasexit.res" + -@erase "$(INTDIR)\rasexit.tlb" + -@erase "$(INTDIR)\rasexitDoc.obj" + -@erase "$(INTDIR)\rasexitView.obj" + -@erase "$(INTDIR)\Shutdown.obj" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(INTDIR)\vc40.idb" + -@erase "$(INTDIR)\vc40.pdb" + -@erase "$(OUTDIR)\Rasexit.exe" + -@erase "$(OUTDIR)\Rasexit.ilk" + -@erase "$(OUTDIR)\Rasexit.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +"$(OUTDIR)" : + +"$(OUTDIR)\rasexit.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + +.c{$(CPP_OBJS)}.obj: + +.c{$(CPP_SBRS)}.sbr: + +.cpp{$(CPP_OBJS)}.obj: + +.cpp{$(CPP_SBRS)}.sbr: + +.cxx{$(CPP_OBJS)}.obj: + +.cxx{$(CPP_SBRS)}.sbr: + +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c +CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\ + /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)/Rasexit.pch" /Yu"stdafx.h"\ + /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS=.\. +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +RSC_PROJ=/l 0x409 /fo"$(INTDIR)/rasexit.res" /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Rasexit.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 +# ADD LINK32 rasapi32.lib /nologo /subsystem:windows /debug /machine:I386 +LINK32_FLAGS=rasapi32.lib /nologo /subsystem:windows /incremental:yes\ + /pdb:"$(OUTDIR)/Rasexit.pdb" /debug /machine:I386 /out:"$(OUTDIR)/Rasexit.exe" +LINK32_OBJS= \ + "$(INTDIR)\MainFrm.obj" \ + "$(INTDIR)\rasexit.obj" \ + "$(INTDIR)\rasexit.res" \ + "$(INTDIR)\rasexitDoc.obj" \ + "$(INTDIR)\rasexitView.obj" \ + "$(INTDIR)\Shutdown.obj" \ + "$(INTDIR)\StdAfx.obj" + +"$(OUTDIR)\Rasexit.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "rasexit - Win32 Release" +# Name "rasexit - Win32 Debug" + +!IF "$(CFG)" == "rasexit - Win32 Release" + +!ELSEIF "$(CFG)" == "rasexit - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=.\rasexit.cpp +DEP_CPP_RASEX=\ + ".\MainFrm.h"\ + ".\rasexit.h"\ + ".\rasexitDoc.h"\ + ".\rasexitView.h"\ + ".\stdafx.h"\ + + +"$(INTDIR)\rasexit.obj" : $(SOURCE) $(DEP_CPP_RASEX) "$(INTDIR)"\ + "$(INTDIR)\Rasexit.pch" + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\rasexit.odl + +!IF "$(CFG)" == "rasexit - Win32 Release" + + +"$(OUTDIR)\rasexit.tlb" : $(SOURCE) "$(OUTDIR)" + $(MTL) /nologo /D "NDEBUG" /tlb "$(OUTDIR)/rasexit.tlb" /win32 $(SOURCE) + + +!ELSEIF "$(CFG)" == "rasexit - Win32 Debug" + + +"$(OUTDIR)\rasexit.tlb" : $(SOURCE) "$(OUTDIR)" + $(MTL) /nologo /D "_DEBUG" /tlb "$(OUTDIR)/rasexit.tlb" /win32 $(SOURCE) + + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\StdAfx.cpp +DEP_CPP_STDAF=\ + ".\stdafx.h"\ + + +!IF "$(CFG)" == "rasexit - Win32 Release" + +# ADD CPP /Yc"stdafx.h" + +BuildCmds= \ + $(CPP) /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\ + "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)/Rasexit.pch" /Yc"stdafx.h" /Fo"$(INTDIR)/"\ + /c $(SOURCE) \ + + +"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" + $(BuildCmds) + +"$(INTDIR)\Rasexit.pch" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" + $(BuildCmds) + +!ELSEIF "$(CFG)" == "rasexit - Win32 Debug" + +# ADD CPP /Yc"stdafx.h" + +BuildCmds= \ + $(CPP) /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\ + /D "_AFXDLL" /D "_MBCS" /Fp"$(INTDIR)/Rasexit.pch" /Yc"stdafx.h"\ + /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c $(SOURCE) \ + + +"$(INTDIR)\StdAfx.obj" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" + $(BuildCmds) + +"$(INTDIR)\Rasexit.pch" : $(SOURCE) $(DEP_CPP_STDAF) "$(INTDIR)" + $(BuildCmds) + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\MainFrm.cpp +DEP_CPP_MAINF=\ + ".\MainFrm.h"\ + ".\rasexit.h"\ + ".\stdafx.h"\ + + +"$(INTDIR)\MainFrm.obj" : $(SOURCE) $(DEP_CPP_MAINF) "$(INTDIR)"\ + "$(INTDIR)\Rasexit.pch" + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\rasexitDoc.cpp +DEP_CPP_RASEXI=\ + ".\rasexit.h"\ + ".\rasexitDoc.h"\ + ".\stdafx.h"\ + + +"$(INTDIR)\rasexitDoc.obj" : $(SOURCE) $(DEP_CPP_RASEXI) "$(INTDIR)"\ + "$(INTDIR)\Rasexit.pch" + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\rasexitView.cpp +DEP_CPP_RASEXIT=\ + ".\rasexit.h"\ + ".\rasexitDoc.h"\ + ".\rasexitView.h"\ + ".\stdafx.h"\ + + +"$(INTDIR)\rasexitView.obj" : $(SOURCE) $(DEP_CPP_RASEXIT) "$(INTDIR)"\ + "$(INTDIR)\Rasexit.pch" + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\rasexit.rc + +!IF "$(CFG)" == "rasexit - Win32 Release" + +DEP_RSC_RASEXIT_=\ + ".\Res\Rasexit.ico"\ + ".\Res\Rasexit.rc2"\ + ".\Res\rasexitDoc.ico"\ + ".\Res\Toolbar.bmp"\ + + +"$(INTDIR)\rasexit.res" : $(SOURCE) $(DEP_RSC_RASEXIT_) "$(INTDIR)" + $(RSC) /l 0x409 /fo"$(INTDIR)/rasexit.res" /i "Release" /d "NDEBUG" /d\ + "_AFXDLL" $(SOURCE) + + +!ELSEIF "$(CFG)" == "rasexit - Win32 Debug" + +DEP_RSC_RASEXIT_=\ + ".\Res\Rasexit.ico"\ + ".\Res\Rasexit.rc2"\ + ".\Res\rasexitDoc.ico"\ + ".\Res\Toolbar.bmp"\ + + +"$(INTDIR)\rasexit.res" : $(SOURCE) $(DEP_RSC_RASEXIT_) "$(INTDIR)" + $(RSC) /l 0x409 /fo"$(INTDIR)/rasexit.res" /i "Debug" /d "_DEBUG" /d\ + "_AFXDLL" $(SOURCE) + + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\Shutdown.cpp +DEP_CPP_SHUTD=\ + ".\rasexit.h"\ + ".\Shutdown.h"\ + ".\stdafx.h"\ + + +"$(INTDIR)\Shutdown.obj" : $(SOURCE) $(DEP_CPP_SHUTD) "$(INTDIR)"\ + "$(INTDIR)\Rasexit.pch" + + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/mozilla/cmd/dialup/win/rasexit/rasexit.rc b/mozilla/cmd/dialup/win/rasexit/rasexit.rc new file mode 100644 index 00000000000..55f380af241 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexit.rc @@ -0,0 +1,413 @@ +/* -*- 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 + +#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 + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif\r\n" + "#include ""res\\rasexit.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#include ""afxprint.rc"" // printing/print preview resources\r\n" + "#endif\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\rasexit.ico" +IDR_RASEXITYPE ICON DISCARDABLE "res\\rasexitDoc.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Toolbar +// + +IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15 +BEGIN + BUTTON ID_FILE_NEW + BUTTON ID_FILE_OPEN + BUTTON ID_FILE_SAVE + SEPARATOR + BUTTON ID_EDIT_CUT + BUTTON ID_EDIT_COPY + BUTTON ID_EDIT_PASTE + SEPARATOR + BUTTON ID_FILE_PRINT + BUTTON ID_APP_ABOUT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MAINFRAME MENU PRELOAD DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&New\tCtrl+N", ID_FILE_NEW + MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN + MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE + MENUITEM "Save &As...", ID_FILE_SAVE_AS + MENUITEM SEPARATOR + MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT + MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW + MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP + MENUITEM SEPARATOR + MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED + MENUITEM SEPARATOR + MENUITEM "E&xit", ID_APP_EXIT + END + POPUP "&Edit" + BEGIN + MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO + MENUITEM SEPARATOR + MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY + MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE + END + POPUP "&View" + BEGIN + MENUITEM "&Toolbar", ID_VIEW_TOOLBAR + MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR + END + POPUP "&Help" + BEGIN + MENUITEM "&About rasexit...", ID_APP_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE +BEGIN + "N", ID_FILE_NEW, VIRTKEY, CONTROL + "O", ID_FILE_OPEN, VIRTKEY, CONTROL + "S", ID_FILE_SAVE, VIRTKEY, CONTROL + "P", ID_FILE_PRINT, VIRTKEY, CONTROL + "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL + "X", ID_EDIT_CUT, VIRTKEY, CONTROL + "C", ID_EDIT_COPY, VIRTKEY, CONTROL + "V", ID_EDIT_PASTE, VIRTKEY, CONTROL + VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT + VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT + VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL + VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT + VK_F6, ID_NEXT_PANE, VIRTKEY + VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 55 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About rasexit" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,17,18,20 + LTEXT "rasexit Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX + LTEXT "Netscape Communications \nCopyright © 1996-1997", + IDC_STATIC,41,22,119,18 + DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP +END + + +#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 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Utility to close down ras connections after navigator exits\0" + VALUE "CompanyName", "Netscape Communications Corporation\0" + VALUE "FileDescription", "RASEXIT MFC Application\0" + VALUE "FileVersion", "4.0\0" + VALUE "InternalName", "RASEXIT\0" + VALUE "LegalCopyright", "Copyright © 1997 Netscape Communications Corporation\0" + VALUE "LegalTrademarks", "Netscape, Mozilla\0" + VALUE "OriginalFilename", "RASEXIT.EXE\0" + VALUE "ProductName", "RASEXIT Application\0" + VALUE "ProductVersion", "4.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 210 + TOPMARGIN, 7 + BOTTOMMARGIN, 48 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDP_OLE_INIT_FAILED "OLE initialization failed. Make sure that the OLE libraries are the correct version." +END + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + IDR_MAINFRAME "rasexit\n\nRasexi\n\n\nNNPE.SHUTDOWN.1\nRasexi Document" +END + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "rasexit" + AFX_IDS_IDLEMESSAGE "Ready" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_INDICATOR_EXT "EXT" + ID_INDICATOR_CAPS "CAP" + ID_INDICATOR_NUM "NUM" + ID_INDICATOR_SCRL "SCRL" + ID_INDICATOR_OVR "OVR" + ID_INDICATOR_REC "REC" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FILE_NEW "Create a new document\nNew" + ID_FILE_OPEN "Open an existing document\nOpen" + ID_FILE_CLOSE "Close the active document\nClose" + ID_FILE_SAVE "Save the active document\nSave" + ID_FILE_SAVE_AS "Save the active document with a new name\nSave As" + ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup" + ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup" + ID_FILE_PRINT "Print the active document\nPrint" + ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_APP_ABOUT "Display program information, version number and copyright\nAbout" + ID_APP_EXIT "Quit the application; prompts to save documents\nExit" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FILE_MRU_FILE1 "Open this document" + ID_FILE_MRU_FILE2 "Open this document" + ID_FILE_MRU_FILE3 "Open this document" + ID_FILE_MRU_FILE4 "Open this document" + ID_FILE_MRU_FILE5 "Open this document" + ID_FILE_MRU_FILE6 "Open this document" + ID_FILE_MRU_FILE7 "Open this document" + ID_FILE_MRU_FILE8 "Open this document" + ID_FILE_MRU_FILE9 "Open this document" + ID_FILE_MRU_FILE10 "Open this document" + ID_FILE_MRU_FILE11 "Open this document" + ID_FILE_MRU_FILE12 "Open this document" + ID_FILE_MRU_FILE13 "Open this document" + ID_FILE_MRU_FILE14 "Open this document" + ID_FILE_MRU_FILE15 "Open this document" + ID_FILE_MRU_FILE16 "Open this document" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_NEXT_PANE "Switch to the next window pane\nNext Pane" + ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_WINDOW_SPLIT "Split the active window into panes\nSplit" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_EDIT_CLEAR "Erase the selection\nErase" + ID_EDIT_CLEAR_ALL "Erase everything\nErase All" + ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy" + ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut" + ID_EDIT_FIND "Find the specified text\nFind" + ID_EDIT_PASTE "Insert Clipboard contents\nPaste" + ID_EDIT_REPEAT "Repeat the last action\nRepeat" + ID_EDIT_REPLACE "Replace specific text with different text\nReplace" + ID_EDIT_SELECT_ALL "Select the entire document\nSelect All" + ID_EDIT_UNDO "Undo the last action\nUndo" + ID_EDIT_REDO "Redo the previously undone action\nRedo" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar" + ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_SCSIZE "Change the window size" + AFX_IDS_SCMOVE "Change the window position" + AFX_IDS_SCMINIMIZE "Reduce the window to an icon" + AFX_IDS_SCMAXIMIZE "Enlarge the window to full size" + AFX_IDS_SCNEXTWINDOW "Switch to the next document window" + AFX_IDS_SCPREVWINDOW "Switch to the previous document window" + AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_SCRESTORE "Restore the window to normal size" + AFX_IDS_SCTASKLIST "Activate Task List" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif +#include "res\rasexit.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#include "afxprint.rc" // printing/print preview resources +#endif +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/mozilla/cmd/dialup/win/rasexit/rasexit.reg b/mozilla/cmd/dialup/win/rasexit/rasexit.reg new file mode 100644 index 00000000000..82ede2c5c0e --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexit.reg @@ -0,0 +1,39 @@ +REM -*- Mode: Fundamental -*- +REM The contents of this file are subject to the Netscape Public License +REM Version 1.0 (the "NPL"); you may not use this file except in +REM compliance with the NPL. You may obtain a copy of the NPL at +REM http://www.mozilla.org/NPL/ +REM +REM Software distributed under the NPL is distributed on an "AS IS" basis, +REM WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL +REM for the specific language governing rights and limitations under the +REM NPL. +REM +REM The Initial Developer of this code under the NPL is Netscape +REM Communications Corporation. Portions created by Netscape are +REM Copyright (C) 1998 Netscape Communications Corporation. All Rights +REM Reserved. +REM +REGEDIT4 + +[HKEY_CLASSES_ROOT\NNPE.SHUTDOWN.1] +@="NNPE.SHUTDOWN.1" + +[HKEY_CLASSES_ROOT\NNPE.SHUTDOWN.1\CLSID] +@="{CB452A09-CB55-11CF-893E-0800091AC64E}" + +[HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator\Automation Shutdown] +"NNPE.SHUTDOWN.1"="" + +[HKEY_CLASSES_ROOT\CLSID\{CB452A09-CB55-11CF-893E-0800091AC64E}] +@="NNPE.SHUTDOWN.1" + +[HKEY_CLASSES_ROOT\CLSID\{CB452A09-CB55-11CF-893E-0800091AC64E}\InprocHandler32] +@="ole32.dll" + +[HKEY_CLASSES_ROOT\CLSID\{CB452A09-CB55-11CF-893E-0800091AC64E}\LocalServer32] +@="d:\\pe32\\rasexit\\release\\rasexit.exe" + +[HKEY_CLASSES_ROOT\CLSID\{CB452A09-CB55-11CF-893E-0800091AC64E}\ProgId] +@="NNPE.SHUTDOWN.1" + diff --git a/mozilla/cmd/dialup/win/rasexit/rasexitDoc.cpp b/mozilla/cmd/dialup/win/rasexit/rasexitDoc.cpp new file mode 100644 index 00000000000..7662bc6ad02 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexitDoc.cpp @@ -0,0 +1,122 @@ +/* -*- 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. + */ +// rasexitDoc.cpp : implementation of the CRasexitDoc class +// + +#include "stdafx.h" +#include "rasexit.h" + +#include "rasexitDoc.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CRasexitDoc + +IMPLEMENT_DYNCREATE(CRasexitDoc, CDocument) + +BEGIN_MESSAGE_MAP(CRasexitDoc, CDocument) + //{{AFX_MSG_MAP(CRasexitDoc) + // 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() + +BEGIN_DISPATCH_MAP(CRasexitDoc, CDocument) + //{{AFX_DISPATCH_MAP(CRasexitDoc) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_DISPATCH_MAP +END_DISPATCH_MAP() + +// Note: we add support for IID_IRasexi to support typesafe binding +// from VBA. This IID must match the GUID that is attached to the +// dispinterface in the .ODL file. + +// {54680790-CB5B-11CF-893E-0800091AC64E} +static const IID IID_IRasexi = +{ 0x54680790, 0xcb5b, 0x11cf, { 0x89, 0x3e, 0x8, 0x0, 0x9, 0x1a, 0xc6, 0x4e } }; + +BEGIN_INTERFACE_MAP(CRasexitDoc, CDocument) + INTERFACE_PART(CRasexitDoc, IID_IRasexi, Dispatch) +END_INTERFACE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CRasexitDoc construction/destruction + +CRasexitDoc::CRasexitDoc() +{ + // TODO: add one-time construction code here + + EnableAutomation(); + + AfxOleLockApp(); +} + +CRasexitDoc::~CRasexitDoc() +{ + AfxOleUnlockApp(); +} + +BOOL CRasexitDoc::OnNewDocument() +{ + if (!CDocument::OnNewDocument()) + return FALSE; + + // TODO: add reinitialization code here + // (SDI documents will reuse this document) + + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////// +// CRasexitDoc serialization + +void CRasexitDoc::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + // TODO: add storing code here + } + else + { + // TODO: add loading code here + } +} + +///////////////////////////////////////////////////////////////////////////// +// CRasexitDoc diagnostics + +#ifdef _DEBUG +void CRasexitDoc::AssertValid() const +{ + CDocument::AssertValid(); +} + +void CRasexitDoc::Dump(CDumpContext& dc) const +{ + CDocument::Dump(dc); +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CRasexitDoc commands diff --git a/mozilla/cmd/dialup/win/rasexit/rasexitDoc.h b/mozilla/cmd/dialup/win/rasexit/rasexitDoc.h new file mode 100644 index 00000000000..44a4985e224 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexitDoc.h @@ -0,0 +1,69 @@ +/* -*- 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. + */ +// rasexitDoc.h : interface of the CRasexitDoc class +// +///////////////////////////////////////////////////////////////////////////// + +class CRasexitDoc : public CDocument +{ +protected: // create from serialization only + CRasexitDoc(); + DECLARE_DYNCREATE(CRasexitDoc) + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CRasexitDoc) + public: + virtual BOOL OnNewDocument(); + virtual void Serialize(CArchive& ar); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CRasexitDoc(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + +// Generated message map functions +protected: + //{{AFX_MSG(CRasexitDoc) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + + // Generated OLE dispatch map functions + //{{AFX_DISPATCH(CRasexitDoc) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_DISPATCH + DECLARE_DISPATCH_MAP() + DECLARE_INTERFACE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/cmd/dialup/win/rasexit/rasexitView.cpp b/mozilla/cmd/dialup/win/rasexit/rasexitView.cpp new file mode 100644 index 00000000000..9e672821491 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexitView.cpp @@ -0,0 +1,122 @@ +/* -*- 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. + */ +// rasexitView.cpp : implementation of the CRasexitView class +// + +#include "stdafx.h" +#include "rasexit.h" + +#include "rasexitDoc.h" +#include "rasexitView.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CRasexitView + +IMPLEMENT_DYNCREATE(CRasexitView, CView) + +BEGIN_MESSAGE_MAP(CRasexitView, CView) + //{{AFX_MSG_MAP(CRasexitView) + // 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 + // Standard printing commands + ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) + ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) + ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CRasexitView construction/destruction + +CRasexitView::CRasexitView() +{ + // TODO: add construction code here + +} + +CRasexitView::~CRasexitView() +{ +} + +BOOL CRasexitView::PreCreateWindow(CREATESTRUCT& cs) +{ + // TODO: Modify the Window class or styles here by modifying + // the CREATESTRUCT cs + + return CView::PreCreateWindow(cs); +} + +///////////////////////////////////////////////////////////////////////////// +// CRasexitView drawing + +void CRasexitView::OnDraw(CDC* pDC) +{ + CRasexitDoc* pDoc = GetDocument(); + ASSERT_VALID(pDoc); + + // TODO: add draw code for native data here +} + +///////////////////////////////////////////////////////////////////////////// +// CRasexitView printing + +BOOL CRasexitView::OnPreparePrinting(CPrintInfo* pInfo) +{ + // default preparation + return DoPreparePrinting(pInfo); +} + +void CRasexitView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) +{ + // TODO: add extra initialization before printing +} + +void CRasexitView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) +{ + // TODO: add cleanup after printing +} + +///////////////////////////////////////////////////////////////////////////// +// CRasexitView diagnostics + +#ifdef _DEBUG +void CRasexitView::AssertValid() const +{ + CView::AssertValid(); +} + +void CRasexitView::Dump(CDumpContext& dc) const +{ + CView::Dump(dc); +} + +CRasexitDoc* CRasexitView::GetDocument() // non-debug version is inline +{ + ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CRasexitDoc))); + return (CRasexitDoc*)m_pDocument; +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CRasexitView message handlers diff --git a/mozilla/cmd/dialup/win/rasexit/rasexitView.h b/mozilla/cmd/dialup/win/rasexit/rasexitView.h new file mode 100644 index 00000000000..9f3fa7b81ad --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/rasexitView.h @@ -0,0 +1,71 @@ +/* -*- 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. + */ +// rasexitView.h : interface of the CRasexitView class +// +///////////////////////////////////////////////////////////////////////////// + +class CRasexitView : public CView +{ +protected: // create from serialization only + CRasexitView(); + DECLARE_DYNCREATE(CRasexitView) + +// Attributes +public: + CRasexitDoc* GetDocument(); + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CRasexitView) + public: + virtual void OnDraw(CDC* pDC); // overridden to draw this view + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + protected: + virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); + virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); + virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CRasexitView(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + +// Generated message map functions +protected: + //{{AFX_MSG(CRasexitView) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +#ifndef _DEBUG // debug version in rasexitView.cpp +inline CRasexitDoc* CRasexitView::GetDocument() + { return (CRasexitDoc*)m_pDocument; } +#endif + +///////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/cmd/dialup/win/rasexit/res/license b/mozilla/cmd/dialup/win/rasexit/res/license new file mode 100644 index 00000000000..947718beabb --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/res/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/rasexit/res/rasexit.rc2 b/mozilla/cmd/dialup/win/rasexit/res/rasexit.rc2 new file mode 100644 index 00000000000..2e8f47546b7 --- /dev/null +++ b/mozilla/cmd/dialup/win/rasexit/res/rasexit.rc2 @@ -0,0 +1,30 @@ +/* -*- 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. + */ +// +// RASEXIT.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +/////////////////////////////////////////////////////////////////////////////