added sql schema + bug fixes

pull/1/head
root 20 years ago
parent af75907e7a
commit c6b8a11ccb

@ -199,17 +199,15 @@
$addys = array();
$defaultemail = "";
if($_SESSION['_config']['incname'] <= 0 || $_SESSION['_config']['incname'] > 5)
if($_SESSION['_config']['incname'] <= 0 || $_SESSION['_config']['incname'] > 4)
$csrsubject = "/CN=CAcert WoT User";
if($_SESSION['_config']['incname'] == 1)
$csrsubject = "/CN=".$_SESSION['profile']['fname'];
if($_SESSION['_config']['incname'] == 2)
$csrsubject = "/CN=".$_SESSION['profile']['fname']." ".$_SESSION['profile']['lname'];
if($_SESSION['_config']['incname'] == 3)
if($_SESSION['_config']['incname'] == 2)
$csrsubject = "/CN = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']."\n";
if($_SESSION['_config']['incname'] == 4)
if($_SESSION['_config']['incname'] == 3)
$csrsubject = "/CN = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix']."\n";
if($_SESSION['_config']['incname'] == 5)
if($_SESSION['_config']['incname'] == 4)
$csrsubject = "/CN = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix']."\n";
if(is_array($_SESSION['_config']['addid']))
foreach($_SESSION['_config']['addid'] as $id)
@ -871,7 +869,7 @@
$org = $_SESSION['_config']['row'];
if($_POST['keytype'] == "NS")
{
if($_POST['SPKAC'] == "" || strlen($_POST['SPKAC']) < 512)
if($_POST['SPKAC'] == "" || strlen($_POST['SPKAC']) < 128)
{
$id = 17;
showheader(_("My CAcert.org Account!"));

@ -100,8 +100,8 @@
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<? // <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ?>
<title><?=$title?></title>
<? if($_SESSION['_config']['header'] != "") { ?><?=$_SESSION['_config']['header']?><? } ?>
<link rel="stylesheet" href="styles/default.css" type="text/css">
<script language="JavaScript" type="text/javascript">
function explode(e) {

@ -0,0 +1,383 @@
# phpMyAdmin SQL Dump
# version 2.5.7-pl1
# http://www.phpmyadmin.net
#
# Host: localhost
# Generation Time: Dec 07, 2004 at 01:01 AM
# Server version: 4.0.22
# PHP Version: 4.3.9-1
#
# Database : `cacert`
#
# --------------------------------------------------------
#
# Table structure for table `alerts`
#
CREATE TABLE `alerts` (
`memid` int(11) NOT NULL default '0',
`general` tinyint(1) NOT NULL default '0',
`country` tinyint(1) NOT NULL default '0',
`regional` tinyint(1) NOT NULL default '0',
`radius` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`memid`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `countries`
#
CREATE TABLE `countries` (
`id` int(11) NOT NULL auto_increment,
`abbr` char(3) NOT NULL default '',
`long` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `domaincerts`
#
CREATE TABLE `domaincerts` (
`id` int(11) NOT NULL auto_increment,
`domid` int(11) NOT NULL default '0',
`serial` varchar(50) NOT NULL default '',
`CN` varchar(255) NOT NULL default '',
`csr_name` varchar(255) NOT NULL default '',
`crt_name` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`revoked` datetime NOT NULL default '0000-00-00 00:00:00',
`expire` datetime NOT NULL default '0000-00-00 00:00:00',
`warning` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `domains`
#
CREATE TABLE `domains` (
`id` int(11) NOT NULL auto_increment,
`memid` int(11) NOT NULL default '0',
`domain` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`deleted` datetime NOT NULL default '0000-00-00 00:00:00',
`hash` varchar(50) NOT NULL default '',
`attempts` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `domlink`
#
CREATE TABLE `domlink` (
`certid` int(11) NOT NULL default '0',
`domid` int(11) NOT NULL default '0',
UNIQUE KEY `index` (`certid`,`domid`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `email`
#
CREATE TABLE `email` (
`id` int(11) NOT NULL auto_increment,
`memid` int(11) NOT NULL default '0',
`email` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`deleted` datetime NOT NULL default '0000-00-00 00:00:00',
`hash` varchar(50) NOT NULL default '',
`attempts` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `emailcerts`
#
CREATE TABLE `emailcerts` (
`id` int(11) NOT NULL auto_increment,
`memid` int(11) NOT NULL default '0',
`serial` varchar(50) NOT NULL default '',
`CN` varchar(255) NOT NULL default '',
`subject` text NOT NULL,
`keytype` char(2) NOT NULL default 'NS',
`csr_name` varchar(255) NOT NULL default '',
`crt_name` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`revoked` datetime NOT NULL default '0000-00-00 00:00:00',
`expire` datetime NOT NULL default '0000-00-00 00:00:00',
`warning` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `emaillink`
#
CREATE TABLE `emaillink` (
`emailcertsid` int(11) NOT NULL default '0',
`emailid` int(11) NOT NULL default '0',
KEY `index` (`emailcertsid`,`emailid`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `gpg`
#
CREATE TABLE `gpg` (
`id` int(11) NOT NULL auto_increment,
`memid` int(11) NOT NULL default '0',
`email` varchar(255) NOT NULL default '',
`level` int(1) NOT NULL default '0',
`multiple` tinyint(1) NOT NULL default '0',
`expires` tinyint(1) NOT NULL default '0',
`csr` varchar(255) NOT NULL default '',
`crt` varchar(255) NOT NULL default '',
`issued` datetime NOT NULL default '0000-00-00 00:00:00',
`expire` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `locations`
#
CREATE TABLE `locations` (
`id` int(11) NOT NULL auto_increment,
`ccid` int(11) NOT NULL default '0',
`regid` int(11) NOT NULL default '0',
`abbr` char(3) NOT NULL default '',
`long` varchar(255) NOT NULL default '',
`longalt` varchar(255) NOT NULL default '',
`lat` decimal(8,5) NOT NULL default '0.00000',
`lon` decimal(8,5) NOT NULL default '0.00000',
PRIMARY KEY (`id`),
UNIQUE KEY `thekey` (`ccid`,`regid`,`abbr`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `news`
#
CREATE TABLE `news` (
`id` int(11) NOT NULL auto_increment,
`when` datetime NOT NULL default '0000-00-00 00:00:00',
`who` varchar(255) NOT NULL default '',
`short` varchar(255) NOT NULL default '',
`story` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `notary`
#
CREATE TABLE `notary` (
`from` int(11) NOT NULL default '0',
`to` int(11) NOT NULL default '0',
`points` int(3) NOT NULL default '0',
`method` enum('Face to Face Meeting','Trusted 3rd Parties','Thawte Points Transfer','Administrative Increase','CT Magazine - Germany') NOT NULL default 'Face to Face Meeting',
`location` varchar(255) NOT NULL default '',
`date` varchar(255) NOT NULL default '',
`when` datetime NOT NULL default '0000-00-00 00:00:00',
KEY `from` (`from`),
KEY `to` (`to`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `org`
#
CREATE TABLE `org` (
`orgid` int(11) NOT NULL default '0',
`memid` int(11) NOT NULL default '0',
`OU` varchar(255) NOT NULL default '',
`masteracc` int(1) NOT NULL default '0',
`comments` text NOT NULL,
UNIQUE KEY `orgid` (`orgid`,`memid`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `orgdomaincerts`
#
CREATE TABLE `orgdomaincerts` (
`id` int(11) NOT NULL auto_increment,
`orgid` int(11) NOT NULL default '0',
`subject` text NOT NULL,
`serial` varchar(50) NOT NULL default '',
`CN` varchar(255) NOT NULL default '',
`csr_name` varchar(255) NOT NULL default '',
`crt_name` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`revoked` datetime NOT NULL default '0000-00-00 00:00:00',
`expire` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `orgdomains`
#
CREATE TABLE `orgdomains` (
`id` int(11) NOT NULL auto_increment,
`orgid` int(11) NOT NULL default '0',
`domain` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `orgdomlink`
#
CREATE TABLE `orgdomlink` (
`orgcertid` int(11) NOT NULL default '0',
`orgdomid` int(11) NOT NULL default '0',
UNIQUE KEY `index` (`orgcertid`,`orgdomid`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `orgemailcerts`
#
CREATE TABLE `orgemailcerts` (
`id` int(11) NOT NULL auto_increment,
`orgid` int(11) NOT NULL default '0',
`serial` varchar(50) NOT NULL default '',
`CN` varchar(255) NOT NULL default '',
`subject` text NOT NULL,
`keytype` char(2) NOT NULL default 'NS',
`csr_name` varchar(255) NOT NULL default '',
`crt_name` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`revoked` datetime NOT NULL default '0000-00-00 00:00:00',
`expire` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `orgemaillink`
#
CREATE TABLE `orgemaillink` (
`emailcertsid` int(11) NOT NULL default '0',
`domid` int(11) NOT NULL default '0',
KEY `index` (`emailcertsid`,`domid`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `orginfo`
#
CREATE TABLE `orginfo` (
`id` int(11) NOT NULL auto_increment,
`contact` varchar(255) NOT NULL default '',
`O` varchar(255) NOT NULL default '',
`L` varchar(255) NOT NULL default '',
`ST` varchar(255) NOT NULL default '',
`C` char(2) NOT NULL default '',
`comments` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `regions`
#
CREATE TABLE `regions` (
`id` int(11) NOT NULL auto_increment,
`ccid` int(11) NOT NULL default '0',
`abbr` char(3) NOT NULL default '',
`long` varchar(255) NOT NULL default '',
`type` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `ccid` (`id`,`ccid`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# Table structure for table `users`
#
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`email` varchar(255) NOT NULL default '',
`password` varchar(255) NOT NULL default '',
`fname` varchar(255) NOT NULL default '',
`mname` varchar(255) NOT NULL default '',
`lname` varchar(255) NOT NULL default '',
`suffix` varchar(50) NOT NULL default '',
`dob` date NOT NULL default '0000-00-00',
`verified` int(1) NOT NULL default '0',
`ccid` int(11) NOT NULL default '0',
`regid` int(11) NOT NULL default '0',
`locid` int(11) NOT NULL default '0',
`listme` int(1) NOT NULL default '0',
`codesign` int(1) NOT NULL default '0',
`contactinfo` varchar(255) NOT NULL default '',
`admin` tinyint(1) NOT NULL default '0',
`language` varchar(5) NOT NULL default '',
`Q1` varchar(255) NOT NULL default '',
`Q2` varchar(255) NOT NULL default '',
`Q3` varchar(255) NOT NULL default '',
`Q4` varchar(255) NOT NULL default '',
`Q5` varchar(255) NOT NULL default '',
`A1` varchar(255) NOT NULL default '',
`A2` varchar(255) NOT NULL default '',
`A3` varchar(255) NOT NULL default '',
`A4` varchar(255) NOT NULL default '',
`A5` varchar(255) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`modified` datetime NOT NULL default '0000-00-00 00:00:00',
`deleted` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) TYPE=MyISAM;

@ -34,10 +34,11 @@
$_SESSION['_config']['language'] = $lang;
$_SESSION['_config']['translations'] = array("da_DK" => "Dansk", "de_DE" => "Deutsch", "en_AU" => "English",
"es_ES" => "Español", "fr_FR" => "Français", "it_IT" => "Italiano",
"hu_HU" => "Magyar", "nl_NL" => "Nederlands", "pt_PT" => "Português",
"pt_BR" => "Português Brasileiro", "sv_SE" => "Svenska",
"tr_TR" => "Türkçe", "zh_CN" => "Chinese");
"es_ES" => "Espa&#xf1;ol", "fr_FR" => "Fran&#xe7;ais", "it_IT" => "Italiano",
"hu_HU" => "Magyar", "nl_NL" => "Nederlands", "pt_PT" => "Portugu&#xea;s",
"pt_BR" => "Portugu&#xea;s Brasileiro", "ru_RU" => "&#x420;&#x443;&#x441;&#x441;&#x43a;&#x438;&#x439;",
"sv_SE" => "Svenska", "tr_TR" => "T&#xfc;rk&#xe7;e",
"zh_CN" => "&#x4e2d;&#x6587;(&#x7b80;&#x4f53;)");
if($_SESSION['_config']['language'] == "")
{
@ -94,7 +95,14 @@
if($_SESSION['_config']['language'] == "zh_CN")
{
header("Content-Type: text/html; charset=gb2312");
$_SESSION['_config']['header'] = "<META HTTP-EQUIV=\"content-type\" CONTENT=\"text/html;charset=gb2312\">\n";
// header("Content-Transfer-Encoding: 8bit");
} else if($_SESSION['_config']['language'] == "ru_RU") {
header("Content-Type: text/html; charset=ISO-8859-5");
$_SESSION['_config']['header'] = "<META HTTP-EQUIV=\"content-type\" CONTENT=\"text/html;charset=ISO-8859-5\">\n";
// header("Content-Transfer-Encoding: 8bit");
} else {
unset($_SESSION['_config']['header']);
}
putenv("LANG=".$_SESSION['_config']['language']);
@ -481,4 +489,16 @@
else
return("/screenshots/en/$img");
}
function signmail($to, $subject, $message, $from, $replyto = "")
{
if($replyto == "")
$replyto = $from;
$tmpfname = tempnam("/tmp", "CSR");
$fp = fopen($tmpfname, "w");
fputs($fp, $message);
fclose($fp);
$do = `/usr/bin/gpg --homedir /home/gpg --clearsign "$tmpfname"|/usr/sbin/sendmail "$to"`;
@unlink($tmpfname);
}
?>

@ -22,8 +22,8 @@ if(!function_exists("showheader"))
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<? // <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ?>
<title><?=$title?></title>
<? if($_SESSION['_config']['header'] != "") { ?><?=$_SESSION['_config']['header']?><? } ?>
<link rel="stylesheet" href="styles/default.css" type="text/css">
</head>
<body>
@ -59,8 +59,10 @@ google_color_border = "FFFFFF";
</div>
<div class="relatedLinks">
<h3><?=_("Miscellaneous")?></h3>
<a href="news.php"><?=_("CAcert News")?></a>
<a href="news.php">CAcert <?=_("News")?></a>
<a href="help.php"><?=_("Howto Information")?></a>
<a href="logos.php">CAcert <?=_("Logos")?></a>
<a href="stats.php">CAcert <?=_("Statistics")?></a>
<a href="index.php?id=3"><?=_("Root Certificate")?></a>
<a href="revoke.crl"><?=_("CRL")?></a>
<? if($_SESSION['profile']['admin'] == 1) { ?>

@ -13,7 +13,13 @@
PARTICULAR PURPOSE. See the License for more details.
*/
if($_SERVER['HTTP_HOST'] == "secure.cacert.org")
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0)
{
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_SESSION['profile']['id']."'"));
$_SESSION['profile']['loggedin'] = 1;
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] == 0)
{
$query = "select * from `emailcerts` where `serial`='$_SERVER[SSL_CLIENT_M_SERIAL]' and `revoked`=0 and
UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() > 0";
@ -41,8 +47,6 @@
header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=4");
exit;
}
} else if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0) {
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_SESSION['profile']['id']."'"));
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && ($_SESSION['profile']['id'] <= 0 || $_SESSION['profile']['loggedin'] == 0))

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CAcert\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-12-03 09:37+1100\n"
"POT-Creation-Date: 2004-12-04 10:18+1100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -924,6 +924,10 @@ msgstr ""
msgid "I want to be listed"
msgstr ""
#: www/help/8.php:2
msgid "I'll anwser the why part first, as that's reasonably easy. The short answer is it takes most of the key handling responsibilty away from you and/or your group. If you need to revoke your key for any reason (such as a developer leaving the project) it won't effect your ability to revoke the existing key or keys, and issue new ones."
msgstr ""
#: www/account/43.php:60
msgid "I'm sorry, the user you were looking for seems to have disappeared! Bad things are a foot!"
msgstr ""
@ -1597,6 +1601,10 @@ msgstr ""
msgid "Processing"
msgstr ""
#: www/help/8.php:1
msgid "Question: I'm a software developer for linux and I want to use CAcert/openssl to distribute my packages with detached signatures, is this possible and why would I do this over PGP/GPG detached signatures?"
msgstr ""
#: www/help/2.php:11 www/help/2.php:54
msgid "References"
msgstr ""
@ -2311,7 +2319,7 @@ msgid "You failed to correctly enter your current Pass Phrase."
msgstr ""
#: www/wot.php:109
msgid "You failed to enter a location and date of your meeting."
msgid "You failed to enter a location of your meeting."
msgstr ""
#: www/index.php:91

@ -329,7 +329,7 @@
{
$message = "From: $who\nEmail: $email\nSubject: $subject\n\nMessage:\n".$message;
mail("support@cacert.org", "[CAcert.org] ".$subject, $message, "From: $email");
signmail("support@cacert.org", "[CAcert.org] ".$subject, $message, $email);
showheader(_("Welcome to CAcert.org"));
echo _("Your message has been sent.");
showfooter();

@ -1,7 +1,7 @@
<?
if($process == "Confirm, I agree to these terms and conditions" && $iagree == "yes")
{
$output_file = $fname = "cacert-20041203.tar.bz2";
$output_file = $fname = "cacert-20041204.tar.bz2";
header('Pragma: public');

Loading…
Cancel
Save