summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2014-02-28 17:50:38 +0100
committerINOPIAE <inopiae@cacert.org>2014-02-28 17:50:38 +0100
commit38e62d200f790a72d6d5b097917132f6e5e36f5b (patch)
tree05155577d6536dcd6d429725356d1654ee36b2c0
parent7ae35c299cb54f23c45de78382a279ccb075ebb9 (diff)
downloadcacert-devel-38e62d200f790a72d6d5b097917132f6e5e36f5b.tar.gz
cacert-devel-38e62d200f790a72d6d5b097917132f6e5e36f5b.tar.xz
cacert-devel-38e62d200f790a72d6d5b097917132f6e5e36f5b.zip
bug 649: added function for write_se_log for assurer status
-rw-r--r--includes/notary.inc.php48
-rw-r--r--www/wot.php45
2 files changed, 61 insertions, 32 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 7286186..dbdbf80 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1128,20 +1128,44 @@
//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);
+ $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']);
+ 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`
+ 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);
+ $row = query_getnextrow($res);
+
+ return intval($row['id']);
+ }
+
+/**
+ * write_se_log()
+ * writes an information to the adminlog
+ *
+ * @param mixed $uid - id of the user account
+ * @param mixed $adminid - id of the admin
+ * @param mixed $type - what was changed
+ * @param mixed $info - the ticket / arbitration no or other information
+ * @return
+ */
+// function write_se_log needs to be adjusted after merge with bug 1138
+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);
+ $typeid = intval($typeid);
+ $query="insert into `adminlog` (`when`, `uid`, `adminid`,`type`,`information`,`actiontypeid`) values
+ (Now(), $uid, $adminid, '$type', '$info', '$typeid')";
+ mysql_query($query);
+}
- return intval($row['id']);
- }
diff --git a/www/wot.php b/www/wot.php
index d4434a5..949c18d 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -590,6 +590,7 @@ $iecho= "c";
} else {
$status = _('Is no assurer');
}
+ write_se_log($uid, $_SESSION['profile']['id'], 'User Assurer status check', '', 1000);
$assurer = get_user($uid);
//mail to assurer
$my_translation = L10n::get_translation();
@@ -614,28 +615,32 @@ $iecho= "c";
"", //toname
"CAcert Support"); //fromname
//mail to requestor
- L10n::set_translation($my_translation);
-
- $subject = "[CAcert.org] " . _("Assurer status report that you requested");
-
- $body = sprintf(_("Hi %s,"), $_SESSION['profile']['fname'])."\n\n";
- $body .= sprintf(_("you requested the assurer status of %s %s (%s) for %s."),
- $assurer['fname'],
- $assurer['lname'],
- $assurer['email'],
- $reason)."\n\n";
- $body .= sprintf(_("The transmitted result: %s"), $status)."\n";
- $body .= _("Best regards")."\n";
- $body .= _("CAcert Support Team");
-
- sendmail($_SESSION['profile']['email'], "[CAcert.org] ". $subject, $body,
- "support@cacert.org", //from
- "", //replyto
- "", //toname
- "CAcert Support"); //fromname
+// L10n::set_translation($my_translation);
+//
+// $subject = "[CAcert.org] " . _("Assurer status report that you requested");
+//
+// $body = sprintf(_("Hi %s,"), $_SESSION['profile']['fname'])."\n\n";
+// $body .= sprintf(_("you requested the assurer status of %s %s (%s) for %s."),
+// $assurer['fname'],
+// $assurer['lname'],
+// $assurer['email'],
+// $reason)."\n\n";
+// $body .= sprintf(_("The transmitted result: %s"), $status)."\n";
+// $body .= _("Best regards")."\n";
+// $body .= _("CAcert Support Team");
+//
+// sendmail($_SESSION['profile']['email'], "[CAcert.org] ". $subject, $body,
+// "support@cacert.org", //from
+// "", //replyto
+// "", //toname
+// "CAcert Support"); //fromname
showheader(_("My CAcert.org Account!"));?>
<p>
- <? printf(_('The mail with the status request has been sent to the assurer and you.')); ?>
+ <?=sprintf(_('The assurer status for %s %s (%s) is: %s'),
+ $assurer['fname'],
+ $assurer['lname'],
+ $assurer['email'],
+ $status) . '<br/>'. _('The mail with the status request has been sent to the assurer.'); ?>
</p>
<?
showfooter();