bug 1394: applied text changes according to bug description
[cacert-devel.git] / includes / account_stuff.php
1 <? /*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 $id = 0; if(array_key_exists("id",$_REQUEST)) $id=intval($_REQUEST['id']);
20 $expand="";
21
22 function showheader($title = "CAcert.org", $title2 = "")
23 {
24 global $id, $PHP_SELF;
25 $PHP_SELF = &$_SERVER['PHP_SELF'];
26 $expand="";
27 $tmpid = $id;
28 if($PHP_SELF == "/wot.php")
29 $tmpid = $id + 500;
30 if($PHP_SELF == "/gpg.php")
31 $tmpid = $id + 1000;
32 if($PHP_SELF == "/disputes.php")
33 $tmpid = $id + 1500;
34 if($PHP_SELF == "/advertising.php")
35 $tmpid = $id + 2000;
36
37 switch($tmpid)
38 {
39 case 1: // Add email address
40 case 2: $expand = " explode('emailacc');"; break; // View email addresses
41 case 3: // Add Client certificate
42 case 4: // Confirm Client Certificate Request
43 case 5: // View Client Certificates
44 case 6: $expand = " explode('clicerts');"; break; // Client Certificate page
45 case 7: // Add new domain
46 case 8: // Confirm Domain page
47 case 9: $expand = " explode('domains');"; break; // View Domains
48 case 10: // Add Server Certifiacte
49 case 11: // Confirm Server Certificate Rewust
50 case 12: // View Server Cerificate
51 case 15: $expand = " explode('servercert');"; break; // Server Certificate page
52 case 13: // ViewEdit
53 case 14: // Change password
54 case 36: // My Alert settings
55 case 41: // Language Settings
56 case 55: // Trainings
57 case 59: // Account History
58 case 507:
59 case 508: // My Listing
60 case 510: // Old points calculation
61 case 515: // New points calculation
62 case 513: $expand = " explode('mydetails');"; break; // My Location
63 case 16: // Add Org Client Cert
64 case 17: // Confirm Org Client Certificate Request
65 case 18: // View Org Client Certificate
66 case 19: $expand = " explode('clientorg');"; break; // Org Cleint Cert page
67 case 20: // Add Org Server Cert
68 case 21: // Conform Org Server Cert Request
69 case 22: // View Org Server Certs
70 case 23: $expand = " explode('serverorg');"; break; // Org Server Certificate page
71 case 24: // Add new Organisation
72 case 25: // View Organisation List
73 case 26: // View Organisation Domains
74 case 27: // Edit Org Account
75 case 28: // View Add Org Domain
76 case 29: // Edit Org Domain
77 case 30: // Delete Org Domain
78 case 31:
79 case 32: // View Org Admin
80 case 33: // Add Org Admin
81 case 34: // Delete Org Admin
82 case 60: // View Organisation Account History
83 case 35: $expand = " explode('orgadmin');"; break; // View Org Admin Organisation List
84 case 42:
85 case 43:
86 case 44:
87 case 45:
88 case 46:
89 case 47:
90 case 48:
91 case 49:
92 case 50:
93 case 54:
94 case 53: $expand = " explode('sysadmin');"; break;
95 case 500: // CAcert Web of Trust
96 case 501:
97 case 502: // Become an Assurer
98 case 503: // CAcert Web of Trust Roles
99 case 504: // TTP
100 case 505: // Assurer Some one
101 case 506:
102 case 509:
103 case 511:
104 case 512: $expand = " explode('WoT');"; break; // Find Assurer
105 case 1000:
106 case 1001:
107 case 1002: // View GPG key
108 case 1003:
109 case 1004:
110 case 1005:
111 case 1006:
112 case 1007:
113 case 1008:
114 case 1009:
115 case 1010: $expand = " explode('gpg');"; break;
116 case 1500: // Dipute
117 case 1501: // Dispute Email Request
118 case 1502: // ViewEdit
119 case 1503:
120 case 1504:
121 case 1505:
122 case 1506:
123 case 1507:
124 case 1508:
125 case 1509:
126 case 1510: $expand = " explode('disputes');"; break;
127 case 2000:
128 case 2001:
129 case 2002:
130 case 2003:
131 case 2004:
132 case 2005:
133 case 2006:
134 case 2007:
135 case 2008:
136 case 2009: $expand = " explode('advertising');"; break;
137 }
138
139 ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
140 <html>
141 <head>
142 <title><?=$title?></title>
143 <? if(array_key_exists('header',$_SESSION) && $_SESSION['_config']['header'] != "") { ?><?=$_SESSION['_config']['header']?><? } ?>
144 <link rel="stylesheet" href="/styles/default.css" type="text/css" />
145 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
146 <script language="JavaScript" type="text/javascript">
147 function explode(e) {
148 if (document.getElementById(e).style.display == 'none') {
149 document.getElementById(e).style.display = 'block';
150 } else {
151 document.getElementById(e).style.display = 'none';
152 }
153 }
154
155 function hideall() {
156 var Nodes = document.getElementsByTagName('ul')
157 var max = Nodes.length
158 for(var i = 0;i < max;i++) {
159 var nodeObj = Nodes.item(i)
160 if (nodeObj.className == "menu") {
161 nodeObj.style.display = 'none';
162 }
163 }
164 }
165 </script>
166 </head>
167 <body onload="hideall(); explode('home');<?=$expand?>">
168 <div id="pagecell1">
169 <div id="pageName"><br>
170 <div id="pageLogo"><a href="http://<?=$_SESSION['_config']['normalhostname']?>"><img src="/images/cacert4.png" border="0" alt="CAcert.org logo"></a></div>
171 <div id="googlead"><h2><?=_("Free digital certificates!")?></h2></div>
172 </div>
173 <div id="pageNav">
174 <div class="relatedLinks">
175 <h3>CAcert.org</h3>
176 <ul class="menu" id="home"><li><a href="/index.php"><?=_("Go Home")?></a></li><li><a href="account.php?id=logout"><?=_("Logout")?></a></li></ul>
177 </div>
178 <div class="relatedLinks">
179 <h3 class="pointer" onclick="explode('mydetails')">+ <?=_("My Details")?></h3>
180 <ul class="menu" id="mydetails"><li><a href="account.php?id=13"><?=_("View/Edit")?></a></li><li><a href="account.php?id=14"><?=_("Change Password")?></a></li><li><a href="account.php?id=41"><?=_("Default Language")?></a></li><li><a href="wot.php?id=8"><?=_("My Listing")?></a></li><li><a href="wot.php?id=13"><?=_("My Location")?></a></li><li><a href="account.php?id=36"><?=_("My Alert Settings")?></a></li><li><a href="account.php?id=55"><?=_("My Trainings")?></a></li><li><a href="wot.php?id=10"><?=_("My Points")?></a></li><?
181 /* to delete
182 if($_SESSION['profile']['id'] == 1 || $_SESSION['profile']['id'] == 5897)
183 echo "<li><a href='sqldump.php'>SQL Dump</a></li>";
184 */
185 ?></ul>
186 </div>
187 <div class="relatedLinks">
188 <h3 class="pointer" onclick="explode('emailacc')">+ <?=_("Email Accounts")?></h3>
189 <ul class="menu" id="emailacc"><li><a href="account.php?id=1"><?=_("Add")?></a></li><li><a href="account.php?id=2"><?=_("View")?></a></li></ul>
190 </div>
191 <div class="relatedLinks">
192 <h3 class="pointer" onclick="explode('clicerts')">+ <?=_("Client Certificates")?></h3>
193 <ul class="menu" id="clicerts"><li><a href="account.php?id=3"><?=_("New")?></a></li><li><a href="account.php?id=5"><?=_("View")?></a></li></ul>
194 </div>
195 <? if($_SESSION['profile']['points'] >= 50) { ?>
196 <div class="relatedLinks">
197 <h3 class="pointer" onclick="explode('gpg')">+ <?=_("GPG/PGP Keys")?></h3>
198 <ul class="menu" id="gpg"><li><a href="gpg.php?id=0"><?=_("New")?></a></li><li><a href="gpg.php?id=2"><?=_("View")?></a></li></ul>
199 </div>
200 <? } ?>
201 <div class="relatedLinks">
202 <h3 class="pointer" onclick="explode('domains')">+ <?=_("Domains")?></h3>
203 <ul class="menu" id="domains"><li><a href="account.php?id=7"><?=_("Add")?></a></li><li><a href="account.php?id=9"><?=_("View")?></a></li></ul>
204 </div>
205 <div class="relatedLinks">
206 <h3 class="pointer" onclick="explode('servercert')">+ <?=_("Server Certificates")?></h3>
207 <ul class="menu" id="servercert"><li><a href="account.php?id=10"><?=_("New")?></a></li><li><a href="account.php?id=12"><?=_("View")?></a></li></ul>
208 </div>
209 <? if(mysql_num_rows(mysql_query("select * from `org` where `memid`='".intval($_SESSION['profile']['id'])."'")) > 0 || $_SESSION['profile']['orgadmin'] == 1) { ?>
210 <div class="relatedLinks">
211 <h3 class="pointer" onclick="explode('clientorg')">+ <?=_("Org Client Certs")?></h3>
212 <ul class="menu" id="clientorg"><li><a href="account.php?id=16"><?=_("New")?></a></li><li><a href="account.php?id=18"><?=_("View")?></a></li></ul>
213 </div>
214 <div class="relatedLinks">
215 <h3 class="pointer" onclick="explode('serverorg')">+ <?=_("Org Server Certs")?></h3>
216 <ul class="menu" id="serverorg"><li><a href="account.php?id=20"><?=_("New")?></a></li><li><a href="account.php?id=22"><?=_("View")?></a></li></ul>
217 </div>
218 <? } ?>
219 <? if(mysql_num_rows(mysql_query("select * from `org` where `memid`='".intval($_SESSION['profile']['id'])."'")) > 0 || $_SESSION['profile']['orgadmin'] == 1) { ?>
220 <div class="relatedLinks">
221 <h3 class="pointer" onclick="explode('orgadmin')">+ <?=_("Org Admin")?></h3>
222 <ul class="menu" id="orgadmin"><? if($_SESSION['profile']['orgadmin'] == 1) { ?><li><a href="account.php?id=24"><?=_("New Organisation")?></a></li><li><a href="account.php?id=25"><?=_("View Organisations")?></a></li><? } ?><li><a href="account.php?id=35"><?=_("View")?></a></li></ul>
223 </div>
224 <? } ?>
225 <div class="relatedLinks">
226 <h3 class="pointer" onclick="explode('WoT')">+ <?=_("CAcert Web of Trust")?></h3>
227 <ul class="menu" id="WoT"><li><a href="wot.php?id=0"><?=_("About")?></a></li><li><a href="wot.php?id=12"><?=_("Find an Assurer")?></a></li><li><a href="wot.php?id=3"><?=_("Rules")?></a></li><li><? if($_SESSION['profile']['assurer'] != 1) { ?><a href="wot.php?id=2"><?=_("Becoming an Assurer")?></a><? } else { ?><a href="wot.php?id=5"><?=_("Assure Someone")?></a><? } ?></li><li><a href="wot.php?id=4"><?=_("Trusted ThirdParties")?></a></li><? if($_SESSION['profile']['points'] >= 500) { ?><li><a href="wot.php?id=11"><div style="white-space:nowrap"><?=_("Organisation Assurance")?></div></a></li><? } ?></ul>
228 </div>
229 <div class="relatedLinks">
230 <h3 class="pointer" onclick="explode('WoTForms')">+ <?=_("CAP Forms")?></h3><?
231 $name = $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'];
232 while(strstr($name, " "))
233 $name = str_replace(" ", " ", $name);
234 $extra = "?name=".urlencode($name);
235 $extra .= "&amp;dob=".urlencode($_SESSION['profile']['dob']);
236 $extra .= "&amp;email=".urlencode($_SESSION['profile']['email']);
237
238 $extra2 = "?assurer=".urlencode($name)."&amp;date=now&amp;maxpoints=".maxpoints();
239 ?>
240 <ul class="menu" id="WoTForms">
241 <li><a href="/cap.php<?=$extra?>">A4 - <?=_("WoT Form")?></a></li>
242 <li><a href="/cap.php<?=$extra?>&amp;format=letter">US - <?=_("WoT Form")?></a></li>
243 <? /* <li><div style="white-space:nowrap"><a href="/ttp.php<?=$extra?>">A4 - <?=_("TTP Form")?></a></div></li>
244 <li><div style="white-space:nowrap"><a href="/ttp.php<?=$extra?>&amp;format=letter">US - <?=_("TTP Form")?></a></div></li> */
245 ?>
246 <? if($_SESSION['profile']['points'] > 100) { ?><li><div style="white-space:nowrap"><a href="/cap.php<?=$extra2?>">A4 - <?=_("Assurance Form")?></a></div></li>
247 <li><div style="white-space:nowrap"><a href="/cap.php<?=$extra2?>&amp;format=letter">US - <?=_("Assurance Form")?></a></div></li>
248 <? } ?>
249 <? /*
250 <li><div style="white-space:nowrap"><a href="/ttp.php">A4 - <?=_("Blank TTP Form")?></a></div></li>
251 <li><div style="white-space:nowrap"><a href="/ttp.php?&amp;format=letter">US - <?=_("Blank TTP Form")?></a></div></li>
252 */ ?>
253 <li><div style="white-space:nowrap"><a href="/cap.php">A4 - <?=_("Blank CAP Form")?></a></div></li>
254 <li><div style="white-space:nowrap"><a href="/cap.php?&amp;format=letter">US - <?=_("Blank CAP Form")?></a></div></li></ul>
255 </div>
256 <? if($_SESSION['profile']['admin'] == 1 || $_SESSION['profile']['locadmin'] == 1) { ?>
257 <div class="relatedLinks">
258 <h3 class="pointer" onclick="explode('sysadmin')">+ <?=_("System Admin")?></h3>
259 <ul class="menu" id="sysadmin"><? if($_SESSION['profile']['admin'] == 1) { ?><li><a href="account.php?id=42"><?=_("Find User")?></a></li><li><a href="account.php?id=48"><?=_("Find Domain")?></a></li><? } if($_SESSION['profile']['locadmin'] == 1) { ?><li><a href="account.php?id=53"><?=_("Location DB")?></a></li><? } ?></ul>
260 </div>
261 <? } ?>
262 <div class="relatedLinks">
263 <h3 class="pointer" onclick="explode('disputes')">+ <?=_("Disputes/Abuses")?></h3>
264 <ul class="menu" id="disputes"><li><a href="disputes.php?id=0"><?=_("More Information")?></a></li><li><a href="disputes.php?id=1"><?=_("Email Dispute")?></a></li><li><a href="disputes.php?id=2"><?=_("Domain Dispute")?></a></li><? if($_SESSION['profile']['admin'] == 1) { ?><li><a href="disputes.php?id=3"><?=_("Abuses")?></a></li><? } ?></ul>
265 </div>
266 <? if($_SESSION['profile']['adadmin'] >= 1) { ?>
267 <div class="relatedLinks">
268 <h3 class="pointer" onclick="explode('advertising')">+ <?=_("Advertising")?></h3>
269 <ul class="menu" id="advertising"><li><a href="advertising.php?id=1"><?=_("New Ad")?></a></li><li><a href="advertising.php?id=0"><?=_("View Ads")?></a></li></ul>
270 </div>
271 <? } ?>
272 <? include("about_menu.php"); ?>
273 </div>
274 <div id="content">
275 <div class="story">
276 <h3><?=$title2?></h3>
277 <? if($_SESSION['_config']['errmsg'] != "") { ?>
278 <p><font color="#ff0000" size="+2"><? echo $_SESSION['_config']['errmsg']; $_SESSION['_config']['errmsg'] = ""; ?> </font></p>
279 <? } ?>
280 <?
281 }
282
283 function showfooter()
284 {
285 ?>
286 </div>
287 </div>
288 <div id="siteInfo"><a href="//wiki.cacert.org/FAQ/AboutUs"><?=_("About Us")?></a> | <a href="account.php?id=38"><?=_("Donations")?></a> | <a href="http://wiki.cacert.org/wiki/CAcertIncorporated"><?=_("Association Membership")?></a> |
289 <a href="/policy/PrivacyPolicy.html"><?=_("Privacy Policy")?></a> | <a href="account.php?id=40"><?=_("Contact Us")?></a>
290 | &copy;2002-<?=date("Y")?> <?=_("by CAcert")?></div>
291 </div>
292 </body>
293 </html><?
294 }