[Tickets #5215] Re: Logging for deleted messages
bugs at bugs.horde.org
bugs at bugs.horde.org
Thu Apr 5 20:50:24 UTC 2007
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=5215
-----------------------------------------------------------------------
Ticket | 5215
Updated By | webadmin at ualberta.ca
Summary | Logging for deleted messages
Queue | IMP
Version | 4.1.2
Type | Enhancement
State | New
Priority | 1. Low
Owners |
-----------------------------------------------------------------------
webadmin at ualberta.ca (2007-04-05 13:50) wrote:
Related to this addition I've hacked in one more for the same reason. This
one will log the folders that a user deletes. Anything that perminantly
removes user data should be logged because invariably the users will
either do somethign stupid to themselves and will pretend it's Imp's fault
to avoid the recovery fees OR it WILL be Imp's fault and we'll need a way
to show it.
Anyway... the following is a diff of /horde/imp/lib/Folder.php
--- Folder.php.orig Thu Apr 5 13:36:01 2007
+++ Folder.php Thu Apr 5 14:38:00 2007
@@ -207,8 +207,10 @@
*/
function delete($folder_array, $subscribe)
{
- global $conf, $notification;
+ /* KK added $imp to globals to support additional code below */
+ global $imp, $conf, $notification;
+
$server = IMP::serverString();
$return_value = true;
$deleted = array();
@@ -252,6 +254,22 @@
/* Recreate Virtual Folders. */
$GLOBALS['imp_search']->sessionSetup();
+
+ /* Added by KK - April 5/07
+ *
+ * Determine list of folders (1..N) a user has deleted and
log it
+ *
+ */
+
+ $del_names = array();
+ foreach ($deleted as $KK_del) {
+ array_push($del_names,IMP::displayFolder($KK_del));
+ }
+ $outval = join(', ',$del_names);
+ $entry = sprintf("%s User %s deleted folder(s): %s",
$_SERVER['REMOTE_ADDR'],$imp['user'],$outval);
+ Horde::logMessage($entry, __FILE__, __LINE__,
PEAR_LOG_INFO);
+
+ /* End KK */
}
return $return_value;
More information about the bugs
mailing list