summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2014-02-28 17:18:47 +0100
committerINOPIAE <inopiae@cacert.org>2014-02-28 17:18:47 +0100
commit7ae35c299cb54f23c45de78382a279ccb075ebb9 (patch)
tree1eea1bf71600ca429a175e2799276ca204d54958
parent682c6e71607dcf51f5b14cf41b5b21d03fceb62e (diff)
downloadcacert-devel-7ae35c299cb54f23c45de78382a279ccb075ebb9.tar.gz
cacert-devel-7ae35c299cb54f23c45de78382a279ccb075ebb9.tar.xz
cacert-devel-7ae35c299cb54f23c45de78382a279ccb075ebb9.zip
bug 649: added function to get number of activity
-rw-r--r--includes/notary.inc.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 2a64b7c..7286186 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1134,3 +1134,14 @@
return intval($row['id']);
}
+
+ function get_number_of_adminlog_entries($uid, $typeid, $hours=1){
+ $uid = intval($uid);
+ $typeid = intval($typeid);
+ $hours = intval($hours);
+ $res = query_init ("SELECT count(*) AS `no` FROM `adminlog`
+ WHERE `adminid` = " . $uid . " AND `admintypeid`=" . $typeid . " and `when` > NOW() - INTERVAL " . $hours . " HOUR " );
+ $row = query_getnextrow($res);
+
+ return intval($row['id']);
+ }