Source code taken from cacert-20111125.tar.bz2
[cacert.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'] != "" && $_POST['support'] != "yes") {
29 $who = stripslashes($_REQUEST['who']);
30 $email = stripslashes($_REQUEST['email']);
31 $subject = stripslashes($_REQUEST['subject']);
32 $message = stripslashes($_REQUEST['message']);
33
34 $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message;
35
36 sendmail("support@cacert.org", "[CAcert.org] ".$subject, $message, $email, $email, "", "CAcert Website");
37 showheader(_("Welcome to CAcert.org"));
38 echo _("Your message has been sent.");
39 showfooter();
40 exit;
41 } else if($oldid == 40 && $_REQUEST['process'] != "" && $_POST['support'] == "yes") {
42 $who = stripslashes($_REQUEST['who']);
43 $email = stripslashes($_REQUEST['email']);
44 $subject = stripslashes($_REQUEST['subject']);
45 $message = stripslashes($_REQUEST['message']);
46
47
48 $message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message;
49
50 sendmail("cacert-support@lists.cacert.org, $email", "[website form email]: ".$subject, $message, "website-form@cacert.org", "cacert-support@lists.cacert.org, $email", "", "CAcert Website");
51
52 showheader(_("Welcome to CAcert.org"));
53 echo _("Your message has been sent to the general support list.");
54 showfooter();
55 exit;
56 } else if($id == 51 && $_GET['img'] == "show") {
57 $query = "select * from `tverify` where `id`='".intval($_GET['photoid'])."' and `modified`=0";
58 $res = mysql_query($query);
59 if(mysql_num_rows($res))
60 {
61 $row = mysql_fetch_assoc($res);
62 readfile($row['photoid']);
63 } else {
64 die("No such file.");
65 }
66 exit;
67 } else if ($id == 37) {
68 $protocol = $_SERVER['HTTPS'] ? 'https' : 'http';
69 $newUrl = $protocol . '://wiki.cacert.org/FAQ/AboutUs';
70 header('Location: '.$newUrl, true, 301); // 301 = Permanently Moved
71 } else {
72 showheader(_("My CAcert.org Account!"));
73 includeit($id, "account");
74 showfooter();
75 exit;
76 }
77 ?>