source code taken from cacert-20100204.tar.bz2
[cacert.git] / cacert / pages / wot / 6.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 if(!array_key_exists('notarise',$_SESSION['_config']))
20 {
21 echo "Error: No user data found.";
22 exit;
23 }
24
25 $row = $_SESSION['_config']['notarise'];
26
27 if(!array_key_exists('pointsalready',$_SESSION['_config'])) $_SESSION['_config']['pointsalready']=0;
28
29
30 if($_SESSION['profile']['ttpadmin'] == 1 && $_SESSION['profile']['board'] == 1)
31 {
32 $methods = array("Face to Face Meeting", "Trusted 3rd Parties", "Thawte Points Transfer", "Administrative Increase", "CT Magazine - Germany");
33 } else if($_SESSION['profile']['ttpadmin'] == 1) {
34 $methods = array("Face to Face Meeting", "Trusted 3rd Parties");
35 }
36
37 $cap = "/cap.php?";
38 $name = $row['fname']." ".$row['mname']." ".$row['lname']." ".$row['suffix'];
39 $_SESSION['_config']['wothash'] = md5($name."-".$row['dob']);
40 while(strstr($name, " "))
41 $name = str_replace(" ", " ", $name);
42 $cap .= "name=".urlencode($name);
43 $cap .= "&amp;dob=".urlencode($row['dob']);
44 $cap .= "&amp;email=".urlencode($row['email']);
45 $name = $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'];
46 while(strstr($name, " "))
47 $name = str_replace(" ", " ", $name);
48 $cap .= "&amp;assurer=".urlencode($name);
49 $cap .= "&amp;date=now";
50 $cap .= "&amp;maxpoints=".maxpoints();
51
52 $maxpoints = maxpoints();
53 if($maxpoints > 100)
54 $maxpoints = 100;
55
56 if(array_key_exists('error',$_SESSION['_config']) && $_SESSION['_config']['error'] != "") { ?><font color="#ff0000" size="+1">ERROR: <?=$_SESSION['_config']['error']?></font><? unset($_SESSION['_config']['error']); } ?>
57 <form method="post" action="wot.php">
58 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="600">
59 <tr>
60 <td colspan="2" class="title"><?=_("Assurance Confirmation")?></td>
61 </tr>
62 <? if(array_key_exists('alreadydone',$_SESSION['_config']) && $_SESSION['_config']['alreadydone'] == 1) { ?>
63 <tr>
64 <td class="DataTD" colspan="2" align="left" style="color: red;"><b><?=_("PLEASE NOTE: You have already assured this person before! If this is unintentional please DO NOT CONTINUE with this assurance.")?></b></td>
65 </tr>
66 <?
67 } if(100 - $_SESSION['_config']['pointsalready'] - $maxpoints < 0) {
68 ?>
69 <tr>
70 <td class="DataTD" colspan="2" align="left" style="color: red;"><b><? printf(_("This person already has %s assurance points. Any points you give this person may be rounded down, or they may not even get any points. If you have less then 150 points you will still receive 2 points for assuring them."), $_SESSION['_config']['pointsalready']); ?></b></td>
71 </tr>
72 <? }
73
74 $query = "select `verified` from `users` where `id`='".$row['id']."'";
75 $res = mysql_query($query);
76 $drow = mysql_fetch_assoc($res);
77 //if($_SESSION['_config']['verified'] <= 0)
78 if($drow['verified']<=0)
79 { ?>
80 <tr>
81 <td class="DataTD" colspan="2" align="left" style="color: red;"><b><?=_("You are about to assure a person that isn't currently verified. If you continue and they do not verify their account within 48 hours the account could automatically be removed by the system.")?></b></td>
82 </tr>
83 <? } ?>
84 <tr>
85 <td class="DataTD" colspan="2" align="left"><? printf(_("Please check the following details match against what you witnessed when you met %s in person. You MUST NOT proceed unless you are sure the details are correct. You may be held responsible by the CAcert Arbitrator for any issues with this Assurance."), $row['fname']); ?></td>
86 </tr>
87 <tr>
88 <td class="DataTD"><?=_("Name")?>:</td>
89 <td class="DataTD"><?=$row['fname']?> <?=$row['mname']?> <?=$row['lname']?> <?=$row['suffix']?></td>
90 </tr>
91 <tr>
92 <td class="DataTD"><?=_("Date of Birth")?>:</td>
93 <td class="DataTD"><?=$row['dob']?> (<?=_("YYYY-MM-DD")?>)</td>
94 </tr>
95 <? if($_SESSION['profile']['ttpadmin'] == 1) { ?>
96 <tr>
97 <td class="DataTD"><?=_("Method")?>:</td>
98 <td class="DataTD"><select name="method">
99 <? foreach($methods as $val) { ?>
100 <option value="<?=$val?>"<? if(array_key_exists('method',$_POST) && $val == $_POST['method']) echo " selected"; ?>><?=$val?></option>
101 <? } ?>
102 </select>
103 </td>
104 </tr>
105 <tr>
106 <td class="DataTD" colspan="2"><?=_("Only tick the next box if the Assurance was face to face.")?></td>
107 </tr>
108 <? } ?>
109 <tr>
110 <td class="DataTD"><input type="checkbox" name="certify" value="1"<? if(array_key_exists('certify',$_POST) && $_POST['certify'] == 1) echo " checked"; ?>></td>
111 <td class="DataTD"><? printf(_("I certify that %s %s %s has appeared in person"), $row['fname'], $row['mname'], $row['lname']); ?></td>
112 </tr>
113 <tr>
114 <td class="DataTD"><?=_("Location")?>:</td>
115 <td class="DataTD"><input type="text" name="location" value="<?=array_key_exists('location',$_SESSION['_config'])?$_SESSION['_config']['location']:""?>"></td>
116 </tr>
117 <tr>
118 <td class="DataTD"><?=_("Date")?>:</td>
119 <td class="DataTD"><input type="text" name="date" value="<?=array_key_exists('date',$_SESSION['_config'])?$_SESSION['_config']['date']:""?>"><br><?=_("Only fill this in if you assured the person on a different day")?></td>
120 </tr>
121 <? if($_SESSION['profile']['board'] == 1 && $_SESSION['_config']['pointsalready'] <= 150) { ?>
122 <tr>
123 <td class="DataTD" colspan="2"><?=_("Issuing a temporary increase will automatically boost their points to 200 points for a nomindated amount of days, after which the person will be reduced to 150 points regardless of the amount of points they had previously. Regardless of method chosen above it will be recorded in the system as an Administrative Increase and there is a maximum amount of 45 days that points can be issued for.")?></td>
124 </tr>
125 <tr>
126 <td class="DataTD"><nobr><?=_("Temporary Increase")?>:</nobr><br><nobr><?=_("Number of days")?></nobr></td>
127 <td class="DataTD"><input type="text" name="expire" value="<?=intval(array_key_exists('expire',$_POST)?$_POST['expire']:0)?>"></td>
128 </tr>
129 <tr>
130 <td class="DataTD"><nobr><?=_("Sponsoring Member")?>:</td>
131 <td class="DataTD"><select name="sponsor">
132 <?
133 $query = "select * from `users` where `board`='1' and `id`!='".intval($_SESSION['profile']['id'])."'";
134 $res = mysql_query($query);
135 while($row = mysql_fetch_assoc($res))
136 {
137 ?>
138 <option value="<?=$row['id']?>"<? if(array_key_exists('sponsor',$_POST) && $row['id'] == $_POST['sponsor']) echo " selected='selected'"; ?>><?=$row['fname']." ".$row['lname']?></option>
139 <? } ?>
140 </select>
141 </td>
142 </tr>
143 <? } ?>
144 <tr>
145 <td class="DataTD"><input type="checkbox" name="assertion" value="1"<? if(array_key_exists('assertion',$_POST) && $_POST['assertion'] == 1) echo " checked='checked'"; ?>></td>
146 <td class="DataTD"><?=_("I believe that the assertion of identity I am making is correct, complete and verifiable. I have seen original documentation attesting to this identity. I accept that the CAcert Arbitrator may call upon me to provide evidence in any dispute, and I may be held responsible.")?></td>
147 </tr>
148 <tr>
149 <td class="DataTD"><input type="checkbox" name="rules" value="1"<? if(array_key_exists('rules',$_POST) && $_POST['rules'] == 1) echo " checked='checked'"; ?>></td>
150 <td class="DataTD"><?=_("I have read and understood the Assurance Policy and the Assurance Handbook and am making this Assurance subject to and in compliance with the policy and handbook.")?></td>
151 </tr>
152 <tr>
153 <td class="DataTD"><?=_("Policy")?>:</td>
154 <td class="DataTD"><a href="/policy/AssurancePolicy.php" target="_NEW"><?=_("Assurance Policy")?></a> - <a href="http://wiki.cacert.org/AssuranceHandbook2" target="_NEW"><?=_("Assurance Handbook")?></a></td>
155 </tr>
156 <tr>
157 <td class="DataTD"><?=_("Points")?>:<br><nobr>(Max <?=maxpoints()?>)</nobr></td>
158 <td class="DataTD"><input type="text" name="points" value=""></td>
159 </tr>
160 <tr>
161 <td class="DataTD"><?=_("WoT Form")?>:</td>
162 <td class="DataTD"><a href="<?=$cap?>" target="_NEW">A4 - <?=_("WoT Form")?></a> <a href="<?=$cap?>&amp;format=letter" target="_NEW">US - <?=_("WoT Form")?></a></td>
163 </tr>
164 <tr>
165 <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("I confirm this Assurance")?>"> <input type="submit" name="cancel" value="<?=_("Cancel")?>"></td>
166 </tr>
167 </table>
168 <input type="hidden" name="pagehash" value="<?=$_SESSION['_config']['wothash']?>">
169 <input type="hidden" name="oldid" value="<?=$id?>">
170 </form>