|
From: <ir...@us...> - 2013-04-17 09:26:19
|
Revision: 11393
http://sourceforge.net/p/xoops/svn/11393
Author: irmtfan
Date: 2013-04-17 09:26:16 +0000 (Wed, 17 Apr 2013)
Log Message:
-----------
- improve: add missing configcat in xoops_version.php to be more compatible with xoops26 in xoops_version.php and language/LANG/modinfo.php (2013/04/17)
- improve: replace all '->XoopsFileHandler' with '->__construct' to be more compatible with xoops26 in class/log.php(2013/04/17)
Modified Paths:
--------------
XoopsModules/userlog/trunk/userlog/class/log.php
XoopsModules/userlog/trunk/userlog/docs/changelog.txt
XoopsModules/userlog/trunk/userlog/docs/lang_diff.txt
XoopsModules/userlog/trunk/userlog/docs/readme.txt
XoopsModules/userlog/trunk/userlog/language/english/modinfo.php
XoopsModules/userlog/trunk/userlog/language/persian/modinfo.php
XoopsModules/userlog/trunk/userlog/xoops_version.php
Modified: XoopsModules/userlog/trunk/userlog/class/log.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/class/log.php 2013-04-17 07:11:29 UTC (rev 11392)
+++ XoopsModules/userlog/trunk/userlog/class/log.php 2013-04-17 09:26:16 UTC (rev 11393)
@@ -256,7 +256,7 @@
$log_file = $this->userlog->getWorkingFile();
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- $fileHandler->XoopsFileHandler($log_file, false);
+ $fileHandler->__construct($log_file, false);
if ($fileHandler->size() > $this->userlog->getConfig('maxlogfilesize')) {
$log_file_name = $this->userlog->getConfig('logfilepath') .'/'. USERLOG_DIRNAME . '/' . $this->userlog->getConfig('logfilename');
$old_file = $log_file_name ."_".date('Y-m-d_H-i-s') . "." . $this->userlog->logext;
@@ -267,7 +267,7 @@
}
// force to create file if not exist
if(!$fileHandler->exists()) {
- if(!$fileHandler->XoopsFileHandler($log_file, true)) { // create file and folder
+ if(!$fileHandler->__construct($log_file, true)) { // create file and folder
// Errors Warning: mkdir() [function.mkdir]: Permission denied in file /class/file/folder.php line 529
$this->setErrors("Cannot create folder/file ({$log_file})");
return false;
@@ -317,10 +317,10 @@
$csvFile = $this->userlog->getConfig("logfilepath") . "/" . USERLOG_DIRNAME . "/export/csv/" . $csvNamePrefix . "_" . date('Y-m-d_H-i-s') . ".csv";
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- $fileHandler->XoopsFileHandler($csvFile, false);
+ $fileHandler->__construct($csvFile, false);
// force to create file if not exist
if(!$fileHandler->exists()) {
- $fileHandler->XoopsFileHandler($csvFile, true); // create file and folder
+ $fileHandler->__construct($csvFile, true); // create file and folder
$this->setErrors("File was not exist create file ({$csvFile})");
}
if ($fileHandler->open("a") == false) {
@@ -474,12 +474,12 @@
// file create/open/write
$fileHandler = XoopsFile::getHandler();
- $fileHandler->XoopsFileHandler($mergeFile, false); //to see if file exist
+ $fileHandler->__construct($mergeFile, false); //to see if file exist
if($fileHandler->exists()) {
$this->setErrors("file ({$mergeFile}) is exist");
return false;
}
- $fileHandler->XoopsFileHandler($mergeFile, true); // create file and folder
+ $fileHandler->__construct($mergeFile, true); // create file and folder
if ($fileHandler->open("a") == false) {
$this->setErrors("Cannot open file ({$mergeFile})");
return false;
@@ -499,7 +499,7 @@
// file open/read
$fileHandler = XoopsFile::getHandler();
// not create file if not exist
- $fileHandler->XoopsFileHandler($log_file, false);
+ $fileHandler->__construct($log_file, false);
if (!$fileHandler->exists()) {
$this->setErrors("Cannot open file ({$log_file})");
return array();
@@ -524,7 +524,7 @@
// file open/read
$fileHandler = XoopsFile::getHandler();
foreach($log_files as $file) {
- $fileHandler->XoopsFileHandler($file, false);
+ $fileHandler->__construct($file, false);
if (!$fileHandler->exists()) {
$this->setErrors("({$file}) is a folder or is not exist");
continue;
@@ -546,7 +546,7 @@
}
// check if file exist
$fileHandler = XoopsFile::getHandler();
- $fileHandler->XoopsFileHandler($log_file, false);
+ $fileHandler->__construct($log_file, false);
if (!$fileHandler->exists()) {
$this->setErrors("({$log_file}) is a folder or is not exist");
return false;
@@ -558,7 +558,7 @@
}
$newFile = dirname($log_file) . "/" . $newFileName . "." . $this->userlog->logext;
// check if new file exist => return false
- $fileHandler->XoopsFileHandler($newFile, false);
+ $fileHandler->__construct($newFile, false);
if ($fileHandler->exists()) {
$this->setErrors("({$newFile}) is exist");
return false;
@@ -578,7 +578,7 @@
}
// check if file exist
$fileHandler = XoopsFile::getHandler();
- $fileHandler->XoopsFileHandler($log_file, false);
+ $fileHandler->__construct($log_file, false);
if (!$fileHandler->exists()) {
$this->setErrors("({$log_file}) is a folder or is not exist");
return false;
@@ -590,7 +590,7 @@
}
$newFile = dirname($log_file) . "/" . $newFileName . "." . $this->userlog->logext;
// check if new file exist => return false
- $fileHandler->XoopsFileHandler($newFile, false);
+ $fileHandler->__construct($newFile, false);
if ($fileHandler->exists()) {
$this->setErrors("({$newFile}) is exist");
return false;
@@ -625,7 +625,7 @@
// file open/read
$fileHandler = XoopsFile::getHandler();
foreach($log_files as $key=>$file) {
- $fileHandler->XoopsFileHandler($file, false);
+ $fileHandler->__construct($file, false);
if (!$fileHandler->exists()) {
$this->setErrors("({$file}) is a folder or is not exist");
unset($log_files[$key]);
Modified: XoopsModules/userlog/trunk/userlog/docs/changelog.txt
===================================================================
--- XoopsModules/userlog/trunk/userlog/docs/changelog.txt 2013-04-17 07:11:29 UTC (rev 11392)
+++ XoopsModules/userlog/trunk/userlog/docs/changelog.txt 2013-04-17 09:26:16 UTC (rev 11393)
@@ -2,6 +2,8 @@
Changelog:
VERSION 1.01:
+- improve: add missing configcat in xoops_version.php to be more compatible with xoops26 in xoops_version.php and language/LANG/modinfo.php (2013/04/17)
+- improve: replace all '->XoopsFileHandler' with '->__construct' to be more compatible with xoops26 in class/log.php(2013/04/17)
- change version to 1.01 Final (2013/04/17)
- fix and improve: add eventCoreIncludeFunctionsRedirectheader to log redirects because usually prorammers use exit() after redirect_header function. in include/log.php and preloads/core.php(2013/04/17)
- fix: empty smarty variables cause some errors in templates. in admin/logs.php (2013/04/16)
Modified: XoopsModules/userlog/trunk/userlog/docs/lang_diff.txt
===================================================================
--- XoopsModules/userlog/trunk/userlog/docs/lang_diff.txt 2013-04-17 07:11:29 UTC (rev 11392)
+++ XoopsModules/userlog/trunk/userlog/docs/lang_diff.txt 2013-04-17 09:26:16 UTC (rev 11393)
@@ -11,4 +11,20 @@
add:
define("_AM_USERLOG_CONFIG_CHMOD_ERROR","Could not create any folder inside '%1\$s' because its chmod is under %2\$d.");
-define("_AM_USERLOG_CONFIG_CREATE_FOLDER","If you need to store logs in file, you should create folder '%1\$s' and set chmod = %2\$d manually using Cpanel.");
\ No newline at end of file
+define("_AM_USERLOG_CONFIG_CREATE_FOLDER","If you need to store logs in file, you should create folder '%1\$s' and set chmod = %2\$d manually using Cpanel.");
+
+modinfo.php
+----------
+edit:
+// config categories
+define("_MI_USERLOG_CONFCAT_LOGFILE","Log file settings");
+define("_MI_USERLOG_CONFCAT_LOGFILE_DSC","Log file (Set it if you need to store logs in a file, otherwise ignore it)");
+define("_MI_USERLOG_CONFCAT_FORMAT","Format");
+define("_MI_USERLOG_CONFCAT_FORMAT_DSC","Format settings");
+define("_MI_USERLOG_CONFCAT_PAGENAV","Page navigation");
+define("_MI_USERLOG_CONFCAT_PAGENAV_DSC","Page navigation settings");
+define("_MI_USERLOG_CONFCAT_LOGDB","Log database settings");
+define("_MI_USERLOG_CONFCAT_LOGDB_DSC","Log database (Set it if you need to store logs in database, otherwise ignore it)");
+define("_MI_USERLOG_CONFCAT_PROB","Probability settings");
+define("_MI_USERLOG_CONFCAT_PROB_DSC","Probability to work on database.(These default numbers are recommended for a high traffic website. e.g.: more than 30,000 hits per day)");
+
Modified: XoopsModules/userlog/trunk/userlog/docs/readme.txt
===================================================================
--- XoopsModules/userlog/trunk/userlog/docs/readme.txt 2013-04-17 07:11:29 UTC (rev 11392)
+++ XoopsModules/userlog/trunk/userlog/docs/readme.txt 2013-04-17 09:26:16 UTC (rev 11393)
@@ -4,15 +4,33 @@
=========================
XOOPS 2.5.5 php 5.3 mysql 5.0
+To Install
+=========================
+1- upload the userlog to /modules/userlog (upload the compressed file and decompressed via Cpanel is the best way to insure all files are correctly uploaded)
+2- go to your admin -> system -> modules -> install
+3- change the default settings to your desired in the module preferences.
+
+Important notice: There is a new "ADDITIONAL permission in file for webmasters" addon introduced in userlog module.
+if you want other webmasters dont have access to userlog module this addon is for you.
+for more information go to userlog/admin/addon/perm.php
+If you dont need this addon you just need to remove addon/perm.php
+
Features:
=========================
- Log user activities and navigations.
Examples:
1- The possibility to list all the IPs used from a certain user, and conversely to list all the users logged from a defined IP to find duplicate users.
2- Find deleted items from your database.
+ modules/userlog/admin/logs.php?options[referer]=del&options[request_method]=POST
3- Find admin user activities(webmasters, moderators, ...)
+ modules/userlog/admin/logs.php?options[admin]=1
4- Find users who come to your site from Google.
-
+ modules/userlog/admin/logs.php?options[referer]=google.com
+ 5- Find all updated modules: (change op=update to op=install or op=uninstall to see install and uninstall activities)
+ modules/userlog/admin/logs.php?options[referer]=op=update&options[module]=system&options[request_method]=POST
+ 6- Find all errors/notices/warnings.
+ modules/userlog/admin/logs.php?options[logger]=errno
+
- Can log users by getting User ID, User group or visitor IP.
- Logs can be stored in file, database or both.
- Any below user information and/or page data can be selected to be logged.
@@ -33,19 +51,8 @@
- Can be used as a backup/restore tool.
- Used JSON format to store arrays to database for better performance (instead of xoops core serialize).
-
-To Install
+Known bugs/malfunctioning:
=========================
-1- upload the userlog to /modules/userlog (upload the compressed file and decompressed via Cpanel is the best way to insure all files are correctly uploaded)
-2- go to your admin -> system -> modules -> install
-3- change the default settings to your desired in the module preferences.
-
-Important notice: There is a new "ADDITIONAL permission in file for webmasters" addon introduced in userlog module.
-if you want other webmasters dont have access to userlog module this addon is for you.
-for more information go to userlog/admin/addon/perm.php
-If you dont need this addon you just need to remove addon/perm.php
-
-known bugs/malfunctioning in userlog module:
1- userlog will not work in XOOPS255/index.php (homepage) when no module is set for start page.
there is a bug in XOOPS255/header.php
solution:
Modified: XoopsModules/userlog/trunk/userlog/language/english/modinfo.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/language/english/modinfo.php 2013-04-17 07:11:29 UTC (rev 11392)
+++ XoopsModules/userlog/trunk/userlog/language/english/modinfo.php 2013-04-17 09:26:16 UTC (rev 11393)
@@ -33,16 +33,17 @@
define("_MI_USERLOG_IDLE","Idle");
// config categories
-define("_MI_USERLOG_CONFCAT_LOGFILE","Log file (Set it if you need to store logs in a file, otherwise ignore it)");
-define("_MI_USERLOG_CONFCAT_LOGFILE_DSC","Preferences for Log file");
+define("_MI_USERLOG_CONFCAT_LOGFILE","Log file settings");
+define("_MI_USERLOG_CONFCAT_LOGFILE_DSC","Log file (Set it if you need to store logs in a file, otherwise ignore it)");
define("_MI_USERLOG_CONFCAT_FORMAT","Format");
-define("_MI_USERLOG_CONFCAT_FORMAT_DSC","Preferences for format");
+define("_MI_USERLOG_CONFCAT_FORMAT_DSC","Format settings");
define("_MI_USERLOG_CONFCAT_PAGENAV","Page navigation");
-define("_MI_USERLOG_CONFCAT_PAGENAV_DSC","Preferences for page navigation");
-define("_MI_USERLOG_CONFCAT_LOGDB","Log database (Set it if you need to store logs in database, otherwise ignore it)");
-define("_MI_USERLOG_CONFCAT_LOGDB_DSC","Preferences for Log database");
-define("_MI_USERLOG_CONFCAT_PROB","Probability to work on database.(These default numbers are recommended for a high traffic website. e.g.: more than 30,000 hits per day)");
-define("_MI_USERLOG_CONFCAT_PROB_DSC","Preferences for Probability");
+define("_MI_USERLOG_CONFCAT_PAGENAV_DSC","Page navigation settings");
+define("_MI_USERLOG_CONFCAT_LOGDB","Log database settings");
+define("_MI_USERLOG_CONFCAT_LOGDB_DSC","Log database (Set it if you need to store logs in database, otherwise ignore it)");
+define("_MI_USERLOG_CONFCAT_PROB","Probability settings");
+define("_MI_USERLOG_CONFCAT_PROB_DSC","Probability to work on database.(These default numbers are recommended for a high traffic website. e.g.: more than 30,000 hits per day)");
+
// config logfile
define("_MI_USERLOG_MAXLOGFILESIZE","Maximum file size for current working Log file (in bytes)");
define("_MI_USERLOG_MAXLOGFILESIZE_DSC","Advise: Set it below 1MB because some servers set limitations for viewing large files in CPanel.");
Modified: XoopsModules/userlog/trunk/userlog/language/persian/modinfo.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/language/persian/modinfo.php 2013-04-17 07:11:29 UTC (rev 11392)
+++ XoopsModules/userlog/trunk/userlog/language/persian/modinfo.php 2013-04-17 09:26:16 UTC (rev 11393)
@@ -33,16 +33,17 @@
define("_MI_USERLOG_IDLE","توقف");
// config categories
-define("_MI_USERLOG_CONFCAT_LOGFILE","ذخیره در فایل (اگر میخواهید ثبت شده ها را در فایل ذخیره کنید تنظیمات زیر را به دلخواه خود تغییر دهید وگرنه اهمیت ندهید)");
-define("_MI_USERLOG_CONFCAT_LOGFILE_DSC","تنظیمات ذخیره در فایل");
+define("_MI_USERLOG_CONFCAT_LOGFILE","تنظیمات ذخیره در فایل");
+define("_MI_USERLOG_CONFCAT_LOGFILE_DSC","ذخیره در فایل (اگر میخواهید ثبت شده ها را در فایل ذخیره کنید تنظیمات زیر را به دلخواه خود تغییر دهید وگرنه اهمیت ندهید)");
define("_MI_USERLOG_CONFCAT_FORMAT","فرمت");
define("_MI_USERLOG_CONFCAT_FORMAT_DSC","تنظیمات فرمت");
define("_MI_USERLOG_CONFCAT_PAGENAV","مرور صفحه");
define("_MI_USERLOG_CONFCAT_PAGENAV_DSC","تنظیمات مرور صفحه");
-define("_MI_USERLOG_CONFCAT_LOGDB","ذخیره در پایگاه داده (اگر میخواهید ثبت شده ها را در پایگاه داده ذخیره کنید تنظیمات زیر را به دلخواه خود تغییر دهید وگرنه اهمیت ندهید)");
-define("_MI_USERLOG_CONFCAT_LOGDB_DSC","تنظیمات ذخیره در پایگاه داده");
-define("_MI_USERLOG_CONFCAT_PROB","احتمال برای دسترسی به پایگاه داده.(این اعداد برای سایت هایی با ترافیک بالا مناسب هستند. مثلا: بیشتر از سی هزار بازدید در روز)");
-define("_MI_USERLOG_CONFCAT_PROB_DSC","تنظیمات برای احتمالات");
+define("_MI_USERLOG_CONFCAT_LOGDB","تنظیمات ذخیره در پایگاه داده");
+define("_MI_USERLOG_CONFCAT_LOGDB_DSC","ذخیره در پایگاه داده (اگر میخواهید ثبت شده ها را در پایگاه داده ذخیره کنید تنظیمات زیر را به دلخواه خود تغییر دهید وگرنه اهمیت ندهید)");
+define("_MI_USERLOG_CONFCAT_PROB","تنظیمات برای احتمالات");
+define("_MI_USERLOG_CONFCAT_PROB_DSC","احتمال برای دسترسی به پایگاه داده.(این اعداد برای سایت هایی با ترافیک بالا مناسب هستند. مثلا: بیشتر از سی هزار بازدید در روز)");
+
// config logfile
define("_MI_USERLOG_MAXLOGFILESIZE","بیشترین اندازه فایل در حال کار (به بایت)");
define("_MI_USERLOG_MAXLOGFILESIZE_DSC","توصیه: روی کمتر از یک مگابایت بگذارید تا بتوانید از هر جایی مثلا از سی پنل مستقیم فایل ها را بخوانید.");
Modified: XoopsModules/userlog/trunk/userlog/xoops_version.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/xoops_version.php 2013-04-17 07:11:29 UTC (rev 11392)
+++ XoopsModules/userlog/trunk/userlog/xoops_version.php 2013-04-17 09:26:16 UTC (rev 11393)
@@ -117,6 +117,14 @@
// Config categories
$modversion['configcat']['logfile']['name'] = _MI_USERLOG_CONFCAT_LOGFILE;
$modversion['configcat']['logfile']['description'] = _MI_USERLOG_CONFCAT_LOGFILE_DSC;
+$modversion['configcat']['format']['name'] = _MI_USERLOG_CONFCAT_FORMAT;
+$modversion['configcat']['format']['description'] = _MI_USERLOG_CONFCAT_FORMAT_DSC;
+$modversion['configcat']['pagenav']['name'] = _MI_USERLOG_CONFCAT_PAGENAV;
+$modversion['configcat']['pagenav']['description'] = _MI_USERLOG_CONFCAT_PAGENAV_DSC;
+$modversion['configcat']['logdb']['name'] = _MI_USERLOG_CONFCAT_LOGDB;
+$modversion['configcat']['logdb']['description'] = _MI_USERLOG_CONFCAT_LOGDB_DSC;
+$modversion['configcat']['prob']['name'] = _MI_USERLOG_CONFCAT_PROB;
+$modversion['configcat']['prob']['description'] = _MI_USERLOG_CONFCAT_PROB_DSC;
// Config Settings (only for modules that need config settings generated automatically)
################### Log file ####################
@@ -131,11 +139,12 @@
$i++;
$modversion['config'][$i]['name'] = 'logfile';
-$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_LOGFILE';
-$modversion['config'][$i]['description'] = '_MI_USERLOG_CONFCAT_LOGFILE_DSC';
+$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_LOGFILE_DSC';
+$modversion['config'][$i]['description'] = '';
$modversion['config'][$i]['formtype'] = 'line_break';
$modversion['config'][$i]['valuetype'] = 'textbox';
$modversion['config'][$i]['default'] = 'odd';
+$modversion['config'][$i]['category'] = 'logfile';
$i++;
$modversion['config'][$i]['name'] = 'maxlogfilesize';
@@ -167,11 +176,12 @@
$i++;
$modversion['config'][$i]['name'] = 'format';
-$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_FORMAT';
-$modversion['config'][$i]['description'] = '_MI_USERLOG_CONFCAT_FORMAT_DSC';
+$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_FORMAT_DSC';
+$modversion['config'][$i]['description'] = '';
$modversion['config'][$i]['formtype'] = 'line_break';
$modversion['config'][$i]['valuetype'] = 'textbox';
$modversion['config'][$i]['default'] = 'even';
+$modversion['config'][$i]['category'] = 'format';
$i++;
$modversion['config'][$i]['name'] = 'format_date';
@@ -184,11 +194,12 @@
$i++;
$modversion['config'][$i]['name'] = 'pagenav';
-$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_PAGENAV';
-$modversion['config'][$i]['description'] = '_MI_USERLOG_CONFCAT_PAGENAV_DSC';
+$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_PAGENAV_DSC';
+$modversion['config'][$i]['description'] = '';
$modversion['config'][$i]['formtype'] = 'line_break';
$modversion['config'][$i]['valuetype'] = 'textbox';
$modversion['config'][$i]['default'] = 'odd';
+$modversion['config'][$i]['category'] = 'pagenav';
$i++;
$modversion['config'][$i]['name'] = 'sets_perpage';
@@ -230,11 +241,12 @@
$i++;
$modversion['config'][$i]['name'] = 'logdb';
-$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_LOGDB';
-$modversion['config'][$i]['description'] = '_MI_USERLOG_CONFCAT_LOGDB_DSC';
+$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_LOGDB_DSC';
+$modversion['config'][$i]['description'] = '';
$modversion['config'][$i]['formtype'] = 'line_break';
$modversion['config'][$i]['valuetype'] = 'textbox';
$modversion['config'][$i]['default'] = 'even';
+$modversion['config'][$i]['category'] = 'logdb';
$i++;
$modversion['config'][$i]['name'] = 'maxlogs';
@@ -256,11 +268,12 @@
$i++;
$modversion['config'][$i]['name'] = 'prob';
-$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_PROB';
-$modversion['config'][$i]['description'] = '_MI_USERLOG_CONFCAT_PROB_DSC';
+$modversion['config'][$i]['title'] = '_MI_USERLOG_CONFCAT_PROB_DSC';
+$modversion['config'][$i]['description'] = '';
$modversion['config'][$i]['formtype'] = 'line_break';
$modversion['config'][$i]['valuetype'] = 'textbox';
$modversion['config'][$i]['default'] = 'odd';
+$modversion['config'][$i]['category'] = 'prob';
$i++;
$modversion['config'][$i]['name'] = 'probset';
|