First commit of tag changes. bug-1444
[cacert-devel.git] / pages / account / 16.php
1 <?php /*
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"><?php echo _("New Client Certificate")?></td>
24 </tr>
25 <tr>
26 <td class="DataTD"><?php echo _("Add")?></td>
27 <td class="DataTD"><?php echo _("Address")?></td>
28 <?php if (array_key_exists('emails',$_SESSION['_config']) && is_array($_SESSION['_config']['emails'])) {
29 $i = 1;
30 foreach($_SESSION['_config']['emails'] as $val) {
31 ?>
32 <tr>
33 <td class="DataTD"><label for="email<?php echo $i?>"><?php echo _("Email")?></label></td>
34 <td class="DataTD"><input type="text" id="email<?php echo $i?>" name="emails[]" value="<?php echo $val?>"/></td>
35 </tr>
36 <?php $i++;
37 }
38 } ?>
39 <tr>
40 <td class="DataTD"><label for="email0"><?php echo _("Email")?></td>
41 <td class="DataTD"><input type="text" id="email0" name="emails[]"/></td>
42 </tr>
43 <tr>
44 <td class="DataTD"><label for="name"><?php echo _("Name")?></label></td>
45 <td class="DataTD"><input type="text" id="name" name="name" value="<?php echo array_key_exists('name',$_SESSION['_config'])?($_SESSION['_config']['name']):''?>"/></td>
46 </tr>
47 <tr>
48 <td class="DataTD"><label for="OU"><?php echo _("Department")?></label></td>
49 <td class="DataTD"><input type="text" id="OU" name="OU" value="<?php echo array_key_exists('OU',$_SESSION['_config'])?(sanitizeHTML($_SESSION['_config']['OU'])):''?>"/></td>
50 </tr>
51
52 <tr name="expertoff" style="display:none">
53 <td class="DataTD">
54 <input type="checkbox" id="expertbox" name="expertbox" onchange="showExpert(this.checked)" />
55 </td>
56 <td class="DataTD">
57 <label for="expertbox"><?php echo _("Show advanced options")?></label>
58 </td>
59 </tr>
60 <tr name="expert">
61 <td class="DataTD" colspan="2" align="left">
62 <input type="radio" id="root1" name="rootcert" value="1" /> <label for="root1"><?php echo _("Sign by class 1 root certificate")?></label><br />
63 <input type="radio" id="root2" name="rootcert" value="2" checked="checked" /> <label for="root2"><?php echo _("Sign by class 3 root certificate")?></label><br />
64 <?php echo 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))?>
65 </td>
66 </tr>
67
68 <tr name="expert">
69 <td class="DataTD" colspan="2" align="left">
70 <?php echo _("Hash algorithm used when signing the certificate:")?><br />
71 <?php foreach (HashAlgorithms::getInfo() as $algorithm => $display_info) {
72 ?>
73 <input type="radio" id="hash_alg_<?php echo $algorithm?>" name="hash_alg" value="<?php echo $algorithm?>" <?php echo (HashAlgorithms::$default === $algorithm)?'checked="checked"':''?> />
74 <label for="hash_alg_<?php echo $algorithm?>"><?php echo $display_info['name']?><?php echo $display_info['info']?' - '.$display_info['info']:''?></label><br />
75 <?php }
76 ?>
77 </td>
78 </tr>
79
80 <?php if($_SESSION['profile']['codesign'] && $_SESSION['profile']['points'] >= 100) { ?>
81 <tr name="expert">
82 <td class="DataTD" colspan="2" align="left">
83 <input type="checkbox" id="codesign" name="codesign" value="1" />
84 <label for="codesign"><?php echo _("Code Signing")?></label>
85 </td>
86 </tr>
87 <?php } ?>
88 <tr>
89 <td class="DataTD" colspan="2" align="left">
90 <label for="description"><?php echo _("Optional comment, only used in the certificate overview")?></label><br />
91 <input type="text" id="description" name="description" maxlength="80" size="80" />
92 </td>
93 </tr>
94 <tr>
95 <td class="DataTD" colspan="2">
96 <input type="submit" name="add_email" value="<?php echo _("Add Another Email Address")?>">
97 <input type="submit" name="process" value="<?php echo _("Next")?>" />
98 </td>
99 </tr>
100 </table>
101 <input type="hidden" name="oldid" value="<?php echo $id?>">
102 </form>
103 <?php echo _("Please fill out the form, when all data is entered and you click \"Next\" you can add either a CSR (certificate signing request) or create a new key with your browser. Even in the case that a CSR is given the data from this form will be used for the certificate. Only the public key information of the CSR will be copied.")?>
104
105 <script language="javascript">
106 function showExpert(a)
107 {
108 b=document.getElementsByName("expert");
109 for(i=0;b.length>i;i++)
110 {
111 if(!a) {b[i].setAttribute("style","display:none"); }
112 else {b[i].removeAttribute("style");}
113 }
114 b=document.getElementsByName("expertoff");
115 for(i=0;b.length>i;i++)
116 {
117 b[i].removeAttribute("style");
118 }
119
120 }
121 showExpert(false);
122 </script>