summaryrefslogtreecommitdiff
path: root/includes/notary.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/notary.inc.php')
-rw-r--r--includes/notary.inc.php32
1 files changed, 27 insertions, 5 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 63c426e..40170ad 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1569,8 +1569,29 @@ function get_user_agreements($memid, $type=null, $active=null){
return $return_str;
}
+ //user function
+ function get_user_id_from_email($email){
+ $email = mysql_real_escape_string(trim($email));
+ $res = query_init ("select `id` from `users` where `email` = '" . $email . "'");
+ $row = query_getnextrow($res);
+
+ 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 `actiontypeid`=" . $typeid . " and `when` > NOW() - INTERVAL " . $hours . " HOUR " );
+ $row = query_getnextrow($res);
+
+ return intval($row['no']);
+ }
+
/**
- * Write some information to the adminlog
+ * write_se_log()
+ * writes an information to the adminlog
*
* @param int $uid - id of the user account
* @param int $adminid - id of the admin
@@ -1578,15 +1599,16 @@ function get_user_agreements($memid, $type=null, $active=null){
* @param string $info - the ticket / arbitration number or other information
* @return bool - true := success, false := error
*/
-function write_se_log($uid, $adminid, $type, $info){
+function write_se_log($uid, $adminid, $type, $info, $typeid=1){
//records all support engineer actions changing a user account
$uid = intval($uid);
$adminid = intval($adminid);
$type = mysql_real_escape_string($type);
$info = mysql_real_escape_string($info);
- $query="insert into `adminlog` (`when`, `uid`, `adminid`,`type`,`information`) values
- (Now(), $uid, $adminid, '$type', '$info')";
- return mysql_query($query);
+ $typeid = intval($typeid);
+ $query="insert into `adminlog` (`when`, `uid`, `adminid`,`type`,`information`,`actiontypeid`) values
+ (Now(), $uid, $adminid, '$type', '$info', '$typeid')";
+ mysql_query($query);
}
/**