summaryrefslogtreecommitdiff
path: root/cacert/includes/general.php
diff options
context:
space:
mode:
authorMarkus Warg <mw@it-sls.de>2010-03-11 15:19:46 +0100
committerMarkus Warg <mw@it-sls.de>2010-03-11 15:19:46 +0100
commitdf92c83b625715f223070d5d9c9e3f5b814560ec (patch)
treec770a711fe449be50530c380df13febe19ec63e0 /cacert/includes/general.php
parente3263b2e2c20aef2f955b9b665a162cad606fa9d (diff)
downloadcacert-devel-df92c83b625715f223070d5d9c9e3f5b814560ec.tar.gz
cacert-devel-df92c83b625715f223070d5d9c9e3f5b814560ec.tar.xz
cacert-devel-df92c83b625715f223070d5d9c9e3f5b814560ec.zip
source code taken from cacert-20100204.tar.bz2
Diffstat (limited to 'cacert/includes/general.php')
-rw-r--r--cacert/includes/general.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/cacert/includes/general.php b/cacert/includes/general.php
index f2be4a2..80b16a0 100644
--- a/cacert/includes/general.php
+++ b/cacert/includes/general.php
@@ -25,6 +25,8 @@
// if($_SESSION['profile']['id'] > 0)
// session_regenerate_id();
+ $pageLoadTime_Start = microtime(true);
+
$junk = array(_("Face to Face Meeting"), _("Trusted Third Parties"), _("Thawte Points Transfer"), _("Administrative Increase"),
_("CT Magazine - Germany"), _("Temporary Increase"), _("Unknown"));
@@ -907,5 +909,37 @@
return no_assurer_text(get_assurer_status($userID));
}
+ function generatecertpath($type,$kind,$id)
+ {
+ $name="../$type/$kind-".intval($id).".$type";
+ $newlayout=1;
+ if($newlayout)
+ {
+ $name="../$type/$kind/".intval($id/1000)."/$kind-".intval($id).".$type";
+ mkdir("../csr/$kind",0777);
+ mkdir("../crt/$kind",0777);
+ mkdir("../csr/$kind/".intval($id/1000));
+ mkdir("../crt/$kind/".intval($id/1000));
+ }
+ return $name;
+ }
+
+ /**
+ * Run the sql query given in $sql.
+ * The resource returned by mysql_query is
+ * returned by this function.
+ *
+ * It should be safe to replace every mysql_query
+ * call by a mysql_extended_query call.
+ */
+ function mysql_timed_query($sql)
+ {
+ global $sql_data_log;
+ $query_start = microtime(true);
+ $res = mysql_query($sql);
+ $query_end = microtime(true);
+ $sql_data_log[] = array("sql" => $sql, "duration" => $query_end - $query_start);
+ return $res;
+ }
?>