Commit e714b25b authored by sylvieg's avatar sylvieg

some fixes in actionlog

parent e30a72d5
# $Rev$
# $Date: 2005-09-08 15:17:03 $
# $Date: 2005-09-15 14:52:33 $
# $Author: sylvieg $
# $Name: not supported by cvs2svn $
# phpMyAdmin MySQL-Dump
......@@ -313,12 +313,16 @@ CREATE TABLE sessions(
DROP TABLE IF EXISTS tiki_actionlog;
CREATE TABLE tiki_actionlog (
actionId int(8) NOT NULL auto_increment,
action varchar(255) NOT NULL default '',
lastModif int(14) default NULL,
pageName varchar(200) default NULL,
object varchar(255) default NULL,
objectType varchar(32) NOT NULL default '',
user varchar(200) default NULL,
ip varchar(15) default NULL,
comment varchar(200) default NULL
comment varchar(200) default NULL,
categId int(12) NOT NULL default '0',
PRIMARY KEY (actionId)
) TYPE=MyISAM;
# --------------------------------------------------------
......@@ -2201,6 +2205,7 @@ INSERT INTO tiki_menu_options (menuId,type,name,url,position,section,perm,groupn
INSERT INTO tiki_menu_options (menuId,type,name,url,position,section,perm,groupname) VALUES (42,'o','Admin mods','tiki-mods.php',1240,'','tiki_p_admin','');
INSERT INTO tiki_menu_options (menuId,type,name,url,position,section,perm,groupname) VALUES (42,'o','Tiki Logs','tiki-syslog.php',1245,'','tiki_p_admin','');
INSERT INTO tiki_menu_options (menuId,type,name,url,position,section,perm,groupname) VALUES (42,'o','Security Admin','tiki-admin_security.php',1250,'','tiki_p_admin','');
INSERT INTO tiki_menu_options (menuId,type,name,url,position,section,perm,groupname) VALUES (42,'o','Action Log','tiki-admin_actionlog.php',1255,'feature_actionlog','tiki_p_admin','');
# --------------------------------------------------------
#
......@@ -4654,6 +4659,7 @@ INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('messu_sent_size','200')
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_wiki_protect_email', 'n');
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_wiki_1like_redirection', 'y');
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_actionlog', 'y');
# Dynamic variables
INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_edit_dynvar', 'Can edit dynamic variables', 'editors', 'wiki');
......@@ -4986,4 +4992,32 @@ CREATE TABLE `tiki_registration_fields` (
PRIMARY KEY (`id`)
) TYPE=MyISAM;
DROP TABLE IF EXISTS `tiki_actionlog_conf`;
CREATE TABLE `tiki_actionlog_conf` (
`action` varchar(32) NOT NULL default '',
`objectType`varchar(32) NOT NULL default '',
`status` char(1) default '',
PRIMARY KEY (`action`, `objectType`)
) TYPE=MyISAM;
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Created', 'wiki page', 'y');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Updated', 'wiki page', 'y');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Removed', 'wiki page', 'y');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Viewed', 'wiki page', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Viewed', 'forum', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Posted', 'forum', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Replied', 'forum', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Updated', 'forum', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Viewed', 'file gallery', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Viewed', 'image gallery', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Uploaded', 'file gallery', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Uploaded', 'image gallery', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('*', 'category', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('*', 'login', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Posted', 'message', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Replied', 'message', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Viewed', 'message', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Removed version', 'wiki page', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Removed last version', 'wiki page', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Rollback', 'wiki page', 'n');
# --------------------------------------------------------
# $Header: /cvsroot/tikiwiki/tiki/db/tiki_1.9to1.10.sql,v 1.40 2005-09-14 21:45:42 sylvieg Exp $
# $Header: /cvsroot/tikiwiki/tiki/db/tiki_1.9to1.10.sql,v 1.41 2005-09-15 14:52:33 sylvieg Exp $
# The following script will update a tiki database from verion 1.9 to 1.10
#
......@@ -105,7 +105,7 @@ INSERT IGNORE INTO tiki_preferences(`name`,`value`) VALUES ('feature_wiki_1like_
ALTER TABLE `tiki_actionlog` CHANGE `pageName` `object` varchar(255) default NULL;
ALTER TABLE `tiki_actionlog` ADD `objectType` varchar(32) NOT NULL default '' AFTER `object`;
ALTER TABLE `tiki_actionlog` ADD `categId` int(12) NOT NULL default '0' AFTER `comment`;
ALTER TABLE `tiki_actionlog` ADD PRIMARY KEY (`action`);
ALTER TABLE `tiki_actionlog` ADD `actionId` int(8) NOT NULL auto_increment FIRST;
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_actionlog', 'y');
DELETE FROM `tiki_menu_options` WHERE menuId='42' and type='o' and name='Action Log' and url='tiki-admin_actionlog.php' and position='1255' and section='feature_actionlog' and perm='tiki_p_admin' and groupname='' ;
INSERT INTO tiki_menu_options (menuId,type,name,url,position,section,perm,groupname) VALUES (42,'o','Action Log','tiki-admin_actionlog.php',1255,'feature_actionlog','tiki_p_admin','');
......@@ -135,5 +135,4 @@ INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUE
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Removed version', 'wiki page', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Removed last version', 'wiki page', 'n');
INSERT IGNORE INTO `tiki_actionlog_conf`(`action`, `objectType`, `status`) VALUES ('Rollback', 'wiki page', 'n');
# --------------------------------------------------------
......@@ -1662,10 +1662,12 @@ class Comments extends TikiLib {
$summary, $smiley, (int) $threadId ) );
global $feature_actionlog;
if ($feature_actionlog == 'y' && $objectId[0] == 'forum') {
global $logslib; include_once('lib/logs/logslib.php');
if ($feature_actionlog == 'y') {
$object = explode( ":", $objectId, 2);
$logslib->add_action('Updated', $object[1], $object[0], 'comments_parentId='.$threadId);
if ($object[0] == 'forum') {
global $logslib; include_once('lib/logs/logslib.php');
$logslib->add_action('Updated', $object[1], $object[0], 'comments_parentId='.$threadId);
}
}
}
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/messu-broadcast.php,v 1.24 2005-09-08 01:45:05 damosoft Exp $
// $Header: /cvsroot/tikiwiki/tiki/messu-broadcast.php,v 1.25 2005-09-15 14:52:33 sylvieg Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -148,6 +148,10 @@ if (isset($_REQUEST['send'])) {
$_REQUEST['priority'], $_REQUEST['replyto_hash']);
$smarty->assign('message', $message);
if ($feature_actionlog == 'y') {
$logslib->add_action('Posted', '', 'message');
}
}
ask_ticket('messu-broadcast');
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/messu-compose.php,v 1.28 2005-09-14 21:45:38 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/messu-compose.php,v 1.29 2005-09-15 14:52:33 sylvieg Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -73,6 +73,7 @@ if (!isset($_REQUEST['priority']))
// Strip Re:Re:Re: from subject
if(isset($_REQUEST['reply'])||isset($_REQUEST['replyall'])) {
$_REQUEST['subject'] = tra("Re:") . ereg_replace("^(".tra("Re:").")+", "", $_REQUEST['subject']);
$smarty->assign('reply', 'y');
}
$smarty->assign('to', $_REQUEST['to']);
......@@ -113,7 +114,6 @@ if (isset($_REQUEST['send'])) {
foreach ($arr_to as $a_user) {
if (!empty($a_user)) {
$a_user = str_replace('\\;', ';', $a_user);
echo "<pre>$a_user</pre>";
if ($messulib->user_exists($a_user)) {
// mail only to users with activated message feature
if ($messulib->get_user_preference($a_user, 'allowMsgs', 'y') == 'y') {
......@@ -210,7 +210,7 @@ echo "<pre>$a_user</pre>";
if ($feature_actionlog == 'y') {
include_once('lib/logs/logslib.php');
if (isset($_REQUEST['reply']) || isset($_REQUEST['replyall']))
if (isset($_REQUEST['reply']) && $_REQUEST['reply'] == 'y')
$logslib->add_action('Replied', '', 'message');
else
$logslib->add_action('Posted', '', 'message');
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/messu-read.php,v 1.21 2005-09-14 21:45:38 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/messu-read.php,v 1.22 2005-09-15 14:52:33 sylvieg Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -96,7 +96,7 @@ if ($messulib->get_user_preference($user, 'mess_sendReadStatus', 'n') == 'y') {
}
if ($feature_actionlog == 'y') {
include_once('lib/logs/logslib.php');
$logslib->add_action('Viewed', $_REQUEST['msgId'], 'message');
$logslib->add_action('Viewed', '', 'message');
}
......
......@@ -25,6 +25,7 @@
<tr>
<td class="formcolor"><label for="mess-composeto">{tr}To{/tr}:</label></td><td class="formcolor"><input type="text" name="to" id="mess-composeto" value="{$to|escape}" />
<input type="hidden" name="replyto_hash" value="{$replyto_hash}" />
<input type="hidden" name="reply" value="{$reply}" />
<input type="submit" name="send" value="{tr}send{/tr}" /></td>
</tr>
<tr>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment