Commit 8016018e authored by sept_7's avatar sept_7

[ENH] remove useless include_once/require_once as they are included in

tiki-setup_base.php. mostly logslib and userslib
parent 55aae533
......@@ -177,9 +177,11 @@ if (isset($_REQUEST['send'])) {
$messulib->save_sent_message($user, $user, $_REQUEST['to'], $_REQUEST['cc'], $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority'], $_REQUEST['replyto_hash']);
$smarty->assign('message', $message);
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
if (isset($_REQUEST['reply']) && $_REQUEST['reply'] == 'y') $logslib->add_action('Replied', '', 'message', 'add=' . $tikilib->strlen_quoted($_REQUEST['body']));
else $logslib->add_action('Posted', '', 'message', 'add=' . strlen($_REQUEST['body']));
if (isset($_REQUEST['reply']) && $_REQUEST['reply'] == 'y') {
$logslib->add_action('Replied', '', 'message', 'add=' . $tikilib->strlen_quoted($_REQUEST['body']));
} else {
$logslib->add_action('Posted', '', 'message', 'add=' . strlen($_REQUEST['body']));
}
}
}
$allowMsgs = $prefs['allowmsg_is_optional'] != 'y' || $tikilib->get_user_preference($user, 'allowMsgs', 'y');
......
......@@ -78,7 +78,6 @@ if ($messulib->get_user_preference($user, 'mess_sendReadStatus', 'n') == 'y') {
$messulib->flag_message($msg['user_from'], $_REQUEST['msgId'], 'isRead', 'y', 'sent');
}
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', '', 'message');
}
ask_ticket('messu-read');
......
......@@ -12,8 +12,6 @@ if (empty($prefs['feature_jpgraph'])) {
$prefs['feature_jpgraph'] = 'n'; //optional package does not go througp prefs
}
include_once ('lib/logs/logslib.php');
include_once ('lib/userslib.php');
include_once ('lib/commentslib.php');
include_once ('lib/categories/categlib.php');
include_once ('lib/contribution/contributionlib.php');
......
......@@ -68,8 +68,6 @@ if (isset($_REQUEST["action"])) {
}
}
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'temp_cache') {
global $cachelib; include_once('lib/cache/cachelib.php');
global $logslib; include_once('lib/logs/logslib.php');
$cachelib->erase_dir_content("temp/cache/$tikidomain");
$logslib->add_log('system','erased temp/cache content');
}
......
......@@ -291,7 +291,6 @@ ask_ticket('browse-gallery');
//add a hit
$statslib->stats_hit($gal_info["name"], "image gallery", $_REQUEST["galleryId"]);
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', $_REQUEST['galleryId'], 'image gallery');
}
// Display the template
......
......@@ -202,7 +202,6 @@ ask_ticket('browse-image');
//add a hit
$statslib->stats_hit($info["name"], "image", $imageId);
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', $galleryId, 'image gallery');
}
// Display the template
......
......@@ -72,7 +72,6 @@ if (isset($_REQUEST["change"])) {
$userlib->change_user_password($_REQUEST["user"], $_REQUEST["pass"]);
// Login the user and display Home page
$_SESSION["$user_cookie_site"] = $_REQUEST["user"];
global $logslib; include_once("lib/logs/logslib.php");
$logslib->add_log('login', 'logged from change_password', $_REQUEST['user'], '', '', $tikilib->now);
header ('Location: '.$prefs['tikiIndex']);
}
......
......@@ -132,7 +132,7 @@ if ( ! isset($_GET['thumbnail']) && ! isset($_GET['icon']) ) {
$statslib->stats_hit($info['filename'], 'file', $info['fileId']);
if ( $prefs['feature_actionlog'] == 'y' ) {
require_once('lib/logs/logslib.php');
global $logslib; require_once('lib/logs/logslib.php');
$logslib->add_action('Downloaded', $info['galleryId'], 'file gallery', 'fileId='.$info['fileId']);
}
......
......@@ -435,7 +435,6 @@ ask_ticket('index');
//add a hit
$statslib->stats_hit($page,'wiki');
if ($prefs['feature_actionlog'] == 'y') {
global $logslib; include_once('lib/logs/logslib.php');
$logslib->add_action('Viewed', $page);
}
......
......@@ -409,8 +409,6 @@ if (!empty($_REQUEST['duplicate']) && !empty($_REQUEST['name']) && !empty($_REQU
}
}
if (isset($_REQUEST['dupPerms']) && $_REQUEST['dupPerms'] == 'on') {
global $userlib;
include_once ('lib/userslib.php');
$userlib->copy_object_permissions($galleryId, $newGalleryId, 'file gallery');
}
$_REQUEST['galleryId'] = $newGalleryId;
......@@ -692,7 +690,6 @@ if ($_REQUEST['galleryId'] == 0) {
// Add a file hit
$statslib->stats_hit($gal_info['name'], 'file gallery', $galleryId);
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', $galleryId, 'file gallery');
}
} else {
......
......@@ -161,7 +161,6 @@ $cat_objid = $_REQUEST["galleryId"];
include_once ('tiki-section_options.php');
ask_ticket('list-gal');
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', $_REQUEST['galleryId'], 'image gallery');
}
// Display the template
......
......@@ -70,8 +70,6 @@ if ($prefs['feature_contribution'] == 'y') {
$contributions = $contributionlib->get_assigned_contributions($page, 'wiki page');
$smarty->assign_by_ref('contributions', $contributions);
if ($prefs['feature_contributor_wiki'] == 'y') {
global $logslib;
include_once ('lib/logs/logslib.php');
$contributors = $logslib->get_wiki_contributors($info);
$smarty->assign_by_ref('contributors', $contributors);
}
......
......@@ -179,8 +179,6 @@ ask_ticket('article-read');
//add a hit
$statslib->stats_hit($article_data["title"], "article", $article_data['articleId']);
if ($prefs['feature_actionlog'] == 'y') {
global $logslib;
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', $_REQUEST['articleId'], 'article');
}
// Display the Index Template
......
......@@ -29,7 +29,6 @@ if (!$result->numRows()) {
// $smarty->display('error.tpl');
// die;
//}
include_once ('lib/logs/logslib.php');
if (isset($_REQUEST['clean'])) {
$area = 'cleanlogs';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
......
......@@ -189,7 +189,6 @@ if ($prefs['feature_mobile'] == 'y' && isset($_REQUEST['mode']) && $_REQUEST['mo
HAWTIKI_view_blog($listpages, $blog_data);
}
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', $_REQUEST['blogId'], 'blog', '');
}
ask_ticket('blog');
......
......@@ -315,7 +315,6 @@ if ($prefs['feature_mobile'] == 'y' && isset($_REQUEST['mode']) && $_REQUEST['mo
HAWTIKI_view_forum_thread($forum_info['name'], $thread_info, $tiki_p_forum_read);
}
if ($prefs['feature_actionlog'] == 'y') {
include_once ('lib/logs/logslib.php');
$logslib->add_action('Viewed', $_REQUEST['forumId'], 'forum', 'comments_parentId=' . $comments_parentId);
}
ask_ticket('view-forum');
......
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