From bb7b042f575aaa4b966621f172a39d683c62af4c Mon Sep 17 00:00:00 2001 From: root Date: Sun, 4 Dec 2005 21:04:05 +0000 Subject: [PATCH] updates --- includes/account.php | 108 +- includes/account_stuff.php | 21 +- includes/general_stuff.php | 45 +- includes/loggedin.php | 4 +- locale/de.po | 8 +- locale/fi_FI.po | 3699 ++++++++++++++++++++++++++++++++ locale/is.po | 3576 ++++++++++++++++++++++++++++++ locale/it.po | 163 +- locale/ka.po | 3570 ++++++++++++++++++++++++++++++ locale/sv.po | 64 +- pages/account/15.php | 1 - pages/account/23.php | 1 - pages/account/43.php | 48 +- pages/account/49.php | 44 +- pages/account/53.php | 84 +- pages/account/54.php | 158 ++ pages/gpg/3.php | 1 - pages/index/0.php | 42 +- pages/wot/{1.php => 1-old.php} | 0 pages/wot/12.php | 109 + pages/wot/13.php | 72 + pages/wot/6.php | 1 + pages/wot/{7.php => 7-old.php} | 0 tverify/index.php | 1 + www/ac.js | 547 +++++ www/ac.php | 37 + www/account.php | 4 + www/cap.php | 1 + www/rss.php | 1 + www/stats.php | 11 +- www/styles/default.css | 36 + www/ttp.php | 1 + www/wot.php | 7 +- 33 files changed, 12239 insertions(+), 226 deletions(-) create mode 100644 locale/fi_FI.po create mode 100644 locale/is.po create mode 100644 locale/ka.po create mode 100644 pages/account/54.php rename pages/wot/{1.php => 1-old.php} (100%) create mode 100644 pages/wot/12.php create mode 100644 pages/wot/13.php rename pages/wot/{7.php => 7-old.php} (100%) create mode 100644 www/ac.js create mode 100644 www/ac.php diff --git a/includes/account.php b/includes/account.php index e180a0f..2e0c18c 100644 --- a/includes/account.php +++ b/includes/account.php @@ -1368,6 +1368,7 @@ `org`.`memid`='".$_SESSION['profile']['id']."'"; } $org = mysql_fetch_assoc(mysql_query($query)); + $csrsubject = ""; if($org['OU']) $csrsubject .= "/organizationalUnitName=".$org['OU']; @@ -1394,7 +1395,7 @@ } if($SAN != "") - $csrsubject .= "/subjectAltName=".$SAN."/commonName=*.cacert.org"; + $csrsubject .= "/subjectAltName=".$SAN; if($_SESSION['_config']['rowid']['0'] > 0) { @@ -1891,6 +1892,86 @@ exit; } + if(($id == 53 || $id == 54 || $oldid == 53 || $oldid == 54) && + $_SESSION['profile']['locadmin'] != 1) + { + showheader(_("My CAcert.org Account!")); + echo _("You don't have access to this area."); + showfooter(); + exit; + } + + if($oldid == 54 || ($id == 53 && $_REQUEST['action'] != "")) + { + $id = 53; + $ccid = intval($_REQUEST['ccid']); + $regid = intval($_REQUEST['regid']); + $newreg = intval($_REQUEST['newreg']); + $locid = intval($_REQUEST['locid']); + $name = mysql_escape_string($_REQUEST['name']); + $long = mysql_escape_string($_REQUEST['longitude']); + $lat = mysql_escape_string($_REQUEST['latitude']); + + if($locid > 0 && $_REQUEST['action'] == "edit") + { + $query = "update `locations` set `name`='$name', `lat`='$lat', `long`='$long' where `id`='$locid'"; + mysql_query($query); + $row = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='$locid'")); + $_REQUEST['regid'] = $row['regid']; + unset($_REQUEST['ccid']); + unset($_REQUEST['locid']); + unset($_REQUEST['action']); + } else if($regid > 0 && $_REQUEST['action'] == "edit") { + $query = "update `regions` set `name`='$name' where `id`='$regid'"; + mysql_query($query); + $row = mysql_fetch_assoc(mysql_query("select * from `regions` where `id`='$regid'")); + $_REQUEST['ccid'] = $row['ccid']; + unset($_REQUEST['regid']); + unset($_REQUEST['locid']); + unset($_REQUEST['action']); + } else if($regid > 0 && $_REQUEST['action'] == "add") { + $row = mysql_fetch_assoc(mysql_query("select `ccid` from `regions` where `id`='$regid'")); + $ccid = $row['ccid']; + $query = "insert into `locations` set `ccid`='$ccid', `regid`='$regid', `name`='$name', `lat`='$lat', `long`='$long'"; + mysql_query($query); + unset($_REQUEST['ccid']); + unset($_REQUEST['locid']); + unset($_REQUEST['action']); + } else if($ccid > 0 && $_REQUEST['action'] == "add") { + $query = "insert into `regions` set `ccid`='$ccid', `name`='$name'"; + mysql_query($query); + $row = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='$locid'")); + unset($_REQUEST['regid']); + unset($_REQUEST['locid']); + unset($_REQUEST['action']); + } else if($locid > 0 && $_REQUEST['action'] == "delete") { + $row = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='$locid'")); + $_REQUEST['regid'] = $row['regid']; + mysql_query("delete from `locations` where `id`='$locid'"); + unset($_REQUEST['ccid']); + unset($_REQUEST['locid']); + unset($_REQUEST['action']); + } else if($locid > 0 && $_REQUEST['action'] == "move") { + $row = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='$locid'")); + $oldregid = $row['regid']; + mysql_query("update `locations` set `regid`='$newreg' where `id`='$locid'"); + mysql_query("update `users` set `regid`='$newreg' where `regid`='$oldregid'"); + $row = mysql_fetch_assoc(mysql_query("select * from `locations` where `id`='$locid'")); + $_REQUEST['regid'] = $row['regid']; + unset($_REQUEST['ccid']); + unset($_REQUEST['locid']); + unset($_REQUEST['action']); + } else if($regid > 0 && $_REQUEST['action'] == "delete") { + $row = mysql_fetch_assoc(mysql_query("select * from `regions` where `id`='$regid'")); + $_REQUEST['ccid'] = $row['ccid']; + mysql_query("delete from `locations` where `regid`='$regid'"); + mysql_query("delete from `regions` where `id`='$regid'"); + unset($_REQUEST['regid']); + unset($_REQUEST['locid']); + unset($_REQUEST['action']); + } + } + if($oldid == 42 && $_POST['email'] == "") { $id = $oldid; @@ -2025,7 +2106,7 @@ if($id == 43 && $_GET['tverify'] > 0) { - $memid = $_GET['userid'] = intval($_GET['tverify']); + $memid = $_REQUEST['userid'] = intval($_GET['tverify']); $query = "select * from `users` where `id`='$memid'"; $row = mysql_fetch_assoc(mysql_query($query)); $ver = !$row['tverify']; @@ -2034,7 +2115,7 @@ if($id == 43 && $_GET['codesign'] > 0) { - $memid = $_GET['userid'] = intval($_GET['codesign']); + $memid = $_REQUEST['userid'] = intval($_GET['codesign']); $query = "select * from `users` where `id`='$memid'"; $row = mysql_fetch_assoc(mysql_query($query)); $ver = !$row['codesign']; @@ -2043,7 +2124,7 @@ if($id == 43 && $_GET['ttpadmin'] > 0) { - $memid = $_GET['userid'] = intval($_GET['ttpadmin']); + $memid = $_REQUEST['userid'] = intval($_GET['ttpadmin']); $query = "select * from `users` where `id`='$memid'"; $row = mysql_fetch_assoc(mysql_query($query)); $ver = !$row['ttpadmin']; @@ -2052,21 +2133,28 @@ if($id == 43 && $_GET['locadmin'] > 0) { - $memid = $_GET['userid'] = intval($_GET['locadmin']); + $memid = $_REQUEST['userid'] = intval($_GET['locadmin']); $query = "select * from `users` where `id`='$memid'"; $row = mysql_fetch_assoc(mysql_query($query)); $ver = !$row['locadmin']; mysql_query("update `users` set `locadmin`='$ver' where `id`='$memid'"); } + if($id == 43 && $_GET['admin'] > 0) + { + $memid = $_REQUEST['userid'] = intval($_GET['admin']); + $query = "select * from `users` where `id`='$memid'"; + $row = mysql_fetch_assoc(mysql_query($query)); + $ver = !$row['admin']; + mysql_query("update `users` set `admin`='$ver' where `id`='$memid'"); + } + if($id == 50) { - if($_GET['userid'] != "") - $_POST['userid'] = intval($_GET['userid']); - else - $_POST['userid'] = intval($_POST['userid']); + if($_REQUEST['userid'] != "") + $_REQUEST['userid'] = intval($_REQUEST['userid']); - $row = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_POST['userid']."'")); + $row = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_REQUEST['userid']."'")); if($row['email'] == "") $id = 42; else diff --git a/includes/account_stuff.php b/includes/account_stuff.php index 50e00ea..56fcf43 100644 --- a/includes/account_stuff.php +++ b/includes/account_stuff.php @@ -17,16 +17,6 @@ { global $id, $PHP_SELF; - $locrest = ""; - if($_SESSION['profile']['ccid'] > 0) - $locrest .= "&ccid=".$_SESSION['profile']['ccid']; - - if($_SESSION['profile']['regid'] > 0) - $locrest .= "®id=".$_SESSION['profile']['regid']; - - if($_SESSION['profile']['locid'] > 0) - $locrest .= "&locid=".$_SESSION['profile']['locid']; - $tmpid = $id; if($PHP_SELF == "/wot.php") $tmpid = $id + 500; @@ -55,7 +45,8 @@ case 36: case 41: case 507: - case 508: $expand = " explode('mydetails');"; break; + case 508: + case 513: $expand = " explode('mydetails');"; break; case 16: case 17: case 18: @@ -85,6 +76,7 @@ case 48: case 49: case 50: + case 54: case 53: $expand = " explode('sysadmin');"; break; case 500: case 501: @@ -95,7 +87,8 @@ case 506: case 509: case 510: - case 511: $expand = " explode('WoT');"; break; + case 511: + case 512: $expand = " explode('WoT');"; break; case 1000: case 1001: case 1002: @@ -160,7 +153,7 @@ function hideall() { = 50) { ?> \n
\n"; - } elseif(intval($_GET['locid']) <= 0) { + } elseif(intval($_REQUEST['locid']) <= 0) { echo "\n\n\n\n\n
\n"; - $rc = mysql_num_rows(mysql_query("select * from `locations` where `regid`='".$_GET['regid']."'")); + $rc = mysql_num_rows(mysql_query("select * from `locations` where `regid`='".$_REQUEST['regid']."'")); if($start > 0) { $prev = $start - $limit; if($prev < 0) $prev = 0; - $st = "[ << Start ] "; - $prev = "[ < Previous $limit ] "; + $st = "[ << Start ] "; + $prev = "[ < Previous $limit ] "; } if($start < $rc - $limit) { $next = $start + $limit; $last = $rc - $limit; - $next = "[ Next $limit > ] "; - $end = "[ End >> ]"; + $next = "[ Next $limit > ] "; + $end = "[ End >> ]"; } echo "
$st
$end
\n"; echo "
$prev
$next
\n"; + } ?> -
-
- - - - - - - - - - - -
:
">
- - -
-
- diff --git a/pages/account/54.php b/pages/account/54.php new file mode 100644 index 0000000..7fe1351 --- /dev/null +++ b/pages/account/54.php @@ -0,0 +1,158 @@ + + + This file is part of CAcert. + + CAcert has been released under the CAcert Source License + which can be found included with these source files or can + be downloaded from the internet from the following address: + http://www.cacert.org/src-lic.php + + CAcert is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the License for more details. +*/ ?> + 0 && $_REQUEST['action'] == "add") { ?> +
+ + + + + + + + + + + +
:
">
+ + + +
+ 0 && $_REQUEST['action'] == "edit") { + $query = "select * from `regions` where `id`='$_REQUEST[regid]' order by `name`"; + $row = mysql_fetch_assoc(mysql_query($query)); + $_REQUEST['name'] = $row['name']; +?> +
+ + + + + + + + + + + +
:
">
+ + + +
+ 0 && $_REQUEST['action'] == "add") { ?> +
+ + + + + + + + + + + + + + + + + + + +
:
:
:
">
+ + + +
+ 0 && $_REQUEST['action'] == "edit") { + $locid = intval($_REQUEST['locid']); + $query = "select * from `locations` where `id`='$locid'"; + $row = mysql_fetch_assoc(mysql_query($query)); + + if($_REQUEST['name'] == "") + $_REQUEST['name'] = $row['name']; + if($_REQUEST['longitude'] == "") + $_REQUEST['longitude'] = $row['long']; + if($_REQUEST['latitude'] == "") + $_REQUEST['latitude'] = $row['lat']; +?> +
+ + + + + + + + + + + + + + + + + + + +
:
:
:
">
+ + + +
+ 0 && $_REQUEST['action'] == "move") { + $locid = intval($_REQUEST['locid']); + $query = "select * from `locations` where `id`='$locid'"; + $row = mysql_fetch_assoc(mysql_query($query)); + $_REQUEST['newreg'] = $row['regid']; +?> +
+ + + + + + + + + + + + + + + +
:
:
">
+ + + +
+ + diff --git a/pages/gpg/3.php b/pages/gpg/3.php index f75272d..f269d4b 100644 --- a/pages/gpg/3.php +++ b/pages/gpg/3.php @@ -18,7 +18,6 @@ $res = mysql_query($query); if(mysql_num_rows($res) <= 0) { - showheader(_("My CAcert.org Account!")); echo _("No such PGP/GPG certificates attached to your account."); showfooter(); exit; diff --git a/pages/index/0.php b/pages/index/0.php index de975da..71af869 100644 --- a/pages/index/0.php +++ b/pages/index/0.php @@ -24,10 +24,9 @@

  • - -

    - +

    - [ ]

    2) echo "

    [ "._("More News Items")." ]

    "; +*/ + $open = $items = 0; + $fp = fopen("http://blog.CAcert.org/feed/rss/", "r"); + while(!feof($fp)) + $rss .= trim(fgets($fp, 4096)); + fclose($fp); + $rss = str_replace("><", ">\n<", $rss); + $lines = explode("\n", $rss); + foreach($lines as $line) + { + $line = trim($line); + + if($line != "" && $open == 0) + continue; + + if($line == "" && $open == 0) + { + $open = 1; + continue; + } + + if($line == "" && $open == 1) + { + $items++; + if($items >= 2) + break; + $open == 0; + continue; + } + if(substr($line, 0, 7) == "") + echo "<h3>".trim(substr($line, 7, -8))."</h3>\n"; + if(substr($line, 0, 13) == "<description>") + echo "<p>".trim(substr($line, 13, -14))."</p>\n"; + if(substr($line, 0, 6) == "<link>") + echo "<p>[ <a href='".trim(substr($line, 6, -7))."'>"._("Full Story")."</a> ]</p>\n"; + } ?> -<br> diff --git a/pages/wot/1.php b/pages/wot/1-old.php similarity index 100% rename from pages/wot/1.php rename to pages/wot/1-old.php diff --git a/pages/wot/12.php b/pages/wot/12.php new file mode 100644 index 0000000..631311d --- /dev/null +++ b/pages/wot/12.php @@ -0,0 +1,109 @@ +<? if($_REQUEST['location'] == "") { ?> +<script language="javascript" src="/ac.js"></script> +<script language="javascript"> +<!-- +function oncomplete() { + document.f.submit(); +} +// --> +</script> +<p>Please enter your town or suburb name, followed by region or state or province and then the country (please separate by commas)<br /> +eg Sydney, New South Wales, Australia</p> +<p>This is an AJAX form which depends heavily on javascript for auto-complete functionality and while it will work without javascript the usability will be heavily degraded.</p> +<form name="f" action="wot.php" method="post"> +<input type='hidden' name='oldid' value='12' /> +<table> + <tr> + <td align=right valign=middle>Maximum Distance:</td> + <td><select name="maxdist"> +<? + $arr = array(10, 25, 50, 100, 250, 500, 1000); + foreach($arr as $val) + { + echo "<option value='$val'"; + if($val == $_REQUEST['maxdist']) + echo " selected"; + echo ">${val}km</option>\n"; + } +?> + </td> + </tr> + <tr> + <td align=right valign=middle>Location:</td> + <td><input autocomplete="off" type="text" id="location" name="location" value="" size="50" /> (hit enter to submit)</td> + </tr> +</table> + +</form> +<script language="javascript"> +<!-- +var ac1 = new AC('location', 'location', oncomplete); +ac1.enable_unicode(); +document.f.location.focus(); +// --> +</script> +<? } else { + if(intval($_REQUEST['location']) == 0) + { + $bits = explode(",", $_REQUEST['location']); + + $loc = trim(mysql_escape_string($bits['0'])); + $reg = trim(mysql_escape_string($bits['1'])); + $ccname = trim(mysql_escape_string($bits['2'])); + + $query = "select `locations`.`id` as `locid` from `locations`, `regions`, `countries` where + `locations`.`name` like '$loc%' and `regions`.`name` like '$reg%' and `countries`.`name` like '$ccname%' and + `locations`.`regid`=`regions`.`id` and `locations`.`ccid`=`countries`.`id` + order by `locations`.`name` limit 1"; + $res = mysql_query($query); + if($reg != "" && $ccname == "" && mysql_num_rows($res) <= 0) + { + $query = "select `locations`.`id` as `locid` from `locations`, `regions`, `countries` where + `locations`.`name` like '$loc%' and `countries`.`name` like '$reg%' and + `locations`.`regid`=`regions`.`id` and `locations`.`ccid`=`countries`.`id` + order by `locations`.`name` limit 1"; + $res = mysql_query($query); + } + if(mysql_num_rows($res) <= 0) + die("Unable to find suitable location"); + $row = mysql_fetch_assoc($res); + $_REQUEST['location'] = $row['locid']; + } + + $maxdist = intval($_REQUEST['maxdist']); + + $locid = intval($_REQUEST['location']); + $query = "select * from `locations` where `id`='$locid'"; + $loc = mysql_fetch_assoc(mysql_query($query)); + $query = "SELECT (6378.137 * ACOS((SIN(PI() * $loc[lat] / 180) * SIN(PI() * `locations`.`lat` / 180)) + (COS(PI() * $loc[lat] / 180 ) * + COS(PI() * `locations`.`lat` / 180) * COS(PI() * `locations`.`long` / 180 - PI() * $loc[long] / 180)))) AS `distance`, + `locations`.`name` AS `location`, concat(`users`.`fname`, ' ', LEFT(`users`.`lname`, 1)) AS `name`, `long`, `lat`, + `users`.`id` as `uid`, `contactinfo` FROM `locations`, `users`, `notary` WHERE `users`.`locid` = `locations`.`id` AND + `users`.`id` = `notary`.`to` AND `users`.`listme` = 1 GROUP BY `notary`.`to` + HAVING SUM(`notary`.`points`) >= 100 AND `distance` <= '$maxdist' ORDER BY `distance` LIMIT 50"; + $res = mysql_query($query); +?><table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="700"> + <tr> + <td class="title"><?=_("Name")?></td> + <td class="title"><?=_("Distance")?></td> + <td class="title"><?=_("Max Points")?></td> + <td class="title"><?=_("Contact Details")?></td> + <td class="title"><?=_("Email Assurer")?></td> + </tr> +<? while($row = mysql_fetch_assoc($res)) + { + $row[distance] = round($row[distance], -1); + $points = maxpoints($row['uid']); + if($points > 35) + $points = 35; +?> + <tr> + <td class="DataTD" width="100"><nobr><?=$row['name']?></nobr></td> + <td class="DataTD"><?=$row['distance']?>km</td> + <td class="DataTD"><?=$points?></td> + <td class="DataTD"><?=$row['contactinfo']?></td> + <td class="DataTD"><a href="wot.php?id=9&userid=<?=$row['uid']?>"><?=_("Email Me")?></a></td> + </tr> +<? } ?> +</table> +<? } ?> diff --git a/pages/wot/13.php b/pages/wot/13.php new file mode 100644 index 0000000..1128254 --- /dev/null +++ b/pages/wot/13.php @@ -0,0 +1,72 @@ +<? if($_REQUEST['location'] != "") { + if(intval($_REQUEST['location']) == 0) + { + $bits = explode(",", $_REQUEST['location']); + + $loc = trim(mysql_escape_string($bits['0'])); + $reg = trim(mysql_escape_string($bits['1'])); + $ccname = trim(mysql_escape_string($bits['2'])); + $query = "select `locations`.`id` as `locid` from `locations`, `regions`, `countries` where + `locations`.`name` like '$loc%' and `regions`.`name` like '$reg%' and `countries`.`name` like '$ccname%' and + `locations`.`regid`=`regions`.`id` and `locations`.`ccid`=`countries`.`id` + order by `locations`.`name` limit 1"; + $res = mysql_query($query); + if($reg != "" && $ccname == "" && mysql_num_rows($res) <= 0) + { + $query = "select `locations`.`id` as `locid` from `locations`, `regions`, `countries` where + `locations`.`name` like '$loc%' and `countries`.`name` like '$reg%' and + `locations`.`regid`=`regions`.`id` and `locations`.`ccid`=`countries`.`id` + order by `locations`.`name` limit 1"; + $res = mysql_query($query); + } + if(mysql_num_rows($res) <= 0) + die("Unable to find suitable location"); + + $row = mysql_fetch_assoc($res); + $_REQUEST['location'] = $row['locid']; + } + + $locid = intval($_REQUEST['location']); + $query = "select * from `locations` where `id`='$locid'"; + $res = mysql_query($query); + if(mysql_num_rows($res) > 0) + { + $loc = mysql_fetch_assoc($res); + $_SESSION['profile']['ccid'] = $loc['ccid']; + $_SESSION['profile']['regid'] = $loc['regid']; + $_SESSION['profile']['locid'] = $loc['id']; + $query = "update `users` set `locid`='$loc[id]', `regid`='$loc[regid]', `ccid`='$loc[ccid]' where `id`='".$_SESSION['profile']['id']."'"; + mysql_query($query); + echo "<p>"._("Your location has been updated")."</p>\n"; + } else { + echo "<p>"._("I was unable to match your location with places in my database.")."</p>\n"; + } +} ?> +<script language="javascript" src="/ac.js"></script> +<script language="javascript"> +<!-- +function oncomplete() { + document.f.submit(); +} +// --> +</script> +<p>Please enter your town or suburb name, followed by region or state or province and then the country (please separate by commas)<br /> +eg Sydney, New South Wales, Australia</p> +<p>This is an AJAX form which depends heavily on javascript for auto-complete functionality and while it will work without javascript the usability will be heavily degraded.</p> +<form name="f" action="wot.php" method="post"> +<input type='hidden' name='id' value='13' /> +<table> + <tr> + <td align=right valign=middle>Location:</td> + <td><input autocomplete="off" type="text" id="location" name="location" value="" size="50" /> (hit enter to submit)</td> + </tr> +</table> + +</form> +<script language="javascript"> +<!-- +var ac1 = new AC('location', 'location', oncomplete); +ac1.enable_unicode(); +document.f.location.focus(); +// --> +</script> diff --git a/pages/wot/6.php b/pages/wot/6.php index 8336b1d..ad306e1 100644 --- a/pages/wot/6.php +++ b/pages/wot/6.php @@ -135,5 +135,6 @@ <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("I am sure of myself")?>"></td> </tr> </table> +<input type="hidden" name="pagehash" value="<?=$_SESSION['_config']['wothash']?>"> <input type="hidden" name="oldid" value="<?=$id?>"> </form> diff --git a/pages/wot/7.php b/pages/wot/7-old.php similarity index 100% rename from pages/wot/7.php rename to pages/wot/7-old.php diff --git a/tverify/index.php b/tverify/index.php index d1e1c77..7a2dfaa 100644 --- a/tverify/index.php +++ b/tverify/index.php @@ -61,6 +61,7 @@ else $max = 50; + if($URL != "") if(substr($URL, 0, strlen("https://www.thawte.com/cgi/personal/wot/directory.exe?node=")) != "https://www.thawte.com/cgi/personal/wot/directory.exe?node=") { diff --git a/www/ac.js b/www/ac.js new file mode 100644 index 0000000..60f3bea --- /dev/null +++ b/www/ac.js @@ -0,0 +1,547 @@ +/* vim:ts=4:sts=4:sw=2:noai:noexpandtab + * + * Auto-complete client side javascript. + * Copyright (c) 2005 Steven McCoy <fnjordy@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* format of constructor is overloaded: + * AC(<type>, <id>, <submit callback>) + * AC(<type>, <id>) + * AC(<id>) + */ +function AC(id) { +/* find search type */ + if (arguments.length > 1) { + this.type = arguments[0]; + id = arguments[1]; + } else { + this.type = id; + } + +/* input element we are autocompleting on */ + this.obj = document.getElementById(id); + this.obj.value = ''; + +/* base url to send request too */ + this.url = '/ac.php'; + +/* function to call when option selected */ + this.submit_callback = (arguments.length > 2) ? arguments[2] : null; + +/* popup layer we will display results in */ + this.div = document.createElement('DIV'); + this.div.className = 'ac_menu'; + this.div.style.visibility = 'hidden'; + this.div.style.position = 'absolute'; + this.div.style.zIndex = 1; + this.div.style.width = this.obj.offsetWidth - 2 + "px"; + + this.div.style.left = this.total_offset(this.obj,'offsetLeft') + "px"; + this.div.style.top = this.total_offset(this.obj,'offsetTop') + this.obj.offsetHeight - 1 + "px"; + +/* tie to input element */ + this.obj.parentNode.insertBefore(this.div, this.obj.nextSibling); + +/* iframe for non-XmlHttpRequest() browsers */ + this.iframe = null; + +/* install event handlers */ + this.obj.onkeydown = this.onkeydown; + this.obj.onkeyup = this.onkeyup; + this.obj.onkeypress = this.onkeypress; + this.obj.onblur = function() { this.AC.close_popup(); } + + this.obj.AC = this; /* self reference */ + this.selected_option = null; /* the currently selected option */ + + this.request = null; /* http request object */ + this.cache = new Array(); /* cache of results from server */ + this.typing = false; /* whether user is still typing */ + this.typing_timeout = 10; + this.sending_timeout = 10; + + this.search_term = null; /* current search term */ + this.previous_term = null; /* previous search term */ + this.searched_term = null; /* search from keyboard */ + + this.last_input = null; /* previous typed entry */ + +/* Unicode inputs require polling of the input control for updates */ + this.poll_input = false; + +/* update extern mapping array for rpc reply */ + _ac_map_add(this); +} + +AC.prototype.enable_unicode = function() { + this.poll_input = true; + _ac_key_check(this,this.typing_timeout); +} + +AC.prototype.total_offset = function(element, property) { + var total = 0; + while (element) { + total += element[property]; + element = element.offsetParent; + } + return total; +} + +/* hide popup and cleanup */ +AC.prototype.close_popup = function() { + this.div.style.visibility = 'hidden'; + +/* no selected item, no typing, and close any pending request */ + this.selected_option = null; + this.typing = false; + this.search_term = null; + this.previous_term = null; +} + +/* create object for rpc call */ +AC.prototype.XMLHttpRequest = function() { + var request = null; + if (typeof XMLHttpRequest != 'undefined') { + request = new XMLHttpRequest(); + } else { + try { + request = new ActiveXObject('Msxml2.XMLHTTP') + } catch(e) { + try { + request = new ActiveXObject('Microsoft.XMLHTTP') + } catch(e) { + request = null + } + } + } + return request; +} + +/* helper functions to process typing timer */ +var _ac_key_thunk = new Array(); +function _ac_key_thunk_call(id) { + if (_ac_key_thunk[id]) { + var ac = _ac_key_thunk[id][1]; + +/* now check as if onkeyup() was called */ +/* first find unselected text */ + var unselected = ac.obj.value; + if (document.selection) { + var range = document.selection.createRange(); + if (range) { +/* to limit the execution this would be nice, but parentElement() not supported in Opera */ +// if (range && range.parentElement && range.parentElement() == ac.obj) { + var length = unselected.length - range.text.length; + if (length > 0) { + unselected = unselected.substring(0, length); + } + } + } else if (ac.obj.setSelectionRange) { + var length = ac.obj.selectionEnd - ac.obj.selectionStart; + if (length > 0) + unselected = unselected.substring(0,ac.obj.selectionStart); + } + + if (unselected != ac.last_input) { + if (unselected.length > 0) { + ac.searched_term = unselected; + ac.suggest(ac.searched_term); + } else { + _ac_cancel(ac); + ac.close_popup(); + } + ac.last_input = unselected; + } + +/* re-install timer for polling */ + if (ac.poll_input) { + _ac_key_thunk[id][2] = setTimeout("_ac_key_thunk_call("+id+")",ac.typing_timeout); + } else { +/* remove from list and cleanup list */ + _ac_key_thunk[id] = null; + for (i = _ac_key_thunk.length; i > 0; i--) + if (_ac_key_thunk[i] == null) + _ac_key_thunk.length--; + } + } +} + +function _ac_key_check(ac,timeout) { +/* first remove any pending key check */ + for (i = _ac_key_thunk.length-1; i >= 0; i--) + if (_ac_key_thunk[i] != null && _ac_key_thunk[i][0] == ac.obj.id) { + clearTimeout(_ac_key_thunk[i][2]); + _ac_key_thunk[i] = null; + } + +/* now setup a new one */ + var i = _ac_key_thunk.length; + var handle = setTimeout("_ac_key_thunk_call("+i+")",timeout); + _ac_key_thunk[i] = new Array(ac.obj.id,ac,handle); +} + +/* helper functions to process sending timer */ +var _ac_thunk = new Array(); +function _ac_thunk_call(id) { + if (_ac_thunk[id]) { + var ac = _ac_thunk[id][1]; + ac.typing = false; + ac.send(_ac_thunk[id][2]); + _ac_thunk[id] = null; + for (i = _ac_thunk.length; i > 0; i--) + if (_ac_thunk[i] == null) + _ac_thunk.length--; + } +} + +/* cancel a pending request */ +function _ac_cancel(ac) { + for (i = _ac_thunk.length-1; i >= 0; i--) + if (_ac_thunk[i] != null && _ac_thunk[i][0] == ac.obj.id) { + clearTimeout(_ac_thunk[i][3]); + _ac_thunk[i] = null; + } +} + +function _ac_add(ac,query,timeout) { + var i = _ac_thunk.length; + var handle = setTimeout("_ac_thunk_call("+i+")",timeout); + _ac_thunk[i] = new Array(ac.obj.id,ac,query,handle); +} + +/* helper functions for webserver rpc processing */ +var _ac_map = new Array(); +function _ac_map_add(ac) { + _ac_map[ac.obj.id] = ac; +} + +/* called to initiation suggestion process */ +AC.prototype.suggest = function(query) { +/* remove redundant searches */ + if (query == this.search_term) + return; + +/* cancel any existing http call */ + _ac_cancel(this); + if (this.request && this.request.readyState != 0) { + this.request.abort(); + } + +/* check cache */ + var lc = query.toLowerCase(); + for (i = 0; i < this.cache.length; i++) + if (this.cache[i][0] == lc) { + var results = this.cache[i][1]; + this.search_term = query; + this.update_popup(results); + return; + } + +/* send call to server */ + this.typing = true; + this.send(query); +} + +/* called to send message to a server */ +AC.prototype.send = function(query) { +/* check throttle timer */ + if (this.typing) { + _ac_add(this,query,this.sending_timeout); + return; + } + +/* initiate new call */ + this.search_term = query; + if (this.iframe == null) { + this.request = this.XMLHttpRequest(); + if (this.request == null) { + var iframe = document.createElement('IFRAME'); + iframe.src = this.url+'?i=1&id='+encodeURI(this.obj.id)+'&t='+encodeURI(this.type)+'&s='+encodeURI(query); +/* opera 7.54 doesn't like iframe styles */ + iframe.style.width = '0px'; + iframe.style.height = '0px'; + this.iframe = this.obj.appendChild(iframe); + this.obj.focus(); + } else { +/* send XmlHttpRequest */ + var AC = this; + this.request.onreadystatechange = function() { + if (AC.request.readyState == 4) { + try { + if (AC.request.status != 200 || AC.request.responseText.charAt(0) == '<') { + /* some error */ + } else { + eval(AC.request.responseText); + } + } catch (e) {} + } + } + this.request.open("GET", this.url+"?id="+encodeURI(this.obj.id)+"&t="+encodeURI(this.type)+"&s="+encodeURI(query)); + this.request.send(null); + } + } else { +/* re-submit iframe */ + this.iframe.src = this.url+'?i=1&id='+encodeURI(this.obj.id)+'&t='+encodeURI(this.type)+'&s='+encodeURI(query); + this.obj.focus(); + } +} + +/* called with array of search results */ +AC.prototype.update_popup = function(results) { + if (this.search_term != null && results != null && results.length > 0) { +/* remove currently listed options */ + while (this.div.hasChildNodes()) + this.div.removeChild(this.div.firstChild); + +/* default to first result when adding characters */ + if (this.previous_term == null || this.search_term.length >= this.previous_term.length) { + this.selected_option = 0; + } else { +/* remove selection when deleteing */ + this.selected_option = null; + } + this.previous_term = this.search_term; + + for (i = 0; i < results.length; i++) { + var div = document.createElement('DIV'); + div.divid = results[i][2]; + div.AC = this; + if (this.selected_option == div.divid) + div.className = 'ac_highlight'; + else + div.className = 'ac_normal'; + div.name = results[i][0]; + div.value = results[i][1]; + div.innerHTML = results[i][3]; + div.onmousedown = function() { this.AC.onselected(); } + div.onmouseover = function() { +if (this.AC.selected_option != null) + this.AC.div.childNodes[this.AC.selected_option].className = 'ac_normal'; +this.AC.selected_option = this.divid; +this.AC.cabbage = this.AC.selected_option; +this.className = 'ac_highlight'; +} + div.onmouseout = function() { this.className = 'ac_normal'; } + this.div.appendChild(div); + } + this.div.style.visibility = 'visible'; + +/* complete text box with selected text */ + + if (this.selected_option == 0 && + (this.obj.createTextRange || this.obj.setSelectionRange) && + this.obj.value != results[0][1] && + results[0][1].substring(0,this.search_term.length).toLowerCase() == this.search_term.toLowerCase()) + { + this.obj.value = results[0][1]; + if (this.obj.createTextRange) { + var range = this.obj.createTextRange(); + range.moveStart('character',this.search_term.length); + range.select(); + } else { +// var range = document.createRange(); +// range.setStart(this.obj,this.search_term.length); + this.obj.setSelectionRange(this.search_term.length,this.obj.value.length); + } + } + } else { + this.close_popup(); + } + +/* update cache */ + var found = false; + var lc = this.search_term.toLowerCase(); + for (i = 0; i < this.cache.length; i++) + if (this.cache[i][0] == lc) { + found = true; + break; + } + + if (!found) { + this.cache[this.cache.length] = new Array(lc, results); + } +} + +/* update auto-compete input element with selected option */ +AC.prototype.update_input = function() { + this.obj.value = this.div.childNodes[this.selected_option].name; +} + +/* when option is clicked with mouse, or entered with keyboard */ +AC.prototype.onselected = function() { + if (this.selected_option == null) + if (this.cabbage == null) + return; + else + this.selected_option = this.cabbage; /* opera funky */ + + this.update_input(); + +/* hide popup */ + this.close_popup(); +/* submit form */ + if (this.submit_callback) + this.submit_callback(); +} + +/* capture up & down actions to prevent moving cursor left or right */ +/* input.onkeypress() */ +AC.prototype.onkeypress = function(e) { + if (!e) e = window.event; + var c = e.keyCode; + if (c == 0) c = e.charCode; + if(e.charCode) {_ac_key_check(this.AC,this.AC.typing_timeout); return;} + switch (c) { + case 38: /* up */ + case 40: /* down */ + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); + break; + + default: break; + } +} + +/* move cursor on down to allow repeating */ +/* input.onkeydown() */ +AC.prototype.onkeydown = function(e) { + if (!e) e = window.event; + var c = e.keyCode; + if (c == 0) c = e.charCode; + var i = this.AC.selected_option == null ? -1 : this.AC.selected_option; + if(e.charCode) {_ac_key_check(this.AC,this.AC.typing_timeout); return;} + switch (c) { + case 38: /* up */ + i--; + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); + break; + + case 40: /* down */ + i++; + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); + break; + + default: + _ac_key_check(this.AC,this.AC.typing_timeout); + break; + } + + if (c == 38 || c == 40) { + var length = this.AC.div.childNodes.length; + if (i < 0) i = 0; + if (i >= length) i = length-1; + if (i != this.AC.selected_option) { + for (j = 0; j < length; j++) { + if (j == i) { + this.AC.obj.value = this.AC.div.childNodes[j].value; + this.AC.selected_option = this.AC.div.childNodes[j].divid; + this.AC.div.childNodes[j].className = 'ac_highlight'; + } else { + this.AC.div.childNodes[j].className = 'ac_normal'; + } + } + +/* update search term */ + this.AC.search_term = this.AC.div.childNodes[this.AC.selected_option].value; + +/* popup if hidden */ + if (this.AC.div.style.visibility == 'hidden') { + this.AC.suggest (this.AC.searched_term); + } + } + } +} + +/* input.onkeyup() */ +AC.prototype.onkeyup = function(e) { + if (!e) e = window.event; + var c = e.keyCode; + if (c == 0) c = e.charCode; + switch (c) { +/* prevent strange selections at top of option list */ + case 38: /* up */ + case 40: /* down */ + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); + break; + +/* select highlighted option */ + case 13: /* enter */ + this.AC.onselected(); + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); + break; + +/* hide popup window */ + case 27: /* escape */ + this.AC.close_popup(); + e.returnValue = false; + if (e.preventDefault) e.preventDefault(); + break; + +/* get new suggestion for new data */ + default: + +/* for latin this is ok: + if (this.value.length > 0) { + this.AC.searched_term = this.value; + this.AC.suggest(this.value); + } else { + _ac_cancel(this.AC); + this.AC.close_popup(); + } +*/ + break; + } +} + +/* iframe or XmlHttpRequest() callback */ +function _ac_rpc() { + var id = arguments[0]; + if (_ac_map[id]) { +/* we cannot shift() arguments as it is an object :( */ + _ac_map[id].process_reply.apply(_ac_map[id],arguments); + } +} + +/* parse rpc results into html for the popup */ +AC.prototype.process_reply = function() { + var results = new Array(); + var c = 0; + var re = new RegExp('('+this.searched_term+')', "gi"); + var nt = '<font color="red"><b>$1</b></font>'; + for (i = 1; i < arguments.length; i += 2) { + var name = this.highlight ? arguments[i+1].replace(re, nt) : arguments[i+1]; + var value = this.highlight ? arguments[i].replace(re, nt) : arguments[i]; + var html = "<span class='d'>"+name+"</span><span class='a'>"+value+"</span>"; + results[c] = new Array(arguments[i+1], arguments[i], c, html); + c++; + } + + this.update_popup(results); +} + +function escapeURI(La){ + if(encodeURIComponent) { + return encodeURIComponent(La); + } + if(escape) { + return escape(La) + } +} diff --git a/www/ac.php b/www/ac.php new file mode 100644 index 0000000..dc5bc81 --- /dev/null +++ b/www/ac.php @@ -0,0 +1,37 @@ +<? + header('Content-Type: text/html; charset=UTF-8'); + + if($_REQUEST['i'] != "") + echo "<html><body><script language=\"JavaScript\"><!--\n"; + + $s = mysql_escape_string($_REQUEST['s']); + + $id = $_REQUEST['id']; + + echo "parent._ac_rpc('$id',"; + + $bits = explode(",", $s); + + $loc = trim(mysql_escape_string($bits['0'])); + $reg = trim(mysql_escape_string($bits['1'])); + $ccname = trim(mysql_escape_string($bits['2'])); + $query = "select `locations`.`id` as `locid`, `locations`.`name` as `locname`, `regions`.`name` as `regname`, + `countries`.`name` as `ccname` from `locations`, `regions`, `countries` where + `locations`.`name` like '$loc%' and `regions`.`name` like '$reg%' and `countries`.`name` like '$ccname%' and + `locations`.`regid`=`regions`.`id` and `locations`.`ccid`=`countries`.`id` + order by `locations`.`name` limit 10"; + $res = mysql_query($query); + while($row = mysql_fetch_assoc($res)) + { + $rc++; + if($rc > 1) + echo ","; + echo '"'.$row['locname'].', '.$row['regname'].', '.$row['ccname'].'", "'.$row['locid'].'"'; + } + echo ");"; + + if($_REQUEST['i'] != "") + echo "\n\n// -->\n</script></body></html>"; + + exit; +?> diff --git a/www/account.php b/www/account.php index 8eb3b86..2251462 100644 --- a/www/account.php +++ b/www/account.php @@ -18,8 +18,10 @@ if($id == 6) { include_once("../www/account/6.php"); + exit; } else if($id == 19) { include_once("../www/account/19.php"); + exit; } else if($oldid == 40 && $process != "" && $_POST['support'] != "yes") { $who = stripslashes($who); $email = stripslashes($email); @@ -51,9 +53,11 @@ $query = "select * from `tverify` where `id`='".$_GET['photoid']."'"; $row = mysql_fetch_assoc(mysql_query($query)); readfile($row['photoid']); + exit; } else { showheader(_("My CAcert.org Account!")); includeit($id, "account"); showfooter(); + exit; } ?> diff --git a/www/cap.php b/www/cap.php index e3e3d60..8c02ea6 100644 --- a/www/cap.php +++ b/www/cap.php @@ -245,6 +245,7 @@ $pdf->AddPage(); $pdf->Body($_GET['name'], $_GET['dob'], $_GET['email'], $_GET['assurer'], $_GET['date'], $maxpoints, $_GET['document1'], $_GET['document2'], $_GET['location']); header("Expires: ".gmdate("D, j M Y G:i:s \G\M\T", time()+10800)); + header("Content-Disposition: attachment; filename=cap.pdf"); header("Cache-Control: public, max-age=10800"); header("Pragma: cache"); $pdf->output(); diff --git a/www/rss.php b/www/rss.php index 9f138d7..9042bd2 100644 --- a/www/rss.php +++ b/www/rss.php @@ -1,3 +1,4 @@ +<? header("location: http://my.rsscache.com/blog.CAcert.org/feed/"); exit; ?> <? /* <author>$row['who'] <nomail@nospam.sss></author> */ ?> <? header("Content-Type: application/xml"); ?><<?="?"?>xml version="1.0" encoding="UTF-8" <?="?"?>> diff --git a/www/stats.php b/www/stats.php index e5e8340..3e7b3dd 100644 --- a/www/stats.php +++ b/www/stats.php @@ -43,7 +43,7 @@ $certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `expire`<=NOW()")); $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `revoked`=0 and `expire`>NOW()")); $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `revoked`=0 and `expire`>NOW()")); - $totalassurers = tc(mysql_query("select count(`id`) as `count` from notary group by `to` having sum(`points`) >= 100")); + $totalassurers = mysql_num_rows(mysql_query("select `to` from notary group by `to` having sum(`points`) >= 100")); ?> <tr> <td class="DataTD"><?=_("Valid Certificates")?>:</td> @@ -55,12 +55,11 @@ </tr> <tr> <td class="DataTD"><?=_("Users with 1-49 Points")?>:</td> - <td class="DataTD"><?=number_format(tc(mysql_query( -"select count(`id`) as `count` from `notary` group by `to` having sum(`points`) > 0 and sum(`points`) < 50")))?></td> + <td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) > 0 and sum(`points`) < 50")))?></td> </tr> <tr> <td class="DataTD"><?=_("Users with 50-99 Points")?>:</td> - <td class="DataTD"><?=number_format(tc(mysql_query("select count(`id`) as `count` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")))?></td> + <td class="DataTD"><?=number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")))?></td> </tr> <tr> <td class="DataTD"><?=_("Assurers")?>:</td> @@ -85,7 +84,7 @@ <? for($i = 0; $i < 12; $i++) { $date = date("Y-m", mktime(0,0,0,date("m") - $i,1,date("Y"))); $totalusers += $users = tc(mysql_query("select count(`id`) as `count` from `users` where `created` like '$date%' and `verified`=1")); - $totassurers += $assurers = tc(mysql_query("select count(`id`) as `count` from `notary` where `when` like '$date%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100")); + $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$date%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100")); $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `created` like '$date%'")); $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `created` like '$date%'")); $certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `issued` like '$date%'")); @@ -122,7 +121,7 @@ $totalcerts = $totalusers = $totassurers = 0; for($i = date("Y"); $i >= 2002; $i--) { $totalusers += $users = tc(mysql_query("select count(`id`) as `count` from `users` where `created` like '$i%' and `verified`=1")); - $totassurers += $assurers = tc(mysql_query("select count(`id`) as `count` from `notary` where `when` like '$i%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100")); + $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$i%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100")); $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `created` like '$i%'")); $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `created` like '$i%'")); $certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `issued` like '$i%'")); diff --git a/www/styles/default.css b/www/styles/default.css index 762d0d5..0f22dca 100644 --- a/www/styles/default.css +++ b/www/styles/default.css @@ -560,3 +560,39 @@ td.greytxt { font-weight: BOLD; color: #FF0000; } + +.ac_menu +{ + border:1px solid black +} +.ac_normal +{ + background-color:#ffffff; + cursor:pointer; +} +.ac_highlight +{ + background-color:#3366cc; + color:white; + cursor:pointer; +} +.ac_normal .a +{ + font-size:13px; + color:black; +} +.ac_highlight .a +{ + font-size:13px; +} +.ac_normal .d +{ + float:right; + font-size:10px; + color:green; +} +.ac_highlight .d +{ + float:right; + font-size:10px; +} diff --git a/www/ttp.php b/www/ttp.php index 72a06e5..4670aa8 100644 --- a/www/ttp.php +++ b/www/ttp.php @@ -189,6 +189,7 @@ $pdf->AddPage(); $pdf->Body($_GET['name'], $_GET['dob'], $_GET['email'], $_GET['date']); header("Expires: ".gmdate("D, j M Y G:i:s \G\M\T", time()+10800)); + header("Content-Disposition: attachment; filename=ttp.pdf"); header("Cache-Control: public, max-age=10800"); header("Pragma: cache"); $pdf->output(); diff --git a/www/wot.php b/www/wot.php index 2cfd2f0..d501c3d 100644 --- a/www/wot.php +++ b/www/wot.php @@ -23,6 +23,11 @@ if($_POST['location'] != "") $_SESSION['_config']['location'] = $_POST['location']; + if($oldid == 12) + { + $id = $oldid; + } + if(($id == 5 || $oldid == 5 || $id == 6 || $oldid == 6) && $_SESSION['profile']['points'] < 100) { showheader(_("My CAcert.org Account!")); @@ -170,7 +175,7 @@ $res = mysql_query($query); $row = mysql_fetch_assoc($res); $name = $row['fname']." ".$row['mname']." ".$row['lname']." ".$row['suffix']; - if($_SESSION['_config']['wothash'] != md5($name."-".$row['dob'])) + if($_SESSION['_config']['wothash'] != md5($name."-".$row['dob']) || $_SESSION['_config']['wothash'] != $_REQUEST['pagehash']) { $id = $oldid; unset($oldid);