Merge branch 'bug-602' into release
[cacert-devel.git] / www / account.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 include("../includes/account.php");
20
21 if($id == 6)
22 {
23 include_once("../pages/account/6.php");
24 exit;
25 } else if($id == 19) {
26 include_once("../pages/account/19.php");
27 exit;
28 } else if($oldid == 40 && $_REQUEST['process'] != "") {
29 $who = stripslashes($_REQUEST['who']);
30 $email = stripslashes($_REQUEST['email']);
31 $subject = stripslashes($_REQUEST['subject']);
32 $message = stripslashes($_REQUEST['message']);
33
34 //check for spam via honeypot
35 if(!isset($_REQUEST['robotest']) || !empty($_REQUEST['robotest'])){
36 echo _("Form could not be sent.");
37 showfooter();
38 exit;
39 }
40
41 $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message;
42 if (isset($process[0])){
43 sendmail("cacert-support@lists.cacert.org", "[website form email]: ".$subject, $message, "website-form@cacert.org", "cacert-support@lists.cacert.org, $email", "", "CAcert-Website");
44 showheader(_("Welcome to CAcert.org"));
45 echo _("Your message has been sent to the general support list.");
46 showfooter();
47 exit;
48 }
49 if (isset($process[1])){
50 sendmail("support@cacert.org", "[CAcert.org] ".$subject, $message, $email, "", "", "CAcert Support");
51 showheader(_("Welcome to CAcert.org"));
52 echo _("Your message has been sent.");
53 showfooter();
54 exit;
55 }
56
57 } else if($id == 51 && $_GET['img'] == "show") {
58 $query = "select * from `tverify` where `id`='".intval($_GET['photoid'])."' and `modified`=0";
59 $res = mysql_query($query);
60 if(mysql_num_rows($res))
61 {
62 $row = mysql_fetch_assoc($res);
63 readfile($row['photoid']);
64 } else {
65 die("No such file.");
66 }
67 exit;
68 } else if ($id == 37) {
69 $protocol = $_SERVER['HTTPS'] ? 'https' : 'http';
70 $newUrl = $protocol . '://wiki.cacert.org/FAQ/AboutUs';
71 header('Location: '.$newUrl, true, 301); // 301 = Permanently Moved
72 } else {
73 showheader(_("My CAcert.org Account!"));
74 includeit($id, "account");
75 showfooter();
76 exit;
77 }
78 ?>