Compare commits
276 Commits
Bugzilla_P
...
OJI_199806
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31ebe728d6 | ||
|
|
bbb2bac698 | ||
|
|
27af7a0b3a | ||
|
|
81e7133d17 | ||
|
|
ee06a4f1bd | ||
|
|
1624bbf236 | ||
|
|
e6cb2463eb | ||
|
|
343840c8a1 | ||
|
|
282c4df81c | ||
|
|
283dfd7440 | ||
|
|
cf8f50223d | ||
|
|
5d9fc946a0 | ||
|
|
d3ad42bebc | ||
|
|
39832871eb | ||
|
|
1526a81602 | ||
|
|
12113fe6e4 | ||
|
|
e523aadb4f | ||
|
|
b2abafae6b | ||
|
|
bdfac968f4 | ||
|
|
fea6277a80 | ||
|
|
80853cff2f | ||
|
|
d51c64a00a | ||
|
|
3d4d50303a | ||
|
|
366035a4ee | ||
|
|
f89451eb8c | ||
|
|
4ace11abec | ||
|
|
190c5ff030 | ||
|
|
6d6530f941 | ||
|
|
b44e859234 | ||
|
|
addd0e1ddd | ||
|
|
1dd04d4ee2 | ||
|
|
9332236a37 | ||
|
|
4754b1bc37 | ||
|
|
af5cf6fcc1 | ||
|
|
d344486f4e | ||
|
|
f1a0f661f5 | ||
|
|
b1cb6f1526 | ||
|
|
8d8abe24e6 | ||
|
|
c565993b34 | ||
|
|
14bb3f5cb6 | ||
|
|
cb8c25932b | ||
|
|
2192335150 | ||
|
|
0ae78df348 | ||
|
|
5f2dec9103 | ||
|
|
43fc58a172 | ||
|
|
284043d646 | ||
|
|
5f3167ac2b | ||
|
|
7f528e5cb3 | ||
|
|
68f96f0bb0 | ||
|
|
263c8077a1 | ||
|
|
bda76e77c6 | ||
|
|
207925d985 | ||
|
|
02ccf35f5f | ||
|
|
39857c30be | ||
|
|
97e99010fa | ||
|
|
92d3089962 | ||
|
|
7195223e4a | ||
|
|
54607f14d4 | ||
|
|
a38ed082db | ||
|
|
176369a949 | ||
|
|
cfd7856817 | ||
|
|
f9114ef935 | ||
|
|
99725e18d1 | ||
|
|
ca7d8634aa | ||
|
|
fb2608c2a4 | ||
|
|
8425e93a55 | ||
|
|
82ea4dc1ad | ||
|
|
065f9ddf6d | ||
|
|
3603102904 | ||
|
|
31b1c59321 | ||
|
|
d9b9f078d5 | ||
|
|
358f8c06fe | ||
|
|
1a851b3928 | ||
|
|
9f03428c5e | ||
|
|
c365fb1c0f | ||
|
|
cc9289eb4a | ||
|
|
9c24fa0453 | ||
|
|
42d0ad495f | ||
|
|
a89c406890 | ||
|
|
da324d4d85 | ||
|
|
2d61a44fb0 | ||
|
|
c23fc7ed92 | ||
|
|
d6847a37e0 | ||
|
|
ca38152f9a | ||
|
|
2b733a01c0 | ||
|
|
33d37eafb4 | ||
|
|
e444480135 | ||
|
|
5fdc4c476d | ||
|
|
73aa3a2741 | ||
|
|
939d41c0ed | ||
|
|
54c84fe5a6 | ||
|
|
61665f94d4 | ||
|
|
0cbb965a54 | ||
|
|
bf13b4f471 | ||
|
|
ab3a16f73f | ||
|
|
7e16d6fc5c | ||
|
|
d5b12bf64b | ||
|
|
69c1b71ece | ||
|
|
80fc6dcd88 | ||
|
|
2c52e7cc3e | ||
|
|
8df8a1059b | ||
|
|
745244fa27 | ||
|
|
8eb78fc2aa | ||
|
|
e73cb2bbe1 | ||
|
|
8a4f6f7281 | ||
|
|
a2b4f0597d | ||
|
|
81fd178182 | ||
|
|
7b754df1c7 | ||
|
|
f6e2de4337 | ||
|
|
ce669c0ebb | ||
|
|
b70e81093e | ||
|
|
ef3f0d8c19 | ||
|
|
448f1afeaf | ||
|
|
0a80cbeacb | ||
|
|
f9f76b3d43 | ||
|
|
10b2dc4b86 | ||
|
|
79935ce455 | ||
|
|
bd20618651 | ||
|
|
3df7574e07 | ||
|
|
5ecf3ad538 | ||
|
|
15e3a48198 | ||
|
|
0faee1e925 | ||
|
|
1ae345dd50 | ||
|
|
d125fd92ca | ||
|
|
6497bca889 | ||
|
|
dadbb32497 | ||
|
|
d2b062e7d1 | ||
|
|
be9662c6cc | ||
|
|
d54b547be4 | ||
|
|
2f9dd0a4a0 | ||
|
|
067cd56dd0 | ||
|
|
a78154646c | ||
|
|
5b1d612c05 | ||
|
|
7792b246d5 | ||
|
|
ed4dab3b87 | ||
|
|
26ee6067c5 | ||
|
|
4626483f53 | ||
|
|
5bc85d2391 | ||
|
|
c03c134297 | ||
|
|
e01cdf0c81 | ||
|
|
627fcb50ed | ||
|
|
c518bb8816 | ||
|
|
241951fb57 | ||
|
|
4d140a1ca4 | ||
|
|
5f54f4b293 | ||
|
|
88291d9162 | ||
|
|
2ac33c7d06 | ||
|
|
edb8d77964 | ||
|
|
6cd4274290 | ||
|
|
c1dd844fcd | ||
|
|
de67b0c7ed | ||
|
|
0bf1cb84dc | ||
|
|
48fdc30b75 | ||
|
|
cc23e7e1e6 | ||
|
|
84e003dbda | ||
|
|
8dec87f59a | ||
|
|
8960fb7134 | ||
|
|
9b3d878531 | ||
|
|
666ffe20bf | ||
|
|
6b231e8b16 | ||
|
|
f60e7fb6d3 | ||
|
|
6e75ee61b4 | ||
|
|
549a2ea679 | ||
|
|
1a06d3a75d | ||
|
|
f7fabdbc0f | ||
|
|
b881931561 | ||
|
|
23a88b72d3 | ||
|
|
7c9be6cdd8 | ||
|
|
a671ec1e00 | ||
|
|
468ea89117 | ||
|
|
710b20f74e | ||
|
|
96c4cd71e6 | ||
|
|
af9e81b579 | ||
|
|
a23464f579 | ||
|
|
af0341971f | ||
|
|
83e272e4e7 | ||
|
|
20e372300d | ||
|
|
fe114cb671 | ||
|
|
0ed74a83e5 | ||
|
|
34b3e24e86 | ||
|
|
1f8b1d8d25 | ||
|
|
5ebd89a6f7 | ||
|
|
fbdab6aa3e | ||
|
|
14e16f9d72 | ||
|
|
b2d4249c63 | ||
|
|
9a86c10e5a | ||
|
|
287a10a20c | ||
|
|
a3fb0f01b7 | ||
|
|
32137fbdac | ||
|
|
20372dd301 | ||
|
|
a35b69702c | ||
|
|
8249bdf162 | ||
|
|
780fdf2db8 | ||
|
|
4f01b0bc47 | ||
|
|
0b31bc0427 | ||
|
|
1d6be6f987 | ||
|
|
922a167fbb | ||
|
|
f753c7babc | ||
|
|
6076673de4 | ||
|
|
0d2f1dc2f8 | ||
|
|
326b7fec90 | ||
|
|
e9b45935cf | ||
|
|
6742b4835e | ||
|
|
9bf2d23fe1 | ||
|
|
2000b0be7d | ||
|
|
ef18c1ebce | ||
|
|
fe3f066d9a | ||
|
|
9bf10ba35d | ||
|
|
472e3a0bb1 | ||
|
|
1df94e06eb | ||
|
|
af92655883 | ||
|
|
0c78fcc08e | ||
|
|
bd022d4c0c | ||
|
|
ba24824cd7 | ||
|
|
0c748bc59e | ||
|
|
17320d8244 | ||
|
|
b2b1c6c0a3 | ||
|
|
ecc5cda88e | ||
|
|
d547145e73 | ||
|
|
74f00ba038 | ||
|
|
6e4fb86caf | ||
|
|
fc9585ba2a | ||
|
|
f047662038 | ||
|
|
4861b11b84 | ||
|
|
01a269fdc5 | ||
|
|
e4c976aba9 | ||
|
|
205ad8f312 | ||
|
|
d765c3ed0e | ||
|
|
0112ee9991 | ||
|
|
7c05f3ccbd | ||
|
|
70a900a059 | ||
|
|
26a4d5d4fd | ||
|
|
3d29c3c3a1 | ||
|
|
f11839871d | ||
|
|
3a484fbfa8 | ||
|
|
fbd64d0fe0 | ||
|
|
571a852595 | ||
|
|
4363028c75 | ||
|
|
add738e617 | ||
|
|
7fb068b972 | ||
|
|
c5c372bfbf | ||
|
|
2e846368b5 | ||
|
|
c624f537e4 | ||
|
|
6c4f1a8492 | ||
|
|
edd6fe2c7f | ||
|
|
ce53283216 | ||
|
|
e7fee24c31 | ||
|
|
8cf4fb3b81 | ||
|
|
ed2e6b1431 | ||
|
|
4c8d456eb4 | ||
|
|
187fd20ac2 | ||
|
|
af1bdb4de8 | ||
|
|
3a4721c52a | ||
|
|
a16a19a8ad | ||
|
|
1af9ff07d4 | ||
|
|
2f7213cc47 | ||
|
|
1471901167 | ||
|
|
a5292eee5d | ||
|
|
0547fded32 | ||
|
|
62f65ff27b | ||
|
|
8f2dc31d5d | ||
|
|
eb8636a744 | ||
|
|
d6cac8936e | ||
|
|
5587d39232 | ||
|
|
2c78eb62a9 | ||
|
|
d1d7b339de | ||
|
|
4310b6ab7c | ||
|
|
17f426674e | ||
|
|
c73f229c56 | ||
|
|
cfe50f323d | ||
|
|
48beb5ed09 | ||
|
|
60b4e45149 | ||
|
|
cb7617e58d | ||
|
|
cf7959a412 | ||
|
|
a652b060f1 | ||
|
|
95356db011 |
36279
mozilla/CHANGES.html
Normal file
36279
mozilla/CHANGES.html
Normal file
File diff suppressed because it is too large
Load Diff
40
mozilla/LEGAL
Normal file
40
mozilla/LEGAL
Normal file
@@ -0,0 +1,40 @@
|
||||
Please be apprised of the following Legal Notices:
|
||||
|
||||
A) The U.S. District Court for the Eastern District of Virginia has
|
||||
ruled that the Netscape Navigator code does not infringe Wang's U.S.
|
||||
Patent No. 4,751,669 ("the '669 Patent") because: 1) HTML is not
|
||||
Videotex as defined by the '669 patent; 2) web servers are not central
|
||||
suppliers; and 3) Navigator does not "connect," as defined by the '669
|
||||
Patent, to web servers on the Internet. Wang may appeal this decision to
|
||||
the Federal Circuit. Wang contended that its Patent disclosing a
|
||||
"Videotext" system, is infringed by the following functionality in the
|
||||
Netscape Navigator code: 1) the animated logo and status line indicators
|
||||
--See Claims 1,8 and 9; 2) the "File Save As" function --See Claims
|
||||
23-27; 3) Bookmarks and Rename Bookmarks in the Properties window --See
|
||||
Claims 20-22; 4) storing HTML, GIF, and JPEG files and adding filename
|
||||
extensions --See Claim 38
|
||||
|
||||
B) Intermind owns pending U.S. patent applications on communications
|
||||
systems which employ metadata ("channel objects") to define a control
|
||||
structure for information transfer. The Netscape code does not infringe
|
||||
as released; however, modifications which utilize channel objects as
|
||||
described by Intermind should be considered carefully. The following is
|
||||
a statement from Intermind: "Intermind's claims fundamentally involve
|
||||
the use of a control structure to automate communications. ...The
|
||||
essence of Intermind's top claim is that two devices sender and
|
||||
receiver have persistent storage, communicate over a network,
|
||||
and exchange a control structure including metadata which describes: 1)
|
||||
what information is to be updated, 2) when to update this information,
|
||||
and 3) how to transfer the updated information. In addition, at least
|
||||
the receiving device must be able to process the metadata in order to
|
||||
perform the update determination and transfer. Any digital
|
||||
communications system which incorporates all of these elements will be
|
||||
covered by Intermind's patents." See Intermind.com.
|
||||
|
||||
C) Stac, Inc., and its licensing agent Hi/fn, own several patents which
|
||||
disclose data compression methods implementing an LZS compression
|
||||
algorithm, including U.S. Patent Nos. 4,701,745 and 5,016, 009 ("the
|
||||
Stac Patents"). The Netscape Communicator code does not perform
|
||||
compression. If you modify the Netscape source code to perform
|
||||
compression, please take notice of the Stac Patents.
|
||||
|
||||
421
mozilla/LICENSE
Normal file
421
mozilla/LICENSE
Normal file
@@ -0,0 +1,421 @@
|
||||
NETSCAPE PUBLIC LICENSE
|
||||
Version 1.0
|
||||
|
||||
----------------
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.1. ``Contributor'' means each entity that creates or contributes to
|
||||
the creation of Modifications.
|
||||
|
||||
1.2. ``Contributor Version'' means the combination of the Original
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
made by that particular Contributor.
|
||||
|
||||
1.3. ``Covered Code'' means the Original Code or Modifications or the
|
||||
combination of the Original Code and Modifications, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.4. ``Electronic Distribution Mechanism'' means a mechanism generally
|
||||
accepted in the software development community for the electronic
|
||||
transfer of data.
|
||||
|
||||
1.5. ``Executable'' means Covered Code in any form other than Source
|
||||
Code.
|
||||
|
||||
1.6. ``Initial Developer'' means the individual or entity identified as
|
||||
the Initial Developer in the Source Code notice required by Exhibit A.
|
||||
|
||||
1.7. ``Larger Work'' means a work which combines Covered Code or
|
||||
portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.8. ``License'' means this document.
|
||||
|
||||
1.9. ``Modifications'' means any addition to or deletion from the
|
||||
substance or structure of either the Original Code or any previous
|
||||
Modifications. When Covered Code is released as a series of files, a
|
||||
Modification is:
|
||||
|
||||
A. Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
|
||||
B. Any new file that contains any part of the Original Code or
|
||||
previous Modifications.
|
||||
|
||||
1.10. ``Original Code'' means Source Code of computer software code
|
||||
which is described in the Source Code notice required by Exhibit A as
|
||||
Original Code, and which, at the time of its release under this License
|
||||
is not already Covered Code governed by this License.
|
||||
|
||||
1.11. ``Source Code'' means the preferred form of the Covered Code for
|
||||
making modifications to it, including all modules it contains, plus any
|
||||
associated interface definition files, scripts used to control
|
||||
compilation and installation of an Executable, or a list of source code
|
||||
differential comparisons against either the Original Code or another
|
||||
well known, available Covered Code of the Contributor's choice. The
|
||||
Source Code can be in a compressed or archival form, provided the
|
||||
appropriate decompression or de-archiving software is widely available
|
||||
for no charge.
|
||||
|
||||
1.12. ``You'' means an individual or a legal entity exercising rights
|
||||
under, and complying with all of the terms of, this License or a future
|
||||
version of this License issued under Section 6.1. For legal entities,
|
||||
``You'' includes any entity which controls, is controlled by, or is
|
||||
under common control with You. For purposes of this definition,
|
||||
``control'' means (a) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (b) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares or beneficial ownership of such entity.
|
||||
|
||||
2. Source Code License.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
|
||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
||||
distribute the Original Code (or portions thereof) with or without
|
||||
Modifications, or as part of a Larger Work; and
|
||||
|
||||
(b) under patents now or hereafter owned or controlled by Initial
|
||||
Developer, to make, have made, use and sell (``Utilize'') the
|
||||
Original Code (or portions thereof), but solely to the extent that
|
||||
any such patent is reasonably necessary to enable You to Utilize
|
||||
the Original Code (or portions thereof) and not to any greater
|
||||
extent that may be necessary to Utilize further Modifications or
|
||||
combinations.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
|
||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
||||
distribute the Modifications created by such Contributor (or
|
||||
portions thereof) either on an unmodified basis, with other
|
||||
Modifications, as Covered Code or as part of a Larger Work; and
|
||||
|
||||
(b) under patents now or hereafter owned or controlled by
|
||||
Contributor, to Utilize the Contributor Version (or portions
|
||||
thereof), but solely to the extent that any such patent is
|
||||
reasonably necessary to enable You to Utilize the Contributor
|
||||
Version (or portions thereof), and not to any greater extent that
|
||||
may be necessary to Utilize further Modifications or combinations.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Application of License.
|
||||
The Modifications which You create or to which You contribute are
|
||||
governed by the terms of this License, including without limitation
|
||||
Section 2.2. The Source Code version of Covered Code may be distributed
|
||||
only under the terms of this License or a future version of this
|
||||
License released under Section 6.1, and You must include a copy of this
|
||||
License with every copy of the Source Code You distribute. You may not
|
||||
offer or impose any terms on any Source Code version that alters or
|
||||
restricts the applicable version of this License or the recipients'
|
||||
rights hereunder. However, You may include an additional document
|
||||
offering the additional rights described in Section 3.5.
|
||||
|
||||
3.2. Availability of Source Code.
|
||||
Any Modification which You create or to which You contribute must be
|
||||
made available in Source Code form under the terms of this License
|
||||
either on the same media as an Executable version or via an accepted
|
||||
Electronic Distribution Mechanism to anyone to whom you made an
|
||||
Executable version available; and if made available via Electronic
|
||||
Distribution Mechanism, must remain available for at least twelve (12)
|
||||
months after the date it initially became available, or at least six
|
||||
(6) months after a subsequent version of that particular Modification
|
||||
has been made available to such recipients. You are responsible for
|
||||
ensuring that the Source Code version remains available even if the
|
||||
Electronic Distribution Mechanism is maintained by a third party.
|
||||
|
||||
3.3. Description of Modifications.
|
||||
You must cause all Covered Code to which you contribute to contain a
|
||||
file documenting the changes You made to create that Covered Code and
|
||||
the date of any change. You must include a prominent statement that the
|
||||
Modification is derived, directly or indirectly, from Original Code
|
||||
provided by the Initial Developer and including the name of the Initial
|
||||
Developer in (a) the Source Code, and (b) in any notice in an
|
||||
Executable version or related documentation in which You describe the
|
||||
origin or ownership of the Covered Code.
|
||||
|
||||
3.4. Intellectual Property Matters
|
||||
|
||||
(a) Third Party Claims.
|
||||
If You have knowledge that a party claims an intellectual property
|
||||
right in particular functionality or code (or its utilization
|
||||
under this License), you must include a text file with the source
|
||||
code distribution titled ``LEGAL'' which describes the claim and
|
||||
the party making the claim in sufficient detail that a recipient
|
||||
will know whom to contact. If you obtain such knowledge after You
|
||||
make Your Modification available as described in Section 3.2, You
|
||||
shall promptly modify the LEGAL file in all copies You make
|
||||
available thereafter and shall take other steps (such as notifying
|
||||
appropriate mailing lists or newsgroups) reasonably calculated to
|
||||
inform those who received the Covered Code that new knowledge has
|
||||
been obtained.
|
||||
|
||||
(b) Contributor APIs.
|
||||
If Your Modification is an application programming interface and
|
||||
You own or control patents which are reasonably necessary to
|
||||
implement that API, you must also include this information in the
|
||||
LEGAL file.
|
||||
|
||||
3.5. Required Notices.
|
||||
You must duplicate the notice in Exhibit A in each file of the Source
|
||||
Code, and this License in any documentation for the Source Code, where
|
||||
You describe recipients' rights relating to Covered Code. If You
|
||||
created one or more Modification(s), You may add your name as a
|
||||
Contributor to the notice described in Exhibit A. If it is not possible
|
||||
to put such notice in a particular Source Code file due to its
|
||||
structure, then you must include such notice in a location (such as a
|
||||
relevant directory file) where a user would be likely to look for such
|
||||
a notice. You may choose to offer, and to charge a fee for, warranty,
|
||||
support, indemnity or liability obligations to one or more recipients
|
||||
of Covered Code. However, You may do so only on Your own behalf, and
|
||||
not on behalf of the Initial Developer or any Contributor. You must
|
||||
make it absolutely clear than any such warranty, support, indemnity or
|
||||
liability obligation is offered by You alone, and You hereby agree to
|
||||
indemnify the Initial Developer and every Contributor for any liability
|
||||
incurred by the Initial Developer or such Contributor as a result of
|
||||
warranty, support, indemnity or liability terms You offer.
|
||||
|
||||
3.6. Distribution of Executable Versions.
|
||||
You may distribute Covered Code in Executable form only if the
|
||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||
and if You include a notice stating that the Source Code version of the
|
||||
Covered Code is available under the terms of this License, including a
|
||||
description of how and where You have fulfilled the obligations of
|
||||
Section 3.2. The notice must be conspicuously included in any notice in
|
||||
an Executable version, related documentation or collateral in which You
|
||||
describe recipients' rights relating to the Covered Code. You may
|
||||
distribute the Executable version of Covered Code under a license of
|
||||
Your choice, which may contain terms different from this License,
|
||||
provided that You are in compliance with the terms of this License and
|
||||
that the license for the Executable version does not attempt to limit
|
||||
or alter the recipient's rights in the Source Code version from the
|
||||
rights set forth in this License. If You distribute the Executable
|
||||
version under a different license You must make it absolutely clear
|
||||
that any terms which differ from this License are offered by You alone,
|
||||
not by the Initial Developer or any Contributor. You hereby agree to
|
||||
indemnify the Initial Developer and every Contributor for any liability
|
||||
incurred by the Initial Developer or such Contributor as a result of
|
||||
any such terms You offer.
|
||||
|
||||
3.7. Larger Works.
|
||||
You may create a Larger Work by combining Covered Code with other code
|
||||
not governed by the terms of this License and distribute the Larger
|
||||
Work as a single product. In such a case, You must make sure the
|
||||
requirements of this License are fulfilled for the Covered Code.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to statute
|
||||
or regulation then You must: (a) comply with the terms of this License
|
||||
to the maximum extent possible; and (b) describe the limitations and
|
||||
the code they affect. Such description must be included in the LEGAL
|
||||
file described in Section 3.4 and must be included with all
|
||||
distributions of the Source Code. Except to the extent prohibited by
|
||||
statute or regulation, such description must be sufficiently detailed
|
||||
for a recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Application of this License.
|
||||
|
||||
This License applies to code to which the Initial Developer has
|
||||
attached the notice in Exhibit A, and to related Covered Code.
|
||||
|
||||
6. Versions of the License.
|
||||
|
||||
6.1. New Versions.
|
||||
Netscape Communications Corporation (``Netscape'') may publish revised
|
||||
and/or new versions of the License from time to time. Each version will
|
||||
be given a distinguishing version number.
|
||||
|
||||
6.2. Effect of New Versions.
|
||||
Once Covered Code has been published under a particular version of the
|
||||
License, You may always continue to use it under the terms of that
|
||||
version. You may also choose to use such Covered Code under the terms
|
||||
of any subsequent version of the License published by Netscape. No one
|
||||
other than Netscape has the right to modify the terms applicable to
|
||||
Covered Code created under this License.
|
||||
|
||||
6.3. Derivative Works.
|
||||
If you create or use a modified version of this License (which you may
|
||||
only do in order to apply it to code which is not already Covered Code
|
||||
governed by this License), you must (a) rename Your license so that the
|
||||
phrases ``Mozilla'', ``MOZILLAPL'', ``MOZPL'', ``Netscape'', ``NPL'' or
|
||||
any confusingly similar phrase do not appear anywhere in your license
|
||||
and (b) otherwise make it clear that your version of the license
|
||||
contains terms which differ from the Mozilla Public License and
|
||||
Netscape Public License. (Filling in the name of the Initial Developer,
|
||||
Original Code or Contributor in the notice described in Exhibit A shall
|
||||
not of themselves be deemed to be modifications of this License.)
|
||||
|
||||
7. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
8. TERMINATION.
|
||||
|
||||
This License and the rights granted hereunder will terminate
|
||||
automatically if You fail to comply with terms herein and fail to cure
|
||||
such breach within 30 days of becoming aware of the breach. All
|
||||
sublicenses to the Covered Code which are properly granted shall
|
||||
survive any termination of this License. Provisions which, by their
|
||||
nature, must remain in effect beyond the termination of this License
|
||||
shall survive.
|
||||
|
||||
9. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL
|
||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER
|
||||
PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
|
||||
GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND
|
||||
ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
|
||||
BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT
|
||||
EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
10. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Code is a ``commercial item,'' as that term is defined in
|
||||
48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer
|
||||
software'' and ``commercial computer software documentation,'' as such
|
||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||
all U.S. Government End Users acquire Covered Code with only those
|
||||
rights set forth herein.
|
||||
|
||||
11. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. This License shall be governed by
|
||||
California law provisions (except to the extent applicable law, if any,
|
||||
provides otherwise), excluding its conflict-of-law provisions. With
|
||||
respect to disputes in which at least one party is a citizen of, or an
|
||||
entity chartered or registered to do business in, the United States of
|
||||
America: (a) unless otherwise agreed in writing, all disputes relating
|
||||
to this License (excepting any dispute relating to intellectual
|
||||
property rights) shall be subject to final and binding arbitration,
|
||||
with the losing party paying all costs of arbitration; (b) any
|
||||
arbitration relating to this Agreement shall be held in Santa Clara
|
||||
County, California, under the auspices of JAMS/EndDispute; and (c) any
|
||||
litigation relating to this Agreement shall be subject to the
|
||||
jurisdiction of the Federal Courts of the Northern District of
|
||||
California, with venue lying in Santa Clara County, California, with
|
||||
the losing party responsible for costs, including without limitation,
|
||||
court costs and reasonable attorneys fees and expenses. The application
|
||||
of the United Nations Convention on Contracts for the International
|
||||
Sale of Goods is expressly excluded. Any law or regulation which
|
||||
provides that the language of a contract shall be construed against the
|
||||
drafter shall not apply to this License.
|
||||
|
||||
12. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
Except in cases where another Contributor has failed to comply with
|
||||
Section 3.4, You are responsible for damages arising, directly or
|
||||
indirectly, out of Your utilization of rights under this License, based
|
||||
on the number of copies of Covered Code you made available, the
|
||||
revenues you received from utilizing such rights, and other relevant
|
||||
factors. You agree to work with affected parties to distribute
|
||||
responsibility on an equitable basis.
|
||||
|
||||
AMENDMENTS
|
||||
Additional Terms applicable to the Netscape Public License.
|
||||
|
||||
I. Effect.
|
||||
These additional terms described in this Netscape Public License --
|
||||
Amendments shall apply to the Mozilla Communicator client code and to
|
||||
all Covered Code under this License.
|
||||
|
||||
II. ``Netscape's Branded Code'' means Covered Code that Netscape
|
||||
distributes and/or permits others to distribute under one or more
|
||||
trademark(s) which are controlled by Netscape but which are not
|
||||
licensed for use under this License.
|
||||
|
||||
III. Netscape and logo.
|
||||
This License does not grant any rights to use the trademark
|
||||
``Netscape'', the ``Netscape N and horizon'' logo or the Netscape
|
||||
lighthouse logo, even if such marks are included in the Original Code.
|
||||
|
||||
IV. Inability to Comply Due to Contractual Obligation.
|
||||
Prior to licensing the Original Code under this License, Netscape has
|
||||
licensed third party code for use in Netscape's Branded Code. To the
|
||||
extent that Netscape is limited contractually from making such third
|
||||
party code available under this License, Netscape may choose to
|
||||
reintegrate such code into Covered Code without being required to
|
||||
distribute such code in Source Code form, even if such code would
|
||||
otherwise be considered ``Modifications'' under this License.
|
||||
|
||||
V. Use of Modifications and Covered Code by Initial Developer.
|
||||
|
||||
V.1. In General.
|
||||
The obligations of Section 3 apply to Netscape, except to the
|
||||
extent specified in this Amendment, Section V.2 and V.3.
|
||||
|
||||
V.2. Other Products.
|
||||
Netscape may include Covered Code in products other than the
|
||||
Netscape's Branded Code which are released by Netscape during the
|
||||
two (2) years following the release date of the Original Code,
|
||||
without such additional products becoming subject to the terms of
|
||||
this License, and may license such additional products on
|
||||
different terms from those contained in this License.
|
||||
|
||||
V.3. Alternative Licensing.
|
||||
Netscape may license the Source Code of Netscape's Branded Code,
|
||||
including Modifications incorporated therein, without such
|
||||
additional products becoming subject to the terms of this License,
|
||||
and may license such additional products on different terms from
|
||||
those contained in this License.
|
||||
|
||||
VI. Arbitration and Litigation.
|
||||
Notwithstanding the limitations of Section 11 above, the provisions
|
||||
regarding arbitration and litigation in Section 11(a), (b) and (c) of
|
||||
the License shall apply to all disputes relating to this License.
|
||||
|
||||
EXHIBIT A.
|
||||
|
||||
``The contents of this file are subject to the Netscape Public License
|
||||
Version 1.0 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released March
|
||||
31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape Communications
|
||||
Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
Netscape Communications Corporation. All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.''
|
||||
|
||||
[NOTE: The text of this Exhibit A may differ slightly from the text of
|
||||
the notices in the Source Code files of the Original Code. This is due
|
||||
to time constraints encountered in simultaneously finalizing the
|
||||
License and in preparing the Original Code for release. You should use
|
||||
the text of this Exhibit A rather than the text found in the Original
|
||||
Code Source Code for Your Modifications.]
|
||||
83
mozilla/Makefile
Normal file
83
mozilla/Makefile
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# 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 = .
|
||||
|
||||
NSPRDIR = nsprpub
|
||||
NSPR20 = 1
|
||||
MOZILLA_CLIENT = 1
|
||||
|
||||
ifndef NO_MOCHA
|
||||
DIRS_JS = js
|
||||
endif
|
||||
|
||||
DIRS = config coreconf $(NSPRDIR) jpeg dbm xpcom network caps
|
||||
|
||||
ifdef MOZ_NETCAST
|
||||
DIRS += netcast
|
||||
endif
|
||||
|
||||
ifdef MOZ_JAVA
|
||||
DIRS += sun-java ldap ifc $(DIRS_JS) nav-java ifc/tools js/jsd
|
||||
else
|
||||
DIRS += sun-java nav-java $(DIRS_JS)
|
||||
endif
|
||||
|
||||
ifndef NO_SECURITY
|
||||
DIRS += security
|
||||
endif
|
||||
|
||||
DIRS += modules lib l10n cmd
|
||||
|
||||
ifeq ($(STAND_ALONE_JAVA),1)
|
||||
DIRS = config lib/xp $(NSPRDIR) jpeg modules/zlib sun-java ifc js ifc/tools sun-java/java
|
||||
endif
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
export:: $(OBJS)
|
||||
|
||||
# Running this rule assembles all the SDK source pieces into dist/sdk.
|
||||
# You'll need to run this rule on every platform to get all the
|
||||
# binaries (e.g. javah) copied there. You'll also have to do special
|
||||
# magic on a Mac.
|
||||
sdk-src::
|
||||
$(SDKINSTALL) include/npapi.h $(SDK)/include/
|
||||
$(SDKINSTALL) include/jri_md.h $(SDK)/include/
|
||||
$(SDKINSTALL) include/jritypes.h $(SDK)/include/
|
||||
$(SDKINSTALL) include/jri.h $(SDK)/include/
|
||||
$(SDKINSTALL) lib/plugin/npupp.h $(SDK)/include/
|
||||
$(SDKINSTALL) sdk/common/*.c* $(SDK)/common/
|
||||
$(SDKINSTALL) sun-java/classsrc/$(ZIP_NAME).x $(SDK)/classes/$(ZIP_NAME)
|
||||
$(SDKINSTALL) sdk/examples/simple/Source/*.c $(SDK)/examples/simple/Source/
|
||||
$(SDKINSTALL) sdk/examples/simple/Source/*.java $(SDK)/examples/simple/Source/
|
||||
$(SDKINSTALL) sdk/examples/simple/Source/*.class $(SDK)/examples/simple/Source/
|
||||
$(SDKINSTALL) sdk/examples/simple/Source/_gen/*.h $(SDK)/examples/simple/Source/_gen/
|
||||
$(SDKINSTALL) sdk/examples/simple/Source/_stubs/*.c $(SDK)/examples/simple/Source/_stubs/
|
||||
$(SDKINSTALL) sdk/examples/simple/Unix/makefile.* $(SDK)/examples/simple/Unix/
|
||||
$(SDKINSTALL) sdk/examples/simple/Testing/SimpleExample.html $(SDK)/examples/simple/Testing/
|
||||
$(SDKINSTALL) sdk/examples/simple/readme.html $(SDK)/examples/simple/
|
||||
$(SDKINSTALL) sdk/examples/UnixTemplate/Source/*.c $(SDK)/examples/UnixTemplate/Source/
|
||||
$(SDKINSTALL) sdk/examples/UnixTemplate/Testing/Test.html $(SDK)/examples/UnixTemplate/Testing/
|
||||
$(SDKINSTALL) sdk/examples/UnixTemplate/Unix/makefile.* $(SDK)/examples/UnixTemplate/Unix/
|
||||
$(SDKINSTALL) sdk/examples/UnixTemplate/readme.html $(SDK)/examples/UnixTemplate/
|
||||
|
||||
sdk-bin::
|
||||
cd sdk; $(MAKE); cd ..
|
||||
$(SDKINSTALL) $(DIST)/bin/javah$(BIN_SUFFIX) $(SDK)/bin/$(OS_CONFIG)/
|
||||
$(SDKINSTALL) sdk/examples/simple/Source/$(OBJDIR)/npsimple.$(DLL_SUFFIX) $(SDK)/bin/$(OS_CONFIG)/
|
||||
$(SDKINSTALL) sdk/examples/UnixTemplate/Source/$(OBJDIR)/nptemplate.$(DLL_SUFFIX) $(SDK)/bin/$(OS_CONFIG)/
|
||||
1
mozilla/build/build_number
Normal file
1
mozilla/build/build_number
Normal file
@@ -0,0 +1 @@
|
||||
5009808600
|
||||
25
mozilla/build/genrc.sh
Executable file
25
mozilla/build/genrc.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
DATATYPE="$1"
|
||||
INFILE="$2"
|
||||
|
||||
echo "${DATATYPE} RCDATA"
|
||||
sed 's/"/""/g' ${INFILE} | awk 'BEGIN { printf("BEGIN\n") } { printf("\"%s\\r\\n\",\n", $0) } END { printf("\"\\0\"\nEND\n") }'
|
||||
|
||||
exit 0
|
||||
45
mozilla/build/hcc
Executable file
45
mozilla/build/hcc
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Fix brain-damaged compilers that don't understand -o and -c together
|
||||
#
|
||||
DASH_C=0
|
||||
DASH_O=0
|
||||
for i in $*
|
||||
do
|
||||
case $i in
|
||||
-c) DASH_C=1;;
|
||||
-o) DASH_O=1;;
|
||||
*.c) C_SRC=$i;;
|
||||
*.s) S_SRC=$i;;
|
||||
*.o) OBJECT=$i;;
|
||||
esac
|
||||
done
|
||||
|
||||
cc $* || exit $?
|
||||
|
||||
# if there was no -c and -o we're done
|
||||
[ $DASH_C = 1 -a $DASH_O = 1 ] || exit 0
|
||||
|
||||
# cc always creates the .o from the .c name
|
||||
[ $C_SRC ] && OBJ=`basename $C_SRC .c`.o
|
||||
# or the .o from the .s name
|
||||
[ $S_SRC ] && OBJ=`basename $S_SRC .s`.o
|
||||
|
||||
[ -f $OBJECT ] || [ -f $OBJ ] && mv -f $OBJ $OBJECT
|
||||
86
mozilla/build/hcpp
Executable file
86
mozilla/build/hcpp
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Wrapper for brain-damaged compilers that don't understand -o and -c together.
|
||||
#
|
||||
|
||||
DUMMY="XxxXxxX"
|
||||
DASH_C=0
|
||||
DASH_O=0
|
||||
GET_OBJECT=0
|
||||
C_SRC="${DUMMY}"
|
||||
CC_SRC="${DUMMY}"
|
||||
CPP_SRC="${DUMMY}"
|
||||
S_SRC="${DUMMY}"
|
||||
OBJECT="${DUMMY}"
|
||||
|
||||
for i in $*
|
||||
do
|
||||
if [ ${GET_OBJECT} -eq 1 ]; then
|
||||
OBJECT="$i"
|
||||
GET_OBJECT=0
|
||||
fi
|
||||
case $i in
|
||||
-c)
|
||||
DASH_C=1
|
||||
;;
|
||||
-o)
|
||||
DASH_O=1
|
||||
GET_OBJECT=1
|
||||
;;
|
||||
*.c)
|
||||
C_SRC="$i"
|
||||
;;
|
||||
+.*)
|
||||
;;
|
||||
*.cpp)
|
||||
CPP_SRC="$i"
|
||||
;;
|
||||
*.cc)
|
||||
CC_SRC="$i"
|
||||
;;
|
||||
*.s)
|
||||
S_SRC="$i"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
CC $* || exit $?
|
||||
|
||||
# LAME!!!
|
||||
if [ -f -O ]; then
|
||||
mv -f -- -O ${OBJECT}
|
||||
fi
|
||||
|
||||
# if there was no -c and -o we're done
|
||||
[ ${DASH_C} -eq 1 -a ${DASH_O} -eq 1 ] || exit 0
|
||||
|
||||
# cc always creates the .o from the .c name
|
||||
if [ "${C_SRC}" != "${DUMMY}" ]; then
|
||||
OBJ=`basename ${C_SRC} .c`.o
|
||||
elif [ "${CPP_SRC}" != "${DUMMY}" ]; then
|
||||
OBJ=`basename ${CPP_SRC} .cpp`.o
|
||||
elif [ "${CC_SRC}" != "${DUMMY}" ]; then
|
||||
OBJ=`basename ${CC_SRC} .cc`.o
|
||||
# or the .o from the .s name
|
||||
elif [ "${S_SRC}" != "${DUMMY}" ]; then
|
||||
OBJ=`basename ${S_SRC} .s`.o
|
||||
fi
|
||||
|
||||
[ -f ${OBJECT} ] || [ -f ${OBJ} ] && mv -f ${OBJ} ${OBJECT}
|
||||
302
mozilla/build/mac/BuildList.pm
Normal file
302
mozilla/build/mac/BuildList.pm
Normal file
@@ -0,0 +1,302 @@
|
||||
#!perl
|
||||
|
||||
package BuildList;
|
||||
require Exporter;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(BuildMozilla DistMozilla);
|
||||
|
||||
=head1 NAME
|
||||
|
||||
BuildList - build the [ordered] set of projects needed to construct Mozilla
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
...
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
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.
|
||||
|
||||
=cut
|
||||
|
||||
use Moz;
|
||||
use File::Path;
|
||||
|
||||
sub BuildMozilla()
|
||||
{
|
||||
if ( $main::DEBUG )
|
||||
{
|
||||
$D = "Debug";
|
||||
$dist_dir = ":mozilla:dist:client_debug:";
|
||||
}
|
||||
else
|
||||
{
|
||||
$D = "";
|
||||
$dist_dir = ":mozilla:dist:client:";
|
||||
}
|
||||
|
||||
#
|
||||
# Build the appropriate target of each project
|
||||
#
|
||||
|
||||
BuildProjectClean(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "Stubs");
|
||||
BuildProjectClean(":mozilla:lib:mac:NSRuntime:NSRuntime.mcp", "Stubs");
|
||||
BuildProjectClean(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "Stubs");
|
||||
BuildProjectClean(":mozilla:cmd:macfe:projects:client:NavigatorStubs.mcp", "Stubs");
|
||||
|
||||
BuildProject(":mozilla:lib:mac:NSRuntime:NSRuntime.mcp", "NSRuntime$D.shlb");
|
||||
MakeAlias(":mozilla:lib:mac:NSRuntime:NSRuntime$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:cmd:macfe:restext:StringLib.mcp", "Strings$D.shlb");
|
||||
MakeAlias(":mozilla:cmd:macfe:restext:Strings$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:lib:mac:MoreFiles:build:MoreFilesPPC.mcp", "MoreFiles$D.shlb");
|
||||
MakeAlias(":mozilla:lib:mac:MoreFiles:build:MoreFiles$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:nsprpub:macbuild:NSPR20PPC.mcp", "NSPR20$D.shlb");
|
||||
MakeAlias(":mozilla:nsprpub:macbuild:NSPR20$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:dbm:macbuild:DBMPPC.mcp", "DBM$D.shlb");
|
||||
MakeAlias(":mozilla:dbm:macbuild:DBM$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "MemAllocator$D.shlb");
|
||||
MakeAlias(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "NSStdLib$D.shlb");
|
||||
MakeAlias(":mozilla:lib:mac:NSStdLib:NSStdLib$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:xpcom:macbuild:xpcomPPC.mcp", "xpcom$D.shlb");
|
||||
MakeAlias(":mozilla:xpcom:macbuild:xpcom$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:lib:mac:PowerPlant:PowerPlant.mcp", "PowerPlant$D.shlb");
|
||||
MakeAlias(":mozilla:lib:mac:PowerPlant:PowerPlant$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:modules:zlib:macbuild:zlib.mcp", "zlib$D.shlb");
|
||||
MakeAlias(":mozilla:modules:zlib:macbuild:zlib$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:jpeg:macbuild:JPEG.mcp", "JPEG$D.shlb");
|
||||
MakeAlias(":mozilla:jpeg:macbuild:JPEG$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:sun-java:stubs:macbuild:JavaStubs.mcp", "JavaRuntime$D.shlb");
|
||||
MakeAlias(":mozilla:sun-java:stubs:macbuild:JavaRuntime$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:js:jsj:macbuild:JSJ_PPC.mcp", "JSJ$D.o");
|
||||
|
||||
BuildProject(":mozilla:js:macbuild:JavaScriptPPC.mcp", "JavaScript$D.shlb");
|
||||
MakeAlias(":mozilla:js:macbuild:JavaScript$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:js:macbuild:LiveConnect.mcp", "LiveConnect$D.shlb");
|
||||
MakeAlias(":mozilla:js:macbuild:LiveConnect$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:nav-java:stubs:macbuild:NavJavaStubs.mcp", "NavJava$D.shlb");
|
||||
MakeAlias(":mozilla:nav-java:stubs:macbuild:NavJava$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:modules:rdf:macbuild:RDF.mcp", "RDF$D.shlb");
|
||||
MakeAlias(":mozilla:modules:rdf:macbuild:RDF$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:modules:xml:macbuild:XML.mcp", "XML$D.shlb");
|
||||
MakeAlias(":mozilla:modules:xml:macbuild:XML$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:modules:schedulr:macbuild:Schedulr.mcp", "Scheduler$D.shlb");
|
||||
MakeAlias(":mozilla:modules:schedulr:macbuild:Scheduler$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:build:mac:CustomLib:CustomLib.mcp", "CustomLib$D.shlb");
|
||||
MakeAlias(":mozilla:build:mac:CustomLib:CustomLib$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "Security.o");
|
||||
BuildProject(":mozilla:modules:libfont:macbuild:FontBroker.mcp", "FontBroker$D.o");
|
||||
BuildProject(":mozilla:modules:oji:macbuild:oji.mcp", "oji$D.o");
|
||||
BuildProject(":mozilla:lib:libmocha:macbuild:LibMocha.mcp", "LibMocha$D.o");
|
||||
BuildProject(":mozilla:network:macbuild:network.mcp", "Network$D.o");
|
||||
BuildProject(":mozilla:caps:macbuild:Caps.mcp", "Caps$D.o");
|
||||
|
||||
BuildProject(":mozilla:build:mac:CustomLib:CustomLib.mcp", "CustomStaticLib$D.o");
|
||||
|
||||
if ( $main::MOZ_LITE == 0 )
|
||||
{
|
||||
BuildProject(":mozilla:cmd:macfe:Composer:build:Composer.mcp", "Composer$D.o");
|
||||
|
||||
# Build the appropriate resources target
|
||||
BuildProject(":mozilla:cmd:macfe:projects:client:Client.mcp", "Moz_Resources");
|
||||
}
|
||||
else
|
||||
{
|
||||
# Build a project with dummy targets to make stub libraries
|
||||
BuildProject("cmd:macfe:projects:dummies:MakeDummies.mcp", "Composer$D.o");
|
||||
|
||||
# Build the appropriate resources target
|
||||
BuildProject(":mozilla:cmd:macfe:projects:client:Client.mcp", "Nav_Resources");
|
||||
}
|
||||
|
||||
BuildProject(":mozilla:cmd:macfe:projects:client:Client.mcp", "Client$D");
|
||||
}
|
||||
|
||||
|
||||
sub DistMozilla()
|
||||
{
|
||||
mkpath([ ":mozilla:dist:", ":mozilla:dist:client:", ":mozilla:dist:client_debug:", ":mozilla:dist:client_stubs:" ]);
|
||||
|
||||
#INCLUDE
|
||||
InstallFromManifest(":mozilla:config:mac:MANIFEST", ":mozilla:dist:config:");
|
||||
InstallFromManifest(":mozilla:include:MANIFEST", ":mozilla:dist:include:");
|
||||
InstallFromManifest(":mozilla:cmd:macfe:pch:MANIFEST", ":mozilla:dist:include:");
|
||||
|
||||
#MAC_COMMON
|
||||
InstallFromManifest(":mozilla:build:mac:MANIFEST", ":mozilla:dist:mac:common:");
|
||||
InstallFromManifest(":mozilla:lib:mac:NSStdLib:include:MANIFEST", ":mozilla:dist:mac:common:");
|
||||
InstallFromManifest(":mozilla:lib:mac:MacMemoryAllocator:include:MANIFEST", ":mozilla:dist:mac:common:");
|
||||
InstallFromManifest(":mozilla:lib:mac:Misc:MANIFEST", ":mozilla:dist:mac:common:");
|
||||
InstallFromManifest(":mozilla:lib:mac:MoreFiles:MANIFEST", ":mozilla:dist:mac:common:morefiles:");
|
||||
InstallFromManifest(":mozilla:cmd:macfe:MANIFEST", ":mozilla:dist:mac:macfe:");
|
||||
|
||||
#NSPR
|
||||
InstallFromManifest(":mozilla:nsprpub:pr:include:MANIFEST", ":mozilla:dist:nspr:");
|
||||
InstallFromManifest(":mozilla:nsprpub:pr:src:md:mac:MANIFEST", ":mozilla:dist:nspr:mac:");
|
||||
InstallFromManifest(":mozilla:nsprpub:lib:ds:MANIFEST", ":mozilla:dist:nspr:");
|
||||
InstallFromManifest(":mozilla:nsprpub:lib:libc:include:MANIFEST", ":mozilla:dist:nspr:");
|
||||
InstallFromManifest(":mozilla:nsprpub:lib:msgc:include:MANIFEST", ":mozilla:dist:nspr:");
|
||||
|
||||
#DBM
|
||||
InstallFromManifest(":mozilla:dbm:include:MANIFEST", ":mozilla:dist:dbm:");
|
||||
|
||||
#LIBIMAGE
|
||||
InstallFromManifest(":mozilla:modules:libimg:png:MANIFEST", ":mozilla:dist:libimg:");
|
||||
InstallFromManifest(":mozilla:modules:libimg:src:MANIFEST", ":mozilla:dist:libimg:");
|
||||
InstallFromManifest(":mozilla:modules:libimg:public:MANIFEST", ":mozilla:dist:libimg:");
|
||||
|
||||
#SECURITY_freenav
|
||||
InstallFromManifest(":mozilla:modules:security:freenav:MANIFEST", ":mozilla:dist:security:");
|
||||
|
||||
#XPCOM
|
||||
InstallFromManifest(":mozilla:xpcom:src:MANIFEST", ":mozilla:dist:xpcom:");
|
||||
|
||||
#ZLIB
|
||||
InstallFromManifest(":mozilla:modules:zlib:src:MANIFEST", ":mozilla:dist:zlib:");
|
||||
|
||||
#JPEG
|
||||
InstallFromManifest(":mozilla:jpeg:MANIFEST", ":mozilla:dist:jpeg:");
|
||||
|
||||
#JSJ
|
||||
InstallFromManifest(":mozilla:js:jsj:MANIFEST", ":mozilla:dist:jsj:");
|
||||
|
||||
#JSDEBUG
|
||||
InstallFromManifest(":mozilla:js:jsd:MANIFEST", ":mozilla:dist:jsdebug:");
|
||||
|
||||
#JS
|
||||
InstallFromManifest(":mozilla:js:src:MANIFEST", ":mozilla:dist:js:");
|
||||
|
||||
#LIVECONNECT
|
||||
InstallFromManifest(":mozilla:js:src:liveconnect:MANIFEST", ":mozilla:dist:liveconnect:");
|
||||
|
||||
#RDF
|
||||
InstallFromManifest(":mozilla:modules:rdf:include:MANIFEST", ":mozilla:dist:rdf:");
|
||||
|
||||
#XML
|
||||
InstallFromManifest(":mozilla:modules:xml:glue:MANIFEST", ":mozilla:dist:xml:");
|
||||
InstallFromManifest(":mozilla:modules:xml:expat:xmlparse:MANIFEST", ":mozilla:dist:xml:");
|
||||
|
||||
#LIBFONT
|
||||
InstallFromManifest(":mozilla:modules:libfont:MANIFEST", ":mozilla:dist:libfont:");
|
||||
InstallFromManifest(":mozilla:modules:libfont:src:MANIFEST", ":mozilla:dist:libfont:");
|
||||
|
||||
#LDAP
|
||||
if ( $main::MOZ_LDAP )
|
||||
{
|
||||
InstallFromManifest(":mozilla:directory:c-sdk:ldap:include:MANIFEST", ":mozilla:dist:ldap:");
|
||||
}
|
||||
|
||||
#SCHEDULER
|
||||
InstallFromManifest(":mozilla:modules:schedulr:public:MANIFEST", ":mozilla:dist:schedulr:");
|
||||
|
||||
#NETWORK
|
||||
InstallFromManifest(":mozilla:network:cache:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:client:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:cnvts:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:cstream:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:main:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:mimetype:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:util:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:about:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:certld:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:dataurl:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:file:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:ftp:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:gopher:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:http:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:js:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:mailbox:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:marimba:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:nntp:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:pop3:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:remote:MANIFEST", ":mozilla:dist:network:");
|
||||
InstallFromManifest(":mozilla:network:protocol:smtp:MANIFEST", ":mozilla:dist:network:");
|
||||
|
||||
#HTML_DIALOGS
|
||||
InstallFromManifest(":mozilla:lib:htmldlgs:MANIFEST", ":mozilla:dist:htmldlgs:");
|
||||
|
||||
#LAYOUT
|
||||
InstallFromManifest(":mozilla:lib:layout:MANIFEST", ":mozilla:dist:layout:");
|
||||
|
||||
#LAYERS
|
||||
InstallFromManifest(":mozilla:lib:liblayer:include:MANIFEST", ":mozilla:dist:layers:");
|
||||
|
||||
#PARSE
|
||||
InstallFromManifest(":mozilla:lib:libparse:MANIFEST", ":mozilla:dist:libparse:");
|
||||
|
||||
#STYLE
|
||||
InstallFromManifest(":mozilla:lib:libstyle:MANIFEST", ":mozilla:dist:libstyle:");
|
||||
|
||||
#PLUGIN
|
||||
InstallFromManifest(":mozilla:modules:plugin:public:MANIFEST", ":mozilla:dist:plugin:");
|
||||
InstallFromManifest(":mozilla:modules:plugin:src:MANIFEST", ":mozilla:dist:plugin:");
|
||||
|
||||
#LIBHOOK
|
||||
InstallFromManifest(":mozilla:modules:libhook:public:MANIFEST", ":mozilla:dist:libhook:");
|
||||
|
||||
#LIBPREF
|
||||
InstallFromManifest(":mozilla:modules:libpref:public:MANIFEST", ":mozilla:dist:libpref:");
|
||||
|
||||
#LIBREG
|
||||
InstallFromManifest(":mozilla:modules:libreg:include:MANIFEST", ":mozilla:dist:libreg:");
|
||||
|
||||
#LIBUTIL
|
||||
InstallFromManifest(":mozilla:modules:libutil:public:MANIFEST", ":mozilla:dist:libutil:");
|
||||
|
||||
#PROGRESS
|
||||
InstallFromManifest(":mozilla:modules:progress:public:MANIFEST", ":mozilla:dist:progress:");
|
||||
|
||||
#EDTPLUG
|
||||
InstallFromManifest(":mozilla:modules:edtplug:include:MANIFEST", ":mozilla:dist:edtplug:");
|
||||
|
||||
#NAV_JAVA
|
||||
InstallFromManifest(":mozilla:nav-java:stubs:include:MANIFEST", ":mozilla:dist:nav-java:");
|
||||
InstallFromManifest(":mozilla:nav-java:stubs:macjri:MANIFEST", ":mozilla:dist:nav-java:");
|
||||
|
||||
#SUN_JAVA
|
||||
InstallFromManifest(":mozilla:sun-java:stubs:include:MANIFEST", ":mozilla:dist:sun-java:");
|
||||
InstallFromManifest(":mozilla:sun-java:stubs:macjri:MANIFEST", ":mozilla:dist:sun-java:");
|
||||
|
||||
#OJI
|
||||
InstallFromManifest(":mozilla:modules:oji:public:MANIFEST", ":mozilla:dist:oji:");
|
||||
InstallFromManifest(":mozilla:modules:oji:src:MANIFEST", ":mozilla:dist:oji:");
|
||||
|
||||
#CAPS
|
||||
InstallFromManifest(":mozilla:caps:include:MANIFEST", ":mozilla:dist:caps:");
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
143
mozilla/build/mac/BuildListObsolete.pm
Normal file
143
mozilla/build/mac/BuildListObsolete.pm
Normal file
@@ -0,0 +1,143 @@
|
||||
#!perl
|
||||
|
||||
package BuildListObsolete;
|
||||
require Exporter;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(BuildMozilla);
|
||||
|
||||
=head1 NAME
|
||||
|
||||
BuildList - build the [ordered] set of projects needed to construct Mozilla
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
...
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
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.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
sub BuildMozilla()
|
||||
{
|
||||
use Moz;
|
||||
|
||||
chdir(":::"); # assuming this script is in "...:mozilla:build:mac:", change dir to just inside "mozilla"
|
||||
|
||||
|
||||
if ( $main::DEBUG )
|
||||
{
|
||||
$D = " (Debug)";
|
||||
$LibD = "Debug";
|
||||
$dist_dir = ":dist:client_debug:";
|
||||
}
|
||||
else
|
||||
{
|
||||
$D = "";
|
||||
$LibD = "";
|
||||
$dist_dir = ":dist:client:";
|
||||
}
|
||||
|
||||
#
|
||||
# Build the appropriate target of each project
|
||||
#
|
||||
|
||||
BuildProjectClean(":lib:mac:NSStdLib:NSStdLib.mcp", "Stub Library");
|
||||
BuildProjectClean(":lib:mac:MacMemoryAllocator:MemAllocator.mcp", "Stub Library");
|
||||
BuildProjectClean(":cmd:macfe:projects:client:Navigator.mcp", "Stub Library");
|
||||
|
||||
BuildProject(":lib:mac:NSRuntime:NSRuntime.mcp");
|
||||
MakeAlias(":lib:mac:NSRuntime:NSRuntimePPCLib", "$dist_dir");
|
||||
|
||||
BuildProject(":cmd:macfe:restext:NavStringLibPPC.mcp");
|
||||
MakeAlias(":cmd:macfe:restext:StringsPPCLib", "$dist_dir");
|
||||
|
||||
BuildProject(":lib:mac:MoreFiles:build:MoreFilesPPC.prj");
|
||||
MakeAlias(":lib:mac:MoreFiles:build:MoreFilesPPC.lib", "$dist_dir");
|
||||
|
||||
BuildProject(":nsprpub:macbuild:NSPR20PPC".$LibD.".mcp");
|
||||
MakeAlias(":nsprpub:macbuild:NSPR20PPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":dbm:macbuild:DBMPPC".$LibD.".mcp");
|
||||
MakeAlias(":dbm:macbuild:DBMPPC".$LibD."Lib", "${dist_dir}");
|
||||
|
||||
BuildProject(":lib:mac:MacMemoryAllocator:MemAllocator.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":lib:mac:MacMemoryAllocator:MemAllocatorPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":lib:mac:NSStdLib:NSStdLib.mcp", "PPC Shared Library");
|
||||
MakeAlias(":lib:mac:NSStdLib:NSStdLibPPCLib", "$dist_dir");
|
||||
|
||||
BuildProject(":modules:security:freenav:macbuild:NoSecurity.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":modules:security:freenav:macbuild:NoSecurity".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":xpcom:macbuild:xpcomPPC".$LibD.".mcp");
|
||||
MakeAlias(":xpcom:macbuild:xpcomPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":lib:mac:PowerPlant:PowerPlant.mcp");
|
||||
MakeAlias(":lib:mac:PowerPlant:PowerPlantPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":modules:zlib:macbuild:zlib.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":modules:zlib:macbuild:zlibPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":jpeg:macbuild:JPEG.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":jpeg:macbuild:JPEGPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":sun-java:stubs:macbuild:JavaStubs.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":sun-java:stubs:macbuild:JavaRuntimePPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":js:jsj:macbuild:JSJ_PPC".$LibD.".mcp");
|
||||
|
||||
BuildProject(":js:macbuild:JavaScriptPPC".$LibD.".mcp");
|
||||
MakeAlias(":js:macbuild:JavaScriptPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":nav-java:stubs:macbuild:NavJavaStubs.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":nav-java:stubs:macbuild:NavJavaPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
if ( $main::DEBUG )
|
||||
{
|
||||
BuildProject(":modules:rdf:macbuild:RDF.mcp", "PPC Shared Library +D -LDAP");
|
||||
MakeAlias(":modules:rdf:macbuild:RDFPPCDebugLib", "${dist_dir}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Moz::BuildProject(":modules:rdf:macbuild:RDF.mcp", "PPC Shared Library -LDAP");
|
||||
MakeAlias(":modules:rdf:macbuild:RDFPPCLib", "${dist_dir}");
|
||||
}
|
||||
|
||||
BuildProject(":modules:xml:macbuild:XML.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":modules:xml:macbuild:XMLPPC".$LibD."Lib", "$dist_dir");
|
||||
|
||||
BuildProject(":modules:libfont:macbuild:FontBroker.mcp", "PPC Library$D");
|
||||
|
||||
BuildProject(":modules:schedulr:macbuild:Schedulr.mcp", "PPC Shared Library$D");
|
||||
MakeAlias(":modules:schedulr:macbuild:Schedulr".$LibD."PPCLib", "$dist_dir");
|
||||
|
||||
BuildProject(":network:macbuild:network.mcp", "PPC Library (Debug Moz)");
|
||||
|
||||
if ( $main::MOZ_LITE == 0 )
|
||||
{
|
||||
BuildProject(":cmd:macfe:Composer:build:Composer.mcp", "PPC Library$D");
|
||||
}
|
||||
|
||||
BuildProject(":cmd:macfe:projects:client:Navigator.mcp", "Moz PPC App$D");
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
35
mozilla/build/mac/BuildMozilla.pl
Normal file
35
mozilla/build/mac/BuildMozilla.pl
Normal file
@@ -0,0 +1,35 @@
|
||||
#!perl
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
use Moz;
|
||||
use BuildList;
|
||||
|
||||
$DEBUG = 0;
|
||||
$MOZ_LITE = 0; # build moz medium. This will come from a config file at some stage.
|
||||
|
||||
Moz::OpenErrorLog(":::Mozilla.BuildLog");
|
||||
Moz::StopForErrors();
|
||||
|
||||
chdir("::::");
|
||||
|
||||
# Make and popuplate the dist directory
|
||||
DistMozilla();
|
||||
|
||||
# Now build the projects
|
||||
BuildMozilla();
|
||||
124
mozilla/build/mac/BuildMozilla.pm
Normal file
124
mozilla/build/mac/BuildMozilla.pm
Normal file
@@ -0,0 +1,124 @@
|
||||
#!perl
|
||||
|
||||
package BuildMozilla;
|
||||
require Exporter;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(BuildMozilla);
|
||||
|
||||
=head1 NAME
|
||||
|
||||
BuildMozilla - build the [ordered] set of projects needed to construct Mozilla
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
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.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
sub BuildMozilla()
|
||||
{
|
||||
use Moz;
|
||||
|
||||
chdir("::::"); # assuming this script is in "...:mozilla:build:mac:", change dir to just above "mozilla"
|
||||
|
||||
|
||||
# Ideally, we would set the target name like so:
|
||||
# $target = $main::DEBUG ? "debug" : "optimized";
|
||||
# ...and all projects would have corresponding targets
|
||||
|
||||
|
||||
$D = $main::DEBUG ? " (Debug)" : ""; # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project
|
||||
|
||||
|
||||
#
|
||||
# Build the appropriate target of each project
|
||||
#
|
||||
|
||||
Moz::BuildProject(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "Stub Library");
|
||||
Moz::BuildProject(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "Stub Library");
|
||||
Moz::BuildProject(":mozilla:cmd:macfe:projects:client:Navigator.mcp", "Stub Library");
|
||||
|
||||
Moz::BuildProject(":mozilla:lib:mac:NSRuntime:NSRuntime.mcp");
|
||||
Moz::BuildProject(":mozilla:cmd:macfe:restext:NavStringLibPPC.mcp");
|
||||
Moz::BuildProject(":mozilla:lib:mac:MoreFiles:build:MoreFilesPPC.prj");
|
||||
|
||||
if ( $main::DEBUG )
|
||||
{
|
||||
Moz::BuildProject(":mozilla:nsprpub:macbuild:NSPR20PPCDebug.mcp");
|
||||
Moz::BuildProject(":mozilla:dbm:macbuild:DBMPPCDebug.mcp");
|
||||
}
|
||||
else
|
||||
{
|
||||
Moz::BuildProject(":mozilla:nsprpub:macbuild:NSPR20PPC.mcp");
|
||||
Moz::BuildProject(":mozilla:dbm:macbuild:DBMPPC.mcp");
|
||||
}
|
||||
|
||||
Moz::BuildProject(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "PPC Shared Library$D");
|
||||
Moz::BuildProject(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "PPC Shared Library");
|
||||
Moz::BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "PPC Shared Library$D");
|
||||
|
||||
if ( $main::DEBUG )
|
||||
{
|
||||
Moz::BuildProject(":mozilla:xpcom:macbuild:xpcomPPCDebug.mcp");
|
||||
}
|
||||
else
|
||||
{
|
||||
Moz::BuildProject(":mozilla:xpcom:macbuild:xpcomPPC.mcp");
|
||||
}
|
||||
|
||||
Moz::BuildProject(":mozilla:lib:mac:PowerPlant:PowerPlant.mcp");
|
||||
Moz::BuildProject(":mozilla:modules:zlib:macbuild:zlib.mcp", "PPC Shared Library$D");
|
||||
Moz::BuildProject(":mozilla:jpeg:macbuild:JPEG.mcp", "PPC Shared Library$D");
|
||||
Moz::BuildProject(":mozilla:sun-java:stubs:macbuild:JavaStubs.mcp", "PPC Shared Library$D");
|
||||
|
||||
if ( $main::DEBUG )
|
||||
{
|
||||
Moz::BuildProject(":mozilla:js:jsj:macbuild:JSJ_PPCDebug.mcp");
|
||||
Moz::BuildProject(":mozilla:js:macbuild:JavaScriptPPCDebug.mcp");
|
||||
}
|
||||
else
|
||||
{
|
||||
Moz::BuildProject(":mozilla:js:jsj:macbuild:JSJ_PPC.mcp");
|
||||
Moz::BuildProject(":mozilla:js:macbuild:JavaScriptPPC.mcp");
|
||||
}
|
||||
|
||||
Moz::BuildProject(":mozilla:nav-java:stubs:macbuild:NavJavaStubs.mcp", "PPC Shared Library$D");
|
||||
|
||||
|
||||
# the following `if' can be fixed when we either rename the debug target of the RDF project, or of all the other projects
|
||||
|
||||
if ( $main::DEBUG )
|
||||
{
|
||||
Moz::BuildProject(":mozilla:modules:rdf:macbuild:RDF.mcp", "PPC Shared Library +D -LDAP");
|
||||
}
|
||||
else
|
||||
{
|
||||
Moz::BuildProject(":mozilla:modules:rdf:macbuild:RDF.mcp", "PPC Shared Library -LDAP");
|
||||
}
|
||||
|
||||
Moz::BuildProject(":mozilla:modules:xml:macbuild:XML.mcp", "PPC Shared Library$D");
|
||||
Moz::BuildProject(":mozilla:modules:libfont:macbuild:FontBroker.mcp", "PPC Library$D");
|
||||
Moz::BuildProject(":mozilla:modules:schedulr:macbuild:Schedulr.mcp", "PPC Shared Library$D");
|
||||
Moz::BuildProject(":mozilla:network:macbuild:network.mcp", "PPC Library (Debug Moz)");
|
||||
Moz::BuildProject(":mozilla:cmd:macfe:Composer:build:Composer.mcp", "PPC Library$D");
|
||||
Moz::BuildProject(":mozilla:cmd:macfe:projects:client:Navigator.mcp", "Moz PPC App$D");
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
35
mozilla/build/mac/BuildMozillaDebug.pl
Normal file
35
mozilla/build/mac/BuildMozillaDebug.pl
Normal file
@@ -0,0 +1,35 @@
|
||||
#!perl
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
use Moz;
|
||||
use BuildList;
|
||||
|
||||
$DEBUG = 1;
|
||||
$MOZ_LITE = 0; # build moz medium. This will come from a config file at some stage.
|
||||
|
||||
Moz::OpenErrorLog(":::Mozilla.BuildLog");
|
||||
Moz::StopForErrors();
|
||||
|
||||
chdir("::::");
|
||||
|
||||
# Make and popuplate the dist directory
|
||||
DistMozilla();
|
||||
|
||||
# Now build the projects
|
||||
BuildMozilla();
|
||||
120
mozilla/build/mac/BuildNGLayoutDebug.pl
Normal file
120
mozilla/build/mac/BuildNGLayoutDebug.pl
Normal file
@@ -0,0 +1,120 @@
|
||||
#!perl
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#
|
||||
# nglayout build script (debug)
|
||||
#
|
||||
use NGLayoutBuildList;
|
||||
use Cwd;
|
||||
use Moz;
|
||||
|
||||
# configuration variables
|
||||
$DEBUG = 1;
|
||||
$pull{all} = 0;
|
||||
$pull{lizard} = 0;
|
||||
$pull{xpcom} = 0;
|
||||
$pull{imglib} = 0;
|
||||
$pull{netlib} = 0;
|
||||
$pull{nglayout} = 0;
|
||||
$pull{mac} = 0;
|
||||
|
||||
$build{all} = 0;
|
||||
$build{dist} = 0;
|
||||
$build{projects}= 0;
|
||||
|
||||
#
|
||||
# UI
|
||||
#
|
||||
|
||||
@choices = ("pull_and_build_all",
|
||||
"pull_all",
|
||||
"build_all",
|
||||
"pull_nglayout",
|
||||
"build_dist",
|
||||
"build_projects");
|
||||
#damn, this does not work on
|
||||
if (0)
|
||||
{
|
||||
@pick = MacPerl::Pick("What would you like to do?", @choices);
|
||||
$pull{all} = 0;
|
||||
$build{all} = 1;
|
||||
foreach $i (@pick)
|
||||
{
|
||||
if ($i eq "pull_and_build_all")
|
||||
{
|
||||
$pull{all} = 1;
|
||||
$build{all} = 1;
|
||||
}
|
||||
elsif ($i eq "pull_all")
|
||||
{
|
||||
$pull{all} = 1;
|
||||
}
|
||||
elsif ($i eq "build_all")
|
||||
{
|
||||
$build{all} = 1;
|
||||
}
|
||||
elsif ($i eq "build_dist")
|
||||
{
|
||||
$build{dist} = 1;
|
||||
}
|
||||
elsif ($i eq "build_projects")
|
||||
{
|
||||
$build{projects} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pull{all} = 1;
|
||||
$build{all} = 1;
|
||||
# $build{projects} = 1;
|
||||
# $build{dist} = 1;
|
||||
# $pull{nglayout} = 1;
|
||||
}
|
||||
|
||||
if ($pull{all})
|
||||
{
|
||||
foreach $k (keys(%pull))
|
||||
{
|
||||
$pull{$k} = 1;
|
||||
}
|
||||
}
|
||||
if ($build{all})
|
||||
{
|
||||
foreach $k (keys(%build))
|
||||
{
|
||||
$build{$k} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# do the work
|
||||
# you should not have to edit anything bellow
|
||||
|
||||
chdir("::::");
|
||||
$MOZ_SRC = cwd();
|
||||
Moz::StopForErrors();
|
||||
#Moz::DontStopForErrors();
|
||||
OpenErrorLog("::NGLayoutBuildLog");
|
||||
|
||||
Checkout();
|
||||
chdir($MOZ_SRC);
|
||||
BuildDist();
|
||||
chdir($MOZ_SRC);
|
||||
BuildProjects();
|
||||
print "Build layout complete\n";
|
||||
BIN
mozilla/build/mac/CodeWarriorLib
Normal file
BIN
mozilla/build/mac/CodeWarriorLib
Normal file
Binary file not shown.
78
mozilla/build/mac/CopyExports.script
Normal file
78
mozilla/build/mac/CopyExports.script
Normal file
@@ -0,0 +1,78 @@
|
||||
#
|
||||
# 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 {#} != 1
|
||||
echo "CopyExports requires 1 parameters:"
|
||||
echo "Parameter 1: path relative to {SourceRootDir} of the file which contains"
|
||||
echo " the list of files to be copied, one per line. This path"
|
||||
echo " may not begin with a colon"
|
||||
echo
|
||||
Exit 1
|
||||
end if
|
||||
|
||||
|
||||
Set SourceList "{SourceRootDir}{1}"
|
||||
|
||||
Set ScriptsDir "{SourceRootDir}mozilla:build:mac:"
|
||||
|
||||
#set sourceList "{SourceRootDir}mozilla:{1}"
|
||||
|
||||
if {verbose}
|
||||
echo "Source list is in file ¶"{SourceList}¶""
|
||||
echo "Scripts directory is ¶"{ScriptsDir}¶""
|
||||
end if
|
||||
|
||||
# for each line in the source file, remove it if it starts with #, otherwise quote it
|
||||
|
||||
for curLine in `streamedit "{sourceList}" -e '/¥#Å/ Delete; /¥/ Replace /(Å)¨1/ "¶""¨1"¶""'`
|
||||
|
||||
echo "{curLine}"
|
||||
|
||||
# ignore empty lines
|
||||
if `evaluate "{{curLine}}" != ""`
|
||||
|
||||
echo "{curLine}"
|
||||
|
||||
# strip out trailing comments
|
||||
if `evaluate "{curLine}" =~ /(Å)¨1[ ¶t]+(#Å)¨2/`
|
||||
set sourceLine "{¨1}"
|
||||
# echo "Discarding comment {¨2}"
|
||||
else
|
||||
set sourceLine "{curLine}"
|
||||
end if
|
||||
|
||||
if `evaluate "{sourceLine}" =~ /([Â ¶t]+)¨1[ ¶t]+[:]*(Å)¨2/`
|
||||
|
||||
if {verbose}
|
||||
echo "Cur line is {sourceLine}"
|
||||
end if
|
||||
|
||||
set exportFile "{¨1}"
|
||||
set theTarget "{¨2}"
|
||||
|
||||
if {verbose}
|
||||
echo "Export file name is {exportFile}"
|
||||
echo "Target directory is {theTarget}"
|
||||
end if
|
||||
|
||||
"{ScriptsDir}CopyList.script" "{exportFile}" "{theTarget}"
|
||||
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
end for
|
||||
81
mozilla/build/mac/CopyHeaders.script
Normal file
81
mozilla/build/mac/CopyHeaders.script
Normal file
@@ -0,0 +1,81 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
# This is the controlling script for a set of scripts that copy public
|
||||
# header files in one or more source trees into a single, "dist" directory.
|
||||
#
|
||||
# It relies on the two accompanying scripts, ÒCopyList.scriptÓ and
|
||||
# ÒCopyExports.scriptÓ, which must be in the same directory.
|
||||
#
|
||||
# To execute this script, select everything from "# Get the..." to
|
||||
# " the end" and hit the Enter key.
|
||||
#
|
||||
# Known bugs:
|
||||
# Header files are always copied if the export.mac file contains
|
||||
# non-local paths.
|
||||
# Spurious output is produced even when verbose is off.
|
||||
#
|
||||
|
||||
# Uncomment this to get some progress information
|
||||
# set -e verbose 1
|
||||
|
||||
# Get the root of everything
|
||||
|
||||
set magicfilepath "{systempfolder}filepath" # Temporary items folder, "filepath"
|
||||
if !`Exists "{{magicFilePath}}"`
|
||||
Echo "No file path file seems to have been created in the temporary items folder."
|
||||
Echo "Was this script executed from the perl script? That's the way it was designed."
|
||||
Exit 1
|
||||
end if
|
||||
|
||||
set myDirectory "`catenate "{{magicFilePath}}"`"
|
||||
delete -i "{{magicFilePath}}"
|
||||
|
||||
Set SourceList "{myDirectory}{1}"
|
||||
(Evaluate "{myDirectory}" =~ /(Å:)¨1[Â:]+:[Â:]+:[Â:]+/) #·· dev:null
|
||||
Set -e mozillaDir "{¨1}"
|
||||
|
||||
if !`Exists "{{mozillaDir}}"`
|
||||
Echo "A file path was passed, but it doesn't seem to be the mozilla directory."
|
||||
Exit 1
|
||||
end if
|
||||
echo "Mozilla directory found at {mozillaDir}"
|
||||
|
||||
#Calculate the root directory by stripping off the leaf name.
|
||||
(Evaluate "{mozillaDir}" =~ /(Å:)¨1([Â:]+)¨2/) #·· dev:null
|
||||
Set -e SourceRootDir "{¨1}"
|
||||
Set -e DestRootDir "{mozillaDir}dist:"
|
||||
|
||||
# Ensure the build and stubs folders exist
|
||||
|
||||
if !`exists -d "{mozillaDir}dist"`
|
||||
newfolder "{mozillaDir}dist"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client"`
|
||||
newfolder "{mozillaDir}dist:client"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client_debug"`
|
||||
newfolder "{mozillaDir}dist:client_debug"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client_stubs"`
|
||||
newfolder "{mozillaDir}dist:client_stubs"
|
||||
end if
|
||||
|
||||
"{SourceRootDir}mozilla:build:mac:CopyExports.script" "mozilla:build:mac:MacExportListPublic"
|
||||
|
||||
# the end
|
||||
97
mozilla/build/mac/CopyList.script
Normal file
97
mozilla/build/mac/CopyList.script
Normal file
@@ -0,0 +1,97 @@
|
||||
#
|
||||
# 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 {#} != 2
|
||||
echo "CopyList requires 2 parameters:"
|
||||
echo "Parameter 1: path relative to {SourceRootDir} of the file which contains"
|
||||
echo " the list of files to be copied, one per line. This path"
|
||||
echo " may not begin with a colon"
|
||||
echo
|
||||
echo "Parameter 2: path relative to {DestRootDir} of the directory where all the"
|
||||
echo " files are to be copied. No initial colons!"
|
||||
echo
|
||||
Exit 1
|
||||
end if
|
||||
|
||||
set debugEcho "" # This setting will actually duplicate the files
|
||||
#set debugEcho "echo" # This setting will merely print the "duplicate" commands.
|
||||
|
||||
set sourceList "{SourceRootDir}{1}"
|
||||
set targetDir "{DestRootDir}{2}"
|
||||
|
||||
# targetDir may not end in a colon for this script to work.
|
||||
if `Evaluate "{targetDir}" =~ /(Å)¨1:/`
|
||||
#echo "Removed a colon"
|
||||
set targetDir "{¨1}"
|
||||
end if
|
||||
|
||||
#Ensure the target hierarchy exists
|
||||
# Volume name
|
||||
(Evaluate "{TargetDir}" =~ /([Â:]+)¨1:Å/) ·· dev:null
|
||||
Set PartialPath "{¨1}"
|
||||
Loop
|
||||
(Evaluate "{TargetDir}" =~ /("{PartialPath}":[Â:]+)¨1([:]*)¨2Å/) ·· dev:null
|
||||
Set PartialPath "{¨1}"
|
||||
Set Exit 0
|
||||
(NewFolder "{PartialPath}") ·· dev:null
|
||||
Set Exit 1
|
||||
break if "{¨2}" == ""
|
||||
End Loop
|
||||
|
||||
#Calculate the source directory by stripping off the leaf name.
|
||||
(Evaluate "{SourceList}" =~ /(Å:)¨1([Â:]+)¨2/) #·· dev:null
|
||||
Set SourceDir "{¨1}"
|
||||
|
||||
if {verbose}
|
||||
echo "Source list is in file ¶"{sourceList}¶""
|
||||
echo "Source directory is ¶"{SourceDir}¶""
|
||||
echo "Target directory is ¶"{targetDir}¶""
|
||||
end if
|
||||
|
||||
# Strip all comment lines, pipe the stripped lines into the "for" loop.
|
||||
# We quote each whole line here so that we deal with a line at a time in the
|
||||
# for loop. Don't ya just love MPW quoting rulesÉ
|
||||
|
||||
for f in `streamedit "{sourceList}" -e '/¥#Å/ Delete; /¥/ Replace /(Å)¨1/ "¶""¨1"¶""'`
|
||||
|
||||
if `evaluate "{{f}}" != ""`
|
||||
|
||||
# strip out trailing comments (in fact, anything following whitespace)
|
||||
if `evaluate "{f}" =~ /([Â ¶t]+)¨1[ ¶t]+([#]*Å)¨2/`
|
||||
set sourceFile "{¨1}"
|
||||
# echo "Discarding comment {¨2}"
|
||||
else
|
||||
set sourceFile "{f}"
|
||||
end if
|
||||
|
||||
# sourceFile can be a relative path, so need to get the file name for date comparisons
|
||||
if `evaluate "{sourceFile}" =~ /Å:([Â:]+)¨1/`
|
||||
set filename "{¨1}"
|
||||
else
|
||||
set filename "{sourceFile}"
|
||||
end if
|
||||
|
||||
# now copy the file if newer
|
||||
if "`Newer "{sourceDir}{sourceFile}" "{targetDir}:{filename}"`" #|| !`Exists "{targetDir}:{filename}"`
|
||||
if {verbose} ; echo "{sourceDir}{sourceFile} is newer than {targetDir}:{filename}" ; end if
|
||||
#{debugEcho} duplicate -y "{sourceDir}{sourceFile}" "{targetDir}"
|
||||
{debugEcho} newalias "{sourceDir}{sourceFile}" "{targetDir}:{filename}"
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
end for
|
||||
4
mozilla/build/mac/CustomLib/CustomLib.c
Normal file
4
mozilla/build/mac/CustomLib/CustomLib.c
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
/* This library only exists to provide a dummy library for the final project */
|
||||
|
||||
/* There is nothing to do here. */
|
||||
BIN
mozilla/build/mac/CustomLib/CustomLib.mcp
Normal file
BIN
mozilla/build/mac/CustomLib/CustomLib.mcp
Normal file
Binary file not shown.
69
mozilla/build/mac/DoCopyHeaders
Normal file
69
mozilla/build/mac/DoCopyHeaders
Normal file
@@ -0,0 +1,69 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
|
||||
# This is the controlling script for a set of scripts that copy public
|
||||
# header files in one or more source trees into a single, "dist" directory.
|
||||
#
|
||||
# It relies on the two accompanying scripts, ÒCopyList.scriptÓ and
|
||||
# ÒCopyExports.scriptÓ, which must be in the same directory.
|
||||
#
|
||||
# To execute this script, select everything from "# Get the..." to
|
||||
# " the end" and hit the Enter key.
|
||||
#
|
||||
# Known bugs:
|
||||
# Spurious output is produced even when verbose is off.
|
||||
#
|
||||
|
||||
# Uncomment this to get some progress information
|
||||
# set -e verbose 1
|
||||
|
||||
# Get the root of everything
|
||||
|
||||
set moz ""
|
||||
loop
|
||||
set mozillaDir `GetFileName -d -m "Please select the ÒmozillaÓ directory"`
|
||||
#set SourceRootDir
|
||||
(Evaluate "{mozillaDir}" =~ /(Å:)¨1([Â:]+)¨2:/) #·· dev:null
|
||||
set moz "{¨2}"
|
||||
break if "{moz}" == "mozilla"
|
||||
Alert "Sorry, this only works if you select the folder called ÒmozillaÓ."
|
||||
end loop
|
||||
|
||||
#Calculate the root directory by stripping off the leaf name.
|
||||
(Evaluate "{mozillaDir}" =~ /(Å:)¨1([Â:]+)¨2/) #·· dev:null
|
||||
Set -e SourceRootDir "{¨1}"
|
||||
Set -e DestRootDir "{mozillaDir}dist:"
|
||||
|
||||
# Ensure the build and stubs folders exist
|
||||
|
||||
if !`exists -d "{mozillaDir}dist"`
|
||||
newfolder "{mozillaDir}dist"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client"`
|
||||
newfolder "{mozillaDir}dist:client"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client_debug"`
|
||||
newfolder "{mozillaDir}dist:client_debug"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client_stubs"`
|
||||
newfolder "{mozillaDir}dist:client_stubs"
|
||||
end if
|
||||
|
||||
"{SourceRootDir}mozilla:build:mac:CopyExports.script" "mozilla:build:mac:MacExportListPublic"
|
||||
|
||||
# the end
|
||||
94
mozilla/build/mac/IDE_Options.h
Normal file
94
mozilla/build/mac/IDE_Options.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
/*
|
||||
|
||||
This file overrides all option settings in the IDE. It is an attempt to allow all builds
|
||||
to have the same options.
|
||||
|
||||
Note: We can't use ConditionalMacros.h in this file because it will conflict with
|
||||
the PowerPlant precompiled headers.
|
||||
|
||||
*/
|
||||
|
||||
/* warning pragmas */
|
||||
#pragma warn_hidevirtual on
|
||||
#pragma warn_emptydecl on
|
||||
#pragma warn_unusedvar on
|
||||
#pragma warn_extracomma on
|
||||
#pragma warn_illpragma on
|
||||
#pragma warn_possunwant on
|
||||
#pragma warn_unusedarg off /* turned off to reduce warnings */
|
||||
|
||||
#pragma check_header_flags on
|
||||
|
||||
/* Language features that must be the same across libraries... */
|
||||
#pragma enumsalwaysint on
|
||||
#pragma unsigned_char off
|
||||
#pragma exceptions on
|
||||
#pragma bool on
|
||||
|
||||
|
||||
/* Save as much space as possible with strings... */
|
||||
#pragma pool_strings on
|
||||
#pragma dont_reuse_strings off
|
||||
|
||||
#pragma options align=native
|
||||
#pragma sym on /* Takes no memory. OK in non-debug. */
|
||||
|
||||
|
||||
|
||||
#ifdef powerc /* ...generating PowerPC */
|
||||
#pragma toc_data on
|
||||
#pragma fp_contract on
|
||||
#pragma readonly_strings on
|
||||
|
||||
#ifdef DEBUG
|
||||
#pragma traceback on
|
||||
#pragma global_optimizer off
|
||||
#pragma scheduling off
|
||||
#pragma peephole off
|
||||
#pragma optimize_for_size off
|
||||
#else
|
||||
#pragma traceback off
|
||||
#pragma global_optimizer on
|
||||
#pragma optimization_level 4
|
||||
#pragma scheduling 604
|
||||
#pragma peephole on
|
||||
#pragma optimize_for_size on
|
||||
#endif
|
||||
|
||||
#else /* ...generating 68k */
|
||||
#pragma code68020 on
|
||||
#pragma code68881 off
|
||||
|
||||
/* Far everything... */
|
||||
#pragma far_code
|
||||
#pragma far_data on
|
||||
#pragma far_strings on
|
||||
#pragma far_vtables on
|
||||
|
||||
#pragma fourbyteints on /* 4-byte ints */
|
||||
#pragma IEEEdoubles on /* 8-byte doubles (as required by Java and NSPR) */
|
||||
|
||||
#ifdef DEBUG
|
||||
#pragma macsbug on
|
||||
#pragma oldstyle_symbols off
|
||||
#else
|
||||
#pragma macsbug off
|
||||
#endif
|
||||
#endif
|
||||
5
mozilla/build/mac/MANIFEST
Normal file
5
mozilla/build/mac/MANIFEST
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
IDE_Options.h
|
||||
198
mozilla/build/mac/MacCVS.pm
Normal file
198
mozilla/build/mac/MacCVS.pm
Normal file
@@ -0,0 +1,198 @@
|
||||
#!perl -w
|
||||
package MacCVS;
|
||||
|
||||
# package Mac::Apps::MacCVS; this should really be the name of the package
|
||||
# but due to our directory hierarchy in mozilla, I am not doing it
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT $MacCVSLib);
|
||||
use Mac::StandardFile;
|
||||
use Moz;
|
||||
use Cwd;
|
||||
use Exporter;
|
||||
use File::Basename;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw( new print checkout);
|
||||
$VERSION = "1.00";
|
||||
|
||||
# Architecture:
|
||||
# cvs session object:
|
||||
# name - session name
|
||||
# session_file - session file
|
||||
#
|
||||
# globals
|
||||
# $MacCVSLib - location of MacCVS applescript library
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
# utility routines
|
||||
#
|
||||
|
||||
# just like Mac::DoAppleScript, 1 is success, 0 is failure
|
||||
sub _myDoAppleScript($)
|
||||
{
|
||||
my($script) = @_;
|
||||
my $asresult = MacPerl::DoAppleScript($script);
|
||||
if ($asresult eq "0")
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR "AppleScript error: $asresult\n";
|
||||
print STDERR "AppleScript was: \n $script \n";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
# _useMacCVSLib
|
||||
# returns 1 on success
|
||||
# Search the include path for the file called MacCVSLib
|
||||
sub _useMacCVSLib()
|
||||
{
|
||||
unless ( defined($MacCVSLib) )
|
||||
{
|
||||
my($libname) = "MacCVSLib";
|
||||
# try the directory we were run from
|
||||
my($c) = dirname($0) . ":" . $libname;
|
||||
if ( -e $c)
|
||||
{
|
||||
$MacCVSLib = $c;
|
||||
}
|
||||
else
|
||||
{
|
||||
# now search the include directories
|
||||
foreach (@INC)
|
||||
{
|
||||
unless ( m/^Dev:Pseudo/ ) # This is some bizarre MacPerl special-case directory
|
||||
{
|
||||
$c = $_ . $libname;
|
||||
if (-e $c)
|
||||
{
|
||||
$MacCVSLib = $c;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! (-e $MacCVSLib))
|
||||
{
|
||||
print STDERR "MacCVS lib could not be found! $MacCVSLib";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Session object methods
|
||||
#
|
||||
|
||||
sub new {
|
||||
my ( $proto, $session_file) = @_;
|
||||
my $class = ref($proto) || $proto;
|
||||
my $self = {};
|
||||
|
||||
if ( defined($session_file) && ( -e $session_file) )
|
||||
{
|
||||
$self->{"name"} = basename( $session_file );
|
||||
$self->{"session_file"} = $session_file;
|
||||
bless $self, $class;
|
||||
return $self;
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR "MacCVS->new cvs file < $session_file > does not exist\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# makes sure that the session is open
|
||||
# assertSessionOpen()
|
||||
# returns 1 on failure
|
||||
sub assertSessionOpen() {
|
||||
my ($self) = shift;
|
||||
_useMacCVSLib() || die "Could not load MacCVSLib\n";
|
||||
my $script = <<END_OF_APPLESCRIPT;
|
||||
tell (load script file "$MacCVSLib") to OpenSession("$self->{session_file}")
|
||||
END_OF_APPLESCRIPT
|
||||
return _myDoAppleScript($script);
|
||||
}
|
||||
|
||||
# prints the cvs object, used mostly for debugging
|
||||
sub print {
|
||||
my($self) = shift;
|
||||
print "MacCVS:: name: ", $self->{name}, " session file: ", $self->{session_file}, "\n";
|
||||
}
|
||||
|
||||
# checkout( self, module, revision, date)
|
||||
# MacCVS checkout command
|
||||
# returns 1 on failure
|
||||
sub checkout {
|
||||
my($self, $module, $revision, $date ) = @_;
|
||||
unless( defined ($module) ) { $module = ""; } # get rid of the pesky undefined warnings
|
||||
unless( defined ($revision) ) { $revision = ""; }
|
||||
unless( defined ($date) ) { $date = ""; }
|
||||
|
||||
$self->assertSessionOpen() || return 1;
|
||||
|
||||
my $script = <<END_OF_APPLESCRIPT;
|
||||
tell (load script file "$MacCVSLib") to Checkout given sessionName:"$self->{name}", module:"$module", revision:"$revision", date:"$date"
|
||||
END_OF_APPLESCRIPT
|
||||
return _myDoAppleScript($script);
|
||||
}
|
||||
|
||||
1;
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
MacCVS - Interface to MacCVS
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use MacCVS;
|
||||
$session = MacCVS->new( <session_file_path>) || die "cannot create session";
|
||||
$session->checkout([module] [revision] [date]) || die "Could not check out";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is a MacCVS interface for talking to MacCVS Pro client.
|
||||
MacCVSSession is the class used to manipulate the session
|
||||
|
||||
=item new
|
||||
MacCVS->new( <cvs session file path>);
|
||||
|
||||
Creates a new session. Returns undef on failure.
|
||||
|
||||
=item checkout( <module> [revision] [date] )
|
||||
|
||||
cvs checkout command. Revision and date are optional
|
||||
returns 0 on failure
|
||||
|
||||
=cut
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
=over
|
||||
|
||||
=item MacCVS Home Page
|
||||
|
||||
http://www.maccvs.org/
|
||||
|
||||
=back
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Aleks Totic atotic@netscape.com
|
||||
|
||||
=cut
|
||||
|
||||
__END__
|
||||
BIN
mozilla/build/mac/MacCVSLib
Normal file
BIN
mozilla/build/mac/MacCVSLib
Normal file
Binary file not shown.
152
mozilla/build/mac/MacExportListPublic
Normal file
152
mozilla/build/mac/MacExportListPublic
Normal file
@@ -0,0 +1,152 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# This is a list of paths to export.mac files, and destination
|
||||
# directories for the copied headers. Destinations are relative
|
||||
# to "mozilla:dist".
|
||||
|
||||
###################
|
||||
# PUBLIC TREE
|
||||
###################
|
||||
|
||||
#INCLUDE
|
||||
mozilla:config:mac:export.mac :config
|
||||
mozilla:include:export.mac :include
|
||||
mozilla:cmd:macfe:pch:export.mac :include
|
||||
|
||||
#MAC_COMMON
|
||||
mozilla:build:mac:export.mac :mac:common
|
||||
mozilla:lib:mac:NSStdLib:include:export.mac :mac:common
|
||||
mozilla:lib:mac:MacMemoryAllocator:include:export.mac :mac:common
|
||||
mozilla:lib:mac:Misc:export.mac :mac:common
|
||||
mozilla:lib:mac:MoreFiles:export.mac :mac:common:morefiles
|
||||
mozilla:cmd:macfe:export.mac :mac:macfe
|
||||
|
||||
#NSPR
|
||||
mozilla:nsprpub:pr:include:export.mac :nspr
|
||||
mozilla:nsprpub:pr:src:md:mac:export.mac :nspr:mac
|
||||
mozilla:nsprpub:lib:ds:export.mac :nspr
|
||||
mozilla:nsprpub:lib:libc:include:export.mac :nspr
|
||||
mozilla:nsprpub:lib:msgc:include:export.mac :nspr
|
||||
|
||||
#DBM
|
||||
mozilla:dbm:include:export.mac :dbm
|
||||
|
||||
#LIBIMAGE
|
||||
mozilla:modules:libimg:png:export.mac :libimg
|
||||
mozilla:modules:libimg:src:export.mac :libimg
|
||||
mozilla:modules:libimg:public:export.mac :libimg
|
||||
|
||||
#SECURITY_freenav
|
||||
mozilla:modules:security:freenav:export.mac :security
|
||||
|
||||
#XPCOM
|
||||
mozilla:xpcom:src:export.mac :xpcom
|
||||
|
||||
#ZLIB
|
||||
mozilla:modules:zlib:src:export.mac :zlib
|
||||
|
||||
#JPEG
|
||||
mozilla:jpeg:export.mac :jpeg
|
||||
|
||||
#JSJ
|
||||
mozilla:js:jsj:export.mac :jsj
|
||||
|
||||
#JSDEBUG
|
||||
mozilla:js:jsd:export.mac :jsdebug
|
||||
|
||||
#JS
|
||||
mozilla:js:src:export.mac :js
|
||||
|
||||
#RDF
|
||||
mozilla:modules:rdf:include:export.mac :rdf
|
||||
|
||||
#XML
|
||||
mozilla:modules:xml:glue:export.mac :xml
|
||||
mozilla:modules:xml:expat:xmlparse:export.mac :xml
|
||||
|
||||
#LIBFONT
|
||||
mozilla:modules:libfont:public:export.mac :libfont
|
||||
mozilla:modules:libfont:src:export.mac :libfont
|
||||
|
||||
#SCHEDULER
|
||||
mozilla:modules:schedulr:public:export.mac :schedulr
|
||||
|
||||
#NETWORK
|
||||
mozilla:network:cache:export.mac :network
|
||||
mozilla:network:client:export.mac :network
|
||||
mozilla:network:cnvts:export.mac :network
|
||||
mozilla:network:cstream:export.mac :network
|
||||
mozilla:network:main:export.mac :network
|
||||
mozilla:network:protocol:about:export.mac :network
|
||||
mozilla:network:protocol:certld:export.mac :network
|
||||
mozilla:network:protocol:dataurl:export.mac :network
|
||||
mozilla:network:protocol:file:export.mac :network
|
||||
mozilla:network:protocol:ftp:export.mac :network
|
||||
mozilla:network:protocol:gopher:export.mac :network
|
||||
mozilla:network:protocol:http:export.mac :network
|
||||
mozilla:network:protocol:js:export.mac :network
|
||||
mozilla:network:protocol:mailbox:export.mac :network
|
||||
mozilla:network:protocol:marimba:export.mac :network
|
||||
mozilla:network:protocol:nntp:export.mac :network
|
||||
mozilla:network:protocol:pop3:export.mac :network
|
||||
mozilla:network:protocol:remote:export.mac :network
|
||||
mozilla:network:protocol:smtp:export.mac :network
|
||||
|
||||
#HTML_DIALOGS
|
||||
mozilla:lib:htmldlgs:export.mac :htmldlgs
|
||||
|
||||
#LAYOUT
|
||||
mozilla:lib:layout:export.mac :layout
|
||||
|
||||
#LAYERS
|
||||
mozilla:lib:liblayer:include:export.mac :layers
|
||||
|
||||
#PARSE
|
||||
mozilla:lib:libparse:export.mac :libparse
|
||||
|
||||
#STYLE
|
||||
mozilla:lib:libstyle:export.mac :libstyle
|
||||
|
||||
#LIBHOOK
|
||||
mozilla:modules:libhook:public:export.mac :libhook
|
||||
|
||||
#LIBPREF
|
||||
mozilla:modules:libpref:public:export.mac :libpref
|
||||
|
||||
#LIBREG
|
||||
mozilla:modules:libreg:include:export.mac :libreg
|
||||
|
||||
#LIBUTIL
|
||||
mozilla:modules:libutil:public:export.mac :libutil
|
||||
|
||||
#OJI
|
||||
mozilla:modules:oji:src:export.mac :oji
|
||||
|
||||
#PROGRESS
|
||||
mozilla:modules:progress:public:export.mac :progress
|
||||
|
||||
#SOFTUPDATE
|
||||
mozilla:modules:softupdt:include:export.mac :softupdate
|
||||
|
||||
#NAV_JAVA
|
||||
mozilla:nav-java:stubs:macjri:export.mac :nav-java:macjri
|
||||
mozilla:nav-java:stubs:include:export.mac :nav-java
|
||||
|
||||
#SUN_JAVA
|
||||
mozilla:sun-java:stubs:include:export.mac :sun-java:include
|
||||
mozilla:sun-java:stubs:macjri:export.mac :sun-java:macjri
|
||||
BIN
mozilla/build/mac/MakeDist.mcp
Normal file
BIN
mozilla/build/mac/MakeDist.mcp
Normal file
Binary file not shown.
368
mozilla/build/mac/Moz.pm
Normal file
368
mozilla/build/mac/Moz.pm
Normal file
@@ -0,0 +1,368 @@
|
||||
=head1 NAME
|
||||
|
||||
B<Moz> - routines for automating CodeWarrior builds, and some extra-curricular activities related to building Mozilla
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use Moz;
|
||||
|
||||
OpenErrorLog(":::BuildLog");
|
||||
StopForErrors();
|
||||
|
||||
$Moz::QUIET = 1;
|
||||
InstallFromManifest(":projects:MANIFEST", $dist_dir);
|
||||
|
||||
BuildProjectClean(":projects:SomeProject.mcp", "SomeTarget");
|
||||
MakeAlias(":projects:SomeProject.shlb", $dist_dir);
|
||||
|
||||
DontStopForErrors();
|
||||
|
||||
BuildProject(":projects:SomeOtherProject.mcp", "SomeTarget");
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<Moz> comprises the routines needed to slap CodeWarrior around, force it to build a sequence of projects, report the results, and a few other things.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
|
||||
|
||||
package Moz;
|
||||
require Exporter;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(BuildProject BuildProjectClean OpenErrorLog MakeAlias StopForErrors DontStopForErrors InstallFromManifest);
|
||||
@EXPORT_OK = qw(CloseErrorLog UseCodeWarriorLib QUIET);
|
||||
|
||||
use Cwd;
|
||||
use File::Path;
|
||||
use ExtUtils::Manifest 'maniread';
|
||||
|
||||
sub current_directory()
|
||||
{
|
||||
my $current_directory = cwd();
|
||||
chop($current_directory) if ( $current_directory =~ m/:$/ );
|
||||
return $current_directory;
|
||||
}
|
||||
|
||||
sub full_path_to($)
|
||||
{
|
||||
my ($path) = @_;
|
||||
if ( $path =~ m/^[^:]+$/ )
|
||||
{
|
||||
$path = ":" . $path;
|
||||
}
|
||||
|
||||
if ( $path =~ m/^:/ )
|
||||
{
|
||||
$path = current_directory() . $path;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
=head2 Setup
|
||||
|
||||
Pretty much, everything is taken care of for you.
|
||||
However, B<Moz> does use a little compiled AppleScript library (the file CodeWarriorLib) for some of its communcication with CodeWarrior.
|
||||
If this library isn't in the same directory as "Moz.pm", then you need to tell B<Moz> where to find it.
|
||||
Call C<UseCodeWarriorLib($path_to_CodeWarriorLib)>.
|
||||
This routine is not exported by default, nor are you likely to need it.
|
||||
|
||||
=cut
|
||||
|
||||
sub UseCodeWarriorLib($)
|
||||
{
|
||||
($CodeWarriorLib) = @_;
|
||||
$CodeWarriorLib = full_path_to($CodeWarriorLib);
|
||||
}
|
||||
|
||||
sub activate_CodeWarrior()
|
||||
{
|
||||
MacPerl::DoAppleScript(<<END_OF_APPLESCRIPT);
|
||||
tell (load script file "$CodeWarriorLib") to ActivateCodeWarrior()
|
||||
END_OF_APPLESCRIPT
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
UseCodeWarriorLib(":CodeWarriorLib");
|
||||
activate_CodeWarrior();
|
||||
}
|
||||
|
||||
$logging = 0;
|
||||
$recent_errors_file = "";
|
||||
$stop_on_1st_error = 1;
|
||||
$QUIET = 0;
|
||||
|
||||
|
||||
|
||||
=head2 Logging all the errors and warnings - C<OpenErrorLog($log_file)>, C<CloseErrorLog()>
|
||||
|
||||
The warnings and errors generated in the course of building projects can be logged to a file.
|
||||
Tinderbox uses this facility to show why a remote build failed.
|
||||
|
||||
Logging is off by default.
|
||||
Start logging at any point in your build process with C<OpenErrorLog($log_file)>.
|
||||
Stop with C<CloseErrorLog()>.
|
||||
You never need to close the log explicitly, unless you want to just log a couple of projects in the middle of a big list.
|
||||
C<CloseErrorLog()> is not exported by default.
|
||||
|
||||
=cut
|
||||
|
||||
sub CloseErrorLog()
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
close(ERROR_LOG);
|
||||
$logging = 0;
|
||||
StopForErrors() if $stop_on_1st_error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub OpenErrorLog($)
|
||||
{
|
||||
my ($log_file) = @_;
|
||||
|
||||
CloseErrorLog();
|
||||
if ( $log_file )
|
||||
{
|
||||
$log_file = full_path_to($log_file);
|
||||
|
||||
open(ERROR_LOG, ">$log_file");
|
||||
|
||||
$log_file =~ m/.+:(.+)/;
|
||||
$recent_errors_file = full_path_to("$1.part");
|
||||
$logging = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=head2 Stopping before it's too late - C<StopForErrors()>, C<DontStopForErrors()>
|
||||
|
||||
When building a long list of projects, you decide whether to continue building subsequent projects when one fails.
|
||||
By default, your build script will C<die> after the first project that generates an error while building.
|
||||
Change this behavior with C<DontStopForErrors()>.
|
||||
Re-enable it with C<StopForErrors()>.
|
||||
|
||||
=cut
|
||||
|
||||
sub StopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 1;
|
||||
|
||||
# Can't stop for errors unless we notice them.
|
||||
# Can't notice them unless we are logging.
|
||||
# If the user didn't explicitly request logging, log to a temporary file.
|
||||
|
||||
if ( ! $recent_errors_file )
|
||||
{
|
||||
OpenErrorLog("${TMPDIR}BuildResults");
|
||||
}
|
||||
}
|
||||
|
||||
sub DontStopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 0;
|
||||
}
|
||||
|
||||
sub log_message($)
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
my ($message) = @_;
|
||||
print ERROR_LOG $message;
|
||||
}
|
||||
}
|
||||
|
||||
sub log_message_with_time($)
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
my ($message) = @_;
|
||||
my $time_stamp = localtime();
|
||||
log_message("$message ($time_stamp)\n");
|
||||
}
|
||||
}
|
||||
|
||||
sub log_recent_errors($)
|
||||
{
|
||||
my ($project_name) = @_;
|
||||
my $found_errors = 0;
|
||||
|
||||
if ( $logging )
|
||||
{
|
||||
open(RECENT_ERRORS, "<$recent_errors_file");
|
||||
|
||||
while( <RECENT_ERRORS> )
|
||||
{
|
||||
if ( /^Error/ || /^CouldnÕt find project file/ )
|
||||
{
|
||||
$found_errors = 1;
|
||||
}
|
||||
print ERROR_LOG $_;
|
||||
}
|
||||
|
||||
close(RECENT_ERRORS);
|
||||
unlink("$recent_errors_file");
|
||||
}
|
||||
|
||||
if ( $stop_on_1st_error && $found_errors )
|
||||
{
|
||||
print ERROR_LOG "### Build failed.\n";
|
||||
die "### Errors encountered building \"$project_name\".\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub build_project($$$)
|
||||
{
|
||||
my ($project_path, $target_name, $clean_build) = @_;
|
||||
$project_path = full_path_to($project_path);
|
||||
|
||||
$project_path =~ m/.+:(.+)/;
|
||||
my $project_name = $1;
|
||||
|
||||
log_message_with_time("### Building \"$project_path\"");
|
||||
|
||||
# Check that the given project exists
|
||||
if (! -e $project_path)
|
||||
{
|
||||
print ERROR_LOG "### Build failed.\n";
|
||||
die "### Can't find project file \"$project_path\".\n";
|
||||
}
|
||||
|
||||
print "Building \"$project_path\"\n";
|
||||
|
||||
$had_errors =
|
||||
MacPerl::DoAppleScript(<<END_OF_APPLESCRIPT);
|
||||
tell (load script file "$CodeWarriorLib") to BuildProject("$project_path", "$project_name", "$target_name", "$recent_errors_file", $clean_build)
|
||||
END_OF_APPLESCRIPT
|
||||
|
||||
# Append any errors to the globally accumulated log file
|
||||
if ( $had_errors )
|
||||
{
|
||||
log_recent_errors($project_path);
|
||||
}
|
||||
}
|
||||
|
||||
=head2 Getting CodeWarrior to build projects - C<BuildProject($project, $opt_target)>, C<BuildProjectClean($project, $opt_target)>
|
||||
|
||||
C<BuildProject()> and C<BuildProjectClean()> are identical, except that the latter first removes object code.
|
||||
In both, CodeWarrior opens the project if it wasn't already open; builds the given (or else current) target; and finally closes
|
||||
the project, if it wasn't already open.
|
||||
|
||||
=cut
|
||||
|
||||
sub BuildProject($;$)
|
||||
{
|
||||
my ($project_path, $target_name) = @_;
|
||||
build_project($project_path, $target_name, "false");
|
||||
}
|
||||
|
||||
sub BuildProjectClean($;$)
|
||||
{
|
||||
my ($project_path, $target_name) = @_;
|
||||
build_project($project_path, $target_name, "true");
|
||||
}
|
||||
|
||||
|
||||
=head2 Miscellaneous
|
||||
|
||||
C<MakeAlias($old_file, $new_file)> functions like C<symlink()>, except with better argument defaulting and more explicit error messages.
|
||||
|
||||
=cut
|
||||
|
||||
sub MakeAlias($$)
|
||||
{
|
||||
my ($old_file, $new_file) = @_;
|
||||
|
||||
# if the directory to hold $new_file doesn't exist, create it
|
||||
if ( ($new_file =~ m/(.+:)/) && !-d $1 )
|
||||
{
|
||||
mkpath($1);
|
||||
}
|
||||
|
||||
# if a leaf name wasn't specified for $new_file, use the leaf from $old_file
|
||||
if ( ($new_file =~ m/:$/) && ($old_file =~ m/.+:(.+)/) )
|
||||
{
|
||||
$new_file .= $1;
|
||||
}
|
||||
|
||||
my $message = "Can't create a Finder alias (at \"$new_file\")\n for \"$old_file\";";
|
||||
# die "$message symlink doesn't work on directories.\n" if -d $old_file;
|
||||
die "$message because \"$old_file\" doesn't exist.\n" unless -e $old_file;
|
||||
|
||||
unlink $new_file;
|
||||
# print "symlink(\"$old_file\", \"$new_file\");\n";
|
||||
symlink($old_file, $new_file) || die "$message symlink returned an unexpected error.\n";
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
C<InstallFromManifest()>
|
||||
|
||||
=cut
|
||||
|
||||
sub InstallFromManifest($;$)
|
||||
{
|
||||
my ($manifest_file, $dest_dir) = @_;
|
||||
|
||||
$dest_dir ||= ":";
|
||||
|
||||
$manifest_file =~ m/(.+):/;
|
||||
my $source_dir = $1;
|
||||
|
||||
chop($dest_dir) if $dest_dir =~ m/:$/;
|
||||
|
||||
print "Doing manifest on \"$manifest_file\"\n" unless $QUIET;
|
||||
|
||||
my $read = maniread(full_path_to($manifest_file));
|
||||
foreach $file (keys %$read)
|
||||
{
|
||||
next unless $file;
|
||||
|
||||
$subdir = ":";
|
||||
if ( $file =~ /:.+:/ )
|
||||
{
|
||||
$subdir = $&;
|
||||
}
|
||||
|
||||
$file = ":$file" unless $file =~ m/^:/;
|
||||
MakeAlias("$source_dir$file", "$dest_dir$subdir");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Scott Collins <scc@netscape.com>, Simon Fraser <sfraser@netscape.com>
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
BuildMozillaDebug.pl (et al), BuildList.pm, CodeWarriorLib (an AppleScript library)
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
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.
|
||||
|
||||
=cut
|
||||
341
mozilla/build/mac/NGLayoutBuildList.pm
Normal file
341
mozilla/build/mac/NGLayoutBuildList.pm
Normal file
@@ -0,0 +1,341 @@
|
||||
#!perl -w
|
||||
package NGLayoutBuildList;
|
||||
|
||||
require 5.004;
|
||||
require Exporter;
|
||||
|
||||
use strict;
|
||||
use vars qw( @ISA @EXPORT );
|
||||
|
||||
# perl includes
|
||||
use Mac::StandardFile;
|
||||
use Cwd;
|
||||
use File::Path;
|
||||
|
||||
# homegrown
|
||||
use Moz;
|
||||
use MacCVS;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw( Checkout BuildDist BuildProjects);
|
||||
|
||||
# NGLayoutBuildList builds the nglayout project
|
||||
# it is configured by setting the following variables in the caller:
|
||||
# Usage:
|
||||
# caller variables that affect behaviour:
|
||||
# DEBUG : 1 if we are building a debug version
|
||||
# 3-part build process: checkout, dist, and build_projects
|
||||
# Hack alert:
|
||||
# NGLayout defines are located in :mozilla:config:mac:NGLayoutConfigInclude.h
|
||||
# An alias "MacConfigInclude.h" to this file is created inside dist:config
|
||||
# Note that the name of alias is different than the name of the file. This
|
||||
# is to trick CW into including NGLayout defines
|
||||
|
||||
#
|
||||
# Utility routines
|
||||
#
|
||||
|
||||
# pickWithMemoryFile stores the information about the user pick inside
|
||||
# the file $session_storage
|
||||
sub _pickWithMemoryFile($)
|
||||
{
|
||||
my ($sessionStorage) = @_;
|
||||
my $cvsfile;
|
||||
|
||||
if (( -e $sessionStorage) &&
|
||||
open( SESSIONFILE, $sessionStorage ))
|
||||
{
|
||||
# Read in the path if available
|
||||
$cvsfile = <SESSIONFILE>;
|
||||
chomp $cvsfile;
|
||||
close SESSIONFILE;
|
||||
if ( ! -e $cvsfile )
|
||||
{
|
||||
print STDERR "$cvsfile has disappeared\n";
|
||||
undef $cvsfile;
|
||||
}
|
||||
}
|
||||
unless (defined ($cvsfile))
|
||||
{
|
||||
# prompt user for the file name, and store it
|
||||
print "Choose a CVS session file in file dialog box:\n"; # no way to display a prompt?
|
||||
my $macFile = StandardGetFile( 0, "McvD");
|
||||
if ( $macFile->sfGood() )
|
||||
{
|
||||
$cvsfile = $macFile->sfFile();
|
||||
# save the choice if we can
|
||||
if ( open (SESSIONFILE, ">" . $sessionStorage))
|
||||
{
|
||||
printf SESSIONFILE $cvsfile, "\n";
|
||||
close SESSIONFILE;
|
||||
}
|
||||
else
|
||||
{
|
||||
print STDERR "Could not open storage file\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return $cvsfile;
|
||||
}
|
||||
|
||||
# assert that we are in the correct directory for the build
|
||||
sub _assertRightDirectory()
|
||||
{
|
||||
unless (-e ":mozilla")
|
||||
{
|
||||
my($dir) = cwd();
|
||||
print STDERR "NGLayoutBuildList called from incorrect directory: $dir";
|
||||
}
|
||||
}
|
||||
|
||||
sub _getDistDirectory()
|
||||
{
|
||||
return $main::DEBUG ? ":mozilla:dist:client_debug:" : ":mozilla:dist:client:";
|
||||
}
|
||||
|
||||
#
|
||||
# MAIN ROUTINES
|
||||
#
|
||||
sub Checkout()
|
||||
{
|
||||
_assertRightDirectory();
|
||||
my($cvsfile) = _pickWithMemoryFile("::nglayout.cvsloc");
|
||||
my($session) = MacCVS->new( $cvsfile );
|
||||
unless (defined($session)) { die "Checkout aborted. Cannot create session file: $session" }
|
||||
|
||||
if ($main::pull{lizard})
|
||||
{
|
||||
$session->checkout("mozilla/LICENSE") || die "checkout failure";
|
||||
$session->checkout("mozilla/LEGAL") || die "checkout failure";
|
||||
$session->checkout("mozilla/config") || die "checkout failure";
|
||||
$session->checkout("mozilla/lib/liblayer") || die "checkout failure";
|
||||
$session->checkout("mozilla/modules/zlib") || die "checkout failure";
|
||||
$session->checkout("mozilla/modules/libutil") || die "checkout failure";
|
||||
$session->checkout("mozilla/nsprpub") || die "checkout failure";
|
||||
$session->checkout("mozilla/sun-java") || die "checkout failure";
|
||||
$session->checkout("mozilla/nav-java") || die "checkout failure";
|
||||
$session->checkout("mozilla/js") || die "checkout failure";
|
||||
$session->checkout("mozilla/modules/security/freenav") || die "checkout failure";
|
||||
$session->checkout("mozilla/modules/libpref") || die "checkout failure";
|
||||
}
|
||||
if ($main::pull{xpcom})
|
||||
{
|
||||
$session->checkout("mozilla/modules/libreg ") || die "checkout failure";
|
||||
$session->checkout("mozilla/xpcom") || die "checkout failure";
|
||||
}
|
||||
if ($main::pull{imglib})
|
||||
{
|
||||
my($IMGLIB_BRANCH) = "MODULAR_IMGLIB_BRANCH";
|
||||
|
||||
$session->checkout("mozilla/jpeg ", $IMGLIB_BRANCH) || die "checkout failure";
|
||||
$session->checkout("mozilla/modules/libutil", $IMGLIB_BRANCH) || die "checkout failure";
|
||||
$session->checkout("mozilla/modules/libimg", $IMGLIB_BRANCH) || die "checkout failure";
|
||||
}
|
||||
if ($main::pull{netlib})
|
||||
{
|
||||
$session->checkout("mozilla/lib/xp ") || die "checkout failure";
|
||||
$session->checkout("mozilla/network") || die "checkout failure";
|
||||
$session->checkout("mozilla/include") || die "checkout failure";
|
||||
}
|
||||
if ($main::pull{nglayout})
|
||||
{
|
||||
$session->checkout("mozilla/base ") || die "checkout failure";
|
||||
$session->checkout("mozilla/dom") || die "checkout failure";
|
||||
$session->checkout("mozilla/gfx") || die "checkout failure";
|
||||
$session->checkout("mozilla/htmlparser") || die "checkout failure";
|
||||
$session->checkout("mozilla/layout") || die "checkout failure";
|
||||
$session->checkout("mozilla/view") || die "checkout failure";
|
||||
$session->checkout("mozilla/webshell") || die "checkout failure";
|
||||
$session->checkout("mozilla/widget") || die "checkout failure";
|
||||
}
|
||||
if ($main::pull{mac})
|
||||
{
|
||||
$session->checkout("mozilla/build/mac ") || die "checkout failure";
|
||||
$session->checkout("mozilla/cmd/macfe") || die "checkout failure";
|
||||
$session->checkout("mozilla/lib/mac/MacMemoryAllocator") || die "checkout failure";
|
||||
$session->checkout("mozilla/lib/mac/NSStdLib") || die "checkout failure";
|
||||
$session->checkout("mozilla/lib/mac/MoreFiles") || die "checkout failure";
|
||||
$session->checkout("mozilla/lib/mac/NSRuntime") || die "checkout failure";
|
||||
}
|
||||
}
|
||||
|
||||
# builds the dist directory
|
||||
sub BuildDist()
|
||||
{
|
||||
unless ( $main::build{dist} ) { return;}
|
||||
_assertRightDirectory();
|
||||
|
||||
# we really do not need all these paths, but many client projects include them
|
||||
mkpath([ ":mozilla:dist:", ":mozilla:dist:client:", ":mozilla:dist:client_debug:", ":mozilla:dist:client_stubs:" ]);
|
||||
|
||||
my($distdirectory) = ":mozilla:dist";
|
||||
|
||||
my($distlist) = [
|
||||
#MAC_COMMON
|
||||
[":mozilla:build:mac:MANIFEST", "$distdirectory:mac:common:"],
|
||||
[":mozilla:lib:mac:NSStdLib:include:MANIFEST", "$distdirectory:mac:common:"],
|
||||
[":mozilla:lib:mac:MacMemoryAllocator:include:MANIFEST", "$distdirectory:mac:common:"],
|
||||
[":mozilla:lib:mac:Misc:MANIFEST", "$distdirectory:mac:common:"],
|
||||
[":mozilla:lib:mac:MoreFiles:MANIFEST", "$distdirectory:mac:common:morefiles:"],
|
||||
#INCLUDE
|
||||
[":mozilla:config:mac:MANIFEST", "$distdirectory:config:"],
|
||||
[":mozilla:include:MANIFEST", "$distdirectory:include:"],
|
||||
[":mozilla:cmd:macfe:pch:MANIFEST", "$distdirectory:include:"],
|
||||
#NSPR
|
||||
[":mozilla:nsprpub:pr:include:MANIFEST", "$distdirectory:nspr:"],
|
||||
[":mozilla:nsprpub:pr:src:md:mac:MANIFEST", "$distdirectory:nspr:mac:"],
|
||||
[":mozilla:nsprpub:lib:ds:MANIFEST", "$distdirectory:nspr:"],
|
||||
[":mozilla:nsprpub:lib:libc:include:MANIFEST", "$distdirectory:nspr:"],
|
||||
[":mozilla:nsprpub:lib:msgc:include:MANIFEST", "$distdirectory:nspr:"],
|
||||
#JPEG
|
||||
[":mozilla:jpeg:MANIFEST", "$distdirectory:jpeg:"],
|
||||
#LIBREG
|
||||
[":mozilla:modules:libreg:include:MANIFEST", "$distdirectory:libreg:"],
|
||||
#XPCOM
|
||||
[":mozilla:xpcom:src:MANIFEST", "$distdirectory:xpcom:"],
|
||||
#ZLIB
|
||||
[":mozilla:modules:zlib:src:MANIFEST", "$distdirectory:zlib:"],
|
||||
#LIBUTIL
|
||||
[":mozilla:modules:libutil:public:MANIFEST", "$distdirectory:libutil:"],
|
||||
#SUN_JAVA
|
||||
[":mozilla:sun-java:stubs:include:MANIFEST", "$distdirectory:sun-java:"],
|
||||
[":mozilla:sun-java:stubs:macjri:MANIFEST", "$distdirectory:sun-java:"],
|
||||
#NAV_JAVA
|
||||
[":mozilla:nav-java:stubs:include:MANIFEST", "$distdirectory:nav-java:"],
|
||||
[":mozilla:nav-java:stubs:macjri:MANIFEST", "$distdirectory:nav-java:"],
|
||||
#JS
|
||||
[":mozilla:js:src:MANIFEST", "$distdirectory:js:"],
|
||||
#SECURITY_freenav
|
||||
[":mozilla:modules:security:freenav:MANIFEST", "$distdirectory:security:"],
|
||||
#LIBPREF
|
||||
[":mozilla:modules:libpref:public:MANIFEST", "$distdirectory:libpref:"],
|
||||
#LIBIMAGE
|
||||
[":mozilla:modules:libimg:png:MANIFEST", "$distdirectory:libimg:"],
|
||||
[":mozilla:modules:libimg:src:MANIFEST", "$distdirectory:libimg:"],
|
||||
[":mozilla:modules:libimg:public:MANIFEST", "$distdirectory:libimg:"],
|
||||
#NETWORK
|
||||
[":mozilla:network:cache:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:client:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:cnvts:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:cstream:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:main:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:mimetype:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:util:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:about:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:certld:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:dataurl:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:file:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:ftp:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:gopher:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:http:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:js:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:mailbox:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:marimba:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:nntp:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:pop3:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:remote:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:protocol:smtp:MANIFEST", "$distdirectory:network:"],
|
||||
[":mozilla:network:module:MANIFEST","$distdirectory:network:module"],
|
||||
#BASE
|
||||
[":mozilla:base:src:MANIFEST", "$distdirectory:base:"],
|
||||
[":mozilla:base:public:MANIFEST", "$distdirectory:base:"],
|
||||
#WEBSHELL
|
||||
[":mozilla:webshell:public:MANIFEST", "$distdirectory:webshell:"],
|
||||
#LAYOUT
|
||||
[":mozilla:layout:base:public:MANIFEST", "$distdirectory:layout:"],
|
||||
[":mozilla:layout:html:style:public:MANIFEST", "$distdirectory:layout:"],
|
||||
[":mozilla:layout:html:document:public:MANIFEST", "$distdirectory:layout:"],
|
||||
#WIDGET
|
||||
[":mozilla:widget:public:MANIFEST", "$distdirectory:widget:"],
|
||||
#GFX
|
||||
[":mozilla:gfx:src:MANIFEST", "$distdirectory:gfx:"],
|
||||
#VIEW
|
||||
[":mozilla:view:public:MANIFEST", "$distdirectory:view:"],
|
||||
#DOM
|
||||
[":mozilla:dom:public:MANIFEST", "$distdirectory:dom:"],
|
||||
[":mozilla:dom:public:coreDom:MANIFEST", "$distdirectory:dom:"],
|
||||
[":mozilla:dom:public:coreEvents:MANIFEST", "$distdirectory:dom:"],
|
||||
[":mozilla:dom:public:events:MANIFEST", "$distdirectory:dom:"],
|
||||
#HTMLPARSER
|
||||
[":mozilla:htmlparser:src:MANIFEST", "$distdirectory:htmlparser:"],
|
||||
|
||||
];
|
||||
foreach $a (@$distlist)
|
||||
{
|
||||
InstallFromManifest( $a->[0], $a->[1]);
|
||||
}
|
||||
|
||||
# To get out defines in all the project, dummy alias NGLayoutConfigInclude.h into MacConfigInclude.h
|
||||
MakeAlias(":mozilla:config:mac:NGLayoutConfigInclude.h", ":mozilla:dist:config:MacConfigInclude.h");
|
||||
}
|
||||
|
||||
# builds all projects
|
||||
# different targets controlled by $main::build
|
||||
sub BuildCommonProjects()
|
||||
{
|
||||
unless( $main::build{projects} ) { return; }
|
||||
_assertRightDirectory();
|
||||
|
||||
# $D becomes a suffix to target names for selecting either the debug or non-debug target of a project
|
||||
my($D) = $main::DEBUG ? "Debug" : "";
|
||||
my($dist_dir) = _getDistDirectory();
|
||||
|
||||
Moz::BuildProjectClean(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "Stubs");
|
||||
Moz::BuildProjectClean(":mozilla:lib:mac:NSRuntime:NSRuntime.mcp", "Stubs");
|
||||
Moz::BuildProjectClean(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "Stubs");
|
||||
|
||||
Moz::BuildProject(":mozilla:lib:mac:NSRuntime:NSRuntime.mcp");
|
||||
MakeAlias(":mozilla:lib:mac:NSRuntime:NSRuntime$D.shlb", "$dist_dir");
|
||||
|
||||
Moz::BuildProject(":mozilla:lib:mac:MoreFiles:build:MoreFilesPPC.mcp");
|
||||
MakeAlias(":mozilla:lib:mac:MoreFiles:build:MoreFiles$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:nsprpub:macbuild:NSPR20PPC.mcp", "NSPR20$D.shlb");
|
||||
MakeAlias(":mozilla:nsprpub:macbuild:NSPR20$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "MemAllocator$D.shlb");
|
||||
MakeAlias(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "NSStdLib$D.shlb");
|
||||
MakeAlias(":mozilla:lib:mac:NSStdLib:NSStdLib$D.shlb", "$dist_dir");
|
||||
|
||||
# BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "Security.o");
|
||||
|
||||
BuildProject(":mozilla:xpcom:macbuild:xpcomPPC.mcp", "xpcom$D.shlb");
|
||||
MakeAlias(":mozilla:xpcom:macbuild:xpcom$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:jpeg:macbuild:JPEG.mcp", "JPEG$D.shlb");
|
||||
MakeAlias(":mozilla:jpeg:macbuild:JPEG$D.shlb", "$dist_dir");
|
||||
|
||||
BuildProject(":mozilla:modules:libimg:macbuild:png.mcp", "png$D.o");
|
||||
|
||||
BuildProject(":mozilla:modules:libimg:macbuild:libimg.mcp", "libimg$D.o");
|
||||
|
||||
}
|
||||
|
||||
sub BuildLayoutProjects()
|
||||
{
|
||||
unless( $main::build{projects} ) { return; }
|
||||
_assertRightDirectory();
|
||||
|
||||
# $D becomes a suffix to target names for selecting either the debug or non-debug target of a project
|
||||
my($D) = $main::DEBUG ? "Debug" : "";
|
||||
my($dist_dir) = _getDistDirectory();
|
||||
|
||||
BuildProject(":mozilla:htmlparser:macbuild:htmlparser.mcp", "htmlparser$D.o");
|
||||
|
||||
BuildProject(":mozilla:dom:macbuild:dom.mcp", "dom$D.o");
|
||||
|
||||
BuildProject(":mozilla:gfx:macbuild:gfx.mcp", "gfx$D.o");
|
||||
|
||||
BuildProject(":mozilla:layout:macbuild:layout.mcp", "layout$D.o");
|
||||
|
||||
BuildProject(":mozilla:webshell:macbuild:webshell.mcp", "webshell$D.o");
|
||||
|
||||
}
|
||||
|
||||
sub BuildProjects()
|
||||
{
|
||||
BuildCommonProjects();
|
||||
BuildLayoutProjects();
|
||||
}
|
||||
43
mozilla/build/mac/NSCrossProductDefines.h
Normal file
43
mozilla/build/mac/NSCrossProductDefines.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
|
||||
#error "DonÕt use me!"
|
||||
|
||||
#define OLDROUTINELOCATIONS 0
|
||||
#define XP_MAC 1
|
||||
#ifndef NSPR20
|
||||
#define NSPR20 1
|
||||
#endif
|
||||
#define _NSPR 1
|
||||
#define _NO_FAST_STRING_INLINES_ 1
|
||||
#define HAVE_BOOLEAN 1
|
||||
#define NETSCAPE 1
|
||||
#define OTUNIXERRORS 1 /* We want OpenTransport error codes */
|
||||
|
||||
#define OJI 1
|
||||
#define MOCHA 1
|
||||
|
||||
/*
|
||||
This compiles in heap dumping utilities and other good stuff
|
||||
for developers -- maybe we only want it in for a special SDK
|
||||
nspr/java runtime(?):
|
||||
*/
|
||||
#define DEVELOPER_DEBUG 1
|
||||
|
||||
#define MAX(_a,_b) ((_a) < (_b) ? (_b) : (_a))
|
||||
#define MIN(_a,_b) ((_a) < (_b) ? (_a) : (_b))
|
||||
BIN
mozilla/build/mac/RunTSScript
Normal file
BIN
mozilla/build/mac/RunTSScript
Normal file
Binary file not shown.
36
mozilla/build/mac/TinderboxMozilla.pl
Normal file
36
mozilla/build/mac/TinderboxMozilla.pl
Normal file
@@ -0,0 +1,36 @@
|
||||
#!perl
|
||||
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
use Moz;
|
||||
use BuildList;
|
||||
|
||||
$DEBUG = 1;
|
||||
$MOZ_LITE = 0; # build moz medium. This will come from a config file at some stage.
|
||||
$MOZ_LDAP = 1;
|
||||
|
||||
Moz::OpenErrorLog("::::Mozilla.BuildLog");
|
||||
#Moz::StopForErrors();
|
||||
|
||||
chdir("::::");
|
||||
|
||||
# Make and popuplate the dist directory
|
||||
DistMozilla();
|
||||
|
||||
# Now build the projects
|
||||
BuildMozilla();
|
||||
5
mozilla/build/mac/export.mac
Normal file
5
mozilla/build/mac/export.mac
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
IDE_Options.h
|
||||
26
mozilla/build/mac/makedist.xps
Normal file
26
mozilla/build/mac/makedist.xps
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
The only job of this file is for make dependencies:
|
||||
include files here that you want to cause MakeDist
|
||||
to happen again when they change.
|
||||
*/
|
||||
|
||||
|
||||
#include "MacExportListPublic"
|
||||
76
mozilla/build/mac/makedist.xps_Make
Normal file
76
mozilla/build/mac/makedist.xps_Make
Normal file
@@ -0,0 +1,76 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# This is the controlling script for a set of scripts that copy public
|
||||
# header files in one or more source trees into a single, "dist" directory.
|
||||
#
|
||||
# It relies on the two accompanying scripts, ÒCopyList.scriptÓ and
|
||||
# ÒCopyExports.scriptÓ, which must be in the same directory.
|
||||
#
|
||||
#
|
||||
# Known bugs:
|
||||
# Header files are always copied if the export.mac file contains
|
||||
# non-local paths.
|
||||
# Spurious output is produced even when verbose is off.
|
||||
#
|
||||
|
||||
set echo 0
|
||||
|
||||
Evaluate % = ("{{SourceFile}}" =~ /(Å:)¨0Å/)
|
||||
Directory "{{¨0}}"
|
||||
|
||||
set mozillaDir "{¨0}"
|
||||
if `evaluate "{mozillaDir}" =~ /(Å:)¨1[Â:]+:[Â:]+:/`
|
||||
set -e mozillaDir "{¨1}"
|
||||
else
|
||||
echo "Failed to find mozilla directory. Exitting"
|
||||
exit 1;
|
||||
end if
|
||||
|
||||
# Sanity check for mozilla
|
||||
|
||||
if !`exists -d "{mozillaDir}"`
|
||||
echo "Failed to find mozilla directory. Exitting"
|
||||
exit 1;
|
||||
end if
|
||||
|
||||
# Calculate the root directory by stripping off the leaf name.
|
||||
|
||||
(Evaluate "{mozillaDir}" =~ /(Å:)¨1([Â:]+)¨2:/)
|
||||
Set -e SourceRootDir "{¨1}"
|
||||
Set -e DestRootDir "{mozillaDir}dist:"
|
||||
|
||||
# Ensure the build and stubs folders exist
|
||||
|
||||
if !`exists -d "{mozillaDir}dist"`
|
||||
newfolder "{mozillaDir}dist"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client"`
|
||||
newfolder "{mozillaDir}dist:client"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client_debug"`
|
||||
newfolder "{mozillaDir}dist:client_debug"
|
||||
end if
|
||||
if !`exists -d "{mozillaDir}dist:client_stubs"`
|
||||
newfolder "{mozillaDir}dist:client_stubs"
|
||||
end if
|
||||
|
||||
# Now do the grunt work of copying headers. This can take some time
|
||||
|
||||
"{SourceRootDir}mozilla:build:mac:CopyExports.script" "mozilla:build:mac:MacExportListPublic"
|
||||
|
||||
|
||||
21
mozilla/caps/Makefile
Normal file
21
mozilla/caps/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
#!gmake
|
||||
# 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 = include src
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
15
mozilla/caps/include/MANIFEST
Normal file
15
mozilla/caps/include/MANIFEST
Normal file
@@ -0,0 +1,15 @@
|
||||
nsZig.h
|
||||
nsPrincipal.h
|
||||
nsPrivilege.h
|
||||
nsPrivilegeManager.h
|
||||
nsPrivilegeTable.h
|
||||
nsSystemPrivilegeTable.h
|
||||
nsTarget.h
|
||||
nsUserTarget.h
|
||||
jpermission.h
|
||||
nsUserDialogHelper.h
|
||||
nsZip.h
|
||||
nsLoadZig.h
|
||||
admin.h
|
||||
nsCaps.h
|
||||
nsCapsEnums.h
|
||||
24
mozilla/caps/include/Makefile
Executable file
24
mozilla/caps/include/Makefile
Executable file
@@ -0,0 +1,24 @@
|
||||
#!gmake
|
||||
# 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.
|
||||
|
||||
MODULE = caps
|
||||
|
||||
DEPTH = ../..
|
||||
|
||||
EXPORTS = nsZip.h nsZig.h nsLoadZig.h nsPrincipal.h nsPrivilege.h nsPrivilegeManager.h nsPrivilegeTable.h nsSystemPrivilegeTable.h nsTarget.h nsUserTarget.h jpermission.h nsUserDialogHelper.h admin.h nsCaps.h nsCapsEnums.h
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
42
mozilla/caps/include/admin.h
Normal file
42
mozilla/caps/include/admin.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* -*- 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 _ADMIN_H_
|
||||
#define _ADMIN_H_
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
PR_PUBLIC_API(const char *)
|
||||
java_netscape_security_getPrincipals(const char *charSetName);
|
||||
|
||||
PR_PUBLIC_API(PRBool)
|
||||
java_netscape_security_removePrincipal(const char *charSetName, char *prinName);
|
||||
|
||||
|
||||
PR_PUBLIC_API(void)
|
||||
java_netscape_security_getPrivilegeDescs(const char *charSetName, char *prinName,
|
||||
char** forever, char** session,
|
||||
char **denied);
|
||||
|
||||
PR_PUBLIC_API(PRBool)
|
||||
java_netscape_security_removePrivilege(const char *charSetName, char *prinName,
|
||||
char *targetName);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* _ADMIN_H_ */
|
||||
42
mozilla/caps/include/jpermission.h
Normal file
42
mozilla/caps/include/jpermission.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* -*- 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 _JPERMISSION_H_
|
||||
#define _JPERMISSION_H_
|
||||
|
||||
typedef enum nsPermState {
|
||||
nsPermState_NotSet,
|
||||
nsPermState_AllowedForever,
|
||||
nsPermState_AllowedSession,
|
||||
nsPermState_ForbiddenForever,
|
||||
nsPermState_BlankSession
|
||||
} nsPermState;
|
||||
|
||||
PR_PUBLIC_API(void)
|
||||
java_netscape_security_savePrivilege(nsPermState permState);
|
||||
|
||||
PR_PUBLIC_API(nsPermState)
|
||||
nsJSJavaDisplayDialog(char *prinStr, char *targetStr, char *rsikStr, PRBool isCert);
|
||||
|
||||
PR_PUBLIC_API(void)
|
||||
java_netscape_security_getTargetDetails(const char *charSetName,
|
||||
char* targetName,
|
||||
char** details,
|
||||
char **risk);
|
||||
|
||||
#endif /* _JPERMISSION_H_ */
|
||||
34
mozilla/caps/include/makefile.win
Executable file
34
mozilla/caps/include/makefile.win
Executable file
@@ -0,0 +1,34 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to install CAPS/INCLUDE header files into the distribution
|
||||
#// directory.
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
MODULE=caps
|
||||
DEPTH=..\..
|
||||
EXPORTS=nsZip.h nsZig.h nsLoadZig.h nsPrincipal.h nsPrivilege.h nsPrivilegeManager.h nsPrivilegeTable.h nsSystemPrivilegeTable.h nsTarget.h nsUserTarget.h jpermission.h nsUserDialogHelper.h admin.h nsCaps.h nsCapsEnums.h
|
||||
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
148
mozilla/caps/include/nsCaps.h
Normal file
148
mozilla/caps/include/nsCaps.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/* -*- 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 _NS_CAPS_H_
|
||||
#define _NS_CAPS_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsCapsEnums.h"
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
struct nsPrincipal;
|
||||
struct nsTarget;
|
||||
struct nsPrivilegeManager;
|
||||
struct nsPrivilege;
|
||||
struct nsPrivilegeTable;
|
||||
struct NSJSJavaFrameWrapper;
|
||||
|
||||
/* wrappers for nsPrivilegeManager object */
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsRegisterPrincipal(struct nsPrincipal *principal);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsEnablePrivilege(struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsIsPrivilegeEnabled(struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsRevertPrivilege(struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsDisablePrivilege(struct nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(void*)
|
||||
nsCapsGetClassPrincipalsFromStack(PRInt32 callerDepth);
|
||||
|
||||
PR_EXTERN(nsSetComparisonType)
|
||||
nsCapsComparePrincipalArray(void* prin1Array, void* prin2Array);
|
||||
|
||||
PR_EXTERN(void*)
|
||||
nsCapsIntersectPrincipalArray(void* prin1Array, void* prin2Array);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsCanExtendTrust(void* from, void* to);
|
||||
|
||||
|
||||
/* wrappers for nsPrincipal object */
|
||||
PR_EXTERN(struct nsPrincipal *)
|
||||
nsCapsNewPrincipal(nsPrincipalType type, void * key,
|
||||
PRUint32 key_len, void *zig);
|
||||
|
||||
PR_EXTERN(const char *)
|
||||
nsCapsPrincipalToString(struct nsPrincipal *principal);
|
||||
|
||||
PR_EXTERN(PRBool)
|
||||
nsCapsIsCodebaseExact(struct nsPrincipal *principal);
|
||||
|
||||
PR_EXTERN(const char *)
|
||||
nsCapsPrincipalGetVendor(struct nsPrincipal *principal);
|
||||
|
||||
PR_EXTERN(void *)
|
||||
nsCapsNewPrincipalArray(PRUint32 count);
|
||||
|
||||
PR_EXTERN(void)
|
||||
nsCapsFreePrincipalArray(void *prinArray);
|
||||
|
||||
PR_EXTERN(void *)
|
||||
nsCapsGetPrincipalArrayElement(void *prinArray, PRUint32 index);
|
||||
|
||||
PR_EXTERN(void)
|
||||
nsCapsSetPrincipalArrayElement(void *prinArray, PRUint32 index, void *element);
|
||||
|
||||
PR_EXTERN(PRUint32)
|
||||
nsCapsGetPrincipalArraySize(void *prinArray);
|
||||
|
||||
|
||||
/* wrappers for nsTarget object */
|
||||
PR_EXTERN(struct nsTarget *)
|
||||
nsCapsFindTarget(char *name);
|
||||
|
||||
|
||||
/* wrappers for nsPrivilege object */
|
||||
PR_EXTERN(nsPermissionState)
|
||||
nsCapsGetPermission(struct nsPrivilege *privilege);
|
||||
|
||||
|
||||
/* wrappers for nsPrivilegeTable object */
|
||||
PR_EXTERN(struct nsPrivilege *)
|
||||
nsCapsGetPrivilege(struct nsPrivilegeTable *annotation, struct nsTarget *target);
|
||||
|
||||
/* Methods for stack walking */
|
||||
|
||||
extern struct NSJSJavaFrameWrapper * (*nsCapsNewNSJSJavaFrameWrapperCallback)(void);
|
||||
PR_EXTERN(void)
|
||||
setNewNSJSJavaFrameWrapperCallback(struct NSJSJavaFrameWrapper * (*fp)(void));
|
||||
|
||||
extern void (*nsCapsFreeNSJSJavaFrameWrapperCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_EXTERN(void)
|
||||
setFreeNSJSJavaFrameWrapperCallback(void (*fp)(struct NSJSJavaFrameWrapper *));
|
||||
|
||||
extern void (*nsCapsGetStartFrameCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_EXTERN(void)
|
||||
setGetStartFrameCallback(void (*fp)(struct NSJSJavaFrameWrapper *));
|
||||
|
||||
extern PRBool (*nsCapsIsEndOfFrameCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_EXTERN(void)
|
||||
setIsEndOfFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *));
|
||||
|
||||
extern PRBool (*nsCapsIsValidFrameCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_EXTERN(void)
|
||||
setIsValidFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *));
|
||||
|
||||
extern void * (*nsCapsGetNextFrameCallback)(struct NSJSJavaFrameWrapper *, int *);
|
||||
PR_EXTERN(void)
|
||||
setGetNextFrameCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, int *));
|
||||
|
||||
extern void * (*nsCapsGetPrincipalArrayCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_EXTERN(void)
|
||||
setOJIGetPrincipalArrayCallback(void * (*fp)(struct NSJSJavaFrameWrapper *));
|
||||
|
||||
extern void * (*nsCapsGetAnnotationCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_EXTERN(void)
|
||||
setOJIGetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *));
|
||||
|
||||
extern void * (*nsCapsSetAnnotationCallback)(struct NSJSJavaFrameWrapper *, void *);
|
||||
PR_EXTERN(void)
|
||||
setOJISetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, void *));
|
||||
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* _NS_CAPS_H_ */
|
||||
59
mozilla/caps/include/nsCapsEnums.h
Normal file
59
mozilla/caps/include/nsCapsEnums.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* -*- 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 _NS_CAPS_ENUMS_H_
|
||||
#define _NS_CAPS_ENUMS_H_
|
||||
|
||||
typedef enum nsSetComparisonType {
|
||||
nsSetComparisonType_ProperSubset=-1,
|
||||
nsSetComparisonType_Equal=0,
|
||||
nsSetComparisonType_NoSubset=1
|
||||
} nsSetComparisonType;
|
||||
|
||||
/**
|
||||
* number of possible permissions (allowed, forbidden, or blank)
|
||||
*/
|
||||
typedef enum nsPermissionState {
|
||||
nsPermissionState_Forbidden = 0,
|
||||
nsPermissionState_Allowed,
|
||||
nsPermissionState_Blank,
|
||||
nsPermissionState_NumberOfPermissions
|
||||
} nsPermissionState;
|
||||
|
||||
/**
|
||||
* number of possible durations (scope, session, or forever)
|
||||
*/
|
||||
typedef enum nsDurationState {
|
||||
nsDurationState_Scope=0,
|
||||
nsDurationState_Session,
|
||||
nsDurationState_Forever,
|
||||
nsDurationState_NumberOfDurations
|
||||
} nsDurationState;
|
||||
|
||||
|
||||
/* The following should match what is in nsJVM plugin's java security code */
|
||||
typedef enum nsPrincipalType {
|
||||
nsPrincipalType_Unknown=-1,
|
||||
nsPrincipalType_CodebaseExact=10,
|
||||
nsPrincipalType_CodebaseRegexp,
|
||||
nsPrincipalType_Cert,
|
||||
nsPrincipalType_CertFingerPrint,
|
||||
nsPrincipalType_CertKey
|
||||
} nsPrincipalType;
|
||||
|
||||
#endif /* _NS_CAPS_ENUMS_H_ */
|
||||
36
mozilla/caps/include/nsLoadZig.h
Normal file
36
mozilla/caps/include/nsLoadZig.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* -*- 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 _NS_LOAD_ZIG_H_
|
||||
#define _NS_LOAD_ZIG_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
#include "zig.h"
|
||||
#include "nsZip.h"
|
||||
|
||||
PR_PUBLIC_API(void *)
|
||||
nsInitializeZig(ns_zip_t *zip,
|
||||
int (*callbackFnName) (int status, ZIG *zig,
|
||||
const char *metafile,
|
||||
char *pathname, char *errortext));
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* _NS_LOAD_ZIG_H_ */
|
||||
150
mozilla/caps/include/nsPrincipal.h
Executable file
150
mozilla/caps/include/nsPrincipal.h
Executable file
@@ -0,0 +1,150 @@
|
||||
/* -*- 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 _NS_PRINCIPAL_H_
|
||||
#define _NS_PRINCIPAL_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsVector.h"
|
||||
#include "nsCaps.h"
|
||||
#include "nsCapsEnums.h"
|
||||
|
||||
|
||||
typedef nsVector nsPrincipalArray;
|
||||
|
||||
struct nsPrincipal {
|
||||
|
||||
public:
|
||||
|
||||
/* Public Field Accessors */
|
||||
/* Public Methods */
|
||||
|
||||
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len);
|
||||
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, char *stringRep);
|
||||
virtual ~nsPrincipal();
|
||||
nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, void *zigObject);
|
||||
|
||||
PRBool equals(nsPrincipal *principal);
|
||||
|
||||
char * getVendor(void);
|
||||
|
||||
char * getCompanyName(void);
|
||||
|
||||
char * getSecAuth(void);
|
||||
|
||||
char * getSerialNo(void);
|
||||
|
||||
char * getExpDate(void);
|
||||
|
||||
char * getFingerPrint(void);
|
||||
|
||||
char * getNickname(void);
|
||||
|
||||
nsPrincipalType getType();
|
||||
|
||||
char *getKey();
|
||||
|
||||
PRUint32 getKeyLength();
|
||||
|
||||
PRInt32 hashCode(void);
|
||||
|
||||
PRBool isCodebase(void);
|
||||
|
||||
PRBool isCodebaseExact(void);
|
||||
|
||||
PRBool isCodebaseRegexp(void);
|
||||
|
||||
PRBool isSecurePrincipal(void);
|
||||
|
||||
PRBool isCert(void);
|
||||
|
||||
PRBool isCertFingerprint(void);
|
||||
|
||||
char * toString(void);
|
||||
|
||||
char * toVerboseString(void);
|
||||
|
||||
char * savePrincipalPermanently(void);
|
||||
|
||||
|
||||
private:
|
||||
/* Private Field Accessors */
|
||||
nsPrincipalType itsType;
|
||||
|
||||
void * itsZig;
|
||||
|
||||
char * itsKey;
|
||||
|
||||
PRUint32 itsKeyLen;
|
||||
|
||||
PRInt32 itsHashCode;
|
||||
|
||||
char * itsCompanyName;
|
||||
char * itsCertAuth;
|
||||
char * itsSerialNo;
|
||||
char * itsExpDate;
|
||||
char * itsAsciiFingerPrint;
|
||||
char * itsNickname;
|
||||
char * itsString;
|
||||
|
||||
/* Private Methods */
|
||||
void init(nsPrincipalType type, void * key, PRUint32 key_len);
|
||||
|
||||
PRInt32 computeHashCode(void * key, PRUint32 key_len);
|
||||
|
||||
PRInt32 computeHashCode(void);
|
||||
|
||||
char * saveCert(void);
|
||||
|
||||
char * getCertAttribute(int attrib);
|
||||
};
|
||||
|
||||
|
||||
class PrincipalKey: public nsHashKey {
|
||||
public:
|
||||
nsPrincipal *itsPrincipal;
|
||||
PrincipalKey(nsPrincipal *prin) {
|
||||
itsPrincipal = prin;
|
||||
}
|
||||
|
||||
PRUint32 HashValue(void) const {
|
||||
return itsPrincipal->hashCode();
|
||||
}
|
||||
|
||||
PRBool Equals(const nsHashKey *aKey) const {
|
||||
return (itsPrincipal->equals(((const PrincipalKey *) aKey)->itsPrincipal));
|
||||
}
|
||||
|
||||
nsHashKey *Clone(void) const {
|
||||
return new PrincipalKey(itsPrincipal);
|
||||
}
|
||||
};
|
||||
|
||||
/* XXX: Hack to determine the system principal */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
nsPrincipal * CreateSystemPrincipal(char* zip_file_name, char *pathname);
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
/* XXX: end of hack to determine the system principal */
|
||||
|
||||
#endif /* _NS_PRINCIPAL_H_ */
|
||||
119
mozilla/caps/include/nsPrivilege.h
Executable file
119
mozilla/caps/include/nsPrivilege.h
Executable file
@@ -0,0 +1,119 @@
|
||||
/* -*- 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 _NS_PRIVILEGE_H_
|
||||
#define _NS_PRIVILEGE_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsCaps.h"
|
||||
#include "nsCapsEnums.h"
|
||||
|
||||
PRBool nsPrivilegeInitialize(void);
|
||||
|
||||
struct nsPrivilege {
|
||||
|
||||
public:
|
||||
/* Public Field Accessors */
|
||||
nsPermissionState itsPerm;
|
||||
|
||||
nsDurationState itsDuration;
|
||||
|
||||
/* Public Methods */
|
||||
nsPrivilege(nsPermissionState perm, nsDurationState duration);
|
||||
|
||||
virtual ~nsPrivilege(void);
|
||||
|
||||
static nsPrivilege * findPrivilege(nsPermissionState permission, nsDurationState duration);
|
||||
|
||||
static nsPermissionState add(nsPermissionState perm1, nsPermissionState perm2);
|
||||
|
||||
static nsPrivilege * add(nsPrivilege *privilege1, nsPrivilege *privilege2);
|
||||
|
||||
PRBool samePermission(nsPrivilege *privilege);
|
||||
|
||||
PRBool samePermission(nsPermissionState perm);
|
||||
|
||||
PRBool sameDuration(nsPrivilege *privilege);
|
||||
|
||||
PRBool sameDuration(nsDurationState duration);
|
||||
|
||||
PRBool isAllowed(void);
|
||||
|
||||
PRBool isAllowedForever(void);
|
||||
|
||||
PRBool isForbidden(void);
|
||||
|
||||
PRBool isForbiddenForever(void);
|
||||
|
||||
PRBool isBlank(void);
|
||||
|
||||
nsPermissionState getPermission(void);
|
||||
|
||||
nsDurationState getDuration(void);
|
||||
|
||||
static nsPrivilege * findPrivilege(char *privStr);
|
||||
|
||||
char * toString(void);
|
||||
|
||||
private:
|
||||
|
||||
/* Private Field Accessors */
|
||||
char *itsString;
|
||||
|
||||
static PRBool theInited;
|
||||
|
||||
/* Private Methods */
|
||||
};
|
||||
|
||||
/**
|
||||
* add() method takes two permissions and returns a new permission.
|
||||
* Permission addition follows these rules:
|
||||
* <pre>
|
||||
* ALLOWED + ALLOWED = ALLOWED 1 + 1 = 1
|
||||
* ALLOWED + BLANK = ALLOWED 1 + 2 = 1
|
||||
* BLANK + BLANK = BLANK 2 + 2 = 2
|
||||
* ALLOWED + FORBIDDEN = FORBIDDEN 1 + 0 = 0
|
||||
* BLANK + FORBIDDEN = FORBIDDEN 2 + 0 = 0
|
||||
* FORBIDDEN + FORBIDDEN = FORBIDDEN 0 + 0 = 0
|
||||
* </pre>
|
||||
*
|
||||
* @return the permission that results from the above rules
|
||||
* <p>
|
||||
* Note: there are two versions of add(). One adds two Privilege
|
||||
* objects. The other just adds permissions (as returned by
|
||||
* <a href="#getPermission">getPermission()</a>).
|
||||
*/
|
||||
/* XXX: Whenever you change the value of FORBIDDEN, ALLOWED and BLANK
|
||||
* make sure they obey the laws mentioned in add() method.
|
||||
*/
|
||||
inline nsPermissionState nsPrivilege::add(nsPermissionState p1, nsPermissionState p2)
|
||||
{
|
||||
if (p1 < p2)
|
||||
return p1;
|
||||
return p2;
|
||||
}
|
||||
|
||||
inline nsPrivilege * nsPrivilege::add(nsPrivilege *p1, nsPrivilege *p2)
|
||||
{
|
||||
if (p1->itsPerm < p2->itsPerm)
|
||||
return p1;
|
||||
return p2;
|
||||
}
|
||||
|
||||
|
||||
#endif /* _NS_PRIVILEGE_H_ */
|
||||
173
mozilla/caps/include/nsPrivilegeManager.h
Executable file
173
mozilla/caps/include/nsPrivilegeManager.h
Executable file
@@ -0,0 +1,173 @@
|
||||
/* -*- 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 _NS_PRIVILEGE_MANAGER_H_
|
||||
#define _NS_PRIVILEGE_MANAGER_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "prio.h"
|
||||
#include "prmon.h"
|
||||
#include "nsHashtable.h"
|
||||
|
||||
#include "nsVector.h"
|
||||
#include "nsCaps.h"
|
||||
#include "nsTarget.h"
|
||||
#include "nsPrincipal.h"
|
||||
#include "nsPrivilege.h"
|
||||
#include "nsPrivilegeTable.h"
|
||||
#include "nsSystemPrivilegeTable.h"
|
||||
#include "nsCapsEnums.h"
|
||||
|
||||
extern PRBool nsCaps_lock(void);
|
||||
extern void nsCaps_unlock(void);
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
PRBool CMGetBoolPref(char * pref_name);
|
||||
PR_END_EXTERN_C
|
||||
|
||||
PRBool nsPrivilegeManagerInitialize(void);
|
||||
|
||||
struct nsPrivilegeManager {
|
||||
|
||||
public:
|
||||
/* Public Methods */
|
||||
|
||||
nsPrivilegeManager(void);
|
||||
virtual ~nsPrivilegeManager(void);
|
||||
|
||||
void registerSystemPrincipal(nsPrincipal *principal);
|
||||
|
||||
void registerPrincipal(nsPrincipal *principal);
|
||||
|
||||
PRBool unregisterPrincipal(nsPrincipal *principal);
|
||||
|
||||
PRBool isPrivilegeEnabled(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrivilege(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrivilege(nsTarget *target, nsPrincipal *preferredPrincipal, PRInt32 callerDepth);
|
||||
|
||||
PRBool revertPrivilege(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool disablePrivilege(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool enablePrincipalPrivilegeHelper(nsTarget *target, PRInt32 callerDepth, nsPrincipal *preferredPrin, void * data, nsTarget *impersonator);
|
||||
|
||||
nsPrivilegeTable *enableScopePrivilegeHelper(nsTarget *target, PRInt32 callerDepth, void *data, PRBool helpingSetScopePrivilege, nsPrincipal *prefPrin);
|
||||
|
||||
void registerPrincipalAndSetPrivileges(nsPrincipal *principal, nsTarget *target, nsPrivilege *newPrivilege);
|
||||
|
||||
void updatePrivilegeTable(nsTarget *target,
|
||||
nsPrivilegeTable *privTable,
|
||||
nsPrivilege *newPrivilege);
|
||||
|
||||
PRBool checkPrivilegeGranted(nsTarget *target, PRInt32 callerDepth);
|
||||
|
||||
PRBool checkPrivilegeGranted(nsTarget *target, nsPrincipal *principal, void *data);
|
||||
|
||||
PRBool checkPrivilegeGranted(nsTarget *target, PRInt32 callerDepth,
|
||||
void *data);
|
||||
|
||||
nsPrivilege *getPrincipalPrivilege(nsTarget *target, nsPrincipal *prin, void *data);
|
||||
|
||||
static nsPrivilegeManager * getPrivilegeManager(void);
|
||||
|
||||
static nsPrincipalArray* getMyPrincipals(PRInt32 callerDepth);
|
||||
|
||||
static nsPrincipal * getSystemPrincipal(void);
|
||||
|
||||
static PRBool hasSystemPrincipal(nsPrincipalArray *prinArray);
|
||||
|
||||
static nsPrincipal* getUnsignedPrincipal(void);
|
||||
|
||||
static nsPrincipal* getUnknownPrincipal(void);
|
||||
|
||||
nsSetComparisonType comparePrincipalArray(nsPrincipalArray* prin1Array,
|
||||
nsPrincipalArray* prin2Array);
|
||||
|
||||
nsPrincipalArray* intersectPrincipalArray(nsPrincipalArray* prin1Array,
|
||||
nsPrincipalArray* prin2Array);
|
||||
|
||||
PRBool canExtendTrust(nsPrincipalArray* prin1Array,
|
||||
nsPrincipalArray* prin2Array);
|
||||
|
||||
PRBool checkMatchPrincipal(nsPrincipal *principal, PRInt32 callerDepth);
|
||||
|
||||
/* Helper functions for ADMIN UI */
|
||||
const char * getAllPrincipalsString(void);
|
||||
|
||||
nsPrincipal * getPrincipalFromString(char *prinName);
|
||||
|
||||
void getTargetsWithPrivileges(char *prinName, char** forever,
|
||||
char** session, char **denied);
|
||||
|
||||
PRBool removePrincipal(char *prinName);
|
||||
|
||||
PRBool removePrincipalsPrivilege(char *prinName, char *targetName);
|
||||
|
||||
void remove(nsPrincipal *prin, nsTarget *target);
|
||||
|
||||
/* The following are old native methods */
|
||||
char * checkPrivilegeEnabled(nsTargetArray* targetArray,
|
||||
PRInt32 callerDepth, void *data);
|
||||
|
||||
nsPrincipalArray* getClassPrincipalsFromStack(PRInt32 callerDepth);
|
||||
|
||||
nsPrivilegeTable * getPrivilegeTableFromStack(PRInt32 callerDepth,
|
||||
PRBool createIfNull);
|
||||
|
||||
/* End of native methods */
|
||||
|
||||
private:
|
||||
|
||||
nsHashtable *itsPrinToPrivTable;
|
||||
nsHashtable *itsPrinToMacroTargetPrivTable;
|
||||
nsHashtable *itsPrinNameToPrincipalTable;
|
||||
|
||||
static PRBool theSecurityInited;
|
||||
|
||||
static char * SignedAppletDBName;
|
||||
|
||||
static PRBool theInited;
|
||||
|
||||
/* Private Field Accessors */
|
||||
|
||||
/* Private Methods */
|
||||
|
||||
void addToPrinNameToPrincipalTable(nsPrincipal *prin);
|
||||
|
||||
PRBool enablePrivilegePrivate(nsTarget *target,
|
||||
nsPrincipal *preferredPrincipal,
|
||||
PRInt32 callerDepth);
|
||||
|
||||
nsPermissionState getPrincipalPrivilege(nsTarget *target,
|
||||
nsPrincipalArray* callerPrinArray,
|
||||
void *data);
|
||||
|
||||
PRBool isPermissionGranted(nsTarget *target, nsPrincipalArray* callerPrinArray, void *data);
|
||||
|
||||
|
||||
/* The following methods are used to save and load the persistent store */
|
||||
void save(nsPrincipal *prin, nsTarget *target, nsPrivilege *newPrivilege);
|
||||
|
||||
void load(void);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _NS_PRIVILEGE_MANAGER_H_ */
|
||||
58
mozilla/caps/include/nsPrivilegeTable.h
Executable file
58
mozilla/caps/include/nsPrivilegeTable.h
Executable file
@@ -0,0 +1,58 @@
|
||||
/* -*- 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 _NS_PRIVILEGE_TABLE_H_
|
||||
#define _NS_PRIVILEGE_TABLE_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsCaps.h"
|
||||
#include "nsTarget.h"
|
||||
#include "nsPrivilege.h"
|
||||
|
||||
struct nsPrivilegeTable {
|
||||
|
||||
public:
|
||||
|
||||
/* Public Methods */
|
||||
nsPrivilegeTable(void);
|
||||
virtual ~nsPrivilegeTable(void);
|
||||
|
||||
PRInt32 size(void);
|
||||
|
||||
PRBool isEmpty(void);
|
||||
|
||||
virtual nsPrivilege * get(nsTarget *t);
|
||||
|
||||
nsPrivilege * put(nsTarget *a, nsPrivilege *priv);
|
||||
|
||||
nsPrivilege * remove(nsTarget *key);
|
||||
|
||||
nsPrivilegeTable * clone(void);
|
||||
|
||||
void clear(void);
|
||||
|
||||
void Enumerate(nsHashtableEnumFunc aEnumFunc);
|
||||
|
||||
private:
|
||||
|
||||
/* Private Field Accessors */
|
||||
nsHashtable * itsTable;
|
||||
};
|
||||
|
||||
#endif /* _NS_PRIVILEGE_TABLE_H_ */
|
||||
38
mozilla/caps/include/nsSystemPrivilegeTable.h
Executable file
38
mozilla/caps/include/nsSystemPrivilegeTable.h
Executable file
@@ -0,0 +1,38 @@
|
||||
/* -*- 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 _NS_SYSTEM_PRIVILEGE_TABLE_H_
|
||||
#define _NS_SYSTEM_PRIVILEGE_TABLE_H_
|
||||
|
||||
#include "nsTarget.h"
|
||||
#include "nsPrivilege.h"
|
||||
#include "nsPrivilegeTable.h"
|
||||
#include "nsCom.h"
|
||||
|
||||
|
||||
class nsSystemPrivilegeTable : public nsPrivilegeTable {
|
||||
|
||||
public:
|
||||
|
||||
/* Public Methods */
|
||||
nsSystemPrivilegeTable(void);
|
||||
|
||||
virtual nsPrivilege * get(nsTarget *a);
|
||||
};
|
||||
|
||||
#endif /* _NS_SYSTEM_PRIVILEGE_TABLE_H_ */
|
||||
215
mozilla/caps/include/nsTarget.h
Executable file
215
mozilla/caps/include/nsTarget.h
Executable file
@@ -0,0 +1,215 @@
|
||||
/* -*- 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 _NS_TARGET_H_
|
||||
#define _NS_TARGET_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "prtypes.h"
|
||||
#include "plhash.h"
|
||||
|
||||
#include "nsHashtable.h"
|
||||
#include "nsVector.h"
|
||||
#include "nsCaps.h"
|
||||
#include "nsPrincipal.h"
|
||||
#include "nsPrivilege.h"
|
||||
#include "nsUserDialogHelper.h"
|
||||
|
||||
typedef nsVector nsTargetArray;
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
#include "jpermission.h"
|
||||
PR_PUBLIC_API(void)
|
||||
java_netscape_security_getTargetDetails(const char *charSetName, char* targetName,
|
||||
char** details, char **risk);
|
||||
PR_END_EXTERN_C
|
||||
|
||||
extern int CAPS_TARGET_RISK_COLOR_HIGH;
|
||||
|
||||
extern PRBool CreateSystemTargets(nsPrincipal *sysPrin);
|
||||
|
||||
struct nsTarget {
|
||||
|
||||
public:
|
||||
|
||||
/* Public Methods */
|
||||
|
||||
virtual ~nsTarget(void);
|
||||
|
||||
nsTarget(char *name, nsPrincipal *prin,
|
||||
PRInt32 risk = JavaSecUI_targetRiskHigh(),
|
||||
char *riskColor = JavaSecUI_getString(CAPS_TARGET_RISK_COLOR_HIGH),
|
||||
char *description = NULL,
|
||||
char *detailDescription = NULL,
|
||||
char *url = NULL,
|
||||
nsTargetArray* targetArray = NULL)
|
||||
{
|
||||
init(name, prin, targetArray, risk, riskColor, description,
|
||||
detailDescription, url);
|
||||
}
|
||||
|
||||
nsTarget * registerTarget(void);
|
||||
|
||||
static nsTarget * findTarget(nsTarget *target);
|
||||
|
||||
static nsTarget * findTarget(char *name);
|
||||
|
||||
static nsTarget * findTarget(char *name, nsPrincipal *prin);
|
||||
|
||||
nsPrivilege * checkPrivilegeEnabled(nsTargetArray* prinArray, void *data);
|
||||
|
||||
nsPrivilege * checkPrivilegeEnabled(nsTargetArray* prinArray);
|
||||
|
||||
nsPrivilege * checkPrivilegeEnabled(nsPrincipal *p, void *data);
|
||||
|
||||
virtual nsPrivilege * enablePrivilege(nsPrincipal *prin, void *data);
|
||||
|
||||
nsPrivilege * getPrincipalPrivilege(nsPrincipal *prin, void *data);
|
||||
|
||||
nsTargetArray* getFlattenedTargetArray(void);
|
||||
|
||||
static nsTargetArray* getAllRegisteredTargets(void);
|
||||
|
||||
char * getRisk(void);
|
||||
|
||||
char * getRiskColor(void);
|
||||
|
||||
char * getDescription(void);
|
||||
|
||||
char * getDetailDescription(void);
|
||||
|
||||
static nsTarget * getTargetFromDescription(char *a);
|
||||
|
||||
char * getHelpURL(void);
|
||||
|
||||
char * getDetailedInfo(void *a);
|
||||
|
||||
nsPrincipal * getPrincipal(void);
|
||||
|
||||
char * getName(void);
|
||||
|
||||
PRBool equals(nsTarget *a);
|
||||
|
||||
PRInt32 hashCode(void);
|
||||
|
||||
char * toString(void);
|
||||
|
||||
PRBool isRegistered(void);
|
||||
|
||||
private:
|
||||
|
||||
/* Private Field Accessors */
|
||||
char * itsName;
|
||||
|
||||
nsPrincipal * itsPrincipal;
|
||||
|
||||
PRInt32 itsRisk;
|
||||
|
||||
char * itsRiskColorStr;
|
||||
|
||||
char * itsDescriptionStr;
|
||||
|
||||
char * itsDetailDescriptionStr;
|
||||
|
||||
char * itsURLStr;
|
||||
|
||||
PRBool itsRegistered;
|
||||
|
||||
nsTargetArray* itsTargetArray;
|
||||
|
||||
nsTargetArray* itsExpandedTargetArray;
|
||||
|
||||
char *itsString;
|
||||
|
||||
PRUint32 itsDescriptionHash;
|
||||
|
||||
static PRBool theInited;
|
||||
|
||||
/* Private Methods */
|
||||
void init(char *name, nsPrincipal *prin, nsTargetArray* targetArray, PRInt32 risk, char *riskColor, char *description, char *detailDescription, char *url);
|
||||
|
||||
void getFlattenedTargets(nsHashtable *targHash, nsTargetArray* expandedTargetArray);
|
||||
|
||||
};
|
||||
|
||||
|
||||
class TargetKey: public nsHashKey {
|
||||
public:
|
||||
nsTarget *itsTarget;
|
||||
TargetKey(nsTarget *targ) {
|
||||
itsTarget = targ;
|
||||
}
|
||||
|
||||
PRUint32 HashValue(void) const {
|
||||
return itsTarget->hashCode();
|
||||
}
|
||||
|
||||
PRBool Equals(const nsHashKey *aKey) const {
|
||||
return (itsTarget->equals(((const TargetKey *) aKey)->itsTarget));
|
||||
}
|
||||
|
||||
nsHashKey *Clone(void) const {
|
||||
return new TargetKey(itsTarget);
|
||||
}
|
||||
};
|
||||
|
||||
/* XXX: IMO, IntegerKey and StringKey should be part of xpcom */
|
||||
class IntegerKey: public nsHashKey {
|
||||
private:
|
||||
PRUint32 itsHash;
|
||||
|
||||
public:
|
||||
IntegerKey(PRUint32 hash) {
|
||||
itsHash = hash;
|
||||
}
|
||||
|
||||
PRUint32 HashValue(void) const {
|
||||
return itsHash;
|
||||
}
|
||||
|
||||
PRBool Equals(const nsHashKey *aKey) const {
|
||||
return (itsHash == (((const IntegerKey *) aKey)->itsHash)) ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
|
||||
nsHashKey *Clone(void) const {
|
||||
return new IntegerKey(itsHash);
|
||||
}
|
||||
};
|
||||
|
||||
class StringKey: public nsHashKey {
|
||||
public:
|
||||
const char *itsString;
|
||||
|
||||
StringKey(const char *string) {
|
||||
itsString = string;
|
||||
}
|
||||
|
||||
PRUint32 HashValue(void) const {
|
||||
return PL_HashString(itsString);
|
||||
}
|
||||
|
||||
PRBool Equals(const nsHashKey *aKey) const {
|
||||
return (strcmp(itsString, (((const StringKey *) aKey)->itsString)) == 0);
|
||||
}
|
||||
|
||||
nsHashKey *Clone(void) const {
|
||||
return new StringKey(itsString);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* _NS_TARGET_H_ */
|
||||
46
mozilla/caps/include/nsUserDialogHelper.h
Normal file
46
mozilla/caps/include/nsUserDialogHelper.h
Normal file
@@ -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 _NS_USER_DIALOG_HELPER_H_
|
||||
#define _NS_USER_DIALOG_HELPER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
typedef enum nsRiskType {
|
||||
nsRiskType_LowRisk=10,
|
||||
nsRiskType_MediumRisk=20,
|
||||
nsRiskType_HighRisk=30
|
||||
} nsRiskType;
|
||||
|
||||
extern char * JavaSecUI_targetRiskStr(int risk);
|
||||
extern int JavaSecUI_targetRiskLow(void);
|
||||
extern int JavaSecUI_targetRiskMedium(void);
|
||||
extern int JavaSecUI_targetRiskHigh(void);
|
||||
|
||||
extern char * JavaSecUI_getHelpURL(int id);
|
||||
extern char * JavaSecUI_getString(int id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _NS_USER_DIALOG_HELPER_H_ */
|
||||
63
mozilla/caps/include/nsUserTarget.h
Executable file
63
mozilla/caps/include/nsUserTarget.h
Executable file
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef _NS_USER_TARGET_H_
|
||||
#define _NS_USER_TARGET_H_
|
||||
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
#include "nsTarget.h"
|
||||
#include "nsPrivilege.h"
|
||||
#include "nsPrincipal.h"
|
||||
#include "nsCom.h"
|
||||
|
||||
/* Any methods that is not defined here is in Java */
|
||||
class nsUserTarget : public nsTarget {
|
||||
|
||||
public:
|
||||
|
||||
/* Public Methods */
|
||||
|
||||
nsUserTarget(char *name);
|
||||
virtual ~nsUserTarget(void);
|
||||
|
||||
nsUserTarget(char *name, nsPrincipal *prin, PRInt32 risk,
|
||||
char *riskColor, char *description,
|
||||
char *detailDescription, char *url)
|
||||
: nsTarget(name, prin, risk, riskColor, description, detailDescription,
|
||||
url, NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsUserTarget(char *name, nsPrincipal *prin, PRInt32 risk,
|
||||
char *riskColor, char *description,
|
||||
char *detailDescription, char *url,
|
||||
nsTargetArray *targetArray)
|
||||
: nsTarget(name, prin, risk, riskColor, description, detailDescription,
|
||||
url, targetArray)
|
||||
{
|
||||
}
|
||||
|
||||
nsPrivilege * enablePrivilege(nsPrincipal *prin, void *data);
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif /* _NS_USER_TARGET_H_ */
|
||||
41
mozilla/caps/include/nsZig.h
Executable file
41
mozilla/caps/include/nsZig.h
Executable file
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef _NS_ZIG_H_
|
||||
#define _NS_ZIG_H_
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
class nsZig {
|
||||
|
||||
public:
|
||||
/* Public Methods */
|
||||
nsZig(void * zig);
|
||||
|
||||
static void destroyZignature(void * nativeZig);
|
||||
|
||||
~nsZig(void);
|
||||
|
||||
void * GetZig(void);
|
||||
|
||||
private:
|
||||
|
||||
void * itsNativeZig;
|
||||
};
|
||||
|
||||
#endif /* _NS_ZIG_H_ */
|
||||
98
mozilla/caps/include/nsZip.h
Normal file
98
mozilla/caps/include/nsZip.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Prototypes for "zip" file reader support
|
||||
*/
|
||||
|
||||
#ifndef _NS_ZIP_H_
|
||||
#define _NS_ZIP_H_
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
#include <time.h>
|
||||
#include "prtypes.h"
|
||||
|
||||
/* XXX: IMO, the following should go into NSPR */
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
#include <malloc.h> /* needed for _halloc() */
|
||||
#ifndef HUGEP
|
||||
#define HUGEP __huge
|
||||
#endif
|
||||
#ifndef CHECK_SIZE_LIMIT
|
||||
#define CHECK_SIZE_LIMIT(x) PR_ASSERT( (x) <= 0xFFFFL )
|
||||
#endif
|
||||
#else /* else for defined(XP_PC) && !defined(_WIN32) */
|
||||
#ifndef HUGEP
|
||||
#define HUGEP
|
||||
#endif
|
||||
#ifndef CHECK_SIZE_LIMIT
|
||||
#define CHECK_SIZE_LIMIT(x) ((void)0)
|
||||
#endif
|
||||
#endif /* defined(XP_PC) && !defined(_WIN32) */
|
||||
|
||||
/* XXX: IMO, the following should go into NSPR */
|
||||
#ifndef FD_ERROR1
|
||||
#define FD_ERROR1 ((PRFileDesc*)-1)
|
||||
#endif
|
||||
#ifndef FD_ERROR2
|
||||
#define FD_ERROR2 ((PRFileDesc*)-2)
|
||||
#endif
|
||||
#ifndef FD_IS_ERROR
|
||||
#define FD_IS_ERROR(fd) ((fd) == NULL || fd == FD_ERROR1 || fd == FD_ERROR2)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Central directory entry
|
||||
*/
|
||||
typedef struct {
|
||||
char *fn; /* file name */
|
||||
PRUint32 len; /* file size */
|
||||
PRUint32 size; /* file compressed size */
|
||||
int method; /* Compression method */
|
||||
int mod; /* file modification time */
|
||||
long off; /* local file header offset */
|
||||
} direl_t;
|
||||
|
||||
/*
|
||||
* Zip file
|
||||
*/
|
||||
typedef struct {
|
||||
char *fn; /* zip file name */
|
||||
PRFileDesc *fd; /* zip file descriptor */
|
||||
direl_t *dir; /* zip file directory */
|
||||
PRUint32 nel; /* number of directory entries */
|
||||
PRUint32 cenoff; /* Offset of central directory (CEN) */
|
||||
PRUint32 endoff; /* Offset of end-of-central-directory record */
|
||||
} ns_zip_t;
|
||||
|
||||
struct stat;
|
||||
|
||||
PR_PUBLIC_API(PRBool) ns_zip_lock(void);
|
||||
PR_PUBLIC_API(void) ns_zip_unlock(void);
|
||||
PR_PUBLIC_API(ns_zip_t *) ns_zip_open(const char *fn);
|
||||
PR_PUBLIC_API(void) ns_zip_close(ns_zip_t *zip);
|
||||
PR_PUBLIC_API(PRBool) ns_zip_stat(ns_zip_t *zip, const char *fn, struct stat *sbuf);
|
||||
PR_PUBLIC_API(PRBool) ns_zip_get(ns_zip_t *zip, const char *fn, void *buf, PRInt32 len);
|
||||
PR_PUBLIC_API(PRUint32) ns_zip_get_no_of_elements(ns_zip_t *zip, const char *fn_suffix);
|
||||
PR_PUBLIC_API(PRUint32) ns_zip_list_files(ns_zip_t *zip, const char *fn_suffix, void HUGEP *buf, PRUint32 len);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
#endif /* !_NS_ZIP_H_ */
|
||||
9
mozilla/caps/macbuild/Caps.Prefix
Normal file
9
mozilla/caps/macbuild/Caps.Prefix
Normal file
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Caps.Prefix
|
||||
//
|
||||
// Global prefix file for the Caps project.
|
||||
//
|
||||
//
|
||||
|
||||
#include "MacPrefix.h"
|
||||
#include "CapsConfig.h"
|
||||
BIN
mozilla/caps/macbuild/Caps.mcp
Normal file
BIN
mozilla/caps/macbuild/Caps.mcp
Normal file
Binary file not shown.
3
mozilla/caps/macbuild/CapsConfig.h
Normal file
3
mozilla/caps/macbuild/CapsConfig.h
Normal file
@@ -0,0 +1,3 @@
|
||||
//
|
||||
// CapsConfig.h
|
||||
//
|
||||
9
mozilla/caps/macbuild/CapsDebug.Prefix
Normal file
9
mozilla/caps/macbuild/CapsDebug.Prefix
Normal file
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// CapsDebug.Prefix
|
||||
//
|
||||
// Global prefix file for the debug Caps project.
|
||||
//
|
||||
//
|
||||
|
||||
#include "MacPrefix_debug.h"
|
||||
#include "CapsConfig.h"
|
||||
47
mozilla/caps/makefile.win
Normal file
47
mozilla/caps/makefile.win
Normal file
@@ -0,0 +1,47 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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.
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build the CAPS tree
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH=..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...)
|
||||
#// (these must come before the common makefiles are included)
|
||||
#//
|
||||
#// DIRS - There are subdirectories to process
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DIRS=include src
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
45
mozilla/caps/src/Makefile
Executable file
45
mozilla/caps/src/Makefile
Executable file
@@ -0,0 +1,45 @@
|
||||
#!gmake
|
||||
# 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.
|
||||
|
||||
MODULE = caps
|
||||
|
||||
LIBRARY_NAME = caps
|
||||
|
||||
DEPTH = ../..
|
||||
|
||||
REQUIRES = nspr xpcom security layer js jar zlib pref img util rdf caps
|
||||
|
||||
CSRCS = \
|
||||
nsZip.c \
|
||||
nsUserDialogHelper.c \
|
||||
nsZig.c \
|
||||
nsLoadZig.c \
|
||||
nsPrincipal.c \
|
||||
nsPrivilege.c \
|
||||
nsPrivilegeManager.c \
|
||||
nsPrivilegeTable.c \
|
||||
nsSystemPrivilegeTable.c \
|
||||
nsTarget.c \
|
||||
jpermission.c \
|
||||
nsUserTarget.c \
|
||||
admin.c \
|
||||
nsCaps.c \
|
||||
$(NULL)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
INCLUDES += -I$(DEPTH)/include
|
||||
|
||||
99
mozilla/caps/src/admin.cpp
Normal file
99
mozilla/caps/src/admin.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
/* -*- 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 "prtypes.h"
|
||||
#include "nspr.h"
|
||||
#include "prmem.h"
|
||||
#include "prmon.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#include "admin.h"
|
||||
#include "nsPrivilegeManager.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* A D M I N U I A P I
|
||||
*
|
||||
* All of the following methods are used by admin API (the code located
|
||||
* in security/lib/nav area).
|
||||
*/
|
||||
|
||||
PR_PUBLIC_API(const char *)
|
||||
java_netscape_security_getPrincipals(const char *charSetName)
|
||||
{
|
||||
#ifdef DEBUG_raman_xxx
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
const char *prins = nsPrivManager->getAllPrincipalsString();
|
||||
PRBool test_admin_api = PR_FALSE;
|
||||
if (test_admin_api) {
|
||||
char *a1;
|
||||
char *a2;
|
||||
char *a3;
|
||||
java_netscape_security_getPrivilegeDescs(NULL, "raman tenneti", &a1, &a2, &a3);
|
||||
java_netscape_security_removePrivilege(NULL, "raman tenneti", "Reading, modification, or deletion of any of your files");
|
||||
java_netscape_security_removePrincipal(NULL, "raman tenneti");
|
||||
}
|
||||
return prins;
|
||||
#else
|
||||
return NULL;
|
||||
#endif /* DEBUG_raman_xxx */
|
||||
}
|
||||
|
||||
PR_PUBLIC_API(PRBool)
|
||||
java_netscape_security_removePrincipal(const char *charSetName, char *prinName)
|
||||
{
|
||||
#ifdef DEBUG_raman_xxx
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->removePrincipal(prinName);
|
||||
#else
|
||||
return PR_FALSE;
|
||||
#endif /* DEBUG_raman_xxx */
|
||||
}
|
||||
|
||||
PR_PUBLIC_API(void)
|
||||
java_netscape_security_getPrivilegeDescs(const char *charSetName, char *prinName,
|
||||
char** forever, char** session,
|
||||
char **denied)
|
||||
{
|
||||
#ifdef DEBUG_raman_xxx
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
nsPrivManager->getTargetsWithPrivileges(prinName, forever, session, denied);
|
||||
#endif /* DEBUG_raman_xxx */
|
||||
}
|
||||
|
||||
PR_PUBLIC_API(PRBool)
|
||||
java_netscape_security_removePrivilege(const char *charSetName, char *prinName,
|
||||
char *targetName)
|
||||
{
|
||||
#ifdef DEBUG_raman_xxx
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->removePrincipalsPrivilege(prinName, targetName);
|
||||
#else
|
||||
return PR_FALSE;
|
||||
#endif /* DEBUG_raman_xxx */
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
75
mozilla/caps/src/jpermission.c
Normal file
75
mozilla/caps/src/jpermission.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/* -*- 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 "prtypes.h"
|
||||
#include "nspr.h"
|
||||
#include "prmem.h"
|
||||
#include "prmon.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#include "structs.h"
|
||||
#include "proto.h"
|
||||
#include "secnav.h"
|
||||
|
||||
#include "jpermission.h"
|
||||
|
||||
static char *userTargetErrMsg;
|
||||
static nsPermState gPermState;
|
||||
|
||||
static void
|
||||
nsUserTargetHandleMonitorError(int rv)
|
||||
{
|
||||
if (rv == PR_FAILURE) {
|
||||
userTargetErrMsg = "IllegalMonitorStateException current thread not owner";
|
||||
}
|
||||
else if (PR_GetError() == PR_PENDING_INTERRUPT_ERROR) {
|
||||
userTargetErrMsg = "ThreadDeath: thread tried to proceed after being stopped";
|
||||
} else {
|
||||
userTargetErrMsg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PR_PUBLIC_API(void)
|
||||
java_netscape_security_savePrivilege(nsPermState permState)
|
||||
{
|
||||
PR_CEnterMonitor((void *)&gPermState);
|
||||
gPermState = permState;
|
||||
nsUserTargetHandleMonitorError(PR_CNotifyAll((void*)&gPermState));
|
||||
PR_CExitMonitor((void *)&gPermState);
|
||||
}
|
||||
|
||||
PR_PUBLIC_API(nsPermState)
|
||||
nsJSJavaDisplayDialog(char *prinStr, char *targetStr, char *riskStr, PRBool isCert)
|
||||
{
|
||||
void * context = XP_FindSomeContext();
|
||||
PRIntervalTime sleep = (PRIntervalTime)PR_INTERVAL_NO_TIMEOUT;
|
||||
nsPermState ret_val=nsPermState_NotSet;
|
||||
|
||||
SECNAV_signedAppletPrivileges(context, prinStr, targetStr,
|
||||
riskStr, isCert);
|
||||
|
||||
PR_CEnterMonitor((void *)&gPermState);
|
||||
nsUserTargetHandleMonitorError(PR_CWait((void*)&gPermState, sleep));
|
||||
nsUserTargetHandleMonitorError(PR_CNotifyAll((void*)&gPermState));
|
||||
ret_val = gPermState;
|
||||
PR_CExitMonitor((void *)&gPermState);
|
||||
|
||||
PR_Sleep(500000);
|
||||
return ret_val;
|
||||
}
|
||||
121
mozilla/caps/src/makefile.win
Executable file
121
mozilla/caps/src/makefile.win
Executable file
@@ -0,0 +1,121 @@
|
||||
#!nmake
|
||||
#
|
||||
# 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.
|
||||
|
||||
IGNORE_MANIFEST=1
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of MOZILLA
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..
|
||||
|
||||
!ifndef MAKE_OBJ_TYPE
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBNAME=libcaps
|
||||
PDBFILE=$(LIBNAME).pdb
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\nsZip.obj \
|
||||
.\$(OBJDIR)\nsUserDialogHelper.obj \
|
||||
.\$(OBJDIR)\nsZig.obj \
|
||||
.\$(OBJDIR)\nsLoadZig.obj \
|
||||
.\$(OBJDIR)\nsPrincipal.obj \
|
||||
.\$(OBJDIR)\nsPrivilege.obj \
|
||||
.\$(OBJDIR)\nsPrivilegeManager.obj \
|
||||
.\$(OBJDIR)\nsPrivilegeTable.obj \
|
||||
.\$(OBJDIR)\nsSystemPrivilegeTable.obj \
|
||||
.\$(OBJDIR)\nsTarget.obj \
|
||||
.\$(OBJDIR)\jpermission.obj \
|
||||
.\$(OBJDIR)\nsUserTarget.obj \
|
||||
.\$(OBJDIR)\admin.obj \
|
||||
.\$(OBJDIR)\nsCaps.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
LIBRARY= .\$(OBJDIR)\$(LIBNAME).lib
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any local options for the make tools
|
||||
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LINCS= $(LINCS) \
|
||||
#
|
||||
# For Win16 the following include directories are copied into
|
||||
# ns/dist/public/win16
|
||||
#
|
||||
!if "$(MOZ_BITS)" == "32"
|
||||
-I$(PUBLIC)/js \
|
||||
-I$(PUBLIC)\nspr \
|
||||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\security \
|
||||
-I$(PUBLIC)\libimg \
|
||||
!endif
|
||||
-I$(PUBLIC)\jar \
|
||||
-I$(PUBLIC)\zlib \
|
||||
-I$(PUBLIC)\pref \
|
||||
-I$(DEPTH)\lib\layout \
|
||||
-I$(DEPTH)\lib\libstyle \
|
||||
-I$(PUBLIC)\rdf \
|
||||
-I$(PUBLIC)\caps \
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
libs::$(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
export::
|
||||
|
||||
install:: export libs
|
||||
|
||||
clobber::
|
||||
|
||||
278
mozilla/caps/src/nsCaps.cpp
Normal file
278
mozilla/caps/src/nsCaps.cpp
Normal file
@@ -0,0 +1,278 @@
|
||||
/* -*- 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 "prtypes.h"
|
||||
#include "nspr.h"
|
||||
#include "prmem.h"
|
||||
#include "prmon.h"
|
||||
#include "prlog.h"
|
||||
|
||||
#include "nsCaps.h"
|
||||
#include "nsPrivilegeManager.h"
|
||||
#include "nsPrivilege.h"
|
||||
#include "nsPrivilegeTable.h"
|
||||
#include "nsPrincipal.h"
|
||||
#include "nsTarget.h"
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
|
||||
/*
|
||||
* C API FOR JS
|
||||
*
|
||||
* All of the following methods are used by JS (the code located
|
||||
* in lib/libmocha area).
|
||||
*/
|
||||
|
||||
/* wrappers for nsPrivilegeManager object */
|
||||
PR_IMPLEMENT(PRBool)
|
||||
nsCapsRegisterPrincipal(struct nsPrincipal *principal)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
nsPrivManager->registerPrincipal(principal);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRBool)
|
||||
nsCapsEnablePrivilege(struct nsTarget *target, PRInt32 callerDepth)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->enablePrivilege(target, callerDepth);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRBool)
|
||||
nsCapsIsPrivilegeEnabled(struct nsTarget *target, PRInt32 callerDepth)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->isPrivilegeEnabled(target, callerDepth);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRBool)
|
||||
nsCapsRevertPrivilege(struct nsTarget *target, PRInt32 callerDepth)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->revertPrivilege(target, callerDepth);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRBool)
|
||||
nsCapsDisablePrivilege(struct nsTarget *target, PRInt32 callerDepth)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->disablePrivilege(target, callerDepth);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(void*)
|
||||
nsCapsGetClassPrincipalsFromStack(PRInt32 callerDepth)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return (void *)nsPrivManager->getClassPrincipalsFromStack(callerDepth);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(nsSetComparisonType)
|
||||
nsCapsComparePrincipalArray(void* prin1Array, void* prin2Array)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->comparePrincipalArray((nsPrincipalArray*)prin1Array,
|
||||
(nsPrincipalArray*)prin2Array);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(void*)
|
||||
nsCapsIntersectPrincipalArray(void* prin1Array, void* prin2Array)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->intersectPrincipalArray((nsPrincipalArray*)prin1Array,
|
||||
(nsPrincipalArray*)prin2Array);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRBool)
|
||||
nsCapsCanExtendTrust(void* from, void* to)
|
||||
{
|
||||
nsPrivilegeManager *nsPrivManager = nsPrivilegeManager::getPrivilegeManager();
|
||||
return nsPrivManager->canExtendTrust((nsPrincipalArray*)from,
|
||||
(nsPrincipalArray*)to);
|
||||
}
|
||||
|
||||
/* wrappers for nsPrincipal object */
|
||||
PR_IMPLEMENT(struct nsPrincipal *)
|
||||
nsCapsNewPrincipal(nsPrincipalType type, void * key,
|
||||
PRUint32 key_len, void *zig)
|
||||
{
|
||||
return new nsPrincipal(type, key, key_len, zig);
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(const char *)
|
||||
nsCapsPrincipalToString(struct nsPrincipal *principal)
|
||||
{
|
||||
return principal->toString();
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRBool)
|
||||
nsCapsIsCodebaseExact(struct nsPrincipal *principal)
|
||||
{
|
||||
return principal->isCodebaseExact();
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(const char *)
|
||||
nsCapsPrincipalGetVendor(struct nsPrincipal *principal)
|
||||
{
|
||||
return principal->getVendor();
|
||||
}
|
||||
|
||||
PR_EXTERN(void *)
|
||||
nsCapsNewPrincipalArray(PRUint32 count)
|
||||
{
|
||||
nsPrincipalArray *prinArray = new nsPrincipalArray();
|
||||
prinArray->SetSize(count, 1);
|
||||
return prinArray;
|
||||
}
|
||||
|
||||
PR_EXTERN(void)
|
||||
nsCapsFreePrincipalArray(void *prinArrayArg)
|
||||
{
|
||||
nsPrincipalArray *prinArray = (nsPrincipalArray *)prinArrayArg;
|
||||
if (prinArray) {
|
||||
prinArray->RemoveAll();
|
||||
delete prinArray;
|
||||
}
|
||||
}
|
||||
|
||||
PR_EXTERN(void *)
|
||||
nsCapsGetPrincipalArrayElement(void *prinArrayArg, PRUint32 index)
|
||||
{
|
||||
nsPrincipalArray *prinArray = (nsPrincipalArray *)prinArrayArg;
|
||||
if (prinArray == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return prinArray->Get(index);
|
||||
}
|
||||
|
||||
PR_EXTERN(void)
|
||||
nsCapsSetPrincipalArrayElement(void *prinArrayArg, PRUint32 index, void *element)
|
||||
{
|
||||
nsPrincipalArray *prinArray = (nsPrincipalArray *)prinArrayArg;
|
||||
if (prinArray == NULL) {
|
||||
return;
|
||||
}
|
||||
prinArray->Set(index, element);
|
||||
}
|
||||
|
||||
PR_EXTERN(PRUint32)
|
||||
nsCapsGetPrincipalArraySize(void *prinArrayArg)
|
||||
{
|
||||
nsPrincipalArray *prinArray = (nsPrincipalArray *)prinArrayArg;
|
||||
if (prinArray == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return prinArray->GetSize();
|
||||
}
|
||||
|
||||
/* wrappers for nsTarget object */
|
||||
PR_IMPLEMENT(struct nsTarget *)
|
||||
nsCapsFindTarget(char *name)
|
||||
{
|
||||
return nsTarget::findTarget(name);
|
||||
}
|
||||
|
||||
/* wrappers for nsPrivilege object */
|
||||
PR_IMPLEMENT(nsPermissionState)
|
||||
nsCapsGetPermission(struct nsPrivilege *privilege)
|
||||
{
|
||||
return privilege->getPermission();
|
||||
}
|
||||
|
||||
/* wrappers for nsPrivilegeTable object */
|
||||
PR_IMPLEMENT(struct nsPrivilege *)
|
||||
nsCapsGetPrivilege(struct nsPrivilegeTable *annotation, struct nsTarget *target)
|
||||
{
|
||||
return annotation->get(target);
|
||||
}
|
||||
|
||||
|
||||
/* Methods for stack walking */
|
||||
struct NSJSJavaFrameWrapper * (*nsCapsNewNSJSJavaFrameWrapperCallback)(void) = NULL;
|
||||
PR_IMPLEMENT(void)
|
||||
setNewNSJSJavaFrameWrapperCallback(struct NSJSJavaFrameWrapper * (*fp)(void))
|
||||
{
|
||||
nsCapsNewNSJSJavaFrameWrapperCallback = fp;
|
||||
}
|
||||
|
||||
|
||||
void (*nsCapsFreeNSJSJavaFrameWrapperCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_IMPLEMENT(void)
|
||||
setFreeNSJSJavaFrameWrapperCallback(void (*fp)(struct NSJSJavaFrameWrapper *))
|
||||
{
|
||||
nsCapsFreeNSJSJavaFrameWrapperCallback = fp;
|
||||
}
|
||||
|
||||
|
||||
void (*nsCapsGetStartFrameCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_IMPLEMENT(void)
|
||||
setGetStartFrameCallback(void (*fp)(struct NSJSJavaFrameWrapper *))
|
||||
{
|
||||
nsCapsGetStartFrameCallback = fp;
|
||||
}
|
||||
|
||||
PRBool (*nsCapsIsEndOfFrameCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_IMPLEMENT(void)
|
||||
setIsEndOfFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *))
|
||||
{
|
||||
nsCapsIsEndOfFrameCallback = fp;
|
||||
}
|
||||
|
||||
|
||||
PRBool (*nsCapsIsValidFrameCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_IMPLEMENT(void)
|
||||
setIsValidFrameCallback(PRBool (*fp)(struct NSJSJavaFrameWrapper *))
|
||||
{
|
||||
nsCapsIsValidFrameCallback = fp;
|
||||
}
|
||||
|
||||
|
||||
void * (*nsCapsGetNextFrameCallback)(struct NSJSJavaFrameWrapper *, int *);
|
||||
PR_IMPLEMENT(void)
|
||||
setGetNextFrameCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, int *))
|
||||
{
|
||||
nsCapsGetNextFrameCallback = fp;
|
||||
}
|
||||
|
||||
|
||||
void * (*nsCapsGetPrincipalArrayCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_IMPLEMENT(void)
|
||||
setOJIGetPrincipalArrayCallback(void * (*fp)(struct NSJSJavaFrameWrapper *))
|
||||
{
|
||||
nsCapsGetPrincipalArrayCallback = fp;
|
||||
}
|
||||
|
||||
|
||||
void * (*nsCapsGetAnnotationCallback)(struct NSJSJavaFrameWrapper *);
|
||||
PR_IMPLEMENT(void)
|
||||
setOJIGetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *))
|
||||
{
|
||||
nsCapsGetAnnotationCallback = fp;
|
||||
}
|
||||
|
||||
|
||||
void * (*nsCapsSetAnnotationCallback)(struct NSJSJavaFrameWrapper *, void *);
|
||||
PR_IMPLEMENT(void)
|
||||
setOJISetAnnotationCallback(void * (*fp)(struct NSJSJavaFrameWrapper *, void *))
|
||||
{
|
||||
nsCapsSetAnnotationCallback = fp;
|
||||
}
|
||||
|
||||
PR_END_EXTERN_C
|
||||
190
mozilla/caps/src/nsLoadZig.c
Normal file
190
mozilla/caps/src/nsLoadZig.c
Normal file
@@ -0,0 +1,190 @@
|
||||
/* -*- 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 "zig.h"
|
||||
#include "nsZip.h"
|
||||
#include "nsLoadZig.h"
|
||||
#include "prmem.h"
|
||||
|
||||
#define MANIFEST_SUFFIX_STR ".mf"
|
||||
#define META_INF_STR "META-INF"
|
||||
#define MANIFEST_MF_STR "manifest" MANIFEST_SUFFIX_STR
|
||||
#define META_INF_STR_LEN 8
|
||||
#define MANIFEST_STR_LEN 11
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
#ifdef XP_UNIX
|
||||
#include <sys/param.h> /* for MAXPATHLEN */
|
||||
#endif
|
||||
|
||||
static PRInt32
|
||||
load_files(ns_zip_t* zip, ZIG* zig, char *fn_suffix,
|
||||
int (*callbackFnName) (int status, ZIG *zig, const char *metafile,
|
||||
char *pathname, char *errortext));
|
||||
static PRInt32
|
||||
loadSignatures(ns_zip_t *zip, ZIG *zig,
|
||||
int (*callbackFnName) (int status, ZIG *zig, const char *metafile,
|
||||
char *pathname, char *errortext));
|
||||
|
||||
|
||||
static PRInt32
|
||||
load_files(ns_zip_t* zip, ZIG* zig, char *fn_suffix,
|
||||
int (*callbackFnName) (int status, ZIG *zig, const char *metafile,
|
||||
char *pathname, char *errortext))
|
||||
{
|
||||
struct stat st;
|
||||
char HUGEP * classData;
|
||||
char HUGEP * fileData;
|
||||
char HUGEP * dataPtr;
|
||||
char* fn;
|
||||
int len;
|
||||
PRInt32 dataSize;
|
||||
PRInt32 noOfSigs;
|
||||
PRInt32 i;
|
||||
int ret;
|
||||
|
||||
dataSize = ns_zip_get_no_of_elements(zip, fn_suffix) * MAXPATHLEN;
|
||||
|
||||
/* No elements of the given suffix were found... */
|
||||
if (dataSize == 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((fileData = (char HUGEP * )PR_MALLOC(dataSize)) == 0) {
|
||||
return -1;
|
||||
}
|
||||
noOfSigs = ns_zip_list_files(zip, fn_suffix, fileData, dataSize);
|
||||
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
/*
|
||||
* Create a temporary buffer to hold each pathname from fileData.
|
||||
* This is necessary since the pathnames returned by ns_zip_list_files(...)
|
||||
* could cross segment boundaries
|
||||
*/
|
||||
if ((fn = (char *)malloc(MAXPATHLEN+1)) == NULL) {
|
||||
PR_Free(fileData);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
dataPtr = fileData;
|
||||
for (i = 0; i < noOfSigs; i++, len=strlen(fn), dataPtr += len +1) {
|
||||
#if !defined(XP_PC) || defined(_WIN32)
|
||||
fn = dataPtr;
|
||||
#else
|
||||
/*
|
||||
* Copy the pathname into the temp buffer. This insures that the
|
||||
* pathname will not cross a segment boundary!
|
||||
*/
|
||||
HUGE_STRNCPY(fn, dataPtr, MAXPATHLEN);
|
||||
fn[MAXPATHLEN] ='\0';
|
||||
#endif
|
||||
if (XP_STRNCASECMP (fn, META_INF_STR, META_INF_STR_LEN)) {
|
||||
continue;
|
||||
}
|
||||
if ((fn[META_INF_STR_LEN] != '/') && (fn[META_INF_STR_LEN] != '\\')) {
|
||||
continue;
|
||||
}
|
||||
if ((!XP_STRCASECMP(fn_suffix, MANIFEST_SUFFIX_STR)) &&
|
||||
(XP_STRNCASECMP(&fn[META_INF_STR_LEN+1], MANIFEST_MF_STR, MANIFEST_STR_LEN))) {
|
||||
continue;
|
||||
}
|
||||
if (!ns_zip_stat(zip, fn, &st)) {
|
||||
callbackFnName(-1, zig, fn, zip->fn, "ns_zip_stat failed");
|
||||
break;
|
||||
}
|
||||
if ((classData = (char HUGEP *)PR_MALLOC(st.st_size + 1)) == 0) {
|
||||
callbackFnName(-1, zig, fn, zip->fn, "malloc failed while setting up zig");
|
||||
break;
|
||||
}
|
||||
if (!ns_zip_get(zip, fn, classData, st.st_size)) {
|
||||
callbackFnName(-1, zig, fn, zip->fn, "ns_zip_get failed");
|
||||
PR_Free(classData);
|
||||
break;
|
||||
}
|
||||
classData[st.st_size] = '\0';
|
||||
if ((ret = SOB_parse_manifest(classData, st.st_size, fn, zip->fn,
|
||||
zig)) < 0) {
|
||||
PR_Free(classData);
|
||||
callbackFnName(ret, zig, fn, zip->fn, SOB_get_error(ret));
|
||||
break;
|
||||
}
|
||||
|
||||
PR_Free(classData);
|
||||
}
|
||||
|
||||
PR_Free(fileData);
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
/* Free the temporary buffer */
|
||||
free(fn);
|
||||
#endif
|
||||
|
||||
return (i < noOfSigs) ? -1 : noOfSigs;
|
||||
}
|
||||
|
||||
|
||||
static PRInt32
|
||||
loadSignatures(ns_zip_t* zip, ZIG *zig,
|
||||
int (*callbackFnName) (int status, ZIG *zig, const char *metafile,
|
||||
char *pathname, char *errortext))
|
||||
{
|
||||
PRInt32 noOfSigs;
|
||||
int ret_val;
|
||||
|
||||
if ((noOfSigs = load_files(zip, zig, ".sf", callbackFnName)) < 0)
|
||||
return noOfSigs;
|
||||
if ((ret_val = load_files(zip, zig, ".rsa", callbackFnName)) < 0)
|
||||
return ret_val;
|
||||
if ((ret_val = load_files(zip, zig, ".dsa", callbackFnName)) < 0)
|
||||
return ret_val;
|
||||
return noOfSigs;
|
||||
}
|
||||
|
||||
|
||||
PR_PUBLIC_API(void *)
|
||||
nsInitializeZig(ns_zip_t *zip,
|
||||
int (*callbackFnName) (int status, ZIG *zig,
|
||||
const char *metafile,
|
||||
char *pathname, char *errortext))
|
||||
{
|
||||
ZIG *zig;
|
||||
|
||||
zig = SOB_new();
|
||||
if (zig == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SOB_set_callback(ZIG_CB_SIGNAL, zig, callbackFnName);
|
||||
|
||||
if (load_files(zip, zig, MANIFEST_SUFFIX_STR, callbackFnName) <= 0) {
|
||||
/* If the number of manifest files loaded are zero
|
||||
* then this is an old style zip file. No need to
|
||||
* to allocate zig or verification of signatures.
|
||||
*/
|
||||
SOB_destroy(zig);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (loadSignatures(zip, zig, callbackFnName) < 0) {
|
||||
SOB_destroy(zig);
|
||||
return NULL;
|
||||
}
|
||||
return (void *)zig;
|
||||
}
|
||||
|
||||
PR_END_EXTERN_C
|
||||
544
mozilla/caps/src/nsPrincipal.cpp
Executable file
544
mozilla/caps/src/nsPrincipal.cpp
Executable file
@@ -0,0 +1,544 @@
|
||||
/* -*- 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 "nsPrincipal.h"
|
||||
#include "nsPrivilegeManager.h"
|
||||
|
||||
#include "structs.h"
|
||||
#include "xp_mem.h"
|
||||
#include "prmem.h"
|
||||
#include "zig.h"
|
||||
|
||||
/* XXX: Hack to determine the system principal */
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
#include "proto.h"
|
||||
#include "jpermission.h"
|
||||
#include "nsZip.h"
|
||||
#include "fe_proto.h"
|
||||
#include "nsLoadZig.h"
|
||||
|
||||
/* XXX: Create an error object with all arguments except errorText, instead pass error enum,
|
||||
This will be a method on caps consumer interface. */
|
||||
PR_PUBLIC_API(int)
|
||||
nsPrintZigError(int status, ZIG *zig, const char *metafile, char *pathname,
|
||||
char *errortext)
|
||||
{
|
||||
char* data;
|
||||
char* error_fmt = "# Error: %s (%d)\n#\tjar file: %s\n#\tpath: %s\n";
|
||||
char* zig_name = NULL;
|
||||
int len;
|
||||
|
||||
PR_ASSERT(errortext);
|
||||
|
||||
if (zig) {
|
||||
zig_name = SOB_get_url(zig);
|
||||
}
|
||||
|
||||
if (!zig_name) {
|
||||
zig_name = "unknown";
|
||||
}
|
||||
|
||||
if (!pathname) {
|
||||
pathname = "";
|
||||
}
|
||||
|
||||
/* Add 16 slop bytes */
|
||||
len = strlen(error_fmt) + strlen(zig_name) + strlen(pathname) +
|
||||
strlen(errortext) + 32;
|
||||
|
||||
if ((data = (char *)PR_MALLOC(len)) == 0) {
|
||||
return 0;
|
||||
}
|
||||
sprintf(data, error_fmt, errortext, status, zig_name, pathname);
|
||||
|
||||
MWContext* someRandomContext = XP_FindSomeContext();
|
||||
FE_Alert(someRandomContext, data);
|
||||
PR_DELETE(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
nsPrincipal *
|
||||
CreateSystemPrincipal(char* zip_file_name, char *pathname)
|
||||
{
|
||||
ZIG* zig;
|
||||
ZIG_Context * context;
|
||||
SOBITEM *item;
|
||||
FINGERZIG *fingPrint;
|
||||
int size=0;
|
||||
int slot=0;
|
||||
ns_zip_t *zip;
|
||||
nsPrincipal *sysPrin = NULL;
|
||||
|
||||
if (!pathname)
|
||||
return NULL;
|
||||
|
||||
zip = ns_zip_open(zip_file_name);
|
||||
if (zip == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
zig = (ZIG*)nsInitializeZig(zip, nsPrintZigError);
|
||||
if (zig == NULL) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* count the number of signers */
|
||||
if ((context = SOB_find(zig, pathname, ZIG_SIGN)) == NULL) {
|
||||
goto done;
|
||||
}
|
||||
while (SOB_find_next (context, &item) >= 0) {
|
||||
size++;
|
||||
}
|
||||
SOB_find_end(context);
|
||||
|
||||
if ((context = SOB_find(zig, pathname, ZIG_SIGN)) == NULL) {
|
||||
goto done;
|
||||
}
|
||||
while (SOB_find_next(context, &item) >= 0) {
|
||||
PR_ASSERT(slot < size);
|
||||
|
||||
/* Allocate the Cert's FP and put them in an array */
|
||||
fingPrint = (FINGERZIG *) item->data;
|
||||
sysPrin = new nsPrincipal(nsPrincipalType_CertKey,
|
||||
fingPrint->key,
|
||||
fingPrint->length);
|
||||
if (sysPrin != NULL)
|
||||
break;
|
||||
}
|
||||
SOB_find_end(context);
|
||||
|
||||
done:
|
||||
ns_zip_close(zip);
|
||||
return sysPrin;
|
||||
}
|
||||
|
||||
/* XXX: Move all PR_END_EXTERN_C to end of each file */
|
||||
PR_END_EXTERN_C
|
||||
|
||||
/* XXX: end of hack to determine the system principal */
|
||||
|
||||
|
||||
//
|
||||
// PUBLIC METHODS
|
||||
//
|
||||
|
||||
nsPrincipal::nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len)
|
||||
{
|
||||
init(type, key, key_len);
|
||||
}
|
||||
|
||||
nsPrincipal::nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, void *zigObject)
|
||||
{
|
||||
init(type, key, key_len);
|
||||
itsZig = zigObject;
|
||||
}
|
||||
|
||||
nsPrincipal::nsPrincipal(nsPrincipalType type, void * key, PRUint32 key_len, char *stringRep)
|
||||
{
|
||||
init(type, key, key_len);
|
||||
itsString = stringRep;
|
||||
}
|
||||
|
||||
nsPrincipal::~nsPrincipal(void)
|
||||
{
|
||||
#ifdef DEBUG_raman
|
||||
fprintf(stderr, "Deleting principal %s\n", itsKey);
|
||||
#endif /* DEBUG_raman */
|
||||
if (itsKey) {
|
||||
delete []itsKey;
|
||||
}
|
||||
if (itsCompanyName) {
|
||||
delete []itsCompanyName;
|
||||
}
|
||||
if (itsCertAuth) {
|
||||
delete []itsCertAuth;
|
||||
}
|
||||
if (itsSerialNo) {
|
||||
delete []itsSerialNo;
|
||||
}
|
||||
if (itsExpDate) {
|
||||
delete []itsExpDate;
|
||||
}
|
||||
if (itsAsciiFingerPrint) {
|
||||
delete []itsAsciiFingerPrint;
|
||||
}
|
||||
if (itsNickname) {
|
||||
delete []itsNickname;
|
||||
}
|
||||
}
|
||||
|
||||
PRBool nsPrincipal::equals(nsPrincipal *prin)
|
||||
{
|
||||
if (prin == this)
|
||||
return PR_TRUE;
|
||||
|
||||
if ((itsKeyLen != prin->itsKeyLen) ||
|
||||
(itsType != prin->itsType))
|
||||
return PR_FALSE;
|
||||
|
||||
if (0 == memcmp(itsKey, prin->itsKey, itsKeyLen))
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
char * nsPrincipal::getVendor(void)
|
||||
{
|
||||
switch(itsType) {
|
||||
case nsPrincipalType_Cert:
|
||||
case nsPrincipalType_CertKey:
|
||||
case nsPrincipalType_CertFingerPrint:
|
||||
return getNickname();
|
||||
|
||||
default:
|
||||
PR_ASSERT(PR_FALSE);
|
||||
return NULL;
|
||||
|
||||
case nsPrincipalType_CodebaseExact:
|
||||
return itsKey;
|
||||
}
|
||||
}
|
||||
|
||||
// XXX copyied from ns/lib/libjar/zig.h
|
||||
#ifndef ZIG_C_COMPANY
|
||||
#define ZIG_C_COMPANY 1
|
||||
#endif
|
||||
#ifndef ZIG_C_CA
|
||||
#define ZIG_C_CA 2
|
||||
#endif
|
||||
#ifndef ZIG_C_SERIAL
|
||||
#define ZIG_C_SERIAL 3
|
||||
#endif
|
||||
#ifndef ZIG_C_EXPIRES
|
||||
#define ZIG_C_EXPIRES 4
|
||||
#endif
|
||||
#ifndef ZIG_C_NICKNAME
|
||||
#define ZIG_C_NICKNAME 5
|
||||
#endif
|
||||
#ifndef ZIG_C_FP
|
||||
#define ZIG_C_FP 6
|
||||
#endif
|
||||
#ifndef ZIG_C_JAVA
|
||||
#define ZIG_C_JAVA 100
|
||||
#endif
|
||||
|
||||
char * nsPrincipal::getCompanyName(void)
|
||||
{
|
||||
if (itsCompanyName == NULL)
|
||||
itsCompanyName = getCertAttribute(ZIG_C_COMPANY);
|
||||
return itsCompanyName;
|
||||
}
|
||||
|
||||
char * nsPrincipal::getSecAuth(void)
|
||||
{
|
||||
if (itsCertAuth == NULL)
|
||||
itsCertAuth = getCertAttribute(ZIG_C_CA);
|
||||
return itsCertAuth;
|
||||
}
|
||||
|
||||
char * nsPrincipal::getSerialNo(void)
|
||||
{
|
||||
if (itsSerialNo == NULL)
|
||||
itsSerialNo = getCertAttribute(ZIG_C_SERIAL);
|
||||
return itsSerialNo;
|
||||
}
|
||||
|
||||
char * nsPrincipal::getExpDate(void)
|
||||
{
|
||||
if (itsExpDate == NULL)
|
||||
itsExpDate = getCertAttribute(ZIG_C_EXPIRES);
|
||||
return itsExpDate;
|
||||
}
|
||||
|
||||
char * nsPrincipal::getFingerPrint(void)
|
||||
{
|
||||
switch(itsType) {
|
||||
case nsPrincipalType_Cert:
|
||||
case nsPrincipalType_CertFingerPrint:
|
||||
case nsPrincipalType_CodebaseExact:
|
||||
case nsPrincipalType_CodebaseRegexp:
|
||||
return toString();
|
||||
|
||||
case nsPrincipalType_CertKey:
|
||||
if (itsAsciiFingerPrint == NULL)
|
||||
itsAsciiFingerPrint = getCertAttribute(ZIG_C_FP);
|
||||
return itsAsciiFingerPrint;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char * nsPrincipal::getNickname(void)
|
||||
{
|
||||
if ((nsPrincipalType_Cert == itsType) &&
|
||||
(this == nsPrivilegeManager::getUnsignedPrincipal())) {
|
||||
/* XXX: The following needs to i18n */
|
||||
return "Unsigned classes from local hard disk";
|
||||
}
|
||||
|
||||
if ((nsPrincipalType_Cert == itsType) &&
|
||||
(this == nsPrivilegeManager::getUnknownPrincipal())) {
|
||||
/* XXX: The following needs to i18n */
|
||||
return "Classes for whom we don't the principal";
|
||||
}
|
||||
|
||||
if (nsPrincipalType_CertKey != itsType)
|
||||
return itsKey;
|
||||
|
||||
if (itsNickname == NULL)
|
||||
itsNickname = getCertAttribute(ZIG_C_NICKNAME);
|
||||
return itsNickname;
|
||||
}
|
||||
|
||||
nsPrincipalType
|
||||
nsPrincipal::getType()
|
||||
{
|
||||
return itsType;
|
||||
}
|
||||
|
||||
char *
|
||||
nsPrincipal::getKey()
|
||||
{
|
||||
return itsKey;
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsPrincipal::getKeyLength()
|
||||
{
|
||||
return itsKeyLen;
|
||||
}
|
||||
|
||||
PRInt32 nsPrincipal::hashCode(void)
|
||||
{
|
||||
return itsHashCode;
|
||||
}
|
||||
|
||||
PRBool nsPrincipal::isCodebase(void)
|
||||
{
|
||||
if (itsType == nsPrincipalType_CodebaseExact)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrincipal::isCodebaseRegexp(void)
|
||||
{
|
||||
/* We don't support regular expressions yet */
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrincipal::isCodebaseExact(void)
|
||||
{
|
||||
if (itsType == nsPrincipalType_CodebaseExact)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsPrincipal::isSecurePrincipal(void)
|
||||
{
|
||||
if (this == nsPrivilegeManager::getUnknownPrincipal()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (!isCodebase())
|
||||
return PR_TRUE;
|
||||
|
||||
if ((memcmp("https:", itsKey, strlen("https:"))) ||
|
||||
(memcmp("file:", itsKey, strlen("file:"))))
|
||||
return PR_TRUE;
|
||||
|
||||
/* signed.applets.codebase_principal_support */
|
||||
if ((memcmp("http:", itsKey, strlen("http:"))) &&
|
||||
(!CMGetBoolPref("signed.applets.codebase_principal_support")))
|
||||
return PR_TRUE;
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsPrincipal::isCert(void)
|
||||
{
|
||||
if (itsType == nsPrincipalType_Cert)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsPrincipal::isCertFingerprint(void)
|
||||
{
|
||||
if ((itsType == nsPrincipalType_CertFingerPrint) ||
|
||||
(itsType == nsPrincipalType_CertKey))
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
char * nsPrincipal::toString(void)
|
||||
{
|
||||
char * str;
|
||||
|
||||
switch(itsType) {
|
||||
case nsPrincipalType_CertKey:
|
||||
str = getNickname();
|
||||
break;
|
||||
|
||||
case nsPrincipalType_Cert:
|
||||
case nsPrincipalType_CertFingerPrint:
|
||||
case nsPrincipalType_CodebaseExact:
|
||||
if (itsString != NULL)
|
||||
str = itsString;
|
||||
else
|
||||
str = itsKey;
|
||||
break;
|
||||
default:
|
||||
str = "Unknown Principal";
|
||||
break;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
char * nsPrincipal::toVerboseString(void)
|
||||
{
|
||||
return toString();
|
||||
}
|
||||
|
||||
char * nsPrincipal::savePrincipalPermanently(void)
|
||||
{
|
||||
if ((isCodebase()) || (itsZig == NULL))
|
||||
return NULL;
|
||||
|
||||
char * ret_value = saveCert();
|
||||
|
||||
// Don't hold the reference to itsZig, once we have saved the
|
||||
// principal's certificate permanently. Deleting this reference would
|
||||
// allow us to garbage collect ZIG object and thus free up memory.
|
||||
itsZig = NULL;
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// PRIVATE METHODS
|
||||
//
|
||||
|
||||
void nsPrincipal::init(nsPrincipalType type, void * key, PRUint32 key_len)
|
||||
{
|
||||
switch(type) {
|
||||
case nsPrincipalType_Cert:
|
||||
case nsPrincipalType_CertKey:
|
||||
case nsPrincipalType_CertFingerPrint:
|
||||
case nsPrincipalType_CodebaseExact:
|
||||
break;
|
||||
|
||||
default:
|
||||
type = nsPrincipalType_Unknown;
|
||||
}
|
||||
|
||||
itsType=type;
|
||||
itsKey = new char[key_len+1];
|
||||
memcpy(itsKey, key, key_len);
|
||||
itsKey[key_len] = '\0';
|
||||
#ifdef DEBUG_raman
|
||||
fprintf(stderr, "Creating principal %d, %s\n", type, itsKey);
|
||||
#endif /* DEBUG_raman */
|
||||
itsKeyLen = key_len;
|
||||
itsHashCode = computeHashCode();
|
||||
itsZig = NULL;
|
||||
itsString = NULL;
|
||||
itsCompanyName = NULL;
|
||||
itsCertAuth = NULL;
|
||||
itsSerialNo = NULL;
|
||||
itsExpDate = NULL;
|
||||
itsAsciiFingerPrint = NULL;
|
||||
itsNickname = NULL;
|
||||
}
|
||||
|
||||
PRInt32 nsPrincipal::computeHashCode(void * key, PRUint32 keyLen)
|
||||
{
|
||||
char *cptr = (char *)key;
|
||||
//
|
||||
// Same basic hash algorithm as used in java.lang.String --
|
||||
// no security relevance, only a performance optimization.
|
||||
// The security comes from the equals() method.
|
||||
//
|
||||
int hashCode=0;
|
||||
for (PRUint32 i = 0; i < keyLen; i++)
|
||||
hashCode = hashCode * 37 + cptr[i];
|
||||
return hashCode;
|
||||
}
|
||||
|
||||
PRInt32 nsPrincipal::computeHashCode(void)
|
||||
{
|
||||
switch(itsType) {
|
||||
case nsPrincipalType_Cert:
|
||||
case nsPrincipalType_CertFingerPrint:
|
||||
case nsPrincipalType_CertKey:
|
||||
case nsPrincipalType_CodebaseExact:
|
||||
return computeHashCode(itsKey, itsKeyLen);
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
char * nsPrincipal::saveCert(void)
|
||||
{
|
||||
int result;
|
||||
if ((!itsZig)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = SOB_stash_cert((ZIG *)itsZig, itsKeyLen, itsKey);
|
||||
if (result < 0) {
|
||||
return SOB_get_error(result);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* The caller is responsible for free'ing the memory */
|
||||
char *
|
||||
nsPrincipal::getCertAttribute(int attrib)
|
||||
{
|
||||
void *result;
|
||||
unsigned long length;
|
||||
char *attrStr;
|
||||
ZIG *zig = NULL;
|
||||
|
||||
if (itsZig != NULL) {
|
||||
zig = (ZIG *)itsZig;
|
||||
}
|
||||
|
||||
if (SOB_cert_attribute(attrib, zig,
|
||||
itsKeyLen, itsKey,
|
||||
&result, &length) < 0) {
|
||||
/* We need to print the message "invalid certificate fingerprint" */
|
||||
return NULL;
|
||||
}
|
||||
attrStr = new char[length+1];
|
||||
memcpy(attrStr, result, length);
|
||||
attrStr[length] = '\0';
|
||||
/* Should be SOB_FREE(result); */
|
||||
XP_FREE(result);
|
||||
return attrStr;
|
||||
}
|
||||
|
||||
|
||||
229
mozilla/caps/src/nsPrivilege.cpp
Executable file
229
mozilla/caps/src/nsPrivilege.cpp
Executable file
@@ -0,0 +1,229 @@
|
||||
/* -*- 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 "nsPrivilege.h"
|
||||
#include "xp.h"
|
||||
|
||||
static nsPrivilege *thePrivilegeCache[nsPermissionState_NumberOfPermissions][nsDurationState_NumberOfDurations];
|
||||
|
||||
|
||||
//
|
||||
// PUBLIC METHODS
|
||||
//
|
||||
|
||||
nsPrivilege::nsPrivilege(nsPermissionState perm, nsDurationState duration)
|
||||
{
|
||||
itsPerm=perm;
|
||||
itsDuration=duration;
|
||||
itsString = NULL;
|
||||
}
|
||||
|
||||
nsPrivilege::~nsPrivilege(void)
|
||||
{
|
||||
if (itsString)
|
||||
delete []itsString;
|
||||
}
|
||||
|
||||
nsPrivilege * nsPrivilege::findPrivilege(nsPermissionState permission, nsDurationState duration)
|
||||
{
|
||||
return thePrivilegeCache[permission][duration];
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::samePermission(nsPrivilege *p)
|
||||
{
|
||||
if (p->itsPerm == itsPerm)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::samePermission(nsPermissionState perm)
|
||||
{
|
||||
if (itsPerm == perm)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::sameDuration(nsPrivilege *p)
|
||||
{
|
||||
if (p->itsDuration == itsDuration)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::sameDuration(nsDurationState duration)
|
||||
{
|
||||
if (itsDuration == duration)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::isAllowed(void)
|
||||
{
|
||||
if (itsPerm == nsPermissionState_Allowed)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::isAllowedForever(void)
|
||||
{
|
||||
if ((itsPerm == nsPermissionState_Allowed) &&
|
||||
(itsDuration == nsDurationState_Forever))
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::isForbidden(void)
|
||||
{
|
||||
if (itsPerm == nsPermissionState_Forbidden)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::isForbiddenForever(void)
|
||||
{
|
||||
if ((itsPerm == nsPermissionState_Forbidden) &&
|
||||
(itsDuration == nsDurationState_Forever))
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::isBlank(void)
|
||||
{
|
||||
if (itsPerm == nsPermissionState_Blank)
|
||||
return PR_TRUE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsPermissionState nsPrivilege::getPermission(void)
|
||||
{
|
||||
return itsPerm;
|
||||
}
|
||||
|
||||
nsDurationState nsPrivilege::getDuration(void)
|
||||
{
|
||||
return itsDuration;
|
||||
}
|
||||
|
||||
/* The following function is used to restore the privilege from persistent store.
|
||||
* This does the reverse of toString method.
|
||||
*/
|
||||
nsPrivilege * nsPrivilege::findPrivilege(char *privStr)
|
||||
{
|
||||
nsPermissionState permission;
|
||||
nsDurationState duration;
|
||||
if (XP_STRCMP(privStr, "allowed in scope") == 0) {
|
||||
permission = nsPermissionState_Allowed;
|
||||
duration = nsDurationState_Scope;
|
||||
} else if (XP_STRCMP(privStr, "allowed in session") == 0) {
|
||||
permission = nsPermissionState_Allowed;
|
||||
duration = nsDurationState_Session;
|
||||
} else if (XP_STRCMP(privStr, "allowed forever") == 0) {
|
||||
permission = nsPermissionState_Allowed;
|
||||
duration = nsDurationState_Forever;
|
||||
} else if (XP_STRCMP(privStr, "forbidden forever") == 0) {
|
||||
permission = nsPermissionState_Forbidden;
|
||||
duration = nsDurationState_Forever;
|
||||
} else if (XP_STRCMP(privStr, "forbidden in session") == 0) {
|
||||
permission = nsPermissionState_Forbidden;
|
||||
duration = nsDurationState_Session;
|
||||
} else if (XP_STRCMP(privStr, "forbidden in scope") == 0) {
|
||||
permission = nsPermissionState_Forbidden;
|
||||
duration = nsDurationState_Scope;
|
||||
} else if (XP_STRCMP(privStr, "blank forever") == 0) {
|
||||
permission = nsPermissionState_Blank;
|
||||
duration = nsDurationState_Forever;
|
||||
} else if (XP_STRCMP(privStr, "blank in session") == 0) {
|
||||
permission = nsPermissionState_Blank;
|
||||
duration = nsDurationState_Session;
|
||||
} else if (XP_STRCMP(privStr, "blank in scope") == 0) {
|
||||
permission = nsPermissionState_Blank;
|
||||
duration = nsDurationState_Scope;
|
||||
} else {
|
||||
permission = nsPermissionState_Blank;
|
||||
duration = nsDurationState_Scope;
|
||||
}
|
||||
return findPrivilege(permission, duration);
|
||||
}
|
||||
|
||||
|
||||
char * nsPrivilege::toString(void)
|
||||
{
|
||||
char *permStr=NULL;
|
||||
char *durStr=NULL;
|
||||
if (itsString != NULL)
|
||||
return itsString;
|
||||
|
||||
switch(itsPerm) {
|
||||
case nsPermissionState_Allowed:
|
||||
permStr = "allowed";
|
||||
break;
|
||||
case nsPermissionState_Forbidden:
|
||||
permStr = "forbidden";
|
||||
break;
|
||||
case nsPermissionState_Blank:
|
||||
permStr = "blank";
|
||||
break;
|
||||
default:
|
||||
PR_ASSERT(FALSE);
|
||||
permStr = "blank";
|
||||
break;
|
||||
}
|
||||
|
||||
switch(itsDuration) {
|
||||
case nsDurationState_Scope:
|
||||
durStr = " in scope";
|
||||
break;
|
||||
case nsDurationState_Session:
|
||||
durStr = " in session";
|
||||
break;
|
||||
case nsDurationState_Forever:
|
||||
durStr = " forever";
|
||||
break;
|
||||
default:
|
||||
PR_ASSERT(FALSE);
|
||||
permStr = "blank";
|
||||
break;
|
||||
}
|
||||
|
||||
itsString = new char[strlen(permStr) + strlen(durStr) + 1];
|
||||
XP_STRCPY(itsString, permStr);
|
||||
XP_STRCAT(itsString, durStr);
|
||||
return itsString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// PRIVATE METHODS
|
||||
//
|
||||
|
||||
PRBool nsPrivilegeInitialize(void)
|
||||
{
|
||||
nsPermissionState perm;
|
||||
nsDurationState duration;
|
||||
for (int i = 0; i < nsPermissionState_NumberOfPermissions; i++)
|
||||
for(int j = 0; j < nsDurationState_NumberOfDurations; j++) {
|
||||
/* XXX: hack fix it */
|
||||
perm = (nsPermissionState)i;
|
||||
duration = (nsDurationState)j;
|
||||
thePrivilegeCache[i][j] = new nsPrivilege(perm, duration);
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool nsPrivilege::theInited = nsPrivilegeInitialize();
|
||||
1446
mozilla/caps/src/nsPrivilegeManager.cpp
Executable file
1446
mozilla/caps/src/nsPrivilegeManager.cpp
Executable file
File diff suppressed because it is too large
Load Diff
118
mozilla/caps/src/nsPrivilegeTable.cpp
Executable file
118
mozilla/caps/src/nsPrivilegeTable.cpp
Executable file
@@ -0,0 +1,118 @@
|
||||
/* -*- 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 "nsPrivilegeTable.h"
|
||||
#include "nsPrivilegeManager.h"
|
||||
|
||||
//
|
||||
// PUBLIC METHODS
|
||||
//
|
||||
|
||||
nsPrivilegeTable::nsPrivilegeTable(void)
|
||||
{
|
||||
itsTable = NULL;
|
||||
}
|
||||
|
||||
nsPrivilegeTable::~nsPrivilegeTable(void)
|
||||
{
|
||||
/* XXX: We need to incr and decr objects that we put into this hashtable.
|
||||
* There is a big memory leak.
|
||||
*
|
||||
* We need to delete all the entries in the privilege Table
|
||||
*/
|
||||
if (itsTable)
|
||||
delete itsTable;
|
||||
itsTable = NULL;
|
||||
}
|
||||
|
||||
PRInt32 nsPrivilegeTable::size(void)
|
||||
{
|
||||
if (itsTable != NULL)
|
||||
return itsTable->Count();
|
||||
else return 0;
|
||||
}
|
||||
|
||||
PRBool nsPrivilegeTable::isEmpty(void)
|
||||
{
|
||||
if (itsTable == NULL) return PR_TRUE;
|
||||
else return ((itsTable->Count() > 0) ? PR_FALSE : PR_TRUE);
|
||||
}
|
||||
|
||||
nsPrivilege * nsPrivilegeTable::get(nsTarget *target)
|
||||
{
|
||||
if (itsTable == NULL) {
|
||||
return nsPrivilege::findPrivilege(nsPermissionState_Blank,
|
||||
nsDurationState_Session);
|
||||
}
|
||||
|
||||
TargetKey targKey(target);
|
||||
|
||||
nsPrivilege *priv = (nsPrivilege *) itsTable->Get(&targKey);
|
||||
if (priv == NULL) {
|
||||
return nsPrivilege::findPrivilege(nsPermissionState_Blank,
|
||||
nsDurationState_Session);
|
||||
}
|
||||
return priv;
|
||||
}
|
||||
|
||||
nsPrivilege * nsPrivilegeTable::put(nsTarget *target, nsPrivilege *priv)
|
||||
{
|
||||
nsCaps_lock();
|
||||
if (itsTable == NULL) itsTable = new nsHashtable();
|
||||
|
||||
TargetKey targKey(target);
|
||||
nsPrivilege *priv2 = (nsPrivilege *)itsTable->Put(&targKey, (void *)priv);
|
||||
nsCaps_unlock();
|
||||
return priv2;
|
||||
}
|
||||
|
||||
nsPrivilege * nsPrivilegeTable::remove(nsTarget *target)
|
||||
{
|
||||
if (itsTable == NULL) return NULL;
|
||||
TargetKey targKey(target);
|
||||
nsCaps_lock();
|
||||
nsPrivilege *priv = (nsPrivilege *)itsTable->Remove(&targKey);
|
||||
nsCaps_unlock();
|
||||
return priv;
|
||||
}
|
||||
|
||||
nsPrivilegeTable * nsPrivilegeTable::clone(void)
|
||||
{
|
||||
nsCaps_lock();
|
||||
nsPrivilegeTable *newbie = new nsPrivilegeTable();
|
||||
if (itsTable != NULL) {
|
||||
newbie->itsTable = itsTable->Clone();
|
||||
}
|
||||
nsCaps_unlock();
|
||||
return newbie;
|
||||
}
|
||||
|
||||
void nsPrivilegeTable::clear(void)
|
||||
{
|
||||
/* XXX: free the entries also */
|
||||
nsCaps_lock();
|
||||
delete itsTable;
|
||||
itsTable = NULL;
|
||||
nsCaps_unlock();
|
||||
}
|
||||
|
||||
void nsPrivilegeTable::Enumerate(nsHashtableEnumFunc aEnumFunc) {
|
||||
if (itsTable != NULL) {
|
||||
itsTable->Enumerate(aEnumFunc);
|
||||
}
|
||||
}
|
||||
32
mozilla/caps/src/nsSystemPrivilegeTable.cpp
Executable file
32
mozilla/caps/src/nsSystemPrivilegeTable.cpp
Executable file
@@ -0,0 +1,32 @@
|
||||
/* -*- 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 "nsSystemPrivilegeTable.h"
|
||||
|
||||
//
|
||||
// PUBLIC METHODS
|
||||
//
|
||||
|
||||
nsSystemPrivilegeTable::nsSystemPrivilegeTable(void) : nsPrivilegeTable()
|
||||
{
|
||||
}
|
||||
|
||||
nsPrivilege * nsSystemPrivilegeTable::get(nsTarget *a)
|
||||
{
|
||||
return nsPrivilege::findPrivilege(nsPermissionState_Allowed, nsDurationState_Forever);
|
||||
}
|
||||
1508
mozilla/caps/src/nsTarget.cpp
Executable file
1508
mozilla/caps/src/nsTarget.cpp
Executable file
File diff suppressed because it is too large
Load Diff
86
mozilla/caps/src/nsUserDialogHelper.cpp
Normal file
86
mozilla/caps/src/nsUserDialogHelper.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
/* -*- 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 /* __cplusplus */
|
||||
|
||||
#include "nsUserDialogHelper.h"
|
||||
#include "xp.h"
|
||||
#include "xpgetstr.h"
|
||||
#include "prprf.h"
|
||||
|
||||
extern int CAPS_TARGET_RISK_STR_LOW;
|
||||
extern int CAPS_TARGET_RISK_STR_MEDIUM;
|
||||
extern int CAPS_TARGET_RISK_STR_HIGH;
|
||||
extern int CAPS_TARGET_HELP_URL;
|
||||
|
||||
//
|
||||
// resources for user targets
|
||||
//
|
||||
char * JavaSecUI_targetRiskStr(int risk)
|
||||
{
|
||||
char * str;
|
||||
if (risk <= nsRiskType_LowRisk) {
|
||||
str = XP_GetString(CAPS_TARGET_RISK_STR_LOW);
|
||||
} else if (risk <= nsRiskType_MediumRisk) {
|
||||
str = XP_GetString(CAPS_TARGET_RISK_STR_MEDIUM);
|
||||
} else {
|
||||
str = XP_GetString(CAPS_TARGET_RISK_STR_HIGH);
|
||||
}
|
||||
return XP_STRDUP(str);
|
||||
}
|
||||
|
||||
int JavaSecUI_targetRiskLow(void)
|
||||
{
|
||||
return nsRiskType_LowRisk;
|
||||
}
|
||||
|
||||
int JavaSecUI_targetRiskMedium(void)
|
||||
{
|
||||
return nsRiskType_MediumRisk;
|
||||
}
|
||||
|
||||
int JavaSecUI_targetRiskHigh(void)
|
||||
{
|
||||
return nsRiskType_HighRisk;
|
||||
}
|
||||
|
||||
char * JavaSecUI_getHelpURL(int id)
|
||||
{
|
||||
char * tag = XP_GetString(id);
|
||||
char * java_sec_help_url = XP_GetString(CAPS_TARGET_HELP_URL);
|
||||
PR_ASSERT(tag != NULL);
|
||||
PR_ASSERT(java_sec_help_url != NULL);
|
||||
|
||||
char *helpURL = new char[strlen(java_sec_help_url) + strlen(tag) + 1];
|
||||
XP_STRCPY(helpURL, java_sec_help_url);
|
||||
XP_STRCAT(helpURL, tag);
|
||||
return helpURL;
|
||||
}
|
||||
|
||||
char * JavaSecUI_getString(int id)
|
||||
{
|
||||
char *str = XP_GetString(id);
|
||||
PR_ASSERT(str != NULL);
|
||||
return XP_STRDUP(str);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
92
mozilla/caps/src/nsUserTarget.cpp
Executable file
92
mozilla/caps/src/nsUserTarget.cpp
Executable file
@@ -0,0 +1,92 @@
|
||||
/* -*- 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 "xp.h"
|
||||
#include "nsUserTarget.h"
|
||||
#include "nsPrivilegeManager.h"
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "jpermission.h"
|
||||
|
||||
static PRBool displayUI=PR_FALSE;
|
||||
|
||||
static nsPermState
|
||||
displayPermissionDialog(char *prinStr, char *targetStr, char *riskStr, PRBool isCert)
|
||||
{
|
||||
return nsJSJavaDisplayDialog(prinStr, targetStr, riskStr, isCert);
|
||||
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
//
|
||||
// PUBLIC METHODS
|
||||
//
|
||||
|
||||
nsUserTarget::~nsUserTarget(void)
|
||||
{
|
||||
}
|
||||
|
||||
#define OPTION "<option>"
|
||||
nsPrivilege * nsUserTarget::enablePrivilege(nsPrincipal *prin, void *data)
|
||||
{
|
||||
char *riskStr = getRisk();
|
||||
char *desc = getDescription();
|
||||
char *prinStr = prin->toString();
|
||||
char *targetStr = new char[strlen(OPTION) + strlen(desc) + 1];
|
||||
XP_STRCPY(targetStr, OPTION);
|
||||
XP_STRCAT(targetStr, desc);
|
||||
PRBool isCert = (prin->isCodebase()) ? PR_FALSE : PR_TRUE;
|
||||
nsPermState permState = nsPermState_AllowedSession;
|
||||
|
||||
/* set displayUI to TRUE, to enable UI */
|
||||
if (displayUI) {
|
||||
nsCaps_lock();
|
||||
permState = displayPermissionDialog(prinStr, targetStr, riskStr, isCert);
|
||||
nsCaps_unlock();
|
||||
}
|
||||
|
||||
nsPermissionState permVal;
|
||||
nsDurationState durationVal;
|
||||
|
||||
if (permState == nsPermState_AllowedForever) {
|
||||
permVal = nsPermissionState_Allowed;
|
||||
durationVal = nsDurationState_Forever;
|
||||
} else if (permState == nsPermState_AllowedSession) {
|
||||
permVal = nsPermissionState_Allowed;
|
||||
durationVal = nsDurationState_Session;
|
||||
} else if (permState == nsPermState_ForbiddenForever) {
|
||||
permVal = nsPermissionState_Forbidden;
|
||||
durationVal = nsDurationState_Forever;
|
||||
} else {
|
||||
permVal = nsPermissionState_Blank;
|
||||
durationVal = nsDurationState_Session;
|
||||
}
|
||||
delete []targetStr;
|
||||
return nsPrivilege::findPrivilege(permVal, durationVal);
|
||||
}
|
||||
|
||||
|
||||
52
mozilla/caps/src/nsZig.cpp
Executable file
52
mozilla/caps/src/nsZig.cpp
Executable file
@@ -0,0 +1,52 @@
|
||||
/* -*- 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 "nsZig.h"
|
||||
#include "zig.h"
|
||||
|
||||
//
|
||||
// PUBLIC METHODS
|
||||
//
|
||||
|
||||
nsZig::nsZig(void * zig)
|
||||
{
|
||||
itsNativeZig = zig;
|
||||
}
|
||||
|
||||
void nsZig::destroyZignature(void * nativeZig)
|
||||
{
|
||||
SOB_destroy((ZIG *)nativeZig);
|
||||
}
|
||||
|
||||
nsZig::~nsZig(void)
|
||||
{
|
||||
if (itsNativeZig != NULL) {
|
||||
nsZig::destroyZignature(itsNativeZig);
|
||||
}
|
||||
itsNativeZig = NULL;
|
||||
}
|
||||
|
||||
void * nsZig::GetZig(void)
|
||||
{
|
||||
return itsNativeZig;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// PRIVATE METHODS
|
||||
//
|
||||
954
mozilla/caps/src/nsZip.c
Normal file
954
mozilla/caps/src/nsZip.c
Normal file
@@ -0,0 +1,954 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Routines for reading classes from a ZIP/JAR file in the class path.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#if !(XP_MAC)
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#include <types.h>
|
||||
//#include "NSstring.h"
|
||||
#endif
|
||||
#if !(XP_MAC)
|
||||
#include <sys/stat.h>
|
||||
#else
|
||||
#include <stat.h>
|
||||
#endif
|
||||
|
||||
#include "prlog.h"
|
||||
#include "prio.h"
|
||||
#include "prdtoa.h"
|
||||
#ifdef XP_MAC
|
||||
#include "prpriv.h"
|
||||
#else
|
||||
#include "private/prpriv.h"
|
||||
#endif
|
||||
#include "prtypes.h"
|
||||
#include "nsZip.h"
|
||||
#include "zlib.h"
|
||||
#include "xp.h" /* for XP_STRDUP */
|
||||
#include "xp_qsort.h"
|
||||
#include "prmem.h"
|
||||
|
||||
|
||||
#ifdef NSPR20
|
||||
#include "prerror.h"
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Header signatures
|
||||
*/
|
||||
#define SIGSIZ 4
|
||||
#define LOCSIG "PK\003\004"
|
||||
#define CENSIG "PK\001\002"
|
||||
#define ENDSIG "PK\005\006"
|
||||
|
||||
/*
|
||||
* Header sizes including signatures
|
||||
*/
|
||||
#define LOCHDRSIZ 30
|
||||
#define CENHDRSIZ 46
|
||||
#define ENDHDRSIZ 22
|
||||
|
||||
/*
|
||||
* Header field access macros
|
||||
*/
|
||||
#define CH(b, n) ((unsigned short)(((unsigned char HUGEP *)(b))[n]))
|
||||
#define SH(b, n) ((unsigned long)(CH(b, n) | (CH(b, n+1) << 8)))
|
||||
#define LG(b, n) (SH(b, n) | (SH(b, n+2) << 16))
|
||||
|
||||
/*
|
||||
* Macros for getting local file header (LOC) fields
|
||||
*/
|
||||
#define LOCFLG(b) SH(b, 6) /* encrypt flags */
|
||||
#define LOCHOW(b) SH(b, 8) /* compression method */
|
||||
#define LOCCRC(b) LG(b, 14) /* uncompressed file crc-32 value */
|
||||
#define LOCSIZ(b) LG(b, 18) /* compressed size */
|
||||
#define LOCLEN(b) LG(b, 22) /* uncompressed size */
|
||||
#define LOCNAM(b) SH(b, 26) /* filename size */
|
||||
#define LOCEXT(b) SH(b, 28) /* extra field size */
|
||||
|
||||
/*
|
||||
* Macros for getting central directory header (CEN) fields
|
||||
*/
|
||||
#define CENHOW(b) SH(b, 10) /* compression method */
|
||||
#define CENTIM(b) LG(b, 12) /* file modification time (DOS format) */
|
||||
#define CENSIZ(b) LG(b, 20) /* compressed size */
|
||||
#define CENLEN(b) LG(b, 24) /* uncompressed size */
|
||||
#define CENNAM(b) SH(b, 28) /* length of filename */
|
||||
#define CENEXT(b) SH(b, 30) /* length of extra field */
|
||||
#define CENCOM(b) SH(b, 32) /* file comment length */
|
||||
#define CENOFF(b) LG(b, 42) /* offset of local header */
|
||||
|
||||
/*
|
||||
* Macros for getting end of central directory header (END) fields
|
||||
*/
|
||||
#define ENDSUB(b) SH(b, 8) /* number of entries on this disk */
|
||||
#define ENDTOT(b) SH(b, 10) /* total number of entries */
|
||||
#define ENDSIZ(b) LG(b, 12) /* central directory size */
|
||||
#define ENDOFF(b) LG(b, 16) /* central directory offset */
|
||||
#define ENDCOM(b) SH(b, 20) /* size of zip file comment */
|
||||
|
||||
|
||||
/*
|
||||
* Supported compression types
|
||||
*/
|
||||
#define STORED 0
|
||||
#define DEFLATED 8
|
||||
|
||||
PR_BEGIN_EXTERN_C
|
||||
|
||||
|
||||
#ifdef NETSCAPE
|
||||
|
||||
#ifdef XP_PC
|
||||
#define strncasecmp(s1, s2, len) strnicmp((s1),(s2),(len))
|
||||
#endif /* XP_PC */
|
||||
|
||||
/*
|
||||
* The following 2 macros are necessary for Win16 since they operate
|
||||
* on huge memory (which is unsupported by the runtime library)...
|
||||
*/
|
||||
#if !defined(XP_PC) || defined(_WIN32)
|
||||
#define NS_ZIP_STRNCMP(buf, key, len) strncmp((buf),(key),(len))
|
||||
#define NS_ZIP_STRNCPY(dst, src, len) strncpy((dst),(src),(len))
|
||||
#define NS_ZIP_STRCPY(dst, src) strcpy((dst), (src))
|
||||
|
||||
#else /* WIN16 only */
|
||||
static int NS_ZIP_STRNCMP(char HUGEP *buf, char *key, int len)
|
||||
{
|
||||
while(len--) {
|
||||
char c1, c2;
|
||||
|
||||
c1 = *buf++;
|
||||
c2 = *key++;
|
||||
if (c1 != c2) {
|
||||
return (c1 < c2) ? -1 : 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char HUGEP *NS_ZIP_STRCPY(char HUGEP *dst, char * src)
|
||||
{
|
||||
char HUGEP *ret = dst;
|
||||
|
||||
if (src && dst) {
|
||||
while(*src) {
|
||||
*dst++ = *src++;
|
||||
}
|
||||
*dst = *src;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define NS_ZIP_STRNCPY(dst, src, len) hmemcpy((dst),(src),(len))
|
||||
|
||||
#endif /* XP_PC || _WIN32 */
|
||||
#endif /* NETSCAPE */
|
||||
|
||||
static void
|
||||
ns_zip_errmsg(const char *msg)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
PRFileDesc* prfd = PR_GetSpecialFD(2);
|
||||
PR_Write(prfd, msg, strlen(msg));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
ns_ziperr(ns_zip_t *zip, const char *msg)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
ns_zip_errmsg("Zip Error: ");
|
||||
ns_zip_errmsg(zip->fn);
|
||||
ns_zip_errmsg(": ");
|
||||
ns_zip_errmsg(msg);
|
||||
ns_zip_errmsg("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
/*#define ZTRACE*/
|
||||
#ifdef ZTRACE
|
||||
FILE *ns_zlog = NULL;
|
||||
#endif
|
||||
|
||||
/* single open fd cache
|
||||
* this relies on the fact that none of the public routines in here
|
||||
* depend on seek state between operations */
|
||||
|
||||
static ns_zip_t *ns_zip_cache = NULL;
|
||||
static PRMonitor *ns_zlock = NULL;
|
||||
|
||||
static PRBool nsEnsureZip(ns_zip_t *zip)
|
||||
{
|
||||
if(zip != ns_zip_cache) {
|
||||
PRFileDesc *fd;
|
||||
if(ns_zip_cache) {
|
||||
PR_Close(ns_zip_cache->fd);
|
||||
ns_zip_cache->fd = 0;
|
||||
#ifdef ZTRACE
|
||||
if (ns_zlog) fprintf(ns_zlog, "close %s\n", ns_zip_cache->fn);
|
||||
#endif
|
||||
}
|
||||
#ifdef ZTRACE
|
||||
if (ns_zlog) fprintf(ns_zlog,"open %s\n", zip->fn);
|
||||
#endif
|
||||
fd = PR_Open(zip->fn, PR_RDONLY, 0);
|
||||
if (FD_IS_ERROR(fd)) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16 dlls
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
ns_zip_cache = NULL;
|
||||
return PR_FALSE;
|
||||
}
|
||||
zip->fd = fd;
|
||||
ns_zip_cache = zip;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
/*
|
||||
* Read exactly 'len' bytes of data into 'buf'. Return PR_TRUE if all bytes
|
||||
* could be read, otherwise return PR_FALSE.
|
||||
*/
|
||||
static PRBool
|
||||
nsZipReadFully(PRFileDesc *fd, void *buf, PRInt32 len)
|
||||
{
|
||||
char HUGEP *bp = (char HUGEP *)buf;
|
||||
PRInt32 segBlock;
|
||||
|
||||
PR_ASSERT( !IsBadHugeWritePtr((void HUGEP *)buf, len) );
|
||||
|
||||
do {
|
||||
segBlock = (len >= 0x10000L) ? (0x10000L - OFFSETOF(bp)) : len;
|
||||
len -= segBlock;
|
||||
|
||||
/*
|
||||
* Read a segment (64K) into the buffer...
|
||||
*/
|
||||
while (segBlock > 0) {
|
||||
PRInt32 rqst, n;
|
||||
|
||||
rqst = (segBlock > 4096) ? 4096 : segBlock;
|
||||
|
||||
n = PR_Read(fd, bp, rqst);
|
||||
if (n <= 0) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
bp += n;
|
||||
segBlock -= n;
|
||||
}
|
||||
} while (len > 0);
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#else
|
||||
/*
|
||||
* Read exactly 'len' bytes of data into 'buf'. Return PR_TRUE if all bytes
|
||||
* could be read, otherwise return PR_FALSE.
|
||||
*/
|
||||
static PRBool
|
||||
nsZipReadFully(PRFileDesc *fd, void *buf, PRInt32 len)
|
||||
{
|
||||
char *bp = buf;
|
||||
|
||||
while (len > 0) {
|
||||
PRInt32 n = PR_Read(fd, bp, len);
|
||||
if (n <= 0) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
bp += n;
|
||||
len -= n;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define INBUFSIZ 64
|
||||
|
||||
/*
|
||||
* Find end of central directory (END) header in zip file and set the file
|
||||
* pointer to start of header. Return PR_FALSE if the END header could not be
|
||||
* found, otherwise return PR_TRUE.
|
||||
*/
|
||||
static PRBool
|
||||
nsZipFindEnd(ns_zip_t *zip, char *endbuf)
|
||||
{
|
||||
char buf[INBUFSIZ+SIGSIZ], *bp;
|
||||
PRInt32 len, off, mark;
|
||||
|
||||
/* Need to search backwards from end of file */
|
||||
if ((len = PR_Seek(zip->fd, 0, SEEK_END)) == -1) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
return PR_FALSE;
|
||||
}
|
||||
/*
|
||||
* Set limit on how far back we need to search. The END header must be
|
||||
* located within the last 64K bytes of the file.
|
||||
*/
|
||||
mark = max(0, len - 0xffff);
|
||||
/*
|
||||
* Search backwards INBUFSIZ bytes at a time from end of file stopping
|
||||
* when the END header signature has been found. Since the signature
|
||||
* may straddle a buffer boundary, we need to stash the first SIGSIZ-1
|
||||
* bytes of the previous record at the tail of the current record so
|
||||
* that the search can overlap.
|
||||
*/
|
||||
memset(buf, 0, SIGSIZ);
|
||||
for (off = len; off > mark; ) {
|
||||
long n = min(off - mark, INBUFSIZ);
|
||||
memcpy(buf + n, buf, SIGSIZ);
|
||||
if (PR_Seek(zip->fd, off -= n, SEEK_SET) == -1) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (!nsZipReadFully(zip->fd, buf, n)) {
|
||||
ns_ziperr(zip, "Fatal read error while searching for END record");
|
||||
return PR_FALSE;
|
||||
}
|
||||
for (bp = buf + n - 1; bp >= buf; --bp) {
|
||||
if (strncmp(bp, ENDSIG, SIGSIZ) == 0) {
|
||||
long endoff = off + (long)bp - (long)buf;
|
||||
if (len - endoff < ENDHDRSIZ) {
|
||||
continue;
|
||||
}
|
||||
if ((buf+n-bp) >= ENDHDRSIZ) {
|
||||
memcpy(endbuf, bp, ENDHDRSIZ);
|
||||
} else {
|
||||
if (PR_Seek(zip->fd, endoff, SEEK_SET) == -1) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
}
|
||||
if (!nsZipReadFully(zip->fd, endbuf, ENDHDRSIZ)) {
|
||||
ns_ziperr(zip, "Read error while searching for END record");
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
if (endoff + ENDHDRSIZ + ENDCOM(endbuf) != len) {
|
||||
continue;
|
||||
}
|
||||
if (PR_Seek(zip->fd, endoff, SEEK_SET) == -1) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
return PR_FALSE;
|
||||
}
|
||||
zip->endoff = endoff;
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert DOS time to UNIX time
|
||||
*/
|
||||
static time_t
|
||||
ns_zip_unixtime(int dostime)
|
||||
{
|
||||
struct tm tm;
|
||||
|
||||
tm.tm_sec = (dostime << 1) & 0x3e;
|
||||
tm.tm_min = (dostime >> 5) & 0x3f;
|
||||
tm.tm_hour = (dostime >> 11) & 0x1f;
|
||||
tm.tm_mday = (dostime >> 16) & 0x1f;
|
||||
tm.tm_mon = ((dostime >> 21) & 0xf) - 1;
|
||||
tm.tm_year = ((dostime >> 25) & 0x7f) + 1980;
|
||||
return mktime(&tm);
|
||||
}
|
||||
|
||||
static int
|
||||
ns_zip_direlcmp(const void *d1, const void *d2)
|
||||
{
|
||||
return strcmp(((direl_t *)d1)->fn, ((direl_t *)d2)->fn);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize zip file reader, read in central directory and construct the
|
||||
* lookup table for locating zip file members.
|
||||
*/
|
||||
static PRBool
|
||||
ns_zip_initReader(ns_zip_t *zip)
|
||||
{
|
||||
char endbuf[ENDHDRSIZ];
|
||||
char HUGEP *cenbuf;
|
||||
char HUGEP *cp;
|
||||
PRUint32 locoff;
|
||||
PRUint32 i, cenlen;
|
||||
|
||||
/* Seek to END header and read it in */
|
||||
if (!nsZipFindEnd(zip, endbuf)) {
|
||||
ns_ziperr(zip, "Unable to locate end-of-central-directory record");
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Verify END signature */
|
||||
if (strncmp(endbuf, ENDSIG, SIGSIZ) != 0) {
|
||||
ns_ziperr(zip, "Invalid END signature");
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Get real offset of central directory */
|
||||
zip->cenoff = zip->endoff - ENDSIZ(endbuf);
|
||||
/*
|
||||
* Since there may be a stub prefixed to the ZIP or JAR file, the
|
||||
* the start offset of the first local file (LOC) header will be
|
||||
* the difference between the real offset of the first CEN header
|
||||
* and what is specified in the END header.
|
||||
*/
|
||||
if (zip->cenoff < ENDOFF(endbuf)) {
|
||||
ns_ziperr(zip, "Invalid end-of-central directory header");
|
||||
return PR_FALSE;
|
||||
}
|
||||
locoff = zip->cenoff - ENDOFF(endbuf);
|
||||
/* Get length of central directory */
|
||||
cenlen = ENDSIZ(endbuf);
|
||||
/* Check offset and length */
|
||||
if (zip->cenoff + cenlen != zip->endoff) {
|
||||
ns_ziperr(zip, "Invalid end-of-central-directory header");
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Get total number of central directory entries */
|
||||
zip->nel = ENDTOT(endbuf);
|
||||
/* Check entry count */
|
||||
if (zip->nel * CENHDRSIZ > cenlen) {
|
||||
ns_ziperr(zip, "Invalid end-of-central-directory header");
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Verify that zip file contains only one drive */
|
||||
if (ENDSUB(endbuf) != zip->nel) {
|
||||
ns_ziperr(zip, "Cannot contain more than one drive");
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Seek to first CEN header */
|
||||
if (PR_Seek(zip->fd, zip->cenoff, SEEK_SET) == -1) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Allocate file lookup table */
|
||||
CHECK_SIZE_LIMIT( zip->nel * sizeof(direl_t) );
|
||||
if ((zip->dir = PR_MALLOC((size_t)(zip->nel * sizeof(direl_t)))) == 0) {
|
||||
ns_ziperr(zip, "Out of memory allocating lookup table");
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Allocate temporary buffer for contents of central directory */
|
||||
if ((cenbuf = PR_MALLOC(cenlen)) == 0) {
|
||||
ns_ziperr(zip, "Out of memory allocating central directory buffer");
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Read central directory */
|
||||
if (!nsZipReadFully(zip->fd, cenbuf, cenlen)) {
|
||||
ns_ziperr(zip, "Fatal error while reading central directory");
|
||||
PR_Free(cenbuf);
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Scan each header in central directory */
|
||||
for (i = 0, cp = cenbuf; i < zip->nel; i++) {
|
||||
direl_t *dp = &zip->dir[i];
|
||||
PRUint32 n;
|
||||
/* Verify signature of CEN header */
|
||||
if (NS_ZIP_STRNCMP(cp, CENSIG, SIGSIZ) != 0) {
|
||||
ns_ziperr(zip, "Invalid central directory header signature");
|
||||
PR_Free(cenbuf);
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Get file name */
|
||||
n = CENNAM(cp);
|
||||
|
||||
CHECK_SIZE_LIMIT( n+1 );
|
||||
if ((dp->fn = PR_MALLOC((size_t)n + 1)) == 0) {
|
||||
ns_ziperr(zip, "Out of memory reading CEN header file name");
|
||||
PR_Free(cenbuf);
|
||||
return PR_FALSE;
|
||||
}
|
||||
NS_ZIP_STRNCPY(dp->fn, cp + CENHDRSIZ, (size_t) n);
|
||||
dp->fn[n] = '\0';
|
||||
/* Get compression method */
|
||||
dp->method = CENHOW(cp);
|
||||
/* Get real offset of LOC header */
|
||||
dp->off = locoff + CENOFF(cp);
|
||||
/* Get uncompressed file size */
|
||||
dp->len = CENLEN(cp);
|
||||
/* Get compressed file size */
|
||||
dp->size = CENSIZ(cp);
|
||||
/* Check offset and size */
|
||||
if (dp->off + CENSIZ(cp) > zip->cenoff) {
|
||||
ns_ziperr(zip, "Invalid CEN header");
|
||||
PR_Free(cenbuf);
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Get file modification time */
|
||||
dp->mod = (int) CENTIM(cp);
|
||||
/* Skip to next CEN header */
|
||||
cp += CENHDRSIZ + CENNAM(cp) + CENEXT(cp) + CENCOM(cp);
|
||||
if (cp > cenbuf + cenlen) {
|
||||
ns_ziperr(zip, "Invalid CEN header");
|
||||
PR_Free(cenbuf);
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
/* Free temporary buffer */
|
||||
PR_Free(cenbuf);
|
||||
/* Sort directory elements by name */
|
||||
XP_QSORT(zip->dir, (size_t) zip->nel, sizeof(direl_t), ns_zip_direlcmp);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PR_PUBLIC_API(PRBool)
|
||||
ns_zip_lock(void)
|
||||
{
|
||||
if(ns_zlock == NULL)
|
||||
{
|
||||
ns_zlock = PR_NewMonitor();
|
||||
if(ns_zlock == NULL)
|
||||
return PR_FALSE;
|
||||
}
|
||||
PR_EnterMonitor(ns_zlock);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PR_PUBLIC_API(void)
|
||||
ns_zip_unlock(void)
|
||||
{
|
||||
PR_ASSERT(ns_zlock != NULL);
|
||||
|
||||
if(ns_zlock != NULL)
|
||||
{
|
||||
PR_ExitMonitor(ns_zlock);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Open ns_zip_t file and initialize file lookup table.
|
||||
*/
|
||||
PR_PUBLIC_API(ns_zip_t *)
|
||||
ns_zip_open(const char *fn)
|
||||
{
|
||||
PRFileDesc *fd;
|
||||
ns_zip_t *zip;
|
||||
|
||||
if (!ns_zip_lock())
|
||||
return NULL;
|
||||
#ifdef ZTRACE
|
||||
if(ns_zlog == NULL) {
|
||||
ns_zlog = fopen("ns_zlog.txt", "w");
|
||||
if (FD_IS_ERROR(fd)) {
|
||||
ns_zlog = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(ns_zip_cache)
|
||||
{
|
||||
#ifdef ZTRACE
|
||||
if (ns_zlog) fprintf(ns_zlog, "close %s\n", ns_zip_cache->fn);
|
||||
#endif
|
||||
PR_Close(ns_zip_cache->fd);
|
||||
ns_zip_cache->fd = 0;
|
||||
ns_zip_cache = 0;
|
||||
}
|
||||
|
||||
#ifdef ZTRACE
|
||||
if (ns_zlog) fprintf(ns_zlog, "zip open %s\n", fn);
|
||||
#endif
|
||||
fd = PR_Open(fn, PR_RDONLY, 0);
|
||||
if (FD_IS_ERROR(fd)) {
|
||||
ns_zip_unlock();
|
||||
return 0;
|
||||
}
|
||||
if ((zip = PR_Calloc(1, sizeof(ns_zip_t))) == 0) {
|
||||
ns_zip_errmsg("Out of memory");
|
||||
ns_zip_unlock();
|
||||
return 0;
|
||||
}
|
||||
if ((zip->fn = XP_STRDUP(fn)) == 0) {
|
||||
ns_zip_errmsg("Out of memory");
|
||||
ns_zip_unlock();
|
||||
return 0;
|
||||
}
|
||||
zip->fd = fd;
|
||||
if (!ns_zip_initReader(zip)) {
|
||||
PR_Free(zip->fn);
|
||||
PR_Free(zip);
|
||||
PR_Close(fd);
|
||||
ns_zip_unlock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
ns_zip_cache = zip;
|
||||
ns_zip_unlock();
|
||||
return zip;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close zip file and free lookup table
|
||||
*/
|
||||
PR_PUBLIC_API(void)
|
||||
ns_zip_close(ns_zip_t *zip)
|
||||
{
|
||||
PRUint32 i;
|
||||
|
||||
ns_zip_lock();
|
||||
#ifdef ZTRACE
|
||||
if (ns_zlog) fprintf(ns_zlog, "zip close %s\n", zip->fn);
|
||||
#endif
|
||||
PR_Free(zip->fn);
|
||||
if(ns_zip_cache == zip) {
|
||||
PR_Close(zip->fd);
|
||||
ns_zip_cache = NULL;
|
||||
} else {
|
||||
PR_ASSERT(zip->fd == 0);
|
||||
}
|
||||
ns_zip_unlock();
|
||||
|
||||
for (i = 0; i < zip->nel; i++) {
|
||||
PR_Free(zip->dir[i].fn);
|
||||
}
|
||||
PR_Free(zip->dir);
|
||||
PR_Free(zip);
|
||||
}
|
||||
|
||||
static direl_t *
|
||||
ns_zip_lookup(ns_zip_t *zip, const char *fn)
|
||||
{
|
||||
direl_t key;
|
||||
key.fn = (char *)fn;
|
||||
return bsearch(&key, zip->dir, (size_t) zip->nel, sizeof(direl_t), ns_zip_direlcmp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return file status for ns_zip_t file member
|
||||
*/
|
||||
PR_PUBLIC_API(PRBool)
|
||||
ns_zip_stat(ns_zip_t *zip, const char *fn, struct stat *sbuf)
|
||||
{
|
||||
direl_t *dp;
|
||||
|
||||
if(zip == NULL)
|
||||
return PR_FALSE;
|
||||
|
||||
dp = ns_zip_lookup(zip, fn);
|
||||
#ifdef ZTRACE
|
||||
if(ns_zlog) fprintf(ns_zlog, "stat %s %s\n", dp ? "found" : "failed", fn);
|
||||
#endif
|
||||
if (dp == 0) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
memset(sbuf, 0, sizeof(struct stat));
|
||||
sbuf->st_size = dp->len;
|
||||
#if 0
|
||||
/* no one uses this stuff yet */
|
||||
sbuf->st_mode = 444;
|
||||
sbuf->st_mtime = ns_zip_unixtime(dp->mod);
|
||||
sbuf->st_atime = sbuf->st_mtime;
|
||||
sbuf->st_ctime = sbuf->st_mtime;
|
||||
#endif
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
static PRBool
|
||||
ns_zip_inflateFully(PRFileDesc *fd, PRUint32 size, void *buf, PRUint32 len, char **msg)
|
||||
{
|
||||
static z_stream *strm;
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
char tmp[16000];
|
||||
char tmpBuf[4096];
|
||||
#else
|
||||
char tmp[32000];
|
||||
#endif /* defined(XP_PC) && !defined(_WIN32) */
|
||||
PRBool ok = PR_TRUE;
|
||||
|
||||
if (strm == 0) {
|
||||
strm = PR_Calloc(1, sizeof(z_stream));
|
||||
if (inflateInit2(strm, -MAX_WBITS) != Z_OK) {
|
||||
*msg = strm->msg;
|
||||
PR_Free(strm);
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(XP_PC) || defined(_WIN32)
|
||||
strm->next_out = buf;
|
||||
strm->avail_out = len;
|
||||
#endif
|
||||
|
||||
while (strm->total_in <= size) {
|
||||
PRInt32 n = size - strm->total_in;
|
||||
if (n > 0) {
|
||||
n = PR_Read(fd, tmp, n > sizeof(tmp) ? sizeof(tmp) : n);
|
||||
if (n == 0) {
|
||||
*msg = "Unexpected EOF";
|
||||
ok = PR_FALSE;
|
||||
goto stop;
|
||||
}
|
||||
if (n < 0) {
|
||||
(void) PR_GetErrorText(*msg);
|
||||
ok = PR_FALSE;
|
||||
goto stop;
|
||||
}
|
||||
}
|
||||
strm->next_in = (Bytef *)tmp;
|
||||
strm->avail_in = n;
|
||||
|
||||
do {
|
||||
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
strm->next_out = tmpBuf;
|
||||
strm->avail_out = sizeof(tmpBuf);
|
||||
#endif /* defined(XP_PC) && !defined(_WIN32) */
|
||||
|
||||
switch (inflate(strm, Z_PARTIAL_FLUSH)) {
|
||||
case Z_OK:
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
{
|
||||
int inflatedLength;
|
||||
inflatedLength = strm->next_out - tmpBuf;
|
||||
NS_ZIP_STRNCPY((char HUGEP *)buf, (char HUGEP *)tmpBuf, inflatedLength);
|
||||
((char HUGEP *)buf)+=inflatedLength;
|
||||
}
|
||||
#endif /* defined(XP_PC) && !defined(_WIN32) */
|
||||
break;
|
||||
case Z_STREAM_END:
|
||||
#if defined(XP_PC) && !defined(_WIN32)
|
||||
{
|
||||
int inflatedLength;
|
||||
inflatedLength = strm->next_out - tmpBuf;
|
||||
NS_ZIP_STRNCPY((char HUGEP *)buf, (char HUGEP *)tmpBuf, inflatedLength);
|
||||
((char HUGEP *)buf)+=inflatedLength;
|
||||
}
|
||||
#endif /* defined(XP_PC) && !defined(_WIN32) */
|
||||
if (strm->total_in != size || strm->total_out != len) {
|
||||
*msg = "Invalid entry compressed size";
|
||||
ok = PR_FALSE;
|
||||
}
|
||||
goto stop;
|
||||
default:
|
||||
*msg = strm->msg;
|
||||
goto stop;
|
||||
}
|
||||
} while (strm->avail_in > 0);
|
||||
}
|
||||
*msg = "Invalid entry compressed size";
|
||||
ok = PR_FALSE;
|
||||
|
||||
stop:
|
||||
inflateReset(strm);
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read contents of zip file member into buffer 'buf'. If the size of the
|
||||
* data should exceed 'len' then nothing is read and PR_FALSE is returned.
|
||||
*/
|
||||
PR_PUBLIC_API(PRBool)
|
||||
ns_zip_get(ns_zip_t *zip, const char *fn, void HUGEP *buf, PRInt32 len)
|
||||
{
|
||||
char locbuf[LOCHDRSIZ];
|
||||
long off;
|
||||
direl_t *dp = ns_zip_lookup(zip, fn);
|
||||
|
||||
if (!ns_zip_lock())
|
||||
return PR_FALSE;
|
||||
if(!nsEnsureZip(zip)) {
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
#ifdef ZTRACEX
|
||||
if(ns_zlog) fprintf(ns_zlog, "get %s\n", fn);
|
||||
#endif
|
||||
/* Look up file member */
|
||||
if (dp == 0) {
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Check buffer length */
|
||||
if (len != (PRInt32) dp->len) {
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Seek to beginning of LOC header */
|
||||
if (PR_Seek(zip->fd, dp->off, SEEK_SET) == -1) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Read LOC header */
|
||||
if (!nsZipReadFully(zip->fd, locbuf, LOCHDRSIZ)) {
|
||||
ns_ziperr(zip, "Fatal error while reading LOC header");
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Verify signature */
|
||||
if (strncmp(locbuf, LOCSIG, SIGSIZ) != 0) {
|
||||
ns_ziperr(zip, "Invalid LOC header signature");
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Make sure file is not encrypted */
|
||||
if ((LOCFLG(locbuf) & 1) == 1) {
|
||||
ns_ziperr(zip, "Member is encrypted");
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Get offset of file data */
|
||||
off = dp->off + LOCHDRSIZ + LOCNAM(locbuf) + LOCEXT(locbuf);
|
||||
if (off + dp->size > zip->cenoff) {
|
||||
ns_ziperr(zip, "Invalid LOC header");
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Seek to file data */
|
||||
if (PR_Seek(zip->fd, off, SEEK_SET) == -1) {
|
||||
#if !defined(NSPR20) || !defined(XP_PC) || defined(_WIN32)
|
||||
/*
|
||||
* perror is not defined for win16
|
||||
*/
|
||||
perror(zip->fn);
|
||||
#endif
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
/* Read file data */
|
||||
switch (dp->method) {
|
||||
case STORED:
|
||||
if (!nsZipReadFully(zip->fd, buf, dp->len)) {
|
||||
ns_ziperr(zip, "Fatal error while reading LOC data");
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
break;
|
||||
case DEFLATED: {
|
||||
char *msg = 0;
|
||||
if (!ns_zip_inflateFully(zip->fd, dp->size, buf, dp->len, &msg)) {
|
||||
if (msg != 0) {
|
||||
ns_ziperr(zip, msg);
|
||||
} else {
|
||||
ns_ziperr(zip, "Error while reading compressed zip file entry");
|
||||
}
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ns_ziperr(zip, "Unsupported compression method");
|
||||
ns_zip_unlock();
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
ns_zip_unlock();
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return total number of files in the archive that match the suffix.
|
||||
* For example look for all files that end with ".sf"
|
||||
* XXX just look in META??
|
||||
*/
|
||||
PR_PUBLIC_API(PRUint32)
|
||||
ns_zip_get_no_of_elements(ns_zip_t *zip, const char *fn_suffix)
|
||||
{
|
||||
int suf_len = strlen(fn_suffix);
|
||||
PRUint32 nel;
|
||||
PRUint32 i;
|
||||
|
||||
for (i=0, nel=0; i < zip->nel; i++) {
|
||||
char *fn = zip->dir[i].fn;
|
||||
int fn_len = strlen(fn);
|
||||
if (strncasecmp(&fn[fn_len - suf_len], fn_suffix, suf_len) == 0) {
|
||||
nel++;
|
||||
}
|
||||
}
|
||||
return nel;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a list of files in the archive that match the filename suffix
|
||||
*/
|
||||
PR_PUBLIC_API(PRUint32)
|
||||
ns_zip_list_files(ns_zip_t *zip, const char *fn_suffix, void HUGEP *buf, PRUint32 len)
|
||||
{
|
||||
int suf_len = strlen(fn_suffix);
|
||||
PRUint32 nel;
|
||||
PRUint32 i;
|
||||
char HUGEP *buf_ptr = buf;
|
||||
char HUGEP *buf_end_ptr = buf_ptr + len;
|
||||
|
||||
for (i=0, nel=0; i < zip->nel; i++) {
|
||||
char *fn = zip->dir[i].fn;
|
||||
int fn_len = strlen(fn);
|
||||
if ((strncasecmp(&fn[fn_len - suf_len], fn_suffix, suf_len) == 0) &&
|
||||
((buf_ptr + fn_len) < buf_end_ptr)) {
|
||||
nel++;
|
||||
NS_ZIP_STRCPY(buf_ptr, fn);
|
||||
buf_ptr += fn_len+1;
|
||||
}
|
||||
}
|
||||
return nel;
|
||||
}
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
267
mozilla/client.mak
Normal file
267
mozilla/client.mak
Normal file
@@ -0,0 +1,267 @@
|
||||
# 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.
|
||||
|
||||
# Enable builds on any drive if defined.
|
||||
!if !defined(MOZ_SRC)
|
||||
MOZ_SRC=y:
|
||||
!endif
|
||||
|
||||
# Enable builds from user defined top level directory.
|
||||
!if !defined(MOZ_TOP)
|
||||
MOZ_TOP=mozilla
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Defines specific to MOZ_NGLAYOUT
|
||||
#//------------------------------------------------------------------------
|
||||
!if defined(MOZ_NGLAYOUT)
|
||||
NGLAYOUT_MAKEFILE=nglayout.mak
|
||||
NGLAYOUT_ENV_VARS=STANDALONE_IMAGE_LIB=1 MODULAR_NETLIB=1 NGLAYOUT_BUILD_PREFIX=1
|
||||
MOZNGLAYOUT_BRANCH=RAPTOR_INTEGRATION0_BRANCH
|
||||
CVSCO = cvs -q co -P
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Figure out how to do the pull.
|
||||
#//------------------------------------------------------------------------
|
||||
!if "$(MOZ_BRANCH)" != ""
|
||||
CVS_BRANCH=-r $(MOZ_BRANCH)
|
||||
HAVE_BRANCH=1
|
||||
!else
|
||||
HAVE_BRANCH=0
|
||||
!endif
|
||||
|
||||
!if "$(MOZ_DATE)" != ""
|
||||
CVS_BRANCH=-D "$(MOZ_DATE)"
|
||||
HAVE_DATE=1
|
||||
!else
|
||||
HAVE_DATE=0
|
||||
!endif
|
||||
|
||||
!if $(HAVE_DATE) && $(HAVE_BRANCH)
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
Cannot specify both MOZ_BRANCH and MOZ_DATE
|
||||
!endif
|
||||
|
||||
NMAKE=@nmake -nologo -$(MAKEFLAGS)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Stuff a do complete pull and build
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
default:: build_all
|
||||
|
||||
pull_and_build_all:: pull_all \
|
||||
build_all
|
||||
|
||||
#// Do this when you pull a new tree, or else you will often get bugs
|
||||
#// when replaceing an old dist with a new dist.
|
||||
|
||||
pull_clobber_build_all:: pull_all \
|
||||
clobber_all \
|
||||
build_all
|
||||
|
||||
clobber_build_all:: clobber_all \
|
||||
build_all
|
||||
|
||||
!if defined(MOZ_NGLAYOUT)
|
||||
# The MOZ_NGLAYOUT pull is complicated, be very careful choosing which files are on
|
||||
# the tip and which are on the branches.
|
||||
pull_all:: pull_client_source_product pull_nglayout pull_netlib repull_ngl_integration pull_imglib repull_include
|
||||
!else
|
||||
pull_all:: pull_client_source_product
|
||||
!endif
|
||||
|
||||
!if defined(MOZ_NGLAYOUT)
|
||||
pull_nglayout:
|
||||
@cd $(MOZ_SRC)
|
||||
$(CVSCO) $(MOZ_TOP)/$(NGLAYOUT_MAKEFILE)
|
||||
@cd $(MOZ_SRC)/$(MOZ_TOP)
|
||||
$(NMAKE) -f $(NGLAYOUT_MAKEFILE) pull_nglayout $(NGLAYOUT_ENV_VARS)
|
||||
|
||||
pull_netlib:
|
||||
@cd $(MOZ_SRC)/$(MOZ_TOP)
|
||||
$(NMAKE) -f $(NGLAYOUT_MAKEFILE) pull_netlib $(NGLAYOUT_ENV_VARS)
|
||||
|
||||
# Here is where we pull everything on the layout integration branch
|
||||
repull_ngl_integration:
|
||||
@cd $(MOZ_SRC)
|
||||
$(CVSCO) -r $(MOZNGLAYOUT_BRANCH) $(MOZ_TOP)/include $(MOZ_TOP)/cmd $(MOZ_TOP)/lib $(MOZ_TOP)/modules
|
||||
@cd $(MOZ_SRC)/$(MOZ_TOP)
|
||||
|
||||
# Careful to put this after repull_ngl_integration, want modules/libutil and
|
||||
# modules/libimg to be on imglib branch
|
||||
pull_imglib:
|
||||
@cd $(MOZ_SRC)/$(MOZ_TOP)
|
||||
$(NMAKE) -f $(NGLAYOUT_MAKEFILE) pull_imglib $(NGLAYOUT_ENV_VARS)
|
||||
|
||||
# Want certain files in the include directory to be on the tip
|
||||
repull_include:
|
||||
@cd $(MOZ_SRC)
|
||||
$(CVSCO) -A $(MOZ_TOP)/include/net.h
|
||||
!endif
|
||||
|
||||
|
||||
pull_client_source_product:
|
||||
@echo +++ client.mak: checking out the client with "$(CVS_BRANCH)"
|
||||
cd $(MOZ_SRC)\.
|
||||
-cvs -q co $(CVS_BRANCH) MozillaSourceWin
|
||||
|
||||
|
||||
!if defined(MOZ_NGLAYOUT)
|
||||
# Build NGLayout first.
|
||||
build_all: build_nglayout \
|
||||
build_dist \
|
||||
build_client
|
||||
!else
|
||||
build_all: build_dist \
|
||||
build_client
|
||||
!endif
|
||||
|
||||
!if defined(MOZ_NGLAYOUT)
|
||||
build_nglayout:
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)
|
||||
$(NMAKE) -f $(NGLAYOUT_MAKEFILE) $(NGLAYOUT_ENV_VARS)
|
||||
!endif
|
||||
|
||||
build_dist:
|
||||
@echo +++ client.mak: building dist
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)
|
||||
$(NMAKE) -f makefile.win
|
||||
|
||||
|
||||
build_client:
|
||||
@echo +++ client.mak: building client
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)\cmd\winfe\mkfiles32
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
$(NMAKE) -f mozilla.mak exports
|
||||
!endif
|
||||
$(NMAKE) -f mozilla.mak DEPEND=1
|
||||
$(NMAKE) -f mozilla.mak
|
||||
|
||||
|
||||
#
|
||||
# remove all source files from the tree and print a report of what was missed
|
||||
#
|
||||
!if defined(MOZ_NGLAYOUT)
|
||||
clobber_all:: clobber_moz clobber_nglayout
|
||||
!else
|
||||
clobber_all:: clobber_moz
|
||||
!endif
|
||||
|
||||
clobber_moz:
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)
|
||||
$(NMAKE) -f makefile.win clobber_all
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)\cmd\winfe\mkfiles32
|
||||
$(NMAKE) -f mozilla.mak clobber_all
|
||||
!if !defined(MOZ_MEDIUM)
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)\netsite\ldap\libraries\msdos\winsock
|
||||
$(NMAKE) -f nsldap.mak clobber_all
|
||||
!endif
|
||||
|
||||
!if defined(MOZ_NGLAYOUT)
|
||||
clobber_nglayout:
|
||||
cd $(MOZ_SRC)\$(MOZ_TOP)
|
||||
$(NMAKE) -f $(NGLAYOUT_MAKEFILE) clobber $(NGLAYOUT_ENV_VARS)
|
||||
!endif
|
||||
|
||||
depend:
|
||||
-del /s /q make.dep
|
||||
$(NMAKE) -f makefile.win depend
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Utility stuff...
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
# Verify that MOZ_SRC is set correctly
|
||||
#//------------------------------------------------------------------------
|
||||
# Check to see if it is set at all
|
||||
|
||||
!if "$(MOZ_SRC)"!=""
|
||||
|
||||
#
|
||||
# create a temp file at the root and make sure it is visible from MOZ_SRC
|
||||
#
|
||||
!if [copy $(MAKEDIR)\client.mak $(MAKEDIR)\xyzzy.tmp > NUL] == 0
|
||||
!endif
|
||||
|
||||
!if !EXIST( $(MOZ_SRC)\$(MOZ_TOP)\xyzzy.tmp )
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
MOZ_SRC isn't set correctly: [$(MOZ_SRC)\$(MOZ_TOP)]!=[$(MAKEDIR)]
|
||||
!endif
|
||||
|
||||
!if [del $(MAKEDIR)\xyzzy.tmp]
|
||||
!endif
|
||||
|
||||
!else
|
||||
# MOZ_SRC isn't set at all
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
Environment variable MOZ_SRC isn't set.
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
# Verify that MOZ_BITS is set
|
||||
#//------------------------------------------------------------------------
|
||||
!if !defined(MOZ_BITS)
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
Environment variable MOZ_BITS isn't set.
|
||||
!endif
|
||||
|
||||
!if !defined(MOZ_TOOLS)
|
||||
ERR_MESSAGE=$(ERR_MESSAGE)^
|
||||
Environment variable MOZ_TOOLS isn't set.
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#// Display error
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
!if "$(ERR_MESSAGE)" != ""
|
||||
ERR_MESSAGE = ^
|
||||
client.mak: ^
|
||||
$(ERR_MESSAGE) ^
|
||||
^
|
||||
client.mak: usage^
|
||||
^
|
||||
nmake -f client.mak [MOZ_BRANCH=<cvs_branch_name>] ^
|
||||
[MOZ_DATE=<cvs_date>]^
|
||||
[pull_and_build_all]^
|
||||
[pull_all]^
|
||||
[pull_dist]^
|
||||
[pull_client]^
|
||||
[build_all]^
|
||||
[build_dist]^
|
||||
[build_ldap]^
|
||||
[build_client]^
|
||||
^
|
||||
Environment variables:^
|
||||
^
|
||||
MOZ_BITS set to either 32 or 16 ^
|
||||
MOZ_SRC set to the directory above $(MOZ_TOP) or "$(MAKEDIR)\.."^
|
||||
MOZ_TOOLS set to the directory containing the java compiler see ^
|
||||
http://warp/tools/nt^
|
||||
JAVA_HOME set to the same thing as MOZ_TOOLS^
|
||||
CVSROOT set to the public mozilla cvs server^
|
||||
|
||||
!ERROR $(ERR_MESSAGE)
|
||||
|
||||
!endif
|
||||
|
||||
21
mozilla/cmd/Makefile
Normal file
21
mozilla/cmd/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# 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 = xfe patcher
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
57
mozilla/cmd/dialup/as_html/1step.htm
Normal file
57
mozilla/cmd/dialup/as_html/1step.htm
Normal file
@@ -0,0 +1,57 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Account Setup</TITLE>
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="1step.js"></SCRIPT>
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js"></LINK>
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY BACKGROUND="images/bg.gif" BGCOLOR="cccccc" onLoad="loadData()" ID="1step100">
|
||||
|
||||
|
||||
<!-- The layer below contains the Account Setup identifier. -->
|
||||
|
||||
<LAYER NAME = "tagtext" LEFT = 420 TOP = 0 VISIBILITY = SHOW>
|
||||
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=200 ID="nospace">
|
||||
<TR><TD HEIGHT=20 VALIGN=MIDDLE BACKGROUND="images/tag.gif">
|
||||
<B CLASS="previewtag">ACCOUNT SETUP</B>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</LAYER>
|
||||
|
||||
|
||||
<!-- The layer below contains the headline and text of this screen -->
|
||||
|
||||
|
||||
<P CLASS="title"><B>Connecting to the Internet <BR>account server...</B></P>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH=500>
|
||||
<TR>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<SPACER TYPE=HORIZONTAL SIZE=42>
|
||||
<APPLET ARCHIVE="asw.jar" CODE="netscape/asw/CPGeneratorProgress.class" HEIGHT=140 WIDTH=400></APPLET>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
242
mozilla/cmd/dialup/as_html/1step.js
Normal file
242
mozilla/cmd/dialup/as_html/1step.js
Normal file
@@ -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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
var globals = parent.parent.globals;
|
||||
var plugin = globals.document.setupPlugin;
|
||||
var documentVars = globals.document.vars;
|
||||
|
||||
function go( msg )
|
||||
{
|
||||
parent.parent.globals.debug( "1step go" );
|
||||
|
||||
if ( parent.parent.globals.document.vars.editMode.value == "yes" )
|
||||
return true;
|
||||
else
|
||||
return checkData();
|
||||
}
|
||||
|
||||
function checkData()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function configureDialer( configFolder, acctSetupIni, regFile )
|
||||
{
|
||||
globals.debug( "Configuring dialer" );
|
||||
|
||||
var intlFlag = globals.GetNameValuePair( acctSetupIni, "Mode Selection", "IntlMode" );
|
||||
intlFlag = intlFlag.toLowerCase();
|
||||
|
||||
// * determine name of scripting file
|
||||
var scriptEnabledFlag = "FALSE";
|
||||
var scriptFile = globals.GetNameValuePair( regFile, "Dial-In Configuration", "ScriptFileName" );
|
||||
if ( scriptFile != null && scriptFile != "" )
|
||||
{
|
||||
scriptFile = configFolder + scriptFile;
|
||||
scriptEnabledFlag = "TRUE";
|
||||
}
|
||||
else
|
||||
{
|
||||
scriptFile = "";
|
||||
scriptEnabledFlag = "FALSE";
|
||||
}
|
||||
|
||||
// * determine tty
|
||||
var ttyFlag = globals.GetNameValuePair( regFile, "Security", "SecurityDevice" );
|
||||
ttyFlag = ttyFlag.toLowerCase();
|
||||
if ( ttyFlag == "yes" )
|
||||
ttyFlag = "TRUE";
|
||||
else
|
||||
ttyFlag = "FALSE";
|
||||
|
||||
|
||||
// * determine outside line access string
|
||||
var outsideLineAccessStr = "";
|
||||
if ( documentVars.prefixData.value != "" )
|
||||
{
|
||||
outsideLineAccessStr = documentVars.prefixData.value;
|
||||
x = outsideLineAccessStr.indexOf( "," );
|
||||
if ( x < 0 )
|
||||
outsideLineAccessStr = outsideLineAccessStr + ",";
|
||||
}
|
||||
|
||||
|
||||
// * configure dialer for Registration Server
|
||||
dialerData = plugin.newStringArray( 28 ); // increment this # as new dialer strings are added
|
||||
dialerData[ 0 ] = "FileName=" + regFile;
|
||||
dialerData[ 1 ] = "AccountName=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "SiteName" );
|
||||
dialerData[ 2 ] = "ISPPhoneNum=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "Phone" );
|
||||
dialerData[ 3 ] = "LoginName=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "Name" );
|
||||
dialerData[ 4 ] = "Password=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "Password" );
|
||||
dialerData[ 5 ] = "DNSAddress=" + globals.GetNameValuePair( regFile, "IP", "DNSAddress" );
|
||||
dialerData[ 6 ] = "DNSAddress2=" + globals.GetNameValuePair( regFile, "IP", "DNSAddress2" );
|
||||
dialerData[ 7 ] = "DomainName=" + globals.GetNameValuePair( regFile, "IP", "DomainName" );
|
||||
dialerData[ 8 ] = "IPAddress=" + globals.GetNameValuePair( regFile, "IP", "IPAddress" );
|
||||
dialerData[ 9 ] = "IntlMode=" + ( ( intlFlag == "yes" ) ? "TRUE" : "FALSE" );
|
||||
dialerData[ 10 ] = "DialOnDemand=TRUE";
|
||||
dialerData[ 11 ] = "ModemName=" + globals.document.vars.modem.value;
|
||||
dialerData[ 12 ] = "ModemType=" + plugin.GetModemType( documentVars.modem.value );
|
||||
dialerData[ 13 ] = "DialType=" + documentVars.dialMethod.value;
|
||||
dialerData[ 14 ] = "OutsideLineAccess=" + outsideLineAccessStr;
|
||||
dialerData[ 15 ] = "DisableCallWaiting=" + ( ( documentVars.cwData.value != "" ) ? "TRUE" : "FALSE" );
|
||||
dialerData[ 16 ] = "DisableCallWaitingCode=" + documentVars.cwData.value;
|
||||
dialerData[ 17 ] = "UserAreaCode=" + documentVars.modemAreaCode.value; // XXX what to do if international mode?
|
||||
dialerData[ 18 ] = "CountryCode=" + documentVars.countryCode.value;
|
||||
dialerData[ 19 ] = "LongDistanceAccess=1"; // XXX
|
||||
dialerData[ 20 ] = "DialAsLongDistance=TRUE"; // XXX
|
||||
dialerData[ 21 ] = "DialAreaCode=TRUE"; // XXX
|
||||
dialerData[ 22 ] = "ScriptEnabled=" + scriptEnabledFlag;
|
||||
dialerData[ 23 ] = "ScriptFileName=" + scriptFile;
|
||||
dialerData[ 24 ] = "NeedsTTYWindow=" + ttyFlag;
|
||||
dialerData[ 25 ] = "Location=Home";
|
||||
dialerData[ 26 ] = "DisconnectTime=" + globals.GetNameValuePair( acctSetupIni, "Mode Selection", "Dialer_Disconnect_After" );
|
||||
dialerData[ 27 ] = "Path=Server";
|
||||
|
||||
// * write out dialer data to Java Console
|
||||
if ( documentVars.debugMode.value.toLowerCase() == "yes" )
|
||||
{
|
||||
globals.debug( "\nDialer data (for Registration Server): " );
|
||||
var numElements = dialerData.length;
|
||||
for ( var x = 0; x < numElements; x++ )
|
||||
globals.debug( " " + x + ": " + dialerData[ x ] );
|
||||
}
|
||||
|
||||
// * configure the dialer
|
||||
plugin.DialerConfig( dialerData, true );
|
||||
|
||||
// * check if we need to reboot
|
||||
if ( plugin.NeedReboot() == true )
|
||||
{
|
||||
// XXX hardcode in name of next screen???
|
||||
globals.forceReboot( "1step.htm" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( plugin.DialerConnect() == false )
|
||||
{
|
||||
plugin.DialerHangup();
|
||||
// XXX hardcode in name of next screen???
|
||||
window.location.replace( "error.htm" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function loadData()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
|
||||
|
||||
if ( parent.controls.generateControls )
|
||||
parent.controls.generateControls();
|
||||
|
||||
// * only connect to reggie if editmode is off
|
||||
if ( documentVars.editMode.value != "yes" )
|
||||
{
|
||||
var configFolder = globals.getConfigFolder( self );
|
||||
var acctSetupIni = globals.getAcctSetupFilename( self );
|
||||
var regFile = configFolder + documentVars.regServer.value;
|
||||
|
||||
|
||||
var regSource = globals.GetNameValuePair( acctSetupIni, "Mode Selection", "RegSource" );
|
||||
|
||||
var localFlag = globals.GetNameValuePair( regFile, "Dial-In Configuration", "LocalMode" );
|
||||
localFlag = localFlag.toLowerCase();
|
||||
globals.debug( "localFlag:" + localFlag );
|
||||
if ( localFlag != "yes" )
|
||||
{
|
||||
globals.debug( "LocalMode==no" );
|
||||
var connectStatusFlag = plugin.IsDialerConnected();
|
||||
if ( connectStatusFlag == true )
|
||||
{
|
||||
if ( confirm( "Account Setup can't connect until you close your current connection. Close the connection now?" ) == false )
|
||||
return;
|
||||
plugin.DialerHangup();
|
||||
}
|
||||
|
||||
configureDialer( configFolder, acctSetupIni, regFile );
|
||||
}
|
||||
|
||||
regCGI = globals.GetNameValuePair( regFile, "IP", "RegCGI" );
|
||||
regRoot = globals.GetNameValuePair( regFile, "Configuration", "RegRoot" );
|
||||
metadataMode = globals.GetNameValuePair( regFile, "Configuration", "MetadataMode" );
|
||||
if ( metadataMode == "no" )
|
||||
globals.debug( "MetadataMode==no, you will not be downloading necessary metadata" );
|
||||
|
||||
if ( regCGI == null || regCGI == "" )
|
||||
{
|
||||
alert( "Internal problem determining the Registration Server." );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( regRoot == null )
|
||||
{
|
||||
alert( "Internal problem determining location of Registration Server data file repository (RegRoot)." );
|
||||
return;
|
||||
}
|
||||
/*
|
||||
// * write out reggie data to Java Console
|
||||
if ( documentVars.debugMode.value.toLowerCase() == "yes" )
|
||||
{
|
||||
globals.debug( "\nRegServer data: " + document.forms[ 0 ].action );
|
||||
var numElements = document.forms[ 0 ].length;
|
||||
for ( var x = 0; x < document.forms[ 0 ].length; x++ )
|
||||
globals.debug( " " + x + ": " + document.forms[ 0 ].elements[ x ].name + "=" + document.forms[ 0 ].elements[ x ].value );
|
||||
}
|
||||
*/
|
||||
|
||||
// * submit reggie data
|
||||
navigator.preference( "security.warn_submit_insecure", false );
|
||||
navigator.preference( "security.warn_entering_secure", false );
|
||||
navigator.preference( "security.warn_leaving_secure", false );
|
||||
|
||||
// * automatically submit form to registration server
|
||||
//document.forms[ 0 ].submit();
|
||||
|
||||
reggieData = plugin.newStringArray( 8 ); // increment this # as new dialer strings are added
|
||||
reggieData[ 0 ] = "CST_PHONE_NUMBER=" + documentVars.modemPhoneNumber.value;
|
||||
reggieData[ 1 ] = "REG_SOURCE=" + regSource;
|
||||
reggieData[ 2 ] = "CLIENT_LANGUAGE=" + navigator.language;
|
||||
reggieData[ 3 ] = "CST_AREA_CODE_1=" + documentVars.modemAreaCode.value;
|
||||
reggieData[ 4 ] = "CST_AREA_CODE_2=" + documentVars.altAreaCode1.value;
|
||||
reggieData[ 5 ] = "CST_AREA_CODE_3=" + documentVars.altAreaCode2.value;
|
||||
reggieData[ 6 ] = "CST_AREA_CODE_4=" + documentVars.altAreaCode3.value;
|
||||
reggieData[ 7 ] = "CST_COUNTRY_CODE=" + "1";
|
||||
|
||||
/*documentVars.countryCode.value;*/
|
||||
|
||||
//if ( localFlag != "yes" )
|
||||
// globals.set1StepMode( 1 );
|
||||
|
||||
var result = plugin.GenerateComparePage( globals.getFolder( self ), regCGI, regRoot, metadataMode, reggieData );
|
||||
|
||||
plugin.DialerHangup();
|
||||
//if ( localFlag != "yes" )
|
||||
// globals.oneStepSemaphore = true;
|
||||
|
||||
if ( result == true )
|
||||
window.location.replace( "compwrap.htm" );
|
||||
else
|
||||
window.location.replace( "error.htm" );
|
||||
}
|
||||
}
|
||||
|
||||
function saveData()
|
||||
{
|
||||
}
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
60
mozilla/cmd/dialup/as_html/2step.htm
Normal file
60
mozilla/cmd/dialup/as_html/2step.htm
Normal file
@@ -0,0 +1,60 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<HTML>
|
||||
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Account Setup</TITLE>
|
||||
<SCRIPT LANGUAGE="JavaScript" ARCHIVE="asw.jar" SRC="2step.js"></SCRIPT>
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js"></LINK>
|
||||
</HEAD>
|
||||
|
||||
<BODY BACKGROUND="images/bg.gif" BGCOLOR="cccccc" onLoad="loadData()" ID="2step100">
|
||||
|
||||
<!-- The layer below contains the Account Setup identifier. -->
|
||||
|
||||
<LAYER NAME="tagtext" LEFT=420 TOP=0 VISIBILITY=SHOW>
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=200 ID="nospace">
|
||||
<TR><TD HEIGHT=20 VALIGN=MIDDLE BACKGROUND="images/tag.gif">
|
||||
<B CLASS="previewtag">ACCOUNT SETUP</B>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</LAYER>
|
||||
|
||||
<!-- The layer below contains the headline and text of this screen -->
|
||||
|
||||
<P CLASS="title"><B>Connect to
|
||||
<SCRIPT LANGUAGE="JavaScript" ID="2step101">insertISPName();</SCRIPT>
|
||||
</B></P>
|
||||
|
||||
<P>Account Setup will now connect you to
|
||||
<SCRIPT LANGUAGE="JavaScript" ID="2step102">insertISPName();</SCRIPT>
|
||||
so that you can create an account with this ISP. (Note: It may take a minute for your modem to connect to this ISP.)</P>
|
||||
<P>After you have connected to
|
||||
<SCRIPT LANGUAGE="JavaScript" ID="2step103">insertISPName();</SCRIPT>
|
||||
you will be asked to supply account and billing information, such as your desired electronic mail name and password, and credit card information.</P>
|
||||
|
||||
<CENTER>
|
||||
<SCRIPT LANGUAGE="JavaScript" ID="2step104">
|
||||
generatePopNumberList();
|
||||
</SCRIPT>
|
||||
</CENTER>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
91
mozilla/cmd/dialup/as_html/2step.js
Normal file
91
mozilla/cmd/dialup/as_html/2step.js
Normal file
@@ -0,0 +1,91 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
var globals = parent.parent.globals;
|
||||
var controls = parent.controls;
|
||||
|
||||
function go( msg )
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
|
||||
|
||||
// * skip if we're in edit mode
|
||||
if ( globals.document.vars.editMode.value != "yes" )
|
||||
{
|
||||
if ( document.forms && document.forms[ 0 ] && document.forms[ 0 ].popList )
|
||||
globals.document.setupPlugin.CreateConfigIAS(
|
||||
globals.selectedISP, document.forms[ 0 ].popList.selectedIndex );
|
||||
else
|
||||
globals.document.setupPlugin.CreateConfigIAS( globals.selectedISP, -1 );
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkData()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function saveData()
|
||||
{
|
||||
}
|
||||
|
||||
function insertISPName()
|
||||
{
|
||||
document.write( globals.getSelectedISPName() );
|
||||
}
|
||||
|
||||
function loadData()
|
||||
{
|
||||
//parent.twostepfooter.document.writeln( "<BODY BACKGROUND='images/bg.gif' BGCOLOR='cccccc'>" );
|
||||
//parent.twostepfooter.document.writeln( "<P>If you have trouble setting up your account call " );
|
||||
//parent.twostepfooter.document.writeln( globals.getSelectedISPName() );
|
||||
//parent.twostepfooter.document.writeln( "at (support number).</P>" );
|
||||
//parent.twostepfooter.document.close();
|
||||
|
||||
if ( controls.generateControls )
|
||||
controls.generateControls();
|
||||
}
|
||||
|
||||
function generatePopNumberList()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
|
||||
|
||||
var list = globals.document.setupPlugin.GetISPPopList( globals.selectedISP );
|
||||
|
||||
globals.debug( "generating pop list" );
|
||||
if ( list && list.length > 0 )
|
||||
{
|
||||
globals.debug( "emitting table" );
|
||||
document.writeln( "<TABLE CELLPADDING=2 CELLSPACING=0 ID='minspace'><TR><TD ALIGN=LEFT VALIGN=TOP HEIGHT=25><spacer type=vertical size=2><B>Pick a phone number from the following list to connect to:</B></TD><TD ALIGN=LEFT VALIGN=TOP><FORM><SELECT NAME='popList'>");
|
||||
for ( var x = 0; x < list.length; x++ )
|
||||
{
|
||||
var name = list[ x ];
|
||||
var selected = ( x == 0 ) ? " SELECTED" : "";
|
||||
document.writeln( "<OPTION VALUE='" + x + "'" + selected + ">" + name );
|
||||
}
|
||||
document.writeln( "</SELECT></FORM></TD></TR></TABLE>" );
|
||||
}
|
||||
}
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
134
mozilla/cmd/dialup/as_html/aboutbox.htm
Normal file
134
mozilla/cmd/dialup/as_html/aboutbox.htm
Normal file
@@ -0,0 +1,134 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="aboutbox.js">
|
||||
</SCRIPT>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR=EEEEEE onLoad="loadData()" ID="aboutbox100">
|
||||
|
||||
<LAYER NAME="programName" VISIBILITY=hidden LEFT=-100 TOP=0 HEIGHT=100 WIDTH=100>
|
||||
<TABLE BORDER=0 WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=top><STRONG>Account Setup</STRONG><BR>4.0</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="programDesc" VISIBILITY=hidden LEFT=250 TOP=-100 HEIGHT=100 WIDTH=100>
|
||||
<TABLE BORDER=0 WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=top><STRONG>Internet<BR>Signup<BR>Program</STRONG></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="programCopyRight" VISIBILITY=hidden LEFT=740 TOP=0 HEIGHT=100 WIDTH=200>
|
||||
<TABLE BORDER=0 WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=top>Copyright © 1996, 1997<BR>Netscape Communications Corp.<BR>All Rights Reserved.</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="ProgramThanks" VISIBILITY=hidden LEFT=10 TOP=480 WIDTH=580>
|
||||
<CENTER>Brought to you by:</CENTER>
|
||||
<BR>
|
||||
|
||||
<TABLE BORDER=0 WIDTH="100%" BGCOLOR=CCCCCC>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Client Engineering</STRONG></TD>
|
||||
<TD>Robert John Churchill, Rex Lam, Tim McClarren, Arshad Tayyeb, Cathleen Wang, Stella Yun</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>FreePPP</STRONG></TD>
|
||||
<TD>Steve Dagley</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Server Engineering</STRONG></TD>
|
||||
<TD>Steve Elmer, Lucy Wu</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Documentation/Help</STRONG></TD>
|
||||
<TD>Dirk Dougherty, Robin Foster, Kate O'Day</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>User Experience</STRONG></TD>
|
||||
<TD>Jim Corban, Valerie Hunter</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Kwality Assurance</STRONG></TD>
|
||||
<TD>Aracely Areas, John Bennett, Bruce Gay, Sarah Groves, Vashti Holt, Brent Martin, Dylan Shea, John Unruh, Pascal Vin</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Release Engineering</STRONG></TD>
|
||||
<TD>Don Bragg, Doug Turner, Chris Yeh</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>International</STRONG></TD>
|
||||
<TD>David Yett</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Management</STRONG></TD>
|
||||
<TD>Leland Hambley, Nancy Wang, Monique Barbanson</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Marketing</STRONG></TD>
|
||||
<TD>Ken Hickman, Debra Evans, John Freeborg, Julie Herendeen</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Thanks!</STRONG></TD>
|
||||
<TD>The entire Communicator team!</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD ALIGN=center VALIGN=middle><STRONG>Thank Goodness for...</STRONG></TD>
|
||||
<TD>Mountain Dew!</TD>
|
||||
</TR>
|
||||
|
||||
</TABLE>
|
||||
|
||||
</CENTER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="NetscapeIcon" VISIBILITY=hidden LEFT=250 TOP=90 WIDTH=100 HEIGHT=50>
|
||||
<CENTER>
|
||||
<IMG SRC="images/netscape.gif" WIDTH=32 HEIGHT=32 BORDER=0><BR>
|
||||
<LAYER NAME="NetscapeString" VISIBILITY=hidden LEFT=16>
|
||||
Go Netscape!
|
||||
</LAYER>
|
||||
</CENTER>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
</BODY>
|
||||
|
||||
</HTML>
|
||||
113
mozilla/cmd/dialup/as_html/aboutbox.js
Normal file
113
mozilla/cmd/dialup/as_html/aboutbox.js
Normal file
@@ -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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
function go( msg )
|
||||
{
|
||||
if ( msg=="Back" )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkData()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function loadData()
|
||||
{
|
||||
if ( parent && parent.controls && parent.controls.generateControls )
|
||||
{
|
||||
parent.controls.generateControls();
|
||||
}
|
||||
document.layers[ "programName" ].visibility = "SHOW";
|
||||
animate1();
|
||||
}
|
||||
|
||||
function saveData()
|
||||
{
|
||||
}
|
||||
|
||||
function animate1()
|
||||
{
|
||||
if ( document.layers[ "programName" ].left < 100 )
|
||||
{
|
||||
document.layers[ "programName" ].moveBy( 10, 0 );
|
||||
setTimeout( "animate1()", 100 );
|
||||
}
|
||||
else
|
||||
{
|
||||
document.layers[ "programDesc" ].visibility = "SHOW";
|
||||
animate2();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function animate2()
|
||||
{
|
||||
if ( document.layers[ "programDesc" ].top < 0 )
|
||||
{
|
||||
document.layers[ "programDesc" ].moveBy( 0, 10 );
|
||||
setTimeout( "animate2()", 100 );
|
||||
}
|
||||
else
|
||||
{
|
||||
document.layers[ "programCopyRight" ].visibility = "SHOW";
|
||||
animate3();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function animate3()
|
||||
{
|
||||
if ( document.layers[ "programCopyRight" ].left > 380 )
|
||||
{
|
||||
document.layers[ "programCopyRight" ].moveBy( -10, 0);
|
||||
setTimeout( "animate3()", 100 );
|
||||
}
|
||||
else
|
||||
{
|
||||
document.layers[ "NetscapeIcon" ].visibility = "SHOW";
|
||||
document.layers[ "ProgramThanks" ].visibility = "SHOW";
|
||||
animate4();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function animate4()
|
||||
{
|
||||
if ( document.layers[ "ProgramThanks" ].top > 50 )
|
||||
{
|
||||
document.layers[ "NetscapeIcon" ].moveBy( 0, 5 );
|
||||
document.layers[ "ProgramThanks" ].moveBy( 0, -10 );
|
||||
setTimeout( "animate4()", 100 );
|
||||
}
|
||||
else
|
||||
{
|
||||
document.layers[ "NetscapeIcon" ].document.layers[ "NetscapeString" ].visibility = "SHOW";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
104
mozilla/cmd/dialup/as_html/accounts.htm
Normal file
104
mozilla/cmd/dialup/as_html/accounts.htm
Normal file
@@ -0,0 +1,104 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<HTML>
|
||||
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Account Setup</TITLE>
|
||||
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="accounts.js">
|
||||
</SCRIPT>
|
||||
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js">
|
||||
</LINK>
|
||||
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY BACKGROUND="images/bg.gif" BGCOLOR="cccccc" ONLOAD="loadData()" ID="accounts100">
|
||||
|
||||
|
||||
<!-- The layer below contains the Account Setup identifier. -->
|
||||
|
||||
<LAYER NAME = "tagtext" LEFT = 420 TOP = 0 VISIBILITY = SHOW>
|
||||
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=200 ID="nospace">
|
||||
<TR><TD HEIGHT=20 VALIGN=MIDDLE BACKGROUND="images/tag.gif">
|
||||
<B CLASS="previewtag">ACCOUNT SETUP</B>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</LAYER>
|
||||
|
||||
|
||||
<!-- The layer below contains the headline and text of this screen -->
|
||||
|
||||
|
||||
<FORM>
|
||||
|
||||
|
||||
<P CLASS="title"><B>Welcome to Account Setup</B></P>
|
||||
|
||||
<!-- ÇSPACER TYPE=VERTICAL SIZE=16È -->
|
||||
|
||||
<P>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.</P>
|
||||
|
||||
<SPACER TYPE=HORIZONTAL SIZE=72>
|
||||
|
||||
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="500">
|
||||
<TR>
|
||||
<TD ALIGN=LEFT VALIGN="TOP" WIDTH="66" HEIGHT="54" ALIGN="LEFT">
|
||||
<A HREF="about:blank" ONCLICK="document.images['new'].src='images/str_dn.gif'; setPath('New Path'); return false" ONMOUSEOVER="document.images['new'].src='images/str_mo.gif'" ONMOUSEOUT="document.images['new'].src='images/start.gif'" ID="accounts101">
|
||||
<IMG NAME="new" SRC="images/start.gif" LOWSRC="images/str_dn.gif" BORDER=0 HEIGHT=53 WIDTH=54></A>
|
||||
</TD>
|
||||
|
||||
<TD ALIGN=LEFT WIDTH="358" VALIGN="TOP" CLASS="accounts">
|
||||
|
||||
<B>I want to create a new Internet account.</B>
|
||||
|
||||
<SPACER TYPE=VERTICAL SIZE=4>
|
||||
|
||||
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.
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><SPACER TYPE=VERTICAL SIZE=16>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="66" HEIGHT="54" ALIGN="LEFT">
|
||||
<A HREF="about:blank" ONCLICK="document.images['existing'].src='images/str_dn.gif'; setPath('Existing Path'); return false" ONMOUSEOVER="document.images['existing'].src='images/str_mo.gif'" ONMOUSEOUT="document.images['existing'].src='images/start.gif'" ID="accounts102">
|
||||
<IMG NAME="existing" SRC="images/start.gif" LOWSRC="images/str_dn.gif" BORDER=0 HEIGHT=53 WIDTH=54></A>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" WIDTH="358" VALIGN="TOP" CLASS="accounts">
|
||||
|
||||
<B>I already have an Internet account. I want to set up Communicator to access my account.</B>
|
||||
|
||||
<SPACER TYPE=VERTICAL SIZE=4>
|
||||
|
||||
If you already have an Internet account with an Internet service provider, Account Setup helps you quickly set up Communicator to access your account.
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
67
mozilla/cmd/dialup/as_html/accounts.js
Normal file
67
mozilla/cmd/dialup/as_html/accounts.js
Normal file
@@ -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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
|
||||
|
||||
function go(msg)
|
||||
{
|
||||
if (msg == parent.parent.globals.document.vars.path.value) {
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doGo()
|
||||
{
|
||||
parent.controls.go("Next");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setPath(msg)
|
||||
{
|
||||
parent.parent.globals.document.vars.path.value = msg;
|
||||
setTimeout("doGo()",1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkData()
|
||||
{
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadData()
|
||||
{
|
||||
if (parent.controls.generateControls) parent.controls.generateControls();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function saveData()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
120
mozilla/cmd/dialup/as_html/acctInfo.htm
Normal file
120
mozilla/cmd/dialup/as_html/acctInfo.htm
Normal file
@@ -0,0 +1,120 @@
|
||||
<!-- -*- Mode: HTML; tab-width: 2; 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.
|
||||
-->
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<HTML>
|
||||
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Account Setup</TITLE>
|
||||
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="acctInfo.js">
|
||||
</SCRIPT>
|
||||
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js">
|
||||
</LINK>
|
||||
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY BACKGROUND="images/bg.gif" BGCOLOR="cccccc" onLoad="loadData()" ID="acctInfo100">
|
||||
|
||||
|
||||
<!-- The layer below contains the Account Setup identifier. -->
|
||||
|
||||
<LAYER NAME = "tagtext" LEFT = 420 TOP = 0 VISIBILITY = SHOW>
|
||||
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=200 ID="nospace">
|
||||
<TR><TD HEIGHT=20 VALIGN=MIDDLE BACKGROUND="images/tag.gif">
|
||||
<B CLASS="previewtag">ACCOUNT SETUP</B>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</LAYER>
|
||||
|
||||
|
||||
<!-- The layer below contains the headline and text of this screen -->
|
||||
|
||||
|
||||
|
||||
|
||||
<FORM>
|
||||
|
||||
<P CLASS="title"><B>Information About Yourself</B></P>
|
||||
|
||||
<P>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. </P>
|
||||
|
||||
<CENTER>
|
||||
|
||||
|
||||
<TABLE CELLPADDING="3" CELLSPACING="0" border="0" WIDTH=100>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD ALIGN="CENTER" VALIGN="BOTTOM" CLASS="tabletext">
|
||||
First:
|
||||
</TD>
|
||||
<TD ALIGN="CENTER" VALIGN="BOTTOM" CLASS="tabletext">
|
||||
Last:
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD VALIGN="BOTTOM" ALIGN="RIGHT" CLASS="tabletext">
|
||||
<B>Name:</B>
|
||||
<spacer type=vertical size=2>
|
||||
</FONT>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="TOP" CLASS="tabletext">
|
||||
<INPUT NAME="first" TYPE="text" SIZE=25 MAXLENGTH=30>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="TOP" CLASS="tabletext">
|
||||
<INPUT NAME="last" TYPE="text" SIZE=26 MAXLENGTH=30>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD COLSPAN="3">
|
||||
<spacer type=vertical size=2>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD VALIGN="BOTTOM" ALIGN="RIGHT" CLASS="tabletext">
|
||||
<B>Organization:</B>
|
||||
<spacer type=vertical size=2>
|
||||
</FONT>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="TOP" COLSPAN="2" CLASS="tabletext">
|
||||
<INPUT NAME="company" TYPE="text" SIZE=54 MAXLENGTH=30>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
|
||||
</FORM>
|
||||
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
107
mozilla/cmd/dialup/as_html/acctInfo.js
Normal file
107
mozilla/cmd/dialup/as_html/acctInfo.js
Normal file
@@ -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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
|
||||
|
||||
function go()
|
||||
{
|
||||
if (parent.parent.globals.document.vars.editMode.value == "yes")
|
||||
return true;
|
||||
else
|
||||
return(checkData());
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkData()
|
||||
{
|
||||
if (document.forms[0].first.value == "") {
|
||||
alert("You must enter a first name.");
|
||||
document.forms[0].first.focus();
|
||||
document.forms[0].first.select();
|
||||
return false;
|
||||
}
|
||||
if (document.forms[0].last.value == "") {
|
||||
alert("You must enter a last name.");
|
||||
document.forms[0].last.focus();
|
||||
document.forms[0].last.select();
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
if (document.forms[0].areaCode.value == "") {
|
||||
alert("You must enter an area code.");
|
||||
document.forms[0].areaCode.focus();
|
||||
document.forms[0].areaCode.select();
|
||||
return false;
|
||||
}
|
||||
if (document.forms[0].phoneNumber.value == "") {
|
||||
alert("You must enter a telephone number.");
|
||||
document.forms[0].phoneNumber.focus();
|
||||
document.forms[0].phoneNumber.select();
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadData()
|
||||
{
|
||||
// make sure all data objects/element exists and valid; otherwise, reload. SUCKS!
|
||||
if (((document.forms[0].first == "undefined") || (document.forms[0].first == "[object InputArray]")) ||
|
||||
((document.forms[0].last == "undefined") || (document.forms[0].last == "[object InputArray]")) ||
|
||||
((document.forms[0].company == "undefined") || (document.forms[0].company == "[object InputArray]")))
|
||||
{
|
||||
parent.controls.reloadDocument();
|
||||
return;
|
||||
}
|
||||
|
||||
document.forms[0].first.value = parent.parent.globals.document.vars.first.value;
|
||||
document.forms[0].last.value = parent.parent.globals.document.vars.last.value;
|
||||
document.forms[0].company.value = parent.parent.globals.document.vars.company.value;
|
||||
// document.forms[0].areaCode.value = parent.parent.globals.document.vars.areaCode.value;
|
||||
// document.forms[0].phoneNumber.value = parent.parent.globals.document.vars.phoneNumber.value;
|
||||
parent.parent.globals.setFocus(document.forms[0].first);
|
||||
if (parent.controls.generateControls) parent.controls.generateControls();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function saveData()
|
||||
{
|
||||
// make sure all form element are valid objects, otherwise just skip & return!
|
||||
if (((document.forms[0].first == "undefined") || (document.forms[0].first == "[object InputArray]")) ||
|
||||
((document.forms[0].last == "undefined") || (document.forms[0].last == "[object InputArray]")) ||
|
||||
((document.forms[0].company == "undefined") || (document.forms[0].company == "[object InputArray]")))
|
||||
{
|
||||
parent.controls.reloadDocument();
|
||||
return;
|
||||
}
|
||||
|
||||
parent.parent.globals.document.vars.first.value = document.forms[0].first.value;
|
||||
parent.parent.globals.document.vars.last.value = document.forms[0].last.value;
|
||||
parent.parent.globals.document.vars.company.value = document.forms[0].company.value;
|
||||
// parent.parent.globals.document.vars.areaCode.value = document.forms[0].areaCode.value;
|
||||
// parent.parent.globals.document.vars.phoneNumber.value = document.forms[0].phoneNumber.value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
175
mozilla/cmd/dialup/as_html/billing.htm
Normal file
175
mozilla/cmd/dialup/as_html/billing.htm
Normal file
@@ -0,0 +1,175 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<HTML>
|
||||
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Account Setup</TITLE>
|
||||
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="billing.js">
|
||||
</SCRIPT>
|
||||
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js">
|
||||
</LINK>
|
||||
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY BACKGROUND="images/bg.gif" BGCOLOR="cccccc" onLoad="loadData()" ID="billing100">
|
||||
|
||||
|
||||
<!-- The layer below contains the Account Setup identifier. -->
|
||||
|
||||
<LAYER NAME = "tagtext" LEFT = 420 TOP = 0 VISIBILITY = SHOW>
|
||||
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=200 ID="nospace">
|
||||
<TR><TD HEIGHT=20 VALIGN=MIDDLE BACKGROUND="images/tag.gif">
|
||||
<B CLASS="previewtag">ACCOUNT SETUP</B>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</LAYER>
|
||||
|
||||
|
||||
<!-- The layer below contains the headline and text of this screen -->
|
||||
|
||||
|
||||
<FORM>
|
||||
|
||||
<P CLASS="title"><B>Your Billing Information</B></P>
|
||||
|
||||
<P>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. </P>
|
||||
|
||||
|
||||
|
||||
<CENTER>
|
||||
|
||||
<TABLE CELLPADDING="2" CELLSPACING="0" border="0">
|
||||
<TR>
|
||||
<TD VALIGN="BOTTOM" ALIGN="RIGHT">
|
||||
<B>Name on Card:</B>
|
||||
<spacer type=vertical size=2>
|
||||
</FONT>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="MIDDLE">
|
||||
<INPUT NAME="cardname" TYPE="text" SIZE=30 MAXLENGTH=30>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
|
||||
<TR>
|
||||
<TD COLSPAN="3">
|
||||
<spacer type=vertical size=6>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD VALIGN="BOTTOM" ALIGN="RIGHT">
|
||||
<B>Type of Card:</B>
|
||||
<spacer type=vertical size=4>
|
||||
</FONT>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="MIDDLE">
|
||||
<SELECT NAME="cards">
|
||||
<SCRIPT LANGUAGE="JavaScript" ID="billing101">
|
||||
generateCards();
|
||||
</SCRIPT>
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
|
||||
<TR>
|
||||
<TD COLSPAN="3">
|
||||
<spacer type=vertical size=3>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD VALIGN="BOTTOM" ALIGN="RIGHT">
|
||||
<spacer type=vertical size=6>
|
||||
<B>Card Number:</B>
|
||||
<spacer type=vertical size=2>
|
||||
</FONT>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="MIDDLE">
|
||||
<spacer type=vertical size=4>
|
||||
<INPUT NAME="cardnumber" TYPE="text" SIZE=25 MAXLENGTH=25>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
|
||||
<TR>
|
||||
<TD COLSPAN="3">
|
||||
<spacer type=vertical size=6>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD VALIGN="BOTTOM" ALIGN="RIGHT">
|
||||
<B>Expiration Date:</B>
|
||||
<spacer type=vertical size=4>
|
||||
</FONT>
|
||||
</TD>
|
||||
<TD ALIGN="LEFT" VALIGN="MIDDLE">
|
||||
|
||||
<SELECT NAME="month">
|
||||
<OPTION VALUE="January">January
|
||||
<OPTION VALUE="February">February
|
||||
<OPTION VALUE="March">March
|
||||
<OPTION VALUE="April">April
|
||||
<OPTION VALUE="May">May
|
||||
<OPTION VALUE="June">June
|
||||
<OPTION VALUE="July">July
|
||||
<OPTION VALUE="August">August
|
||||
<OPTION VALUE="September">September
|
||||
<OPTION VALUE="October">October
|
||||
<OPTION VALUE="November">November
|
||||
<OPTION VALUE="December">December
|
||||
</SELECT>
|
||||
|
||||
<spacer type=horizontal size=2>
|
||||
|
||||
<SELECT NAME="year">
|
||||
<OPTION VALUE="1997">1997
|
||||
<OPTION VALUE="1998">1998
|
||||
<OPTION VALUE="1999">1999
|
||||
<OPTION VALUE="2000">2000
|
||||
<OPTION VALUE="2001">2001
|
||||
<OPTION VALUE="2002">2002
|
||||
<OPTION VALUE="2003">2003
|
||||
<OPTION VALUE="2004">2004
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</CENTER>
|
||||
|
||||
</FORM>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
319
mozilla/cmd/dialup/as_html/billing.js
Normal file
319
mozilla/cmd/dialup/as_html/billing.js
Normal file
@@ -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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
|
||||
|
||||
function go(msg)
|
||||
{
|
||||
if (parent.parent.globals.document.vars.editMode.value == "yes")
|
||||
return true;
|
||||
else
|
||||
return(checkData());
|
||||
}
|
||||
|
||||
|
||||
|
||||
function generateCards()
|
||||
{
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename(self);
|
||||
var theCards = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","CardTypes");
|
||||
if (theCards == null || theCards == "") {
|
||||
theCards = "AX,DC,MC,VI";
|
||||
}
|
||||
|
||||
if (theCards.indexOf("AX")>=0) {
|
||||
document.writeln("<OPTION VALUE='American Express'>American Express");
|
||||
}
|
||||
if (theCards.indexOf("DC")>=0) {
|
||||
document.writeln("<OPTION VALUE='Discover Card'>Discover Card");
|
||||
}
|
||||
if (theCards.indexOf("MC")>=0) {
|
||||
document.writeln("<OPTION VALUE='MasterCard'>MasterCard");
|
||||
}
|
||||
if (theCards.indexOf("VI")>=0) {
|
||||
document.writeln("<OPTION VALUE='VISA'>VISA");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadData()
|
||||
{
|
||||
// make sure all data objects/element exists and valid; otherwise, reload. SUCKS!
|
||||
if (((document.forms[0].cardname == "undefined") || (document.forms[0].cardname == "[object InputArray]")) ||
|
||||
((document.forms[0].cards == "undefined") || (document.forms[0].cards == "[object InputArray]")) ||
|
||||
((document.forms[0].cardnumber == "undefined") || (document.forms[0].cardnumber == "[object InputArray]")) ||
|
||||
((document.forms[0].month == "undefined") || (document.forms[0].month == "[object InputArray]")) ||
|
||||
((document.forms[0].year == "undefined") || (document.forms[0].year == "[object InputArray]")))
|
||||
{
|
||||
parent.controls.reloadDocument();
|
||||
return;
|
||||
}
|
||||
|
||||
document.forms[0].cardname.value = parent.parent.globals.document.vars.cardname.value;
|
||||
if (document.forms[0].cardname.value == "") {
|
||||
document.forms[0].cardname.value = parent.parent.globals.document.vars.first.value + " " + parent.parent.globals.document.vars.last.value;
|
||||
}
|
||||
for (var i = 0; i<document.forms[0].cards.length; i++) {
|
||||
if (parent.parent.globals.document.vars.cardtype.value == document.forms[0].cards[i].value) {
|
||||
document.forms[0].cards.selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
document.forms[0].cardnumber.value = parent.parent.globals.document.vars.cardnumber.value;
|
||||
|
||||
var month = parent.parent.globals.document.vars.month.value;
|
||||
if (month == "") month = 0;
|
||||
document.forms[0].month.selectedIndex = month;
|
||||
|
||||
var found = false;
|
||||
var year = parent.parent.globals.document.vars.year.value;
|
||||
// if (year == "") year = document.forms[0].year[0].value;
|
||||
for (var i = 0; i<document.forms[0].year.length; i++) {
|
||||
if (year == document.forms[0].year[i].value) {
|
||||
document.forms[0].year.selectedIndex = i;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found == false) {
|
||||
document.forms[0].year.selectedIndex = 0;
|
||||
}
|
||||
parent.parent.globals.setFocus(document.forms[0].cardname);
|
||||
if (parent.controls.generateControls) parent.controls.generateControls();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function saveData()
|
||||
{
|
||||
// make sure all form element are valid objects, otherwise just skip & return!
|
||||
if (((document.forms[0].cardname == "undefined") || (document.forms[0].cardname == "[object InputArray]")) ||
|
||||
((document.forms[0].cards == "undefined") || (document.forms[0].cards == "[object InputArray]")) ||
|
||||
((document.forms[0].cardnumber == "undefined") || (document.forms[0].cardnumber == "[object InputArray]")) ||
|
||||
((document.forms[0].month == "undefined") || (document.forms[0].month == "[object InputArray]")) ||
|
||||
((document.forms[0].year == "undefined") || (document.forms[0].year == "[object InputArray]")))
|
||||
{
|
||||
parent.controls.reloadDocument();
|
||||
return;
|
||||
}
|
||||
|
||||
parent.parent.globals.document.vars.cardname.value = document.forms[0].cardname.value;
|
||||
if (document.forms[0].cards.length>0 && document.forms[0].cards.selectedIndex >=0) {
|
||||
parent.parent.globals.document.vars.cardtype.value = document.forms[0].cards[document.forms[0].cards.selectedIndex].value;
|
||||
}
|
||||
else {
|
||||
parent.parent.globals.document.vars.cardtype.value="";
|
||||
}
|
||||
parent.parent.globals.document.vars.cardnumber.value = document.forms[0].cardnumber.value;
|
||||
parent.parent.globals.document.vars.month.value = document.forms[0].month.selectedIndex;
|
||||
parent.parent.globals.document.vars.year.value = document.forms[0].year[document.forms[0].year.selectedIndex].value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkData()
|
||||
{
|
||||
if (document.forms[0].cardname.value == "") {
|
||||
alert("You must enter a cardholder name.");
|
||||
document.forms[0].cardname.focus();
|
||||
document.forms[0].cardname.select();
|
||||
return false;
|
||||
}
|
||||
if (document.forms[0].cardnumber.value == "") {
|
||||
alert("You must enter a credit card number.");
|
||||
document.forms[0].cardnumber.focus();
|
||||
document.forms[0].cardnumber.select();
|
||||
return false;
|
||||
}
|
||||
|
||||
// check cardnumber validity here
|
||||
|
||||
var cardNumber=document.forms[0].cardnumber.value;
|
||||
for (var i=0; i<cardNumber.length; i++) {
|
||||
if ("1234567890 -".indexOf(cardNumber.substring(i,i+1)) == -1) {
|
||||
alert("'" + cardNumber + "' is not a valid card number.");
|
||||
document.forms[0].cardnumber.focus();
|
||||
document.forms[0].cardnumber.select();
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
|
||||
// do cardnumber check-digit validity here
|
||||
|
||||
var length=cardNumber.length;
|
||||
var checkDigit=cardNumber.substring(length-1,length);
|
||||
var tempCardNumber="";
|
||||
for (var i=0; i<cardNumber.length; i++) {
|
||||
if ("1234567890".indexOf(cardNumber.substring(i,i+1))>=0) {
|
||||
tempCardNumber+=cardNumber.substring(i,i+1);
|
||||
}
|
||||
}
|
||||
var length=tempCardNumber.length;
|
||||
var checkSum=0;
|
||||
for (var i=0; i<length-1; i++) {
|
||||
var digit=tempCardNumber.substring(length-i-2,length-i-1);
|
||||
var temp=digit * (1+((i+1)%2));
|
||||
if (temp<10) checkSum=checkSum+temp;
|
||||
else checkSum=checkSum+(temp-9);
|
||||
}
|
||||
checkSum=(10-(checkSum%10))%10;
|
||||
if (checkSum != checkDigit) {
|
||||
alert("'" + cardNumber + "' is not a valid card number.");
|
||||
document.forms[0].cardnumber.focus();
|
||||
document.forms[0].cardnumber.select();
|
||||
return(false);
|
||||
}
|
||||
|
||||
// do cardtype check
|
||||
|
||||
var cardType="";
|
||||
|
||||
if (cardNumber.substring(0,1)=="3" && cardNumber.substring(1,2)=="7") {
|
||||
cardType="American Express";
|
||||
cardCode="AX";
|
||||
}
|
||||
/*
|
||||
else if (cardNumber.substring(0,1)=="5" && cardNumber.substring(1,2)=="6") {
|
||||
cardType="BankCard";
|
||||
cardCode="BC";
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
else if (cardNumber.substring(0,1)=="3") {
|
||||
cardType="Diner's Club";
|
||||
cardCode="DI";
|
||||
}
|
||||
*/
|
||||
else if (cardNumber.substring(0,1)=="5") {
|
||||
cardType="MasterCard";
|
||||
cardCode="MC";
|
||||
}
|
||||
else if (cardNumber.substring(0,1)=="4") {
|
||||
cardType="VISA";
|
||||
cardCode="VI";
|
||||
}
|
||||
else if (cardNumber.substring(0,1)=="6") {
|
||||
cardType="Discover Card";
|
||||
cardCode="DC";
|
||||
}
|
||||
// else cardType="unknown";
|
||||
|
||||
parent.parent.globals.document.vars.cardcode.value = cardCode;
|
||||
|
||||
if (document.forms[0].cards.length>0) {
|
||||
if (cardType != document.forms[0].cards[document.forms[0].cards.selectedIndex].value) {
|
||||
var found=false;
|
||||
var currentSelection = document.forms[0].cards.selectedIndex;
|
||||
if (cardType!="") {
|
||||
if (!confirm(cardNumber + " is a " + cardType + ". Correct?")) {
|
||||
document.forms[0].cardnumber.focus();
|
||||
document.forms[0].cardnumber.select();
|
||||
return(false);
|
||||
}
|
||||
for (var i = 0; i < document.forms[0].cards.length; i++) {
|
||||
if (document.forms[0].cards[i].value==cardType) {
|
||||
document.forms[0].cards[i].selected=true;
|
||||
parent.parent.globals.document.vars.cardtype.value=cardType;
|
||||
found=true;
|
||||
}
|
||||
else {
|
||||
document.forms[0].cards[i].selected=false;
|
||||
}
|
||||
}
|
||||
if (found == false && currentSelection>=0) {
|
||||
document.forms[0].cards[currentSelection].selected=true;
|
||||
}
|
||||
}
|
||||
|
||||
if (found==false) {
|
||||
|
||||
// is the card accepted?
|
||||
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename(self);
|
||||
var theCards = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","CardTypes");
|
||||
if (theCards == null || theCards == "") {
|
||||
theCards = "AX,DC,MC,VI";
|
||||
}
|
||||
|
||||
if (theCards.indexOf(cardCode)<0) {
|
||||
alert(cardType + " is not accepted for payment.");
|
||||
}
|
||||
else {
|
||||
alert("'" + cardNumber + "' is not a valid card number.");
|
||||
}
|
||||
document.forms[0].cardnumber.focus();
|
||||
document.forms[0].cardnumber.select();
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
|
||||
// check credit card lengths
|
||||
|
||||
var length=tempCardNumber.length;
|
||||
var validLength = false;
|
||||
if (cardCode != "") {
|
||||
if (cardCode == "AX") {
|
||||
if (length == 16) validLength=true;
|
||||
}
|
||||
else if (cardCode == "MC") {
|
||||
if (length == 16) validLength=true;
|
||||
}
|
||||
else if (cardCode == "VI") {
|
||||
if (length == 13 || length == 16) validLength=true;
|
||||
}
|
||||
else if (cardCode == "DC") {
|
||||
if (length == 16) validLength=true;
|
||||
}
|
||||
}
|
||||
if (validLength == false) {
|
||||
alert("'" + cardNumber + "' is not a valid card number. (Invalid length)");
|
||||
document.forms[0].cardnumber.focus();
|
||||
document.forms[0].cardnumber.select();
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
|
||||
// check month and year
|
||||
|
||||
var today = new Date();
|
||||
var theMonth = today.getMonth();
|
||||
var theYear = today.getYear()+1900;
|
||||
|
||||
var expiredFlag = false;
|
||||
if (theYear > document.forms[0].year[document.forms[0].year.selectedIndex].value) {
|
||||
expiredFlag = true;
|
||||
}
|
||||
else if (theYear == document.forms[0].year[document.forms[0].year.selectedIndex].value) {
|
||||
if (theMonth > document.forms[0].month.selectedIndex) {
|
||||
expiredFlag = true;
|
||||
}
|
||||
}
|
||||
if (expiredFlag) {
|
||||
alert("'" + cardNumber + "' appears to have expired.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
223
mozilla/cmd/dialup/as_html/clayer.htm
Normal file
223
mozilla/cmd/dialup/as_html/clayer.htm
Normal file
@@ -0,0 +1,223 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<HTML>
|
||||
|
||||
|
||||
|
||||
<HEAD>
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="clayer1.js">
|
||||
</SCRIPT>
|
||||
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="clayer2.js">
|
||||
</SCRIPT>
|
||||
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js" >
|
||||
</LINK>
|
||||
|
||||
</HEAD>
|
||||
|
||||
|
||||
|
||||
<BODY BACKGROUND="images/navbar.gif" onLoad="loadData()" ID="clayer100">
|
||||
|
||||
|
||||
|
||||
<NOSCRIPT>
|
||||
<CENTER><STRONG>
|
||||
JavaScript support is disabled!<P>
|
||||
Choose "Edit | Preferences | Advanced" and enable JavaScript, then reload this page.<P>
|
||||
</CENTER></STRONG>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
|
||||
<LAYER NAME="controls" WIDTH=620 HEIGHT=55 TOP=0 LEFT=0>
|
||||
|
||||
<LAYER NAME="help" LEFT=4 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['help'].src='images/hlp_down.gif';var flag=go('Help');document.images['help'].src='images/hlp_up.gif';return false"
|
||||
onMouseOver="document.images['help'].src='images/hlp_mo.gif'"
|
||||
onMouseOut="document.images['help'].src='images/hlp_up.gif'" ID="clayer101">
|
||||
<IMG NAME="help" SRC="images/hlp_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=12 TOP=43>
|
||||
<B CLASS="clayer">HELP</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="exit" LEFT=50 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['exit'].src='images/ext_down.gif';var flag=go('Exit');document.images['exit'].src='images/ext_up.gif';return false"
|
||||
onMouseOver="document.images['exit'].src='images/ext_mo.gif'"
|
||||
onMouseOut="document.images['exit'].src='images/ext_up.gif'" ID="clayer102">
|
||||
<IMG NAME="exit" SRC="images/ext_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=12 TOP=43>
|
||||
<B CLASS="clayer">EXIT</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="back" LEFT=260 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['back'].src='images/bk_down.gif';var flag=go('Back');document.images['back'].src='images/bk_up.gif';return false"
|
||||
onMouseOver="document.images['back'].src='images/bk_mo.gif'"
|
||||
onMouseOut="document.images['back'].src='images/bk_up.gif'" ID="clayer103">
|
||||
<IMG NAME="back" SRC="images/bk_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=4 TOP=43>
|
||||
<B CLASS="clayer">BACK</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="next" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['next'].src='images/nxt_down.gif';var flag=go('Next');document.images['next'].src='images/nxt_up.gif';return false"
|
||||
onMouseOver="document.images['next'].src='images/nxt_mo.gif'"
|
||||
onMouseOut="document.images['next'].src='images/nxt_up.gif'" ID="clayer104">
|
||||
<IMG NAME="next" SRC="images/nxt_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=8 TOP=43>
|
||||
<B CLASS="clayer">NEXT</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="connectnow" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['connectnow'].src='images/cn_down.gif';var flag=go('Next');document.images['connectnow'].src='images/cn_up.gif';return false"
|
||||
onMouseOver="document.images['connectnow'].src='images/cn_mo.gif'"
|
||||
onMouseOut="document.images['connectnow'].src='images/cn_up.gif'" ID="clayer105">
|
||||
<IMG NAME="connectnow" SRC="images/cn_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=8 TOP=43>
|
||||
<B CLASS="clayer">CONNECT NOW</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="download" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['download'].src='images/cn_down.gif';var flag=go('Next');document.images['download'].src='images/cn_up.gif';return false"
|
||||
onMouseOver="document.images['download'].src='images/cn_mo.gif'"
|
||||
onMouseOut="document.images['download'].src='images/cn_up.gif'" ID="clayer113">
|
||||
<IMG NAME="download" SRC="images/cn_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=8 TOP=43>
|
||||
<B CLASS="clayer">CONNECT NOW</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="connectagain" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['connectagain'].src='images/nxt_down.gif';var flag=go('Next');document.images['connectagain'].src='images/nxt_up.gif';return false"
|
||||
onMouseOver="document.images['connectagain'].src='images/nxt_mo.gif'"
|
||||
onMouseOut="document.images['connectagain'].src='images/nxt_up.gif'" ID="clayer106">
|
||||
<IMG NAME="connectagain" SRC="images/nxt_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=8 TOP=43>
|
||||
<B CLASS="clayer">CONNECT AGAIN</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="connectserver" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['connectserver'].src='images/cn_down.gif';var flag=go('Next');document.images['connectserver'].src='images/cn_up.gif';return false"
|
||||
onMouseOver="document.images['connectserver'].src='images/cn_mo.gif'"
|
||||
onMouseOut="document.images['connectserver'].src='images/cn_up.gif'" ID="clayer107">
|
||||
<IMG NAME="connectserver" SRC="images/cn_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=8 TOP=43>
|
||||
<B CLASS="clayer">CONNECT TO NETSCAPE</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="connectisp" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['connectisp'].src='images/cn_down.gif';var flag=go('Next');document.images['connectisp'].src='images/cn_up.gif';return false"
|
||||
onMouseOver="document.images['connectisp'].src='images/cn_mo.gif'"
|
||||
onMouseOut="document.images['connectisp'].src='images/cn_up.gif'" ID="clayer114">
|
||||
<IMG NAME="connectisp" SRC="images/cn_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=8 TOP=43>
|
||||
<B CLASS="clayer">CONNECT TO ISP</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="done" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['done'].src='images/dn_down.gif';var flag=go('Done');document.images['done'].src='images/dn_up.gif';return false"
|
||||
onMouseOver="document.images['done'].src='images/dn_mo.gif'"
|
||||
onMouseOut="document.images['done'].src='images/dn_up.gif'" ID="clayer108">
|
||||
<IMG NAME="done" SRC="images/dn_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=4 TOP=43>
|
||||
<B CLASS="clayer">DONE</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="restart" LEFT=310 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['restart'].src='images/rb_down.gif';var flag=go('Restart');document.images['restart'].src='images/rb_up.gif';return false"
|
||||
onMouseOver="document.images['restart'].src='images/rb_mo.gif'"
|
||||
onMouseOut="document.images['restart'].src='images/rb_up.gif'" ID="clayer109">
|
||||
<IMG NAME="restart" SRC="images/rb_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=8 TOP=43>
|
||||
<B CLASS="clayer">RESTART</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="setup" LEFT=500 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=30 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['setup'].src='images/ff_down.gif';var flag=go('Setup');document.images['setup'].src='images/ff_up.gif';return false"
|
||||
onMouseOver="document.images['setup'].src='images/ff_mo.gif'"
|
||||
onMouseOut="document.images['setup'].src='images/ff_up.gif'" ID="clayer110">
|
||||
<IMG NAME="setup" SRC="images/ff_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=0 TOP=43>
|
||||
<B CLASS="clayer">ACCOUNT SETUP</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
<LAYER NAME="connectlater" LEFT=550 TOP=0 WIDTH=200 VISIBILITY=HIDE>
|
||||
<LAYER LEFT=4 TOP=6>
|
||||
<A HREF="about:blank" onClick="document.images['later'].src='images/dn_down.gif';var flag=go('Later');document.images['later'].src='images/dn_up.gif';return false"
|
||||
onMouseOver="document.images['later'].src='images/dn_mo.gif'"
|
||||
onMouseOut="document.images['later'].src='images/dn_up.gif'" ID="clayer111">
|
||||
<IMG NAME="later" SRC="images/dn_up.gif" BORDER=0 HEIGHT=32 WIDTH=32></A>
|
||||
</LAYER>
|
||||
|
||||
<LAYER LEFT=10 TOP=43>
|
||||
<B CLASS="clayer">DONE</B>
|
||||
</LAYER>
|
||||
</LAYER>
|
||||
|
||||
</LAYER>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
949
mozilla/cmd/dialup/as_html/clayer1.js
Normal file
949
mozilla/cmd/dialup/as_html/clayer1.js
Normal file
@@ -0,0 +1,949 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
|
||||
|
||||
compromisePrincipals();
|
||||
|
||||
|
||||
function page( file, section, variable )
|
||||
{
|
||||
this.type = "INFO";
|
||||
this.file = file;
|
||||
this.section = section;
|
||||
this.variable = variable;
|
||||
|
||||
this.fullhistory = false;
|
||||
this.top = false;
|
||||
}
|
||||
|
||||
// the following three functions make sense if you go look at the "Next" clause in the function
|
||||
// "go" below
|
||||
|
||||
// * a "condition" is read from the Account Setup init file (typically "Config\ACCTSET.INI"),
|
||||
// from the section "[section]" and the given variable name, and if the given "value" matches,
|
||||
// the "file" gets loaded
|
||||
function condition( file, section, variable, value )
|
||||
{
|
||||
this.type = "CONDITION";
|
||||
this.file = file;
|
||||
this.section = section;
|
||||
this.variable = variable;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
// * a "method" is given in "method" (a JavaScript method), and if when evaluated, it's value
|
||||
// is "value", the given "file" gets loaded
|
||||
function method( file, method, value )
|
||||
{
|
||||
this.type = "METHOD";
|
||||
this.file = file;
|
||||
this.method = method;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
// * an "action" simply loads the given "file"
|
||||
function action( file )
|
||||
{
|
||||
this.type = "ACTION";
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
function checkEditMode()
|
||||
{
|
||||
if ( parent.parent && parent.parent.globals && parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes" )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
pages=new Array();
|
||||
|
||||
pages[0]=new Array();
|
||||
pages[0][0]=new page("main.htm",null,null);
|
||||
pages[0][1]=new method("ipreview/inpvw1.htm","parent.content.go('Internet Preview')",true);
|
||||
pages[0][2]=new method("preview/duepvw1.htm","parent.content.go('Preview')",true);
|
||||
pages[0][3]=new method("intro/intro1.htm","parent.controls.checkShowIntroFlag('')",true);
|
||||
//pages[0][4]=new condition("intro/intro1.htm","Mode Selection","Show_Intro_Screens","yes");
|
||||
//pages[0][5]=new condition("needs1.htm","Mode Selection","ForceNew","yes");
|
||||
//pages[0][6]=new condition("useAcct.htm","Mode Selection","ForceExisting","yes");
|
||||
//pages[0][7]=new action("accounts.htm");
|
||||
|
||||
pages[1]=new Array();
|
||||
pages[1][0]=new page("accounts.htm",null,null);
|
||||
pages[1][1]=new method("needs1.htm","parent.content.go('New Path')",true);
|
||||
pages[1][2]=new method("useAcct.htm","parent.content.go('Existing Path')",true);
|
||||
|
||||
// New Account Path
|
||||
|
||||
pages[ 2 ] = new Array();
|
||||
pages[ 2 ][ 0 ] = new page( "needs1.htm", "New Acct Mode", "ShowNewPathInfo" );
|
||||
pages[ 2 ][ 1 ] = new condition( "newAcct.htm", "New Acct Mode", "ShowNewPathInfo", "no" );
|
||||
pages[ 2 ][ 2 ] = new method( "newAcct.htm", "parent.content.go('')", true );
|
||||
|
||||
pages[ 3 ] = new Array();
|
||||
pages[ 3 ][ 0 ] = new page( "newAcct.htm", "New Acct Mode", "AskPersonalInfo" );
|
||||
pages[ 3 ][ 1 ] = new condition( "billing.htm", "New Acct Mode", "AskPersonalInfo", "no" );
|
||||
pages[ 3 ][ 2 ] = new method( "billing.htm", "parent.content.go('')", true );
|
||||
|
||||
pages[ 4 ] = new Array();
|
||||
pages[ 4 ][ 0 ] = new page( "billing.htm", "New Acct Mode", "AskBillingInfo" );
|
||||
pages[ 4 ][ 1 ] = new condition( "modem1.htm", "New Acct Mode", "AskBillingInfo", "no" );
|
||||
pages[ 4 ][ 2 ] = new method( "modem1.htm", "parent.content.go('')", true );
|
||||
|
||||
pages[ 5 ] = new Array();
|
||||
pages[ 5 ][ 0 ] = new page( "modem1.htm", null, null );
|
||||
pages[ 5 ][ 1 ] = new method( "dialinf1.htm", "parent.content.go('')", true );
|
||||
|
||||
pages[ 6 ] = new Array();
|
||||
pages[ 6 ][ 0 ] = new page( "dialinf1.htm", null, null );
|
||||
pages[ 6 ][ 1 ] = new method( "dialinf2.htm", "parent.content.go('')", true );
|
||||
|
||||
pages[ 7 ] = new Array();
|
||||
pages[ 7 ][ 0 ] = new page( "dialinf2.htm", null, null );
|
||||
pages[ 7 ][ 1 ] = new method( "download.htm", "parent.content.go('New Path')", true );
|
||||
pages[ 7 ][ 2 ] = new method( "connect2.htm", "parent.content.go('Existing Path')", true );
|
||||
|
||||
pages[ 53 ] = new Array();
|
||||
pages[ 53 ][ 0 ] = new page( "download.htm", null, null );
|
||||
pages[ 53 ][ 1 ] = new method( "1step.htm", "parent.content.go( '' )", true );
|
||||
|
||||
pages[ 54 ] = new Array();
|
||||
pages[ 54 ][ 0 ] = new page( "1step.htm", null, null );
|
||||
|
||||
pages[ 55 ] = new Array();
|
||||
pages[ 55 ][ 0 ] = new page( "compwrap.htm", null, null );
|
||||
pages[ 55 ][ 1 ] = new method( "moreinfo.htm", "parent.content.go( '' )", true );
|
||||
|
||||
pages[ 56 ] = new Array();
|
||||
pages[ 56 ][ 0 ] = new page( "moreinfo.htm", null, null );
|
||||
pages[ 56 ][ 1 ] = new method( "2step.htm", "parent.content.go( '' )", true );
|
||||
|
||||
pages[ 57 ] = new Array();
|
||||
pages[ 57 ][ 0 ] = new page( "2step.htm", null, null );
|
||||
pages[ 57 ][ 1 ] = new method( "register.htm", "parent.content.go( '' )", true );
|
||||
|
||||
pages[ 8 ] = new Array();
|
||||
pages[ 8 ][ 0 ] = new page( "connect1.htm", null, null );
|
||||
pages[ 8 ][ 1 ] = new method( "editfour.htm", "checkEditMode('')", true );
|
||||
pages[ 8 ][ 2 ] = new method( "register.htm", "parent.content.go('')", true );
|
||||
|
||||
pages[ 9 ] = new Array();
|
||||
pages[ 9 ][ 0 ] = new page( "register.htm", null, null );
|
||||
|
||||
// Existing Account Path
|
||||
|
||||
pages[10]=new Array();
|
||||
pages[10][0]=new page("useAcct.htm",null,null);
|
||||
pages[10][1]=new condition("needs2.htm","Mode Selection","ExistingSRFile","...");
|
||||
pages[10][2]=new method("needs2.htm","parent.content.go('')",true);
|
||||
|
||||
pages[11]=new Array();
|
||||
pages[11][0]=new page("needs2.htm","Existing Acct Mode","ShowExistingPathInfo");
|
||||
pages[11][1]=new condition("acctInfo.htm","Existing Acct Mode","ShowExistingPathInfo","no");
|
||||
pages[11][2]=new method("acctInfo.htm","parent.content.go('')",true);
|
||||
|
||||
pages[12]=new Array();
|
||||
pages[12][0]=new page("acctInfo.htm","Existing Acct Mode","AskName");
|
||||
pages[12][1]=new condition("dial.htm","Existing Acct Mode","AskName","no");
|
||||
pages[12][2]=new method("dial.htm","parent.content.go('')",true);
|
||||
|
||||
pages[13]=new Array();
|
||||
pages[13][0]=new page("dial.htm","Existing Acct Mode","AskPhone");
|
||||
pages[13][1]=new condition("namepw.htm","Existing Acct Mode","AskPhone","no");
|
||||
pages[13][2]=new method("namepw.htm","parent.content.go('')",true);
|
||||
|
||||
pages[14]=new Array();
|
||||
pages[14][0]=new page("namepw.htm","Existing Acct Mode","AskLogin");
|
||||
pages[14][1]=new condition("email.htm","Existing Acct Mode","AskLogin","no");
|
||||
pages[14][2]=new method("email.htm","parent.content.go('')",true);
|
||||
|
||||
pages[15]=new Array();
|
||||
pages[15][0]=new page("email.htm","Existing Acct Mode","AskEmail");
|
||||
pages[15][1]=new condition("servers.htm","Existing Acct Mode","AskEmail","no");
|
||||
pages[15][2]=new method("servers.htm","parent.content.go('')",true);
|
||||
|
||||
pages[16]=new Array();
|
||||
pages[16][0]=new page("servers.htm","Existing Acct Mode","AskHosts");
|
||||
pages[16][1]=new condition("dns.htm","Existing Acct Mode","AskHosts","no");
|
||||
pages[16][2]=new method("dns.htm","parent.content.go('')",true);
|
||||
|
||||
pages[17]=new Array();
|
||||
pages[17][0]=new page("dns.htm","Existing Acct Mode","AskDNS");
|
||||
pages[17][1]=new condition("publish.htm","Existing Acct Mode","AskDNS","no");
|
||||
pages[17][2]=new method("publish.htm","parent.content.go('')",true);
|
||||
|
||||
pages[18]=new Array();
|
||||
pages[18][0]=new page("publish.htm","Existing Acct Mode","AskPublishing");
|
||||
pages[18][1]=new condition("modem1.htm","Existing Acct Mode","AskPublishing","no");
|
||||
pages[18][2]=new method("modem1.htm","parent.content.go('')",true);
|
||||
|
||||
pages[19]=new Array();
|
||||
pages[19][0]=new page("connect2.htm",null,null);
|
||||
pages[19][1]=new method(null,"parent.content.go('Connect Now')",true);
|
||||
pages[19][2]=new method("error.htm","parent.content.go('error.htm')",true);
|
||||
|
||||
// Final Screens
|
||||
|
||||
pages[20]=new Array();
|
||||
pages[20][0]=new page("ok.htm",null,null);
|
||||
|
||||
pages[21]=new Array();
|
||||
pages[21][0]=new page("okreboot.htm",null,null);
|
||||
|
||||
pages[ 22 ] = new Array();
|
||||
pages[ 22 ][ 0 ] = new page( "error.htm", null, null );
|
||||
pages[ 22 ][ 1 ] = new method( "1step.htm", "parent.content.go( 'firstDial' )", true );
|
||||
pages[ 22 ][ 2 ] = new method( "register.htm", "parent.content.go( 'New Path' )", true );
|
||||
pages[ 22 ][ 3 ] = new method( "connect2.htm", "parent.content.go( 'Existing Path' )", true );
|
||||
|
||||
pages[23]=new Array();
|
||||
pages[23][0]=new page("later.htm",null,null);
|
||||
pages[23][1]=new method("later.htm","parent.content.go('Done')",true);
|
||||
|
||||
// Settings
|
||||
|
||||
pages[24]=new Array();
|
||||
pages[24][0]=new page("settings.htm",null,null);
|
||||
|
||||
// About Box
|
||||
|
||||
pages[25]=new Array();
|
||||
pages[25][0]=new page("aboutbox.htm",null,null);
|
||||
|
||||
// Manage IAS Servers
|
||||
|
||||
pages[26]=new Array();
|
||||
pages[26][0]=new page("addias.htm",null,null);
|
||||
|
||||
// Manage NCI Servers
|
||||
|
||||
pages[27]=new Array();
|
||||
pages[27][0]=new page("addnci.htm",null,null);
|
||||
|
||||
// Dialup Edition Preview Screens
|
||||
|
||||
pages[28]=new Array();
|
||||
pages[28][0]=new page("preview/duepvw1.htm",null,null);
|
||||
//pages[28][0].fullhistory=true;
|
||||
pages[28][1]=new method("preview/duepvw2.htm","parent.content.go('')",true);
|
||||
|
||||
pages[29]=new Array();
|
||||
pages[29][0]=new page("preview/duepvw2.htm",null,null);
|
||||
pages[29][1]=new method("preview/duepvw3.htm","parent.content.go('')",true);
|
||||
|
||||
pages[30]=new Array();
|
||||
pages[30][0]=new page("preview/duepvw3.htm",null,null);
|
||||
pages[30][1]=new method("preview/duepvw4.htm","parent.content.go('')",true);
|
||||
|
||||
pages[31]=new Array();
|
||||
pages[31][0]=new page("preview/duepvw4.htm",null,null);
|
||||
pages[31][1]=new method("preview/duepvw5.htm","parent.content.go('')",true);
|
||||
|
||||
pages[32]=new Array();
|
||||
pages[32][0]=new page("preview/duepvw5.htm",null,null);
|
||||
pages[32][1]=new method("preview/duepvw7a.htm","parent.content.go('')",true);
|
||||
|
||||
//The following array is ignored as reference to Conference feature is removed
|
||||
pages[33]=new Array();
|
||||
pages[33][0]=new page("preview/duepvw6.htm",null,null);
|
||||
pages[33][1]=new method("preview/duepvw7.htm","parent.content.go('')",true);
|
||||
|
||||
//The following array is ignored as reference to Netcaster feature is removed
|
||||
pages[34]=new Array();
|
||||
pages[34][0]=new page("preview/duepvw7.htm",null,null);
|
||||
pages[34][1]=new method("preview/duepvw7a.htm","parent.content.go('')",true);
|
||||
|
||||
pages[35]=new Array();
|
||||
pages[35][0]=new page("preview/duepvw7a.htm",null,null);
|
||||
pages[35][1]=new method("preview/duepvw8.htm","parent.content.go('')",true);
|
||||
|
||||
pages[36]=new Array();
|
||||
pages[36][0]=new page("preview/duepvw8.htm",null,null);
|
||||
//pages[36][1]=new method("main.htm","parent.content.go('')",true);
|
||||
pages[36][1]=new action("main.htm");
|
||||
|
||||
// Internet Preview Screens
|
||||
|
||||
pages[37]=new Array();
|
||||
pages[37][0]=new page("ipreview/inpvw1.htm",null,null);
|
||||
//pages[37][0].fullhistory=true;
|
||||
pages[37][1]=new method("ipreview/inpvw2.htm","parent.content.go('')",true);
|
||||
|
||||
pages[38]=new Array();
|
||||
pages[38][0]=new page("ipreview/inpvw2.htm",null,null);
|
||||
pages[38][1]=new method("ipreview/inpvw3.htm","parent.content.go('')",true);
|
||||
|
||||
pages[39]=new Array();
|
||||
pages[39][0]=new page("ipreview/inpvw3.htm",null,null);
|
||||
pages[39][1]=new method("ipreview/inpvw4.htm","parent.content.go('')",true);
|
||||
|
||||
pages[40]=new Array();
|
||||
pages[40][0]=new page("ipreview/inpvw4.htm",null,null);
|
||||
pages[40][1]=new method("ipreview/inpvw5.htm","parent.content.go('')",true);
|
||||
|
||||
pages[41]=new Array();
|
||||
pages[41][0]=new page("ipreview/inpvw5.htm",null,null);
|
||||
pages[41][1]=new method("ipreview/inpvw5a.htm","parent.content.go('')",true);
|
||||
|
||||
pages[42]=new Array();
|
||||
pages[42][0]=new page("ipreview/inpvw6.htm",null,null);
|
||||
pages[42][1]=new method("ipreview/inpvw7.htm","parent.content.go('')",true);
|
||||
|
||||
pages[43]=new Array();
|
||||
pages[43][0]=new page("ipreview/ipreview/inpvw7.htm",null,null);
|
||||
//pages[43][1]=new method("main.htm","parent.content.go('')",true);
|
||||
pages[43][1]=new action("main.htm"); // XXX For Deluxe, change "main.htm" to "ipreview/inpvw8.htm"
|
||||
|
||||
pages[44]=new Array();
|
||||
pages[44][0]=new page("ipreview/inpvw8.htm",null,null);
|
||||
//pages[44][1]=new method("main.htm","parent.content.go('')",true);
|
||||
pages[44][1]=new action("main.htm");
|
||||
|
||||
// start screen
|
||||
|
||||
pages[45]=new Array();
|
||||
pages[45][0]=new page("start.htm",null,null);
|
||||
//pages[45][0].top=true;
|
||||
|
||||
// intro screens
|
||||
|
||||
pages[46]=new Array();
|
||||
pages[46][0]=new page("intro/intro1.htm",null,null);
|
||||
//pages[46][0].fullhistory=true;
|
||||
pages[46][1]=new method("intro/intro2.htm","parent.content.go('')",true);
|
||||
|
||||
pages[47]=new Array();
|
||||
pages[47][0]=new page("intro/intro2.htm",null,null);
|
||||
pages[47][1]=new method("intro/intro3.htm","parent.content.go('')",true);
|
||||
|
||||
pages[48]=new Array();
|
||||
pages[48][0]=new page("intro/intro3.htm",null,null);
|
||||
pages[48][1]=new method("intro/intro4.htm","parent.content.go('')",true);
|
||||
|
||||
pages[49]=new Array();
|
||||
pages[49][0]=new page("intro/intro4.htm",null,null);
|
||||
pages[49][1]=new method("intro/intro5.htm","parent.content.go('')",true);
|
||||
|
||||
pages[50]=new Array();
|
||||
pages[50][0]=new page("intro/intro5.htm",null,null);
|
||||
pages[50][1]=new method("intro/intro6.htm","parent.content.go('')",true);
|
||||
|
||||
pages[51]=new Array();
|
||||
pages[51][0]=new page("intro/intro6.htm",null,null);
|
||||
//pages[51][1]=new condition("needs1.htm","Mode Selection","ForceNew","yes");
|
||||
//pages[51][2]=new condition("useAcct.htm","Mode Selection","ForceExisting","yes");
|
||||
pages[51][1]=new action("main.htm");
|
||||
|
||||
pages[52]=new Array();
|
||||
pages[52][0]=new page("editfour.htm",null,null);
|
||||
pages[52][1]=new method("register.htm","parent.content.go('register.htm')",true);
|
||||
pages[52][2]=new method("ok.htm","parent.content.go('ok.htm')",true);
|
||||
pages[52][3]=new method("okreboot.htm","parent.content.go('okreboot.htm')",true);
|
||||
pages[52][4]=new method("error.htm","parent.content.go('error.htm')",true);
|
||||
|
||||
// 53 - 57 are used in the New Account path
|
||||
|
||||
// Added to accommodate Netcenter Screen
|
||||
pages[58]=new Array();
|
||||
pages[58][0]=new page("ipreview/inpvw5a.htm",null,null);
|
||||
pages[58][1]=new method("ipreview/inpvw6.htm","parent.content.go('')",true);
|
||||
|
||||
|
||||
// NB: if you add new pages here, make sure that the array indices are not already
|
||||
// being used
|
||||
|
||||
|
||||
function checkShowIntroFlag()
|
||||
{
|
||||
if ( parent && parent.parent && parent.parent.globals )
|
||||
{
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename( self );
|
||||
|
||||
var theFlag = parent.parent.globals.GetNameValuePair( theFile, "Mode Selection", "Show_Intro_Screens" );
|
||||
if ( theFlag != null )
|
||||
{
|
||||
theFlag = theFlag.toLowerCase();
|
||||
}
|
||||
return ( theFlag == "yes" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return the page number (according to ordinals along the path taken) of "file"
|
||||
function findPageOffset( file )
|
||||
{
|
||||
// * take off any path information preceeding file name
|
||||
if ( ( slashPos = file.lastIndexOf( "/" ) ) > 0 )
|
||||
{
|
||||
file = file.substring( slashPos + 1, file.length );
|
||||
}
|
||||
|
||||
// * loop through all the page information and attempt to find a page name matching
|
||||
// "file"
|
||||
var pageNum = -1;
|
||||
for ( var x = 0; x < pages.length; x++ )
|
||||
{
|
||||
for ( var y = 0; y < pages[ x ].length; y++ )
|
||||
{
|
||||
if ( pages[ x ][ y ].type== "INFO" )
|
||||
{
|
||||
var theName = pages[ x ][ y ].file;
|
||||
|
||||
// * again, remove any path
|
||||
if ( ( slashPos = theName.lastIndexOf( "/" ) ) > 0 )
|
||||
{
|
||||
theName = theName.substring( slashPos + 1, theName.length );
|
||||
}
|
||||
|
||||
// * pages[ x ][ y ].file
|
||||
if ( theName == file )
|
||||
{
|
||||
// * found it
|
||||
pageNum = x;
|
||||
}
|
||||
|
||||
// * break here so we don't keep testing all the rest of the array entries after
|
||||
// we've found the "INFO" entry
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// * break if we've found it
|
||||
if ( pageNum >= 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( parent && parent.parent && parent.parent.globals )
|
||||
{
|
||||
parent.parent.globals.debug( "\tfindPageOffset: '" +file+ "' is " + pageNum );
|
||||
}
|
||||
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
|
||||
// main navigational function in Account Setup, "msg" is typically the name of a button
|
||||
// that was pressed
|
||||
function go( msg )
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
|
||||
|
||||
var editMode = false;
|
||||
var globals = null;
|
||||
|
||||
if ( parent && parent.parent && parent.parent.globals )
|
||||
globals = parent.parent.globals;
|
||||
|
||||
if ( globals != null )
|
||||
editMode = ( globals.document.vars.editMode.value.toLowerCase() == "yes" ) ? true : false;
|
||||
|
||||
// var formName = new String(parent.content.location);
|
||||
var formName = "" + parent.content.location;
|
||||
|
||||
if ( ( x = formName.lastIndexOf( "/" ) ) > 0 )
|
||||
formName = formName.substring( x + 1, formName.length );
|
||||
|
||||
var pageNum = findPageOffset( formName );
|
||||
if ( pageNum >= 0 )
|
||||
formName = pages[ pageNum ][ 0 ].file;
|
||||
|
||||
// var startingPageName = parent.content.document.forms[0].name;
|
||||
var startingPageName = formName;
|
||||
var thePlatform = globals.getPlatform();
|
||||
var separatorString = ",";
|
||||
|
||||
// process messages
|
||||
|
||||
if ( msg == "Next" )
|
||||
{
|
||||
// * if something is wrong with the current page content, don't do anything
|
||||
if ( !parent || !parent.content )
|
||||
return;
|
||||
|
||||
// * if we're currently loading, don't do anything
|
||||
if ( parent.content.loading )
|
||||
return;
|
||||
|
||||
if ( editMode != true )
|
||||
{
|
||||
if ( parent.content.checkData && ( parent.content.checkData() == false ) )
|
||||
return;
|
||||
|
||||
// workaround for onunload handler bugs in 4.0b2; no longer using onunload handler
|
||||
if ( parent.content.saveData != null )
|
||||
parent.content.saveData();
|
||||
}
|
||||
|
||||
var pageName = startingPageName;
|
||||
|
||||
if ( globals != null )
|
||||
globals.debug("\ngo: Starting at page " +pageName);
|
||||
|
||||
var acctSetupFile = "";
|
||||
if ( globals != null )
|
||||
acctSetupFile = globals.getAcctSetupFilename( self );
|
||||
|
||||
var moved = false;
|
||||
var active = true;
|
||||
|
||||
while ( active )
|
||||
{
|
||||
active = false;
|
||||
var pageNum = findPageOffset( pageName );
|
||||
if ( pageNum < 0 )
|
||||
{
|
||||
alert( "The file '" + pageName + "' is unknown to Account Setup." );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( var x = 0; x < pages[ pageNum ].length; x++ )
|
||||
{
|
||||
if ( editMode == false && pages[ pageNum ][ x ].type == "CONDITION" )
|
||||
{
|
||||
var theFlag = globals.GetNameValuePair( acctSetupFile, pages[ pageNum ][ x ].section,
|
||||
pages[ pageNum ][ x ].variable );
|
||||
theFlag = theFlag.toLowerCase();
|
||||
|
||||
if ( pages[ pageNum ][ x ].value == "..." )
|
||||
{
|
||||
if ( theFlag != null && theFlag != "" )
|
||||
{
|
||||
active = moved = true;
|
||||
pageName = pages[ pageNum ][ x ].file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ( theFlag == pages[ pageNum ][ x ].value )
|
||||
{
|
||||
active = moved = true;
|
||||
pageName = pages[ pageNum ][ x ].file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if ( moved == false && pages[ pageNum ][ x ].type == "METHOD" )
|
||||
{
|
||||
var val = eval( pages[ pageNum ][ x ].method );
|
||||
|
||||
if ( globals != null )
|
||||
{
|
||||
globals.debug( "\tMethod: " + pages[ pageNum ][ x ].method );
|
||||
globals.debug( "\tReturned: " + val );
|
||||
}
|
||||
|
||||
if ( val == pages[ pageNum ][ x ].value )
|
||||
{
|
||||
active = moved = true;
|
||||
pageName = pages[ pageNum ][ x ].file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else if ( moved == false && pages[ pageNum ][ x ].type == "ACTION" )
|
||||
{
|
||||
globals.debug( "\tAction: " + pages[ pageNum ][ x ].file );
|
||||
active = false;
|
||||
moved = true;
|
||||
pageName = pages[ pageNum ][ x ].file;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( pageName != startingPageName )
|
||||
{
|
||||
if ( globals != null )
|
||||
{
|
||||
if ( globals.document.setupPlugin.NeedReboot() == true )
|
||||
globals.forceReboot( pageName );
|
||||
else
|
||||
{
|
||||
if ( pageName == "main.htm" )
|
||||
globals.document.vars.pageHistory.value = "";
|
||||
else
|
||||
globals.document.vars.pageHistory.value += startingPageName + separatorString;
|
||||
|
||||
globals.debug( "go: Moving to page " + pageName );
|
||||
|
||||
pages.current = pageName;
|
||||
parent.content.location.replace( pageName );
|
||||
|
||||
if ( helpWindow && helpWindow != null )
|
||||
{
|
||||
if ( helpWindow.closed == false )
|
||||
{
|
||||
doHelp( pageName );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pages.current = pageName;
|
||||
|
||||
if ( pages[ pageNum ][ 0 ].top == true )
|
||||
{
|
||||
parent.location.replace( pageName );
|
||||
}
|
||||
else
|
||||
{
|
||||
var theLoc = "" + parent.content.location;
|
||||
if ( ( x = theLoc.lastIndexOf( "/" ) ) > 0 )
|
||||
{
|
||||
pageName = theLoc.substring( 0, x + 1 ) + pageName;
|
||||
}
|
||||
|
||||
parent.content.location.replace( pageName );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if ( msg == "Back" )
|
||||
{
|
||||
if ( parent.content.loading )
|
||||
return;
|
||||
|
||||
// workaround for onunload handler bugs in 4.0b2; no longer using onunload handler
|
||||
if ( parent.content.saveData !=null )
|
||||
parent.content.saveData();
|
||||
|
||||
// parent.content.history.back();
|
||||
|
||||
if ( parent.content.verifyData )
|
||||
{
|
||||
var verifyFlag = parent.content.verifyData();
|
||||
if ( verifyFlag != true )
|
||||
{
|
||||
generateControls();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( globals != null )
|
||||
{
|
||||
var historyCleanup = true;
|
||||
while ( historyCleanup == true )
|
||||
{
|
||||
historyCleanup = false;
|
||||
|
||||
var pageHistory = globals.document.vars.pageHistory.value;
|
||||
if ( pageHistory!="" )
|
||||
{
|
||||
var pageName="";
|
||||
x = pageHistory.lastIndexOf( separatorString );
|
||||
pageHistory = pageHistory.substring( 0, x );
|
||||
x = pageHistory.lastIndexOf( separatorString );
|
||||
if ( x >= 0 )
|
||||
{
|
||||
pageName = pageHistory.substring( x + 1, pageHistory.length );
|
||||
globals.document.vars.pageHistory.value = pageHistory.substring( 0, x + 1 );
|
||||
if ( ( pageName == "register.htm" ) || ( pageName == "error.htm" ) )
|
||||
historyCleanup = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pageName=pageHistory;
|
||||
globals.document.vars.pageHistory.value="";
|
||||
}
|
||||
}
|
||||
}
|
||||
globals.debug("go: Moving back to page " + pageName );
|
||||
|
||||
if ( pageName == "undefined" )
|
||||
return;
|
||||
|
||||
pages.current = pageName;
|
||||
if ( pageNum >= 0 && pages[ pageNum ][ 0 ].fullhistory == true )
|
||||
parent.parent.history.back();
|
||||
else
|
||||
parent.content.location.replace( pageName );
|
||||
|
||||
if ( helpWindow && helpWindow != null )
|
||||
{
|
||||
if ( helpWindow.closed == false )
|
||||
doHelp( pageName );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( pages[ pageNum ][ 0 ].fullhistory == true )
|
||||
parent.parent.history.back();
|
||||
else
|
||||
parent.content.history.back();
|
||||
}
|
||||
}
|
||||
else if ( msg == "Help" )
|
||||
{
|
||||
doHelp( formName );
|
||||
}
|
||||
else if ( msg == "Show Screen" )
|
||||
{
|
||||
var pageNum = findPageOffset( formName );
|
||||
if ( pageNum>=0 )
|
||||
{
|
||||
var section = pages[ pageNum ][ 0 ].section;
|
||||
var variable = pages[ pageNum ][ 0 ].variable;
|
||||
if ( section != null && section!="" && variable != null && variable!="" )
|
||||
{
|
||||
showScreenToggle = true;
|
||||
var acctSetupFile = globals.getAcctSetupFilename( self );
|
||||
var theFlag = globals.GetNameValuePair( acctSetupFile, section, variable);
|
||||
theFlag = theFlag.toLowerCase();
|
||||
if ( theFlag == "no" )
|
||||
theFlag="yes";
|
||||
else
|
||||
theFlag="no";
|
||||
|
||||
parent.parent.SetNameValuePair( acctSetupFile, section, variable, theFlag);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( msg == "Later" )
|
||||
{
|
||||
if ( parent.content.go( "Later" ) == true )
|
||||
{
|
||||
|
||||
if ( ( globals.document.vars.editMode.value.toLowerCase() != "yes") ||
|
||||
( confirm( "Normally, this would complete the Account Setup process and quit Communicator. Would you like to quit now?" ) == true ) )
|
||||
{
|
||||
// parent.content.location.href = "later.htm";
|
||||
if ( globals != null )
|
||||
{
|
||||
if ( globals.document.vars.editMode.value.toLowerCase() != "yes")
|
||||
globals.saveGlobalData();
|
||||
globals.document.setupPlugin.QuitNavigator();
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( msg == "Done" )
|
||||
{
|
||||
if ( globals != null )
|
||||
{
|
||||
if ( globals.document.vars.editMode.value.toLowerCase() != "yes" )
|
||||
globals.saveGlobalData();
|
||||
if ( ( globals.document.vars.editMode.value.toLowerCase() != "yes") ||
|
||||
( confirm( "Normally, this would complete the Account Setup process and quit Communicator. Would you like to quit now?") == true ) )
|
||||
{
|
||||
globals.document.setupPlugin.QuitNavigator();
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( msg == "Exit" )
|
||||
{
|
||||
var longMsgFlag = true;
|
||||
var confirmFlag = false;
|
||||
|
||||
if ( formName.indexOf( "main.htm" ) >= 0 )
|
||||
longMsgFlag = false;
|
||||
else if ( formName.indexOf( "aboutbox.htm" ) >= 0 )
|
||||
longMsgFlag = false;
|
||||
else if (formName.indexOf( "error.htm" ) >= 0 )
|
||||
longMsgFlag = false;
|
||||
else if (formName.indexOf( "intro/" ) >= 0 )
|
||||
longMsgFlag = false;
|
||||
else if (formName.indexOf( "ipreview/" ) >= 0 )
|
||||
longMsgFlag = false;
|
||||
else if (formName.indexOf( "preview/" ) >= 0 )
|
||||
longMsgFlag = false;
|
||||
|
||||
if ( longMsgFlag == true )
|
||||
{
|
||||
if ( globals.document.vars.editMode.value.toLowerCase() != "yes" )
|
||||
confirmFlag = confirm( "You haven't finished setting up your account. Are you sure you want to quit Account Setup?" );
|
||||
else // this is for the account setup editor
|
||||
confirmFlag = confirm( "Are you sure you want to quit the Account Setup Editor?" );
|
||||
}
|
||||
else
|
||||
confirmFlag = confirm( "Quit Account Setup?" );
|
||||
|
||||
if ( confirmFlag == true )
|
||||
{
|
||||
if ( globals != null )
|
||||
{
|
||||
globals.saveGlobalData();
|
||||
globals.document.setupPlugin.QuitNavigator();
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
else if ( msg == "Restart" )
|
||||
{
|
||||
if ( globals.document.vars.editMode.value.toLowerCase() != "yes" )
|
||||
{
|
||||
globals.saveGlobalData();
|
||||
globals.document.setupPlugin.Reboot( null );
|
||||
window.close();
|
||||
}
|
||||
else
|
||||
alert( "Cannot reboot in edit mode." );
|
||||
}
|
||||
else if ( msg == "About" )
|
||||
{
|
||||
globals.document.vars.pageHistory.value += startingPageName + separatorString;
|
||||
pages.current = "aboutbox.htm";
|
||||
parent.content.location.replace( "aboutbox.htm" );
|
||||
}
|
||||
else if ( msg == "Setup" )
|
||||
{
|
||||
globals.document.vars.pageHistory.value += startingPageName + separatorString;
|
||||
|
||||
var acctSetupFile = globals.getAcctSetupFilename( self );
|
||||
var newPathFlag = globals.GetNameValuePair( acctSetupFile, "Mode Selection", "ForceNew" );
|
||||
newPathFlag = newPathFlag.toLowerCase();
|
||||
var existingPathFlag = globals.GetNameValuePair( acctSetupFile, "Mode Selection", "ForceExisting" );
|
||||
existingPathFlag = existingPathFlag.toLowerCase();
|
||||
|
||||
var pageName="";
|
||||
if ( newPathFlag == "yes" && existingPathFlag != "yes")
|
||||
pageName = "needs1.htm";
|
||||
else if ( existingPathFlag == "yes" && newPathFlag != "yes" )
|
||||
pageName = "useAcct.htm";
|
||||
else
|
||||
pageName = "accounts.htm";
|
||||
parent.content.location.replace( pageName );
|
||||
if ( helpWindow && helpWindow != null )
|
||||
{
|
||||
if ( helpWindow.closed == false )
|
||||
doHelp( pageName );
|
||||
}
|
||||
}
|
||||
else if ( msg == "Edit Settings" )
|
||||
{
|
||||
globals.document.vars.pageHistory.value += startingPageName + separatorString;
|
||||
pages.current = "settings.htm";
|
||||
parent.content.location.replace( "../CG/docs/settings.htm" );
|
||||
}
|
||||
else if ( msg == "Manage Servers" )
|
||||
{
|
||||
globals.document.vars.pageHistory.value += startingPageName + separatorString;
|
||||
pages.current = "editregs.htm";
|
||||
parent.content.location.replace( "../CG/docs/editregs.htm" );
|
||||
}
|
||||
else if ( msg == "Manage Accounts" )
|
||||
{
|
||||
globals.document.vars.pageHistory.value += startingPageName + separatorString;
|
||||
pages.current = "editisps.htm";
|
||||
parent.content.location.replace( "../CG/docs/editisps.htm" );
|
||||
}
|
||||
else if ( msg == "Edit IAS" )
|
||||
{
|
||||
if ( thePlatform == "Macintosh" )
|
||||
globals.document.vars.pageHistory.value += "../../Tools/CG/docs/" + startingPageName + separatorString;
|
||||
else
|
||||
globals.document.vars.pageHistory.value += "../../../AccountSetupTools/CG/docs/" + startingPageName + separatorString;
|
||||
|
||||
pages.current = "addias.htm";
|
||||
parent.content.location.replace("ias/addias.htm");
|
||||
}
|
||||
else if ( msg == "Edit NCI" )
|
||||
{
|
||||
if (thePlatform == "Macintosh")
|
||||
globals.document.vars.pageHistory.value += "../../Tools/CG/docs/" + startingPageName + separatorString;
|
||||
else
|
||||
globals.document.vars.pageHistory.value += "../../../AccountSetupTools/CG/docs/" + startingPageName + separatorString;
|
||||
pages.current = "addnci.htm";
|
||||
parent.content.location.replace( "nci/addnci.htm" );
|
||||
}
|
||||
else if ( msg == "Screen Options" )
|
||||
{
|
||||
globals.document.vars.pageHistory.value += startingPageName + separatorString;
|
||||
|
||||
if ( formName == "namepw.htm" )
|
||||
{
|
||||
pages.current = "asktty.htm";
|
||||
parent.content.location.replace( "../CG/docs/asktty.htm" );
|
||||
}
|
||||
//else if (formName == "servers.htm") {
|
||||
// pages.current = "askserv.htm";
|
||||
// parent.content.location.replace("../CG/docs/askserv.htm");
|
||||
// }
|
||||
else if ( formName == "ok.htm" )
|
||||
{
|
||||
pages.current = "asksvinf.htm";
|
||||
parent.content.location.replace( "../CG/docs/asksvinf.htm" );
|
||||
}
|
||||
else if ( formName == "okreboot.htm" )
|
||||
{
|
||||
pages.current = "asksvinf.htm";
|
||||
parent.content.location.replace( "../CG/docs/asksvinf.htm" );
|
||||
}
|
||||
else if ( formName == "billing.htm" )
|
||||
{
|
||||
pages.current = "editcc.htm";
|
||||
parent.content.location.replace( "../CG/docs/editcc.htm" );
|
||||
}
|
||||
else if ( formName == "main.htm" )
|
||||
{
|
||||
pages.current = "settings.htm";
|
||||
parent.content.location.replace( "../CG/docs/settings.htm" );
|
||||
}
|
||||
else if ( formName == "useAcct.htm" )
|
||||
{
|
||||
pages.current = "editisps.htm";
|
||||
parent.content.location.replace( "../CG/docs/editisps.htm" );
|
||||
}
|
||||
else if ( formName == "connect1.htm" )
|
||||
{
|
||||
pages.current = "editregs.htm";
|
||||
parent.content.location.replace( "../CG/docs/editregs.htm" );
|
||||
}
|
||||
|
||||
} //end screen options special casing
|
||||
|
||||
else
|
||||
parent.content.go( msg );
|
||||
// generateControls();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadData()
|
||||
{
|
||||
var file="";
|
||||
|
||||
// preLoadImages();
|
||||
|
||||
if (parent && parent.parent && parent.parent.globals) {
|
||||
file = parent.parent.globals.document.vars.startupFile.value;
|
||||
}
|
||||
if (file != null && file != "") {
|
||||
if (parent && parent.parent && parent.parent.globals) {
|
||||
parent.parent.globals.document.vars.startupFile.value = "";
|
||||
}
|
||||
parent.content.location.replace(file);
|
||||
}
|
||||
generateControls();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
875
mozilla/cmd/dialup/as_html/clayer2.js
Normal file
875
mozilla/cmd/dialup/as_html/clayer2.js
Normal file
@@ -0,0 +1,875 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
|
||||
|
||||
// globals
|
||||
var theToolBar = null; // a global pointer to our toolbar - should it exist
|
||||
var helpWindow = null;
|
||||
var preLoaded = false;
|
||||
|
||||
var backImages = null;
|
||||
var helpImages = null;
|
||||
var exitImages = null;
|
||||
var nextImages = null;
|
||||
var connectImages = null;
|
||||
var doneImages = null;
|
||||
var ffImages = null;
|
||||
var rebootImages = null;
|
||||
|
||||
|
||||
compromisePrincipals();
|
||||
|
||||
|
||||
function preLoadImages()
|
||||
{
|
||||
if ( preLoaded == false )
|
||||
{
|
||||
//img[0] is the normal image
|
||||
//img[1] is the mouseover
|
||||
//img[2] is the mousedown
|
||||
|
||||
backImages = new Array;
|
||||
helpImages = new Array;
|
||||
exitImages = new Array;
|
||||
nextImages = new Array;
|
||||
connectImages = new Array;
|
||||
doneImages = new Array;
|
||||
ffImages = new Array;
|
||||
rebootImages = new Array;
|
||||
|
||||
backImages[0] = new Image(32,32);
|
||||
backImages[0].src = "images/bk_up.gif";
|
||||
backImages[1] = new Image(32,32);
|
||||
backImages[1].src = "images/bk_mo.gif";
|
||||
backImages[2] = new Image(32,32);
|
||||
backImages[2].src = "images/bk_down.gif";
|
||||
|
||||
helpImages[0] = new Image(32,32);
|
||||
helpImages[0].src = "images/hlp_up.gif";
|
||||
helpImages[1] = new Image(32,32);
|
||||
helpImages[1].src = "images/hlp_mo.gif";
|
||||
helpImages[2] = new Image(32,32);
|
||||
helpImages[2].src = "images/hlp_down.gif";
|
||||
|
||||
exitImages[0] = new Image(32,32);
|
||||
exitImages[0].src = "images/ext_up.gif";
|
||||
exitImages[1] = new Image(32,32);
|
||||
exitImages[1].src = "images/ext_mo.gif";
|
||||
exitImages[2] = new Image(32,32);
|
||||
exitImages[2].src = "images/ext_down.gif";
|
||||
|
||||
nextImages[0] = new Image(32,32);
|
||||
nextImages[0].src = "images/nxt_up.gif";
|
||||
nextImages[1] = new Image(32,32);
|
||||
nextImages[1].src = "images/nxt_mo.gif";
|
||||
nextImages[2] = new Image(32,32);
|
||||
nextImages[2].src = "images/nxt_down.gif";
|
||||
|
||||
rebootImages[0] = new Image(32,32);
|
||||
rebootImages[0].src = "images/rb_up.gif";
|
||||
rebootImages[1] = new Image(32,32);
|
||||
rebootImages[1].src = "images/rb_mo.gif";
|
||||
rebootImages[2] = new Image(32,32);
|
||||
rebootImages[2].src = "images/rb_down.gif";
|
||||
|
||||
connectImages[0] = new Image(32,32);
|
||||
connectImages[0].src = "images/cn_up.gif";
|
||||
connectImages[1] = new Image(32,32);
|
||||
connectImages[1].src = "images/cn_mo.gif";
|
||||
connectImages[2] = new Image(32,32);
|
||||
connectImages[2].src = "images/cn_down.gif";
|
||||
|
||||
doneImages[0] = new Image(32,32);
|
||||
doneImages[0].src = "images/dn_up.gif";
|
||||
doneImages[1] = new Image(32,32);
|
||||
doneImages[1].src = "images/dn_mo.gif";
|
||||
doneImages[2] = new Image(32,32);
|
||||
doneImages[2].src = "images/dn_down.gif";
|
||||
|
||||
ffImages[0] = new Image(32,32);
|
||||
ffImages[0].src = "images/ff_up.gif";
|
||||
ffImages[1] = new Image(32,32);
|
||||
ffImages[1].src = "images/ff_mo.gif";
|
||||
ffImages[2] = new Image(32,32);
|
||||
ffImages[2].src = "images/ff_down.gif";
|
||||
|
||||
preLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function generateControls()
|
||||
{
|
||||
var editMode = false;
|
||||
var showAcctsetEdit = false;
|
||||
var showRegFileEdit = false;
|
||||
var showISPFileEdit = false;
|
||||
var showExit = true;
|
||||
var showHelp = true;
|
||||
var showBack = true;
|
||||
var showNext = true;
|
||||
var showConnectServer = false;
|
||||
var showConnectISP = false;
|
||||
var showConnectNow = false;
|
||||
var showDownload = false;
|
||||
var showConnectLater = false;
|
||||
var showAgain = false;
|
||||
var showDone = false;
|
||||
var showRestart = false;
|
||||
var showSetupShortcut = false;
|
||||
var showInternet = false;
|
||||
var showScreenToggle = false;
|
||||
var screenVisible = true;
|
||||
var showScreenOptions = false;
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
|
||||
|
||||
if ( parent && parent.parent && parent.parent.globals )
|
||||
{
|
||||
editMode = ( parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes" ) ? true : false;
|
||||
}
|
||||
|
||||
// var formName = parent.content.location.toString();
|
||||
var formName = "" + parent.content.location;
|
||||
if ( formName != null && formName != "" && formName != "about:blank" )
|
||||
{
|
||||
if ( ( x = formName.lastIndexOf( "/" ) ) > 0 )
|
||||
formName = formName.substring( x + 1, formName.length );
|
||||
|
||||
if ( editMode == true )
|
||||
{
|
||||
var section = null;
|
||||
var variable = null;
|
||||
var pageNum = findPageOffset( formName );
|
||||
if ( pageNum >= 0 )
|
||||
{
|
||||
section = pages[ pageNum ][ 0 ].section;
|
||||
variable = pages[ pageNum ][ 0 ].variable;
|
||||
if ( section!=null && section!="" && variable!=null && variable!="" )
|
||||
{
|
||||
showScreenToggle = true;
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename( self );
|
||||
var theFlag = parent.parent.globals.GetNameValuePair( theFile, section, variable );
|
||||
theFlag = theFlag.toLowerCase();
|
||||
if ( theFlag == "no" )
|
||||
screenVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( formName == "main.htm" )
|
||||
{
|
||||
showBack = false;
|
||||
showNext = false;
|
||||
if ( navigator.javaEnabled() == false )
|
||||
{
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
showAcctsetEdit = false;
|
||||
showISPFileEdit = false;
|
||||
showRegFileEdit = false;
|
||||
document.writeln( "<CENTER><STRONG>Java support is disabled!<P>\n" );
|
||||
document.writeln( "Choose Options | Network Preferences and enable Java, then try again.</STRONG></CENTER>\n" );
|
||||
}
|
||||
else if ( !navigator.mimeTypes[ "application/x-netscape-autoconfigure-dialer" ] )
|
||||
{
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
showAcctsetEdit = false;
|
||||
showISPFileEdit = false;
|
||||
showRegFileEdit = false;
|
||||
document.writeln( "<CENTER><STRONG>The 'Account Setup Plugin' is not installed!<P>\n" );
|
||||
document.writeln( "Please install the plugin, then run 'Account Setup' again.</STRONG></CENTER>\n" );
|
||||
}
|
||||
else if ( parent.parent.globals.document.setupPlugin == null )
|
||||
{
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
if ( editMode == true )
|
||||
{
|
||||
showAcctsetEdit = true;
|
||||
showScreenOptions = true;
|
||||
}
|
||||
}
|
||||
else if ( editMode == true && formName == "useAcct.htm" )
|
||||
{
|
||||
showScreenOptions = true;
|
||||
}
|
||||
else if ( editMode == true && formName == "servers.htm" )
|
||||
{
|
||||
showScreenOptions = false;
|
||||
}
|
||||
else if ( editMode == true && formName == "billing.htm" )
|
||||
{
|
||||
showScreenOptions = true;
|
||||
}
|
||||
else if ( formName == "accounts.htm" )
|
||||
{
|
||||
showNext = false;
|
||||
}
|
||||
else if ( formName == "compare.htm" )
|
||||
{
|
||||
}
|
||||
else if ( formName == "connect1.htm" )
|
||||
{
|
||||
showNext = false;
|
||||
showConnectServer = true;
|
||||
if ( editMode == true )
|
||||
showScreenOptions = true;
|
||||
}
|
||||
else if ( formName == "download.htm" )
|
||||
{
|
||||
showNext = false;
|
||||
showConnectServer = true;
|
||||
if ( editMode == true )
|
||||
showScreenOptions = true;
|
||||
}
|
||||
else if ( formName == "connect2.htm" )
|
||||
{
|
||||
showNext = false;
|
||||
showExit = false;
|
||||
showConnectNow = true;
|
||||
showConnectLater = true;
|
||||
}
|
||||
else if ( formName == "1step.htm" )
|
||||
{
|
||||
showNext = false;
|
||||
showExit = false;
|
||||
showHelp = false;
|
||||
if ( editMode == true )
|
||||
showBack = true;
|
||||
}
|
||||
else if ( formName == "2stpwrap.htm" )
|
||||
{
|
||||
showNext = false;
|
||||
showConnectISP = true;
|
||||
if ( editMode == true )
|
||||
showScreenOptions = true;
|
||||
}
|
||||
else if ( formName == "register.htm" )
|
||||
{
|
||||
showHelp = false;
|
||||
showBack = false;
|
||||
showNext = false;
|
||||
if ( editMode == true )
|
||||
showBack = true;
|
||||
}
|
||||
else if ( formName == "ok.htm" )
|
||||
{
|
||||
showScreenOptions = true;
|
||||
showBack = false;
|
||||
showExit = false;
|
||||
showNext = false;
|
||||
showInternet = true;
|
||||
showDone = true;
|
||||
if ( editMode == true )
|
||||
showBack = true;
|
||||
}
|
||||
else if ( formName == "okreboot.htm" )
|
||||
{
|
||||
showScreenOptions = true;
|
||||
showBack = false;
|
||||
showNext = false;
|
||||
showExit = false;
|
||||
showDone = false;
|
||||
showRestart = true;
|
||||
if ( editMode == true )
|
||||
showBack = true;
|
||||
}
|
||||
else if ( formName == "error.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showExit = true;
|
||||
showNext = false;
|
||||
showAgain = true;
|
||||
showDone = false;
|
||||
if ( editMode == true )
|
||||
showBack = true;
|
||||
}
|
||||
else if ( formName == "later.htm" )
|
||||
{
|
||||
showBack = false;
|
||||
showExit = false;
|
||||
showNext = false;
|
||||
showDone = true;
|
||||
if ( editMode == true )
|
||||
showBack = true;
|
||||
}
|
||||
else if ( formName == "intro1.htm" )
|
||||
{
|
||||
showSetupShortcut = false;
|
||||
}
|
||||
else if ( formName == "settings.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "editregs.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "editisps.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "aboutbox.htm" )
|
||||
{
|
||||
showHelp = false;
|
||||
showNext = false;
|
||||
showBack = true;
|
||||
}
|
||||
else if ( formName == "namepw.htm" )
|
||||
{
|
||||
showScreenOptions = true;
|
||||
}
|
||||
else if ( formName == "asktty.htm" )
|
||||
{
|
||||
showScreenOptions = false;
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "askserv.htm" )
|
||||
{
|
||||
showScreenOptions = false;
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "asksvinf.htm" )
|
||||
{
|
||||
showScreenOptions = false;
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "showphon.htm" )
|
||||
{
|
||||
showScreenOptions = false;
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "editcc.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "addnci.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "addias.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
else if ( formName == "editfour.htm" )
|
||||
{
|
||||
showBack = true;
|
||||
showNext = false;
|
||||
editMode = false;
|
||||
}
|
||||
|
||||
if ( document && document.layers && document.layers[ "controls" ] &&
|
||||
document.layers[ "controls" ].document &&
|
||||
document.layers[ "controls" ].document.layers &&
|
||||
document.layers[ "controls" ].document.layers.length > 0 )
|
||||
{
|
||||
document.layers[ "controls" ].layers[ "help" ].visibility = ( ( showHelp == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "exit" ].visibility = ( ( showExit == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "back" ].visibility = ( ( showBack == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "next" ].visibility = ( ( showNext == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "connectnow" ].visibility = ( ( showConnectNow == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "download" ].visibility = ( ( showDownload == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "connectserver" ].visibility = ( ( showConnectServer == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "connectisp" ].visibility = ( ( showConnectISP == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "connectagain" ].visibility = ( ( showAgain == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "done" ].visibility = ( ( showDone == true) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "restart" ].visibility = ( ( showRestart == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "connectlater" ].visibility = ( ( showConnectLater == true ) ? "show" : "hide" );
|
||||
document.layers[ "controls" ].layers[ "setup" ].visibility = ( ( showSetupShortcut == true ) ? "show" : "hide" );
|
||||
|
||||
//NEW - Generate the controls for the toolbar, if it exists
|
||||
if ( ( !theToolBar ) || ( theToolBar == null ) || ( !theToolBar.location ) || ( theToolBar.closed ) )
|
||||
{
|
||||
//alert("opening toolbar");
|
||||
theToolBar = openToolBar();
|
||||
}
|
||||
else
|
||||
{
|
||||
//alert("toolbar open, generating controls" + theToolBar);
|
||||
generateToolBarControls();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout( "generateControls()", 1000 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout( "generateControls()", 1000 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function doHelp(formName)
|
||||
{
|
||||
var thePlatform;
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
|
||||
|
||||
helpFile = "./help/ashelp.htm";
|
||||
|
||||
var helpPath = "";
|
||||
if (parent && parent.parent && parent.parent.globals) {
|
||||
helpPath = "" + parent.parent.globals.getFolder(self);
|
||||
|
||||
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 + "help:";
|
||||
}
|
||||
else { // Windows support
|
||||
helpPath = helpPath + "help/";
|
||||
}
|
||||
|
||||
if (thePlatform != "Macintosh") {
|
||||
|
||||
var hpath=unescape(location.pathname);
|
||||
hpath = hpath.substring(0, hpath.lastIndexOf('/'));
|
||||
helpFile = hpath + "/help/ashelp.htm";
|
||||
|
||||
// get rid of the return char at the end of .htm
|
||||
formName = formName.substring(0, formName.indexOf('.htm')+4);
|
||||
// next, get rid of sub folders in formName
|
||||
while (formName.indexOf('/') > 0)
|
||||
formName = formName.substring(formName.indexOf('/')+1, formName.length);
|
||||
}
|
||||
|
||||
var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(helpPath,".htm");
|
||||
if (theList != null) {
|
||||
for (var i=0; i<theList.length; i++) {
|
||||
if (formName == theList[i]) {
|
||||
if (thePlatform != "Macintosh") {
|
||||
var currentpath=unescape(location.pathname);
|
||||
currentpath = currentpath.substring(0, currentpath.lastIndexOf('/'));
|
||||
helpFile = currentpath + "/help/" + formName;
|
||||
} else {
|
||||
helpFile = "./help/" + formName;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (helpFile != null && helpFile != "") {
|
||||
if (helpWindow == null || helpWindow.closed) {
|
||||
helpWindow=window.open("about:blank","Documentation","width=328,height=328,alwaysRaised=yes,dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
if (helpWindow && helpWindow != null) {
|
||||
helpWindow.focus();
|
||||
helpWindow.location = helpFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//here are a bunch of functions for the floating toolbar
|
||||
|
||||
|
||||
|
||||
function openToolBar()
|
||||
{
|
||||
|
||||
var thePlatform = new String(navigator.userAgent);
|
||||
var x=thePlatform.indexOf("(")+1;
|
||||
var y=thePlatform.indexOf(";",x+1);
|
||||
thePlatform=thePlatform.substring(x,y);
|
||||
|
||||
var editMode = false;
|
||||
|
||||
if (parent && parent.parent && parent.parent.globals) {
|
||||
editMode=(parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes") ? true:false;
|
||||
}
|
||||
|
||||
if (editMode == true)
|
||||
{
|
||||
if (!(theToolBar) || (theToolBar == null) || !(theToolBar.location))
|
||||
{
|
||||
if (thePlatform == "Macintosh")
|
||||
theToolBar = top.open("../../Tools/Kit/config.htm","Configurator","width=400,height=104,dependent=yes,alwaysraised=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
|
||||
else
|
||||
theToolBar = top.open("../../../AccountSetupTools/Kit/config.htm","Configurator","width=400,height=104,dependent=yes,alwaysraised=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
theToolBar = null;
|
||||
}
|
||||
return theToolBar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showLayer(layerName, showIfTrue)
|
||||
{
|
||||
//alert("showLayer "+showIfTrue);
|
||||
//parent.parent.globals.debug("showing layer: " + layerName + " " + showIfTrue + " layers: " + theToolBar.document.layers.length + " " + theToolBar.document.layers[layerName]);
|
||||
if ((theToolBar) && (theToolBar!=null) && (theToolBar.location) && (theToolBar.finishedLoading()))
|
||||
{
|
||||
var gLayerName = "g_" + layerName;
|
||||
//var theLayer = eval("theToolBar.document.layers." + layerName);
|
||||
//parent.parent.globals.debug("theLayer: "+theLayer+ " but t.d.l.l: " + theToolBar.document.layers[layerName]);
|
||||
//var gLayer = eval("theToolBar.document.layers.g_" + layerName);
|
||||
|
||||
//if (theLayer)
|
||||
{
|
||||
if (showIfTrue == true)
|
||||
{
|
||||
//theToolBar.document.layers[layerName].visibility ="show";
|
||||
theToolBar.showlayer(layerName);
|
||||
theToolBar.hidelayer(gLayerName);
|
||||
//theLayer.visibility="show";
|
||||
//if (gLayer) gLayer.visibility="hide";
|
||||
}
|
||||
else
|
||||
{
|
||||
theToolBar.hidelayer(layerName);
|
||||
theToolBar.showlayer(gLayerName);
|
||||
//theToolBar.document.layers[layerName].visibility ="hide";
|
||||
//theLayer.visibility="hide";
|
||||
//if (gLayer) gLayer.visibility="show";
|
||||
}
|
||||
}
|
||||
//else
|
||||
//theToolBar.history.go(0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function screenVisible()
|
||||
{
|
||||
var isVisible = true;
|
||||
var formName = parent.content.location.toString();
|
||||
if (formName!=null && formName!="") {
|
||||
if ((x=formName.lastIndexOf("/"))>0) {
|
||||
formName=formName.substring(x+1,formName.length);
|
||||
}
|
||||
var section=null;
|
||||
var variable=null;
|
||||
var pageNum=findPageOffset(formName);
|
||||
if (pageNum>=0) {
|
||||
section=pages[pageNum][0].section;
|
||||
variable=pages[pageNum][0].variable;
|
||||
if (section!=null && section!="" && variable!=null && variable!="") {
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename(self);
|
||||
var theFlag = parent.parent.globals.GetNameValuePair(theFile,section, variable);
|
||||
theFlag = theFlag.toLowerCase();
|
||||
if (theFlag == "no")
|
||||
isVisible=false;
|
||||
}
|
||||
}
|
||||
//alert("clayer: screenVisible = : " + isVisible + "flag (" + variable + ") = " + theFlag);
|
||||
}
|
||||
return isVisible;
|
||||
}
|
||||
|
||||
function showScreen(inValue)
|
||||
{
|
||||
//alert("in showscreen");
|
||||
var formName = parent.content.location.toString();
|
||||
|
||||
if (formName!=null && formName!="")
|
||||
{
|
||||
if ((x=formName.lastIndexOf("/"))>0) {
|
||||
formName=formName.substring(x+1,formName.length);
|
||||
}
|
||||
|
||||
//alert("formName: " + formName);
|
||||
var pageNum=findPageOffset(formName);
|
||||
if (pageNum>=0)
|
||||
{
|
||||
var section=pages[pageNum][0].section;
|
||||
var variable=pages[pageNum][0].variable;
|
||||
//alert("sec: " + section + " var: "+variable);
|
||||
if (section!=null && section!="" && variable!=null && variable!="") {
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename(self);
|
||||
var theFlag; // = parent.parent.globals.GetNameValuePair(theFile,section, variable);
|
||||
|
||||
|
||||
//theFlag = theFlag.toLowerCase();
|
||||
//if (theFlag == "no") theFlag="yes";
|
||||
//else theFlag="no";
|
||||
|
||||
if (inValue == false)
|
||||
theFlag = "no";
|
||||
else
|
||||
theFlag = "yes";
|
||||
|
||||
//alert("Setting flag " + variable + " to " + theFlag + " invalue: " + inValue);
|
||||
parent.parent.globals.SetNameValuePair(theFile,section, variable,theFlag);
|
||||
return (theFlag == "yes");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("This screen cannot be suppressed");
|
||||
return true; //forces the checkbox back on
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function generateToolBarControls()
|
||||
{
|
||||
var editMode = false;
|
||||
// var editMode = parent.parent.editMode();
|
||||
var showScreenToggle = false;
|
||||
var showScreenOptions = false;
|
||||
var isScreenVisible = true;
|
||||
var showEditHelp = true;
|
||||
|
||||
//var showAcctsetEdit = false;
|
||||
//var showRegFileEdit = false;
|
||||
//var showISPFileEdit = false;
|
||||
|
||||
if (parent && parent.parent && parent.parent.globals) {
|
||||
editMode=(parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes") ? true:false;
|
||||
}
|
||||
|
||||
// var formName = parent.content.location.toString();
|
||||
var formName = "" + parent.content.location;
|
||||
|
||||
if (formName!=null && formName!="")
|
||||
{
|
||||
if ((x=formName.lastIndexOf("/"))>0) {
|
||||
formName=formName.substring(x+1,formName.length);
|
||||
}
|
||||
|
||||
// this decides whether we should show the checkbox
|
||||
var pageNum=findPageOffset(formName);
|
||||
if (pageNum>=0)
|
||||
{
|
||||
section=pages[pageNum][0].section;
|
||||
variable=pages[pageNum][0].variable;
|
||||
if (section!=null && section!="" && variable!=null && variable!="") {
|
||||
showScreenToggle=true;
|
||||
//var theFile = parent.parent.globals.getAcctSetupFilename(self);
|
||||
//var theFlag = parent.parent.globals.GetNameValuePair(theFile,section, variable);
|
||||
//theFlag = theFlag.toLowerCase();
|
||||
//if (theFlag == "no") screenVisible=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (formName == "main.htm")
|
||||
showScreenOptions=true;
|
||||
else if (formName == "useAcct.htm")
|
||||
showScreenOptions=true;
|
||||
else if (formName == "servers.htm")
|
||||
showScreenOptions=false;
|
||||
else if (formName == "billing.htm")
|
||||
showScreenOptions=true;
|
||||
else if (formName == "connect1.htm")
|
||||
showScreenOptions=true;
|
||||
else if (formName == "connect2.htm")
|
||||
;
|
||||
else if (formName == "register.htm")
|
||||
;
|
||||
else if (formName == "ok.htm")
|
||||
showScreenOptions=true;
|
||||
else if (formName == "okreboot.htm")
|
||||
showScreenOptions=true;
|
||||
else if (formName == "error.htm")
|
||||
;
|
||||
else if (formName == "later.htm")
|
||||
;
|
||||
else if (formName == "settings.htm")
|
||||
editMode = false;
|
||||
else if (formName == "editregs.htm")
|
||||
editMode=false;
|
||||
else if (formName == "editisps.htm")
|
||||
editMode=false;
|
||||
else if (formName == "aboutbox.htm")
|
||||
;
|
||||
else if (formName == "namepw.htm")
|
||||
showScreenOptions=true;
|
||||
|
||||
else if (formName == "asktty.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
else if (formName == "askserv.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
else if (formName == "asksvinf.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
else if (formName == "showphon.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
else if (formName == "editcc.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
else if (formName == "addnci.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
else if (formName == "addias.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
else if (formName == "editfour.htm")
|
||||
{
|
||||
showScreenOptions=false;
|
||||
editMode=false;
|
||||
}
|
||||
|
||||
|
||||
if (theToolBar && theToolBar != null && (theToolBar.location) && (theToolBar.document.layers) && !(theToolBar.closed)
|
||||
&& (theToolBar.ready) && (theToolBar.ready == true))
|
||||
{
|
||||
|
||||
if (theToolBar.finishedLoading())
|
||||
{
|
||||
showLayer("reload", editMode);
|
||||
showLayer("edit", editMode);
|
||||
showLayer("chooseed", editMode);
|
||||
showLayer("edithelp", editMode);
|
||||
showLayer("options", showScreenOptions);
|
||||
showLayer("showscreen", showScreenToggle);
|
||||
if (showScreenToggle == true)
|
||||
theToolBar.setShowScreenBox();
|
||||
|
||||
theToolBar.updateLayersLayer();
|
||||
//alert("found toolbar! - setting help location");
|
||||
theToolBar.setHelpLocation();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//alert("Found toolbar, without reloadlayer!");
|
||||
theToolBar.history.go(0);
|
||||
}
|
||||
}
|
||||
//else
|
||||
//alert("warning: toolbar not found");
|
||||
}
|
||||
}
|
||||
|
||||
function showDocumentLayer(inLayerName, inDoShow)
|
||||
{
|
||||
if (inDoShow == "hide")
|
||||
inDoShow = false;
|
||||
else if (inDoShow != false)
|
||||
inDoShow = true;
|
||||
|
||||
if (parent.content && parent.content.document.layers[inLayerName])
|
||||
{
|
||||
if (inDoShow == true)
|
||||
{
|
||||
parent.content.document.layers[inLayerName].visibility = "show";
|
||||
//alert("showing layer: " + inLayerName);
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.content.document.layers[inLayerName].visibility = "hide";
|
||||
//alert("hiding layer: " + inLayerName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function countDocumentLayers()
|
||||
{
|
||||
if (parent.content.document.layers)
|
||||
return parent.content.document.layers.length;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getLayerName(inIndex)
|
||||
{
|
||||
if (parent.content.document.layers && parent.content.document.layers[inIndex])
|
||||
return parent.content.document.layers[inIndex].name;
|
||||
return null;
|
||||
}
|
||||
|
||||
function getLayerSrc(inIndex)
|
||||
{
|
||||
if (parent.content.document.layers && parent.content.document.layers[inIndex])
|
||||
return parent.content.document.layers[inIndex].src;
|
||||
return null;
|
||||
}
|
||||
|
||||
function getDocumentLocation()
|
||||
{
|
||||
return parent.content.document.location;
|
||||
}
|
||||
|
||||
function getDocumentLayerVisibility(inLayerName)
|
||||
{
|
||||
if (parent.content.document.layers && parent.content.document.layers[inLayerName])
|
||||
return parent.content.document.layers[inLayerName].visibility;
|
||||
else
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
function reloadDocument()
|
||||
{
|
||||
top.globals.debug("RELOADING DOCUMENT!!!!" + parent.content.history);
|
||||
if (parent.content.history)
|
||||
parent.content.history.go(0);
|
||||
}
|
||||
// end hiding contents from old browsers -->
|
||||
45
mozilla/cmd/dialup/as_html/cmprehd.htm
Normal file
45
mozilla/cmd/dialup/as_html/cmprehd.htm
Normal file
@@ -0,0 +1,45 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<SCRIPT LANGUAGE="JavaScript" ARCHIVE="asw.jar" SRC="cmprehd.js"></SCRIPT>
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js"></LINK>
|
||||
</HEAD>
|
||||
|
||||
<BODY BACKGROUND="images/bg.gif" onLoad="loadData()" BGCOLOR="cccccc" ID="cmprehd001">
|
||||
|
||||
<!-- The layer below contains the Account Setup identifier. -->
|
||||
<LAYER NAME="tagtext" LEFT=420 TOP=0 VISIBILITY=SHOW>
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=200 ID="nospace">
|
||||
<TR><TD HEIGHT=20 VALIGN=MIDDLE BACKGROUND="images/tag.gif">
|
||||
<B CLASS="previewtag">ACCOUNT SETUP</B>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</LAYER>
|
||||
|
||||
<P CLASS="title"><B>Compare Internet Service Providers</B></P>
|
||||
<P>Select an Internet Service Provider (ISP) to get more information and begin
|
||||
account creation.</P>
|
||||
<P CLASS="comparesmall">
|
||||
<B CLASS="compare">Provider Highlights:</B>
|
||||
<IMG SRC="metadata/images/feature1.gif" HEIGHT=16 WIDTH=16><B>Free Account Time!</B>
|
||||
<IMG SRC="metadata/images/feature2.gif" HEIGHT=16 WIDTH=16>Phone Bill Billing
|
||||
<IMG SRC="metadata/images/feature3.gif" HEIGHT=16 WIDTH=16>Web Page Hosting
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
28
mozilla/cmd/dialup/as_html/cmprehd.js
Normal file
28
mozilla/cmd/dialup/as_html/cmprehd.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
function loadData()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
|
||||
|
||||
if ( parent.parent.controls.generateControls )
|
||||
parent.parent.controls.generateControls();
|
||||
}
|
||||
|
||||
// end hiding contents from old browers -->
|
||||
28
mozilla/cmd/dialup/as_html/compwrap.htm
Normal file
28
mozilla/cmd/dialup/as_html/compwrap.htm
Normal file
@@ -0,0 +1,28 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Account Setup</TITLE>
|
||||
<SCRIPT LANGUAGE="JavaScript" ARCHIVE="asw.jar" SRC="compwrap.js"></SCRIPT>
|
||||
</HEAD>
|
||||
|
||||
<FRAMESET rows="140,*" BORDER=0 FRAMEBORDER="no">
|
||||
<FRAME NAME="compareheader" SRC="cmprehd.htm" NORESIZE SCROLLING="no">
|
||||
<FRAME NAME="compare" SRC="compare.htm" NORESIZE>
|
||||
</FRAMESET>
|
||||
</HTML>
|
||||
39
mozilla/cmd/dialup/as_html/compwrap.js
Normal file
39
mozilla/cmd/dialup/as_html/compwrap.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/* -*- 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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
function go( msg )
|
||||
{
|
||||
parent.parent.globals.debug( "compwrap go" );
|
||||
|
||||
if ( compare.ispRadio != null && compare.ispRadio != "" )
|
||||
{
|
||||
parent.parent.globals.debug( compare.ispRadio );
|
||||
parent.parent.globals.selectedISP = compare.ispRadio;
|
||||
return true;
|
||||
}
|
||||
alert( "You haven't selected an ISP" );
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkData()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// end hiding contents from old browers -->
|
||||
48
mozilla/cmd/dialup/as_html/config/ACCTSET.INI
Normal file
48
mozilla/cmd/dialup/as_html/config/ACCTSET.INI
Normal file
@@ -0,0 +1,48 @@
|
||||
; 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=
|
||||
RegSource=APL
|
||||
|
||||
[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
|
||||
45
mozilla/cmd/dialup/as_html/config/RegServ.IAS
Normal file
45
mozilla/cmd/dialup/as_html/config/RegServ.IAS
Normal file
@@ -0,0 +1,45 @@
|
||||
; 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=Netscape Internet Account Server
|
||||
SiteName=Netscape Internet Account Server
|
||||
|
||||
[IP]
|
||||
RegCGI=https://reggie.netscape.com/IAS5/docs/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=
|
||||
RegRoot=https://reggie.netscape.com/IAS5/docs/
|
||||
|
||||
[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.
|
||||
79
mozilla/cmd/dialup/as_html/connect1.htm
Normal file
79
mozilla/cmd/dialup/as_html/connect1.htm
Normal file
@@ -0,0 +1,79 @@
|
||||
<!-- -*- 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.
|
||||
-->
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
|
||||
<HTML>
|
||||
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Account Setup</TITLE>
|
||||
|
||||
<SCRIPT LANGUAGE = "JavaScript" ARCHIVE="asw.jar" SRC="connect1.js">
|
||||
</SCRIPT>
|
||||
|
||||
<LINK REL=STYLESHEET TYPE="text/JavaScript" ARCHIVE="asw.jar" HREF="sheet.js">
|
||||
</LINK>
|
||||
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY BACKGROUND="images/bg.gif" BGCOLOR="cccccc" onLoad="loadData()" ID="connect100">
|
||||
|
||||
|
||||
<!-- The layer below contains the Account Setup identifier. -->
|
||||
|
||||
<LAYER NAME = "tagtext" LEFT = 420 TOP = 0 VISIBILITY = SHOW>
|
||||
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=200 ID="nospace">
|
||||
<TR><TD HEIGHT=20 VALIGN=MIDDLE BACKGROUND="images/tag.gif">
|
||||
<B CLASS="previewtag">ACCOUNT SETUP</B>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</LAYER>
|
||||
|
||||
|
||||
<!-- The layer below contains the headline and text of this screen -->
|
||||
|
||||
|
||||
|
||||
<P CLASS="title"><B>Connect to Server</B></P>
|
||||
|
||||
<P>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.</P>
|
||||
|
||||
<P>When evaluating account plans, think about these questions:</P>
|
||||
|
||||
<UL>
|
||||
<LI>How much time do you think you'll spend on the Internet each month?</LI>
|
||||
<LI>What are the monthly or hourly rates?</LI>
|
||||
<LI>What technical support is offered?</LI>
|
||||
</UL>
|
||||
|
||||
|
||||
|
||||
<P ID="nospace">Make sure your modem is properly connected and turned on, then click Connect to Server to begin.</P>
|
||||
|
||||
<CENTER>
|
||||
<SCRIPT LANGUAGE = "JavaScript" ID="connect101">
|
||||
generateRegServerList();
|
||||
</SCRIPT>
|
||||
</CENTER>
|
||||
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
134
mozilla/cmd/dialup/as_html/connect1.js
Normal file
134
mozilla/cmd/dialup/as_html/connect1.js
Normal file
@@ -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.
|
||||
*/
|
||||
<!-- to hide script contents from old browsers
|
||||
|
||||
|
||||
|
||||
function go(msg)
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
|
||||
|
||||
if (parent.parent.globals.document.vars.editMode.value != "yes") {
|
||||
// if RegServer specified in ACCTSET.INI, use it
|
||||
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename(self);
|
||||
var intlFlag = parent.parent.globals.GetNameValuePair(theFile,"Mode Selection","IntlMode");
|
||||
intlFlag = intlFlag.toLowerCase();
|
||||
|
||||
var theRegFile = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","RegServer");
|
||||
|
||||
if (theRegFile != null && theRegFile != "") {
|
||||
parent.parent.globals.document.vars.regServer.value = theRegFile;
|
||||
}
|
||||
else {
|
||||
// otherwise, if multiple .IAS files exist, get list selection and determine appropriate .IAS file
|
||||
|
||||
var pathName = parent.parent.globals.getConfigFolder(self);
|
||||
var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(pathName,".IAS");
|
||||
if (theList != null) {
|
||||
if (theList.length >1) {
|
||||
if (document.forms[0].regServerList.selectedIndex<0) {
|
||||
alert("Please select an Internet account server.");
|
||||
return(false);
|
||||
}
|
||||
for (var x=0; x<theList.length; x++) {
|
||||
var file = parent.parent.globals.getConfigFolder(self) + theList[x];
|
||||
var name = parent.parent.globals.document.setupPlugin.GetNameValuePair(file,"Dial-In Configuration","SiteName");
|
||||
|
||||
if (name == document.forms[0].regServerList.options[document.forms[0].regServerList.selectedIndex].text) {
|
||||
parent.parent.globals.document.vars.regServer.value = theList[x];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (parent.parent.globals.document.vars.regServer.value == "") {
|
||||
alert("Internal problem locating appropriate registration server file.");
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
else if (theList.length==1) {
|
||||
parent.parent.globals.document.vars.regServer.value = theList[0];
|
||||
}
|
||||
else {
|
||||
alert("Internal problem locating a registration server file.");
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert("Internal problem locating appropriate registration server file.");
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
else {
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkData()
|
||||
{
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadData()
|
||||
{
|
||||
if (parent.controls.generateControls) parent.controls.generateControls();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function saveData()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
function generateRegServerList()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
|
||||
|
||||
// if RegServer is not specified in ACCTSET.INI and multiple .IAS files exist, build list
|
||||
|
||||
var theFile = parent.parent.globals.getAcctSetupFilename(self);
|
||||
var theRegFile = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","RegServer");
|
||||
|
||||
if (theRegFile == null || theRegFile == "") {
|
||||
var pathName = parent.parent.globals.getConfigFolder(self);
|
||||
var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(pathName,".IAS");
|
||||
if (theList != null) {
|
||||
if (theList.length >1) {
|
||||
document.writeln("<TABLE CELLPADDING=2 CELLSPACING=0 ID='minspace'><TR><TD ALIGN=LEFT VALIGN=TOP HEIGHT=25><spacer type=vertical size=2><B>Select an Internet account server:</B></TD><TD ALIGN=LEFT VALIGN=TOP><FORM><SELECT NAME='regServerList'>");
|
||||
for (var x=0; x<theList.length; x++) {
|
||||
var file = parent.parent.globals.getConfigFolder(self) + theList[x];
|
||||
var name = parent.parent.globals.document.setupPlugin.GetNameValuePair(file,"Dial-In Configuration","SiteName");
|
||||
var selected=(x==0) ? " SELECTED":"";
|
||||
document.writeln("<OPTION VALUE='" + name + "'" + selected + ">" + name);
|
||||
}
|
||||
document.writeln("</SELECT></FORM></TD></TR></TABLE>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// end hiding contents from old browsers -->
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user