summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2014-01-11 20:10:03 +0100
committerBenny Baumann <BenBE@geshi.org>2014-01-11 20:10:03 +0100
commit499b1281956490bb2f4d243e3b04686444a79816 (patch)
tree4b1ca507fc69f5bba36de9fdd580b2df515598f7 /www
parent39f4aa38f6b1cbbf3f8593420b42c0a30badc3d4 (diff)
parentbeef667c8fc1dd6e41807732358174832d801ecf (diff)
downloadcacert-devel-499b1281956490bb2f4d243e3b04686444a79816.tar.gz
cacert-devel-499b1281956490bb2f4d243e3b04686444a79816.tar.xz
cacert-devel-499b1281956490bb2f4d243e3b04686444a79816.zip
Merge branch 'release' into bug-1138
Conflicts: www/styles/default.css
Diffstat (limited to 'www')
-rw-r--r--www/gpg.php23
-rw-r--r--www/sqldump.php22
-rw-r--r--www/stats.php428
-rw-r--r--www/styles/default.css430
4 files changed, 425 insertions, 478 deletions
diff --git a/www/gpg.php b/www/gpg.php
index f24d84c..829bbcf 100644
--- a/www/gpg.php
+++ b/www/gpg.php
@@ -319,10 +319,10 @@ function verifyEmail($email)
`keyid`='".mysql_real_escape_string($keyid)."',
`description`='".mysql_real_escape_string($description)."'";
mysql_query($query);
- $id = mysql_insert_id();
+ $insert_id = mysql_insert_id();
- $cwd = '/tmp/gpgspace'.$id;
+ $cwd = '/tmp/gpgspace'.$insert_id;
mkdir($cwd,0755);
$fp = fopen("$cwd/gpg.csr", "w");
@@ -333,7 +333,8 @@ function verifyEmail($email)
system("gpg --homedir $cwd --import $cwd/gpg.csr");
- $gpg = trim(`gpg --homedir $cwd --with-colons --fixed-list-mode --list-keys $keyid 2>&1`);
+ $cmd_keyid = escapeshellarg($keyid);
+ $gpg = trim(`gpg --homedir $cwd --with-colons --fixed-list-mode --list-keys $cmd_keyid 2>&1`);
$lines = "";
$gpgarr = explode("\n", $gpg);
foreach($gpgarr as $line)
@@ -433,7 +434,8 @@ function verifyEmail($email)
//echo "Keyid: $keyid\n";
- $process = proc_open("/usr/bin/gpg --homedir $cwd --no-tty --command-fd 0 --status-fd 1 --logger-fd 2 --edit-key $keyid", $descriptorspec, $pipes);
+ $cmd_keyid = escapeshellarg($keyid);
+ $process = proc_open("/usr/bin/gpg --homedir $cwd --no-tty --command-fd 0 --status-fd 1 --logger-fd 2 --edit-key $cmd_keyid", $descriptorspec, $pipes);
//echo "Process: $process\n";
//fputs($stderr,"Process: $process\n");
@@ -515,15 +517,16 @@ function verifyEmail($email)
}
- $csrname=generatecertpath("csr","gpg",$id);
- $do=`gpg --homedir $cwd --batch --export-options export-minimal --export $keyid >$csrname`;
+ $csrname=generatecertpath("csr","gpg",$insert_id);
+ $cmd_keyid = escapeshellarg($keyid);
+ $do=`gpg --homedir $cwd --batch --export-options export-minimal --export $cmd_keyid >$csrname`;
- mysql_query("update `gpg` set `csr`='$csrname' where `id`='$id'");
- waitForResult('gpg', $id);
+ mysql_query("update `gpg` set `csr`='$csrname' where `id`='$insert_id'");
+ waitForResult('gpg', $insert_id);
showheader(_("Welcome to CAcert.org"));
echo $resulttable;
- $query = "select * from `gpg` where `id`='$id' and `crt`!=''";
+ $query = "select * from `gpg` where `id`='$insert_id' and `crt`!=''";
$res = mysql_query($query);
if(mysql_num_rows($res) <= 0)
{
@@ -531,7 +534,7 @@ function verifyEmail($email)
echo _("If this is a re-occuring problem, please send a copy of the key you are trying to signed to support@cacert.org. Thank you.");
} else {
echo "<pre>";
- readfile(generatecertpath("crt","gpg",$id));
+ readfile(generatecertpath("crt","gpg",$insert_id));
echo "</pre>";
}
diff --git a/www/sqldump.php b/www/sqldump.php
index 9476f6f..f30b4d0 100644
--- a/www/sqldump.php
+++ b/www/sqldump.php
@@ -15,24 +15,24 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- header("content-type: text/plain");
+ header("content-type: text/plain");
?>
# CAcert SQL Dump
-# version 0.0.2
+# version 0.0.3
#
# Generation Time: <?=date('r')?>
#
# Database: `cacert`
#
<?
- $tables = mysql_list_tables('cacert');
- while(list($table_name) = mysql_fetch_array($tables))
- {
- echo "# --------------------------------------------------------\n\n";
- echo "#\n# Table structure for table `$table_name`\n#\n\n";
+ $tables = mysql_query("SHOW TABLES");
+ while(list($table_name) = mysql_fetch_array($tables))
+ {
+ echo "# --------------------------------------------------------\n\n";
+ echo "#\n# Table structure for table `$table_name`\n#\n\n";
- echo "DROP TABLE IF EXISTS `$table_name`;\n";
- $create = mysql_fetch_assoc(mysql_query("SHOW CREATE TABLE `cacert`.`$table_name`"));
- echo $create['Create Table'].";\n\n";
- }
+ echo "DROP TABLE IF EXISTS `$table_name`;\n";
+ $create = mysql_fetch_assoc(mysql_query("SHOW CREATE TABLE `$table_name`"));
+ echo $create['Create Table'].";\n\n";
+ }
?>
diff --git a/www/stats.php b/www/stats.php
index 93f693e..1599e17 100644
--- a/www/stats.php
+++ b/www/stats.php
@@ -1,268 +1,160 @@
-<? /*
- LibreSSL - CAcert web application
- Copyright (C) 2004-2008 CAcert Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
- define('MAX_CACHE_TTL', 36000);
-
- loadem("index");
- showheader(_("Welcome to CAcert.org"));
-
- function tc($sql)
- {
- $row = mysql_fetch_assoc($sql);
- return($row['count']);
- }
-
- /**
- * writes new data to cache, create cache or update existing cache, set current
- * time stamp
- * @return boolean
- */
- function updateCache($stats) {
- $sql = 'insert into statscache (timestamp, cache) values ("' . time() . '", ' .
- '"' . mysql_real_escape_string(serialize($stats)) . '")';
- mysql_query($sql);
- }
-
- /**
- * get statistics data from current cache, return result of getDataFromLive if no cache file exists
- * @return array
- */
- function getData() {
- $sql = 'select * from statscache order by timestamp desc limit 1';
- $res = mysql_query($sql);
- if ($res && mysql_numrows($res) > 0) {
- $ar = mysql_fetch_assoc($res);
- $stats = unserialize($ar['cache']);
- $stats['timestamp'] = $ar['timestamp'];
- if ($ar['timestamp'] + MAX_CACHE_TTL < time())
- {
- $stats=getDataFromLive();
- updateCache($stats);
- }
- return $stats;
- }
- $stats=getDataFromLive();
- updateCache($stats);
- return $stats;
- }
-
- /**
- * get statistics data from live tables, takes a long time so please try to use the
- * cache
- * @return array
- */
- function getDataFromLive() {
- $stats = array();
- $stats['verified_users'] = number_format(tc(mysql_query("select count(`id`) as `count` from `users` where `verified`=1")));
- $stats['verified_emails'] = number_format(tc(mysql_query("select count(`id`) as `count` from `email` where `hash`='' and `deleted`=0")));
- $stats['verified_domains'] = number_format(tc(mysql_query("select count(`id`) as `count` from `domains` where `hash`='' and `deleted`=0")));
- $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `gpg`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts`"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts`"));
- $stats['verified_certificates'] = number_format($certs);
- $certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `revoked`=0 and `expire`>NOW()"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `revoked`=0 and `expire`>NOW()"));
- $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()"));
- $stats['valid_certificates'] = number_format($certs);
- $stats['assurances_made'] = number_format(tc(mysql_query("select count(`id`) as `count` from `notary`")));
- $stats['users_1to49'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) > 0 and sum(`points`) < 50")));
- $stats['users_50to99'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")));
- $stats['assurer_candidates'] = number_format(tc(mysql_query("select count(*) as `count` from `users` where ".
- "not exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` where `cp`.`user_id`=`users`.`id` and `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id`=1) and ".
- "(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100")));
- $stats['aussurers_with_test'] = number_format(tc(mysql_query("select count(*) as `count` from `users` where ".
- "exists(select 1 from `cats_passed` as `cp`, `cats_variant` as `cv` where `cp`.`user_id`=`users`.`id` and `cp`.`variant_id`=`cv`.`id` and `cv`.`type_id`=1) and ".
- "(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100")));
- $stats['points_issued'] = number_format(tc(mysql_query("select sum(`points`) as `count` from `notary`")));
-
- $totalusers=0;
- $totassurers=0;
- $totalcerts=0;
- for($i = 0; $i < 12; $i++) {
- $tmp_arr = array();
- $tmp_arr['date'] = date("Y-m", mktime(0,0,0,date("m") - $i,1,date("Y")));
- $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 = 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%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `created` like '$date%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `created` like '$date%'"));
- $totalcerts += $certs;
-
- $tmp_arr['new_users'] = number_format($users);
- $tmp_arr['new_assurers'] = number_format($assurers);
- $tmp_arr['new_certificates'] = number_format($certs);
-
- $stats['growth_last_12m'][] = $tmp_arr;
- }
- $stats['growth_last_12m_total'] = array('new_users' => number_format($totalusers),
- 'new_assurers' => number_format($totassurers),
- 'new_certificates' => number_format($totalcerts));
-
- $totalcerts = 0;
- $totalusers = 0;
- $totassurers = 0;
- for($i = date("Y"); $i >= 2002; $i--) {
- $tmp_arr = array();
- $tmp_arr['date'] = $i;
- $totalusers += $users = tc(mysql_query("select count(`id`) as `count` from `users` where `created` like '$i%' and `verified`=1"));
- $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%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `created` like '$i%'"));
- $certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `created` like '$i%'"));
- $totalcerts += $certs;
-
- $tmp_arr['new_users'] = number_format($users);
- $tmp_arr['new_assurers'] = number_format($assurers);
- $tmp_arr['new_certificates'] = number_format($certs);
-
- $stats['growth_last_years'][] = $tmp_arr;
- }
- $stats['growth_last_years_total'] = array('new_users' => number_format($totalusers),
- 'new_assurers' => number_format($totassurers),
- 'new_certificates' => number_format($totalcerts));
-
- return $stats;
- }
-
- $stats = getData();
-?>
-<h1>CAcert.org <?=_("Statistics")?></h1>
-
-<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
- <tr>
- <td colspan="2" class="title">CAcert.org <?=_("Statistics")?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Verified Users")?>:</td>
- <td class="DataTD"><?=$stats['verified_users'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Verified Emails")?>:</td>
- <td class="DataTD"><?=$stats['verified_emails'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Verified Domains")?>:</td>
- <td class="DataTD"><?=$stats['verified_domains'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Certificates Issued")?>:</td>
- <td class="DataTD"><?=$stats['verified_certificates'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Valid Certificates")?>:</td>
- <td class="DataTD"><?=$stats['valid_certificates'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Assurances Made")?>:</td>
- <td class="DataTD"><?=$stats['assurances_made'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Users with 1-49 Points")?>:</td>
- <td class="DataTD"><?=$stats['users_1to49'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Users with 50-99 Points")?>:</td>
- <td class="DataTD"><?=$stats['users_50to99'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Assurer Candidates")?>:</td>
- <td class="DataTD"><?=$stats['assurer_candidates'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Assurers with test")?>:</td>
- <td class="DataTD"><?=$stats['aussurers_with_test'];?></td>
- </tr>
- <tr>
- <td class="DataTD"><?=_("Points Issued")?>:</td>
- <td class="DataTD"><?=$stats['points_issued'];?></td>
- </tr>
-</table>
-<br>
-<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
- <tr>
- <td colspan="4" class="title">CAcert.org <?=_("Growth in the last 12 months")?></td>
- </tr>
- <tr>
- <td class="DataTD"><b><?=_("Date")?></b>
- <td class="DataTD"><b><?=_("New Users")?></b>
- <td class="DataTD"><b><?=_("New Assurers")?></b>
- <td class="DataTD"><b><?=_("New Certificates")?></b>
- </tr>
-<?
- for($i = 0; $i < 12; $i++) {
-?>
- <tr>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['date'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_certificates'];?></td>
- </tr>
-<? } ?>
- <tr>
- <td class="DataTD">N/A</td>
- <td class="DataTD"><?=$stats['growth_last_12m_total']['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m_total']['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_12m_total']['new_certificates'];?></td>
- </tr>
-</table>
-<br>
-<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
- <tr>
- <td colspan="4" class="title">CAcert.org <?=_("Growth by year")?></td>
- </tr>
- <tr>
- <td class="DataTD"><b><?=_("Date")?></b>
- <td class="DataTD"><b><?=_("New Users")?></b>
- <td class="DataTD"><b><?=_("New Assurers")?></b>
- <td class="DataTD"><b><?=_("New Certificates")?></b>
- </tr>
-<?
- for($i = 0; $i < count($stats['growth_last_years']); $i++) {
-?>
- <tr>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['date'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_certificates'];?></td>
- </tr>
-<? } ?>
- <tr>
- <td class="DataTD">N/A</td>
- <td class="DataTD"><?=$stats['growth_last_years_total']['new_users'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years_total']['new_assurers'];?></td>
- <td class="DataTD"><?=$stats['growth_last_years_total']['new_certificates'];?></td>
- </tr>
-</table>
-<br>
-<?php
- if (isset($stats['timestamp'])) {
-?>
-<div style="text-align: center;font-size: small;"><?=_("Statistical data from cache, created at ") . date('Y-m-d H:i:s', $stats['timestamp']);?></div>
-<?php
- }
-?>
-<? showfooter(); ?>
-
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2008 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+ loadem("index");
+ showheader(_("Welcome to CAcert.org"));
+
+ /**
+ * get statistics data from current cache, return result of getDataFromLive if no cache file exists
+ * @return array
+ */
+ function getData() {
+ $sql = 'select * from `statscache` order by `timestamp` desc limit 1';
+ $res = mysql_query($sql);
+ if ($res && mysql_numrows($res) > 0) {
+ $ar = mysql_fetch_assoc($res);
+ $stats = unserialize($ar['cache']);
+ $stats['timestamp'] = $ar['timestamp'];
+ return $stats;
+ }
+
+ return null;
+ }
+
+ $stats = getData();
+ if ($stats === null) {
+ echo '<p>', _("Error while retrieving the statistics!"), '</p>';
+ showfooter();
+ die();
+ }
+?>
+<h1>CAcert.org <?=_("Statistics")?></h1>
+
+<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+ <tr>
+ <td colspan="2" class="title">CAcert.org <?=_("Statistics")?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Verified Users")?>:</td>
+ <td class="DataTD"><?=$stats['verified_users'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Verified Emails")?>:</td>
+ <td class="DataTD"><?=$stats['verified_emails'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Verified Domains")?>:</td>
+ <td class="DataTD"><?=$stats['verified_domains'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Certificates Issued")?>:</td>
+ <td class="DataTD"><?=$stats['verified_certificates'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Valid Certificates")?>:</td>
+ <td class="DataTD"><?=$stats['valid_certificates'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Assurances Made")?>:</td>
+ <td class="DataTD"><?=$stats['assurances_made'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Users with 1-49 Points")?>:</td>
+ <td class="DataTD"><?=$stats['users_1to49'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Users with 50-99 Points")?>:</td>
+ <td class="DataTD"><?=$stats['users_50to99'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Assurer Candidates")?>:</td>
+ <td class="DataTD"><?=$stats['assurer_candidates'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Assurers with test")?>:</td>
+ <td class="DataTD"><?=$stats['aussurers_with_test'];?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Points Issued")?>:</td>
+ <td class="DataTD"><?=$stats['points_issued'];?></td>
+ </tr>
+</table>
+<br>
+<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+ <tr>
+ <td colspan="4" class="title">CAcert.org <?=_("Growth in the last 12 months")?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><b><?=_("Date")?></b>
+ <td class="DataTD"><b><?=_("New Users")?></b>
+ <td class="DataTD"><b><?=_("New Assurers")?></b>
+ <td class="DataTD"><b><?=_("New Certificates")?></b>
+ </tr>
+<?
+ for($i = 0; $i < 12; $i++) {
+?>
+ <tr>
+ <td class="DataTD"><?=$stats['growth_last_12m'][$i]['date'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_users'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_assurers'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_12m'][$i]['new_certificates'];?></td>
+ </tr>
+<? } ?>
+ <tr>
+ <td class="DataTD"><?=_("Total")?></td>
+ <td class="DataTD"><?=$stats['growth_last_12m_total']['new_users'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_12m_total']['new_assurers'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_12m_total']['new_certificates'];?></td>
+ </tr>
+</table>
+<br>
+<table align="center" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+ <tr>
+ <td colspan="4" class="title">CAcert.org <?=_("Growth by year")?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><b><?=_("Date")?></b>
+ <td class="DataTD"><b><?=_("New Users")?></b>
+ <td class="DataTD"><b><?=_("New Assurers")?></b>
+ <td class="DataTD"><b><?=_("New Certificates")?></b>
+ </tr>
+<?
+ for($i = 0; $i < count($stats['growth_last_years']); $i++) {
+?>
+ <tr>
+ <td class="DataTD"><?=$stats['growth_last_years'][$i]['date'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_users'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_assurers'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_years'][$i]['new_certificates'];?></td>
+ </tr>
+<? } ?>
+ <tr>
+ <td class="DataTD"><?=_("Total")?></td>
+ <td class="DataTD"><?=$stats['growth_last_years_total']['new_users'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_years_total']['new_assurers'];?></td>
+ <td class="DataTD"><?=$stats['growth_last_years_total']['new_certificates'];?></td>
+ </tr>
+</table>
+<br>
+
+<div style="text-align: center;font-size: small;"><?
+ printf(_("Last updated: %s"), date('Y-m-d H:i:s', $stats['timestamp']));?>
+</div>
+
+<? showfooter(); ?>
+
diff --git a/www/styles/default.css b/www/styles/default.css
index 3c5c8e3..424dcb8 100644
--- a/www/styles/default.css
+++ b/www/styles/default.css
@@ -6,20 +6,22 @@
/***********************************************/
/* HTML tag styles */
/***********************************************/
-body{
+
+body {
font-family: Arial,sans-serif;
color: #333333;
line-height: 1.166;
margin: 0px;
padding: 0px;
background: #cccccc;
-/* url("/siteimages/bg_grad.jpg") fixed; */
+/* url("/siteimages/bg_grad.jpg") fixed; */
}
+
/******* hyperlink and anchor tag styles *******/
a:link, a:visited {
- color: #005FA9;
+ color: #005fa9;
text-decoration: none;
}
@@ -27,85 +29,87 @@ a:hover {
text-decoration: underline;
}
+
/************** header tag styles **************/
-h1{
- font: bold 120% Arial,sans-serif;
- color: #334d55;
- margin: 0px;
- padding: 0px;
+h1 {
+ font: bold 120% Arial ,sans-serif;
+ color: #334d55;
+ margin: 0px;
+ padding: 0px;
}
-h2{
- font: bold 114% Arial,sans-serif;
- color: #006699;
- margin: 0px;
- padding: 0px;
+h2 {
+ font: bold 114% Arial ,sans-serif;
+ color: #006699;
+ margin: 0px;
+ padding: 0px;
}
-h3{
- font: bold 100% Arial,sans-serif;
- color: #334d55;
- margin: 0px;
- padding: 0px;
+h3 {
+ font: bold 100% Arial ,sans-serif;
+ color: #334d55;
+ margin: 0px;
+ padding: 0px;
}
-h3.pointer{
- cursor: pointer;
- /* cursor: hand; */
+h3.pointer {
+ cursor: pointer;
+ /* cursor: hand; */
}
-h4{
- font: bold 100% Arial,sans-serif;
- color: #333333;
- margin: 0px;
- padding: 0px;
+h4 {
+ font: bold 100% Arial ,sans-serif;
+ color: #333333;
+ margin: 0px;
+ padding: 0px;
}
-h5{
- font: 100% Arial,sans-serif;
- color: #334d55;
- margin: 0px;
- padding: 0px;
+h5 {
+ font: 100% Arial ,sans-serif;
+ color: #334d55;
+ margin: 0px;
+ padding: 0px;
}
/*************** list tag styles ***************/
ul.menu {
-list-style: none;
-margin :0px 0px 0px 15px;
-padding-left: 5px;
-border-left: 1px dotted #000;
+ list-style: none;
+ margin: 0px 0px 0px 15px;
+ padding-left: 5px;
+ border-left: 1px dotted #000;
}
ul.top {
-list-style: none;
-margin: 0px 0px 0px 15px;
-padding-left: 5px;
-border-left: 0px;
+ list-style: none;
+ margin: 0px 0px 0px 15px;
+ padding-left: 5px;
+ border-left: 0px;
}
ul.no_indent {
-list-style: none;
-padding: 0px;
+ list-style: none;
+ padding: 0px;
}
+
/***********************************************/
/* Layout Divs */
/***********************************************/
-#pagecell1{
- position:absolute;
+
+#pagecell1 {
+ position: absolute;
top: 2%;
left: 2%;
right: 2%;
width: 96%;
background-color: #ffffff;
-
}
#tl {
- position:absolute;
+ position: absolute;
top: -1px;
left: -1px;
margin: 0px;
@@ -114,7 +118,7 @@ padding: 0px;
}
#tr {
- position:absolute;
+ position: absolute;
top: -1px;
right: -1px;
margin: 0px;
@@ -122,43 +126,43 @@ padding: 0px;
z-index: 100;
}
-#masthead{
+#masthead {
position: absolute;
top: 0px;
left: 2%;
right: 2%;
- width:95.6%;
-
+ width: 95.6%;
}
-#pageNav{
+#pageNav {
float: right;
- width:178px;
+ width: 178px;
padding: 0px;
background-color: #F5f7f7;
border-left: 1px solid #cccccc;
font: small Verdana,sans-serif;
}
-#content{
+#content {
padding: 0px 10px 0px 0px;
- margin:0px 178px 0px 0px;
+ margin: 0px 178px 0px 0px;
}
/***********************************************/
/* Component Divs */
/***********************************************/
-#siteName{
+#siteName {
margin: 0px;
padding: 16px 0px 8px 0px;
color: #ffffff;
font-weight: normal;
}
+
/************** utility styles *****************/
-#utility{
+#utility {
font: 75% Verdana,sans-serif;
position: absolute;
top: 16px;
@@ -166,7 +170,7 @@ padding: 0px;
color: #919999;
}
-#utility a{
+#utility a {
color: #ffffff;
}
@@ -174,46 +178,48 @@ padding: 0px;
text-decoration: underline;
}
+
/************** pageName styles ****************/
-#pageName{
+#pageName {
padding: 0px 0px 14px 10px;
margin: 0px;
- border-bottom:1px solid #ccd2d2;
+ border-bottom: 1px solid #ccd2d2;
z-index: 2;
}
-#pageName h2{
+#pageName h2 {
font: bold 175% Arial,sans-serif;
color: #000000;
- margin:0px;
+ margin: 0px;
padding: 0px;
}
+
/*
#pageLogo {
- position: absolute;
- top: 8px;
- left: 10px;
- z-index: 5;
+ position: absolute;
+ top: 8px;
+ left: 10px;
+ z-index: 5;
}
*/
+
/************* globalNav styles ****************/
-#globalNav{
-position: relative;
-width: 100%;
-min-width: 640px;
-height: 32px;
-color: #cccccc;
-padding: 0px;
-margin: 0px;
-background-image: url("siteimages/glbnav_background.gif");
+#globalNav {
+ position: relative;
+ width: 100%;
+ min-width: 640px;
+ height: 32px;
+ color: #cccccc;
+ padding: 0px;
+ margin: 0px;
+ background-image: url("siteimages/glbnav_background.gif");
}
-#globalNav img{
+#globalNav img {
margin-bottom: -4px;
-
}
#gnl {
@@ -228,7 +234,7 @@ background-image: url("siteimages/glbnav_background.gif");
right:0px;
}
-#globalLink{
+#globalLink {
position: absolute;
top: 6px;
height: 22px;
@@ -241,24 +247,27 @@ background-image: url("siteimages/glbnav_background.gif");
a.glink, a.glink:visited {
- font-size: small;
- color: #000000;
+ font-size: small;
+ color: #000000;
font-weight: bold;
margin: 0px;
padding: 2px 5px 4px 5px;
- border-right: 1px solid #8FB8BC;
+ border-right: 1px solid #8fb8bc;
}
a.glink:hover {
- background-image: url("siteimages/glblnav_selected.gif");
+ background-image: url("siteimages/glblnav_selected.gif");
text-decoration: none;
}
-.skipLinks {display: none;}
+.skipLinks {
+ display: none;
+}
+
/************ subglobalNav styles **************/
-.subglobalNav{
+.subglobalNav {
position: absolute;
top: 84px;
left: 0px;
@@ -279,13 +288,15 @@ a.glink:hover {
color: #cccccc;
}
+
/*************** search styles *****************/
/*
#listshow {
z-order: 101;
}
*/
-#search{
+
+#search {
position: absolute;
top: 125px;
right: 0px;
@@ -300,40 +311,40 @@ a.glink:hover {
font-size: 11px;
}
-#search1{
+#search1 {
position: absolute;
top: 85px;
right: 300px;
}
-#search2{
+#search2 {
position: absolute;
top: 100px;
right: 300px;
}
-#search3{
+#search3 {
position: absolute;
top: 85px;
right: 240px;
}
-#search4{
+#search4 {
position: absolute;
top: 100px;
right: 226px;
}
-#googlead{
+#googlead {
position: absolute;
top: 5px;
right: 0px;
z-index: -10;
}
-#search input{
- font-size: 70%;
- margin: 0px 0px 0px 10px;
+#search input {
+ font-size: 70%;
+ margin: 0px 0px 0px 10px;
}
#search a:link, #search a:visited {
@@ -349,40 +360,42 @@ a.glink:hover {
/************* breadCrumb styles ***************/
-#breadCrumb{
+#breadCrumb {
padding: 5px 0px 5px 10px;
font: small Verdana,sans-serif;
- color: #AAAAAA;
+ color: #aaaaaa;
}
-#breadCrumb a{
- color: #AAAAAA;
+#breadCrumb a {
+ color: #aaaaaa;
}
#breadCrumb a:hover {
- color: #005FA9;
+ color: #005fa9;
text-decoration: underline;
}
/************** feature styles *****************/
-.feature{
+.feature {
padding: 0px 0px 10px 10px;
font-size: 80%;
min-height: 200px;
height: 200px;
}
-.feature {height: auto;}
+.feature {
+ height: auto;
+}
-.feature h3{
+.feature h3 {
font: bold 175% Arial,sans-serif;
color: #000000;
padding: 30px 0px 5px 0px;
}
-.feature img{
+.feature img {
float: left;
padding: 0px 10px 0px 0px;
}
@@ -396,7 +409,7 @@ a.glink:hover {
min-height: 450px;
}
-.story h3{
+.story h3 {
font: bold 125% Arial,sans-serif;
color: #000000;
}
@@ -405,10 +418,10 @@ a.glink:hover {
padding: 0px 0px 10px 0px;
}
-.story a.capsule{
+.story a.capsule {
font: bold 1em Arial,sans-serif;
color: #005FA9;
- display:block;
+ display: block;
padding-bottom: 5px;
}
@@ -416,14 +429,14 @@ a.glink:hover {
text-decoration: underline;
}
-td.storyLeft{
+td.storyLeft {
padding-right: 12px;
}
/************** siteInfo styles ****************/
-#siteInfo{
+#siteInfo {
clear: both;
border-top: 1px solid #cccccc;
font-size: small;
@@ -431,15 +444,15 @@ td.storyLeft{
padding: 10px 10px 10px 10px;
}
+
/************ sectionLinks styles **************/
-#sectionLinks{
+#sectionLinks {
margin: 0px;
padding: 0px;
-
}
-#sectionLinks h3{
+#sectionLinks h3 {
padding: 10px 0px 2px 10px;
border-bottom: 1px solid #cccccc;
}
@@ -448,7 +461,7 @@ td.storyLeft{
display: block;
border-top: 1px solid #ffffff;
border-bottom: 1px solid #cccccc;
- background-image: url("siteimages/bg_nav.jpg");
+ background-image: url("siteimages/bg_nav.jpg");
font-weight: bold;
padding: 3px 0px 3px 10px;
color: #21536A;
@@ -465,83 +478,84 @@ td.storyLeft{
/************* relatedLinks styles **************/
-.relatedLinks{
+.relatedLinks {
margin: 0px;
padding: 0px 0px 10px 10px;
border-bottom: 1px solid #cccccc;
}
-.relatedLinks h3{
+.relatedLinks h3 {
padding: 10px 0px 2px 0px;
}
-.relatedLinks a{
+.relatedLinks a {
display: block;
}
/**************** advert styles *****************/
-#advert{
+#advert {
padding: 10px;
}
-#advert img{
+#advert img {
display: block;
}
+
/********************* end **********************/
.DataTD input, .DataTD textarea {
- FONT-SIZE: 92%;
+ font-size: 92%;
}
.DataTD select, .DataTD option {
- FONT-SIZE: 92%;
+ font-size: 92%;
}
.DataTD {
- background-color: #E2E2E2;
+ background-color: #e2e2e2;
border-style: inset;
border-width: 1px;
- FONT-SIZE: 8pt;
- COLOR: #000000;
- FONT-FAMILY: Arial, Tahoma, Verdana, Helvetica, sans-serif;
+ font-size: 8pt;
+ color: #000000;
+ font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif;
background: #ffffff;
padding: 1px 5px 1px 5px;
- border: 1px #CFCFCF solid;
- border-left: 1px #CFCFCF dotted;
- border-right: 1px #CFCFCF dotted;
+ border: 1px #cfcfcf solid;
+ border-left: 1px #cfcfcf dotted;
+ border-right: 1px #cfcfcf dotted;
}
.DataTDGrey {
background-color: #EFEDED;
border-style: inset;
border-width: 1px;
- FONT-SIZE: 8pt;
- COLOR: #000000;
- FONT-FAMILY: Arial, Tahoma, Verdana, Helvetica, sans-serif;
+ font-size: 8pt;
+ color: #000000;
+ font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif;
padding: 1px 5px 1px 5px;
border: 1px #CFCFCF solid;
- border-left: 1px #CFCFCF dotted;
- border-right: 1px #CFCFCF dotted;
+ border-left: 1px #cfcfcf dotted;
+ border-right: 1px #cfcfcf dotted;
}
.DataTDNotDotted {
- background-color: #E2E2E2;
+ background-color: #e2e2e2;
border-style: inset;
border-width: 1px;
- FONT-SIZE: 8pt;
- COLOR: #000000;
- FONT-FAMILY: Arial, Tahoma, Verdana, Helvetica, sans-serif;
+ font-size: 8pt;
+ color: #000000;
+ font-family: Arial, Tahoma, Verdana, Helvetica, sans-serif;
background: #ffffff;
padding: 1px 5px 1px 5px;
border: 1px #CFCFCF solid;
- border-left: 1px #CFCFCF solid;
- border-right: 1px #CFCFCF solid;
+ border-left: 1px #cfcfcf solid;
+ border-right: 1px #cfcfcf solid;
}
.wrapper {
@@ -552,7 +566,7 @@ td.storyLeft{
}
td.greytxt {
- color: #CCCCCC;
+ color: #cccccc;
font-size: smaller;
text-align: right;
vertical-align: bottom;
@@ -564,97 +578,135 @@ td.greytxt {
font-style:italic;
}
.title {
- background: #E2E2E2;
- font-weight:BOLD;
+ background: #e2e2e2;
+ font-weight: bold;
padding: 1px 5px 1px 5px;
- border: 1px solid #CFCFCF;
- border-bottom: 3px double #CFCFCF;
+ border: 1px solid #cfcfcf;
+ border-bottom: 3px double #cfcfcf;
border-top: 1px solid #656565;
text-align: center;
}
.errmsg {
- font-weight: BOLD;
+ font-weight: bold;
color: #FF0000;
}
-.ac_menu
-{
- border:1px solid black
+.ac_menu {
+ border: 1px solid black
}
-.ac_normal
-{
- background-color:#ffffff;
- cursor:pointer;
+
+.ac_normal {
+ background-color: #ffffff;
+ cursor: pointer;
}
-.ac_highlight
-{
- background-color:#3366cc;
- color:white;
- cursor:pointer;
+
+.ac_highlight {
+ background-color: #3366cc;
+ color: white;
+ cursor: pointer;
}
-.ac_normal .a
-{
- font-size:13px;
- color:black;
+
+.ac_normal .a {
+ font-size: 13px;
+ color: black;
}
-.ac_highlight .a
-{
- font-size:13px;
+
+.ac_highlight .a {
+ font-size: 13px;
}
-.ac_normal .d
-{
- float:right;
- font-size:10px;
- color:green;
+
+.ac_normal .d {
+ float: right;
+ font-size: 10px;
+ color: green;
}
-.ac_highlight .d
-{
- float:right;
- font-size:10px;
+
+.ac_highlight .d {
+ float: right;
+ font-size: 10px;
}
+
/************** sponsorInfo styles ****************/
div.sponsorinfo {
- clear: both;
- border-top: 1px solid #cccccc;
- font-size: small;
- color: #000000;
- padding: 10px 10px 10px 10px;
+ clear: both;
+ border-top: 1px solid #cccccc;
+ font-size: small;
+ color: #000000;
+ padding: 10px 10px 10px 10px;
}
img.sponsorlogo {
- margin-left: 10px;
- margin-right: 10px;
- border: 0px none;
- vertical-align: middle;
+ margin-left: 10px;
+ margin-right: 10px;
+ border: 0px none;
+ vertical-align: middle;
}
+
/************ Newsbox *************/
-#lnews { /* class for the text "Latest News" */
- font-size: small;
- font-variant: small-caps;
+#lnews { /* class for the text "Latest News" */
+ font-size: small;
+ font-variant: small-caps;
}
div.newsbox {
- border-top: 1px solid #cccccc;
- color: #101010;
- padding: 10px 10px 10px 10px;
+ border-top: 1px solid #cccccc;
+ color: #101010;
+ padding: 10px 10px 10px 10px;
}
+
/************ SQL Performance ***********/
div.footerbar {
- clear: both;
- border-top: 1px solid #cccccc;
- font-size: small;
- color: black;
- padding: 10px 10px 10px 10px;
+ clear: both;
+ border-top: 1px solid #cccccc;
+ font-size: small;
+ color: black;
+ padding: 10px 10px 10px 10px;
}
+
/************ Honeypot ***********/
-.robotic { display: none; }
+.robotic {
+ display: none;
+}
+
+
+/************ unicode fallbacks ***********/
+
+/* Some embedding of font */
+@font-face {
+ font-family: 'Source Code Pro';
+ src: local('Source Code Pro');
+/* src: url(/res/fonts/SourceCodePro-Medium.ttf); */
+}
+
+@font-face {
+ font-family: 'Last Resort';
+ src: local('LastResort');
+/* src: url(/res/fonts/LastResort.ttf); */
+}
+
+.accountdetail {
+ font-family: 'Source Code Pro', 'Lucida Console', 'Arial Unicode MS', monospace, 'Last Resort';
+ font-size: 1.1em;
+}
+
+.accountdetail.fname {
+}
+
+.accountdetail.mname {
+}
+
+.accountdetail.lname {
+ font-weight: bold;
+}
+.accountdetail.suffix {
+}