Source code taken from cacert-20141124.tar.bz2
[cacert.git] / pages / account / 16.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 include_once("../includes/shutdown.php");
19 ?>
20 <form method="post" action="account.php">
21 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
22 <tr>
23 <td colspan="2" class="title"><?=_("New Client Certificate")?></td>
24 </tr>
25 <tr>
26 <td class="DataTD"><?=_("Add")?></td>
27 <td class="DataTD"><?=_("Address")?></td>
28 <?
29 if (array_key_exists('emails',$_SESSION['_config']) && is_array($_SESSION['_config']['emails'])) {
30 $i = 1;
31 foreach($_SESSION['_config']['emails'] as $val) {
32 ?>
33 <tr>
34 <td class="DataTD"><label for="email<?=$i?>"><?=_("Email")?></label></td>
35 <td class="DataTD"><input type="text" id="email<?=$i?>" name="emails[]" value="<?=$val?>"/></td>
36 </tr>
37 <?
38 $i++;
39 }
40 } ?>
41 <tr>
42 <td class="DataTD"><label for="email0"><?=_("Email")?></td>
43 <td class="DataTD"><input type="text" id="email0" name="emails[]"/></td>
44 </tr>
45 <tr>
46 <td class="DataTD"><label for="name"><?=_("Name")?></label></td>
47 <td class="DataTD"><input type="text" id="name" name="name" value="<?=array_key_exists('name',$_SESSION['_config'])?($_SESSION['_config']['name']):''?>"/></td>
48 </tr>
49 <tr>
50 <td class="DataTD"><label for="OU"><?=_("Department")?></label></td>
51 <td class="DataTD"><input type="text" id="OU" name="OU" value="<?=array_key_exists('OU',$_SESSION['_config'])?(sanitizeHTML($_SESSION['_config']['OU'])):''?>"/></td>
52 </tr>
53
54 <tr name="expertoff" style="display:none">
55 <td class="DataTD">
56 <input type="checkbox" id="expertbox" name="expertbox" onchange="showExpert(this.checked)" />
57 </td>
58 <td class="DataTD">
59 <label for="expertbox"><?=_("Show advanced options")?></label>
60 </td>
61 </tr>
62 <tr name="expert">
63 <td class="DataTD" colspan="2" align="left">
64 <input type="radio" id="root1" name="rootcert" value="1" /> <label for="root1"><?=_("Sign by class 1 root certificate")?></label><br />
65 <input type="radio" id="root2" name="rootcert" value="2" checked="checked" /> <label for="root2"><?=_("Sign by class 3 root certificate")?></label><br />
66 <?=str_replace("\n", "<br>\n", wordwrap(_("Please note: If you use a certificate signed by the class 3 root, the class 3 root certificate needs to be imported into your email program as well as the class 1 root certificate so your email program can build a full trust path chain."), 60))?>
67 </td>
68 </tr>
69
70 <tr name="expert">
71 <td class="DataTD" colspan="2" align="left">
72 <?=_("Hash algorithm used when signing the certificate:")?><br />
73 <?
74 foreach (HashAlgorithms::getInfo() as $algorithm => $display_info) {
75 ?>
76 <input type="radio" id="hash_alg_<?=$algorithm?>" name="hash_alg" value="<?=$algorithm?>" <?=(HashAlgorithms::$default === $algorithm)?'checked="checked"':''?> />
77 <label for="hash_alg_<?=$algorithm?>"><?=$display_info['name']?><?=$display_info['info']?' - '.$display_info['info']:''?></label><br />
78 <?
79 }
80 ?>
81 </td>
82 </tr>
83
84 <? if($_SESSION['profile']['codesign'] && $_SESSION['profile']['points'] >= 100) { ?>
85 <tr name="expert">
86 <td class="DataTD" colspan="2" align="left">
87 <input type="checkbox" id="codesign" name="codesign" value="1" />
88 <label for="codesign"><?=_("Code Signing")?></label>
89 </td>
90 </tr>
91 <? } ?>
92 <tr>
93 <td class="DataTD" colspan="2" align="left">
94 <label for="description"><?=_("Optional comment, only used in the certificate overview")?></label><br />
95 <input type="text" id="description" name="description" maxlength="80" size="80" />
96 </td>
97 </tr>
98 <tr>
99 <td class="DataTD" colspan="2">
100 <input type="submit" name="add_email" value="<?=_("Add Another Email Address")?>">
101 <input type="submit" name="process" value="<?=_("Next")?>" />
102 </td>
103 </tr>
104 </table>
105 <input type="hidden" name="oldid" value="<?=$id?>">
106 </form>
107
108 <script language="javascript">
109 function showExpert(a)
110 {
111 b=document.getElementsByName("expert");
112 for(i=0;b.length>i;i++)
113 {
114 if(!a) {b[i].setAttribute("style","display:none"); }
115 else {b[i].removeAttribute("style");}
116 }
117 b=document.getElementsByName("expertoff");
118 for(i=0;b.length>i;i++)
119 {
120 b[i].removeAttribute("style");
121 }
122
123 }
124 showExpert(false);
125 </script>