11
Cesagonchu
Re: Userlog: a new module to log user activities

Transifex : Userlog 1.0 Alpha 1 (language files for translators).

Sourceforge : Userlog 1.0 Alpha 1.

I'll do the French translation

12
Cesagonchu
Re: Userlog: a new module to log user activities

userlog\language\english\modinfo.php

1 - foget -> forget

replace:
define("_MI_USERLOG_CONFCAT_LOGFILE","Log file (Set if you need to store logs in file otherwise foget it)");

with:
define("_MI_USERLOG_CONFCAT_LOGFILE","Log file (Set if you need to store logs in file otherwise forget it)");



replace:
define("_MI_USERLOG_CONFCAT_LOGDB","Log database (Set if you need to store logs in database otherwise foget it)");

with:
define("_MI_USERLOG_CONFCAT_LOGDB","Log database (Set if you need to store logs in database otherwise forget it)");



2 - wwwroot -> www root

replace:
define("_MI_USERLOG_LOGFILEPATH_DSC","Advise: a path outside wwwroot is safe from browsing by everybody");

with:
define("_MI_USERLOG_LOGFILEPATH_DSC","Advise: a path outside www root is safe from browsing by everybody");



3 - . -> :

replace:
define("_MI_USERLOG_LOGFILENAME_DSC","Older log files will be stored with this prefix. Log_file_name_date('Y-m-d_H-i-s').log");

with:
define("_MI_USERLOG_LOGFILENAME_DSC","Older log files will be stored with this prefix: Log_file_name_date('Y-m-d_H-i-s').log");



4 - db -> database

replace:
define("_MI_USERLOG_MAXLOGS","Maximum logs stored in db");

with:
define("_MI_USERLOG_MAXLOGS","Maximum logs stored in database");



replace:
define("_MI_USERLOG_MAXLOGS_DSC","logs will be deleted from db after this number");

with:
define("_MI_USERLOG_MAXLOGS_DSC","logs will be deleted from database after this number");



replace:
define("_MI_USERLOG_MAXLOGSPERIOD","Maximum period that logs stored in db. 0 = store forever");

with:
define("_MI_USERLOG_MAXLOGSPERIOD","Maximum period that logs stored in database. 0 = store forever");



5 - advise -> Advice

replace:
define("_MI_USERLOG_MAXLOGSPERIOD_DSC","logs older than this period will be deleted from database. Positive for days and negative for hours. advise: use a high number");

with:
define("_MI_USERLOG_MAXLOGSPERIOD_DSC","logs older than this period will be deleted from database. Positive for days and negative for hours. Advice: use a high number");




userlog\language\english\admin.php

1 - isAdmin? -> is Administrator?

replace:
define("_AM_USERLOG_ADMIN","isAdmin?(y/n)");

with:
define("_AM_USERLOG_ADMIN","is Administrator?(y/n)");



2 -
Log user activities by fetchingpriority: IF exist uid log it ELSEIF exist gid log it ELSEIf exist ip log it

---> I don't understand


3 -
Log which user/page dataNoteno option means all optionsno store option (File and/or Databasemeans Databaseselect views means store uidgroupsscript namepagetitlemoduleitem nameitem id in Database

---> I don't understand.
---> Please, put a capital letter after a point


4 - ? select -> ? Select

replace:
define("_AM_USERLOG_SET_SCOPE_DSC","Log users activities in which modules? select nothing means whole website");

with:
define("_AM_USERLOG_SET_SCOPE_DSC","Log users activities in which modules? Select nothing means whole website");



I will continue tomorrow

13
irmtfan
Re: Userlog: a new module to log user activities
  • 2013/2/28 3:30

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


@MikeShane:
I remove that download in xoops.ir forums because it was outdated.
always use the latest SVN trunk
http://svn.code.sf.net/p/xoops/svn/XoopsModules/userlog/trunk/

so you will be sure you have the latest version.(now it is rev.11120)

@Cesag :
Quote:

I'll do the French translation

you are amazing! I even didnt add my native persian language because many parts of this module are costantly changing and i dont want to waste time to change in 2 languages.

please do me a favor and commit the typos yourself. It will help a lot and save our limited times.

If something was wrong we can correct it.

Quote:

wwwroot -> www root

wwwroot is correct. see:
http://answers.yahoo.com/question/index?qid=20080716094956AAUTPbz

Quote:

1 - isAdmin? -> is Administrator?


is Admin is correct. i revise DSC definition like this.
define("_AM_USERLOG_ADMIN_DSC","true if user is admin in all or any section of your website that have been logged. eg: webmasters, moderator in forums");


so it is not just webmaster. the beuty of xoops core is it can show us the user is admin in any single page (eg one forum) that have the right to do something like delete, edit, ...

so in logs you can filter logs to only see all admin activities.

I updated the SVN with your corrections.

@Mamba:
Quote:

The order will stay the same, regardless how many times you click.

Now i understand. it is because i just add sort in the first version to the header. but today i add a complete pagination, sort, order to the haeder.
please report me any issue because i cannot see any more issue.
Also a reset button will be good for the future.

Edit:
i forget to inform you about a known issue in core which stop userlog from loggin in XOOPS255/index.php (homepage) when no module is set for start page.

there is a bug in XOOPS255/header.php
exit() should be commented there
$xoopsPreload->triggerEvent('core.header.checkcache');
    if (
$xoTheme->checkCache()) {
        
$xoopsPreload->triggerEvent('core.header.cacheend');
        
//exit();
    
}

I will send this bug later today.
xoops 2.6 has not this issue.

Also another advise: it is better to dont log the navigation in userlog module itself. it will confuse you! it is good for test purposes but in real environment you may only want to log yourself activities


14
Mamba
Re: Userlog: a new module to log user activities
  • 2013/3/1 4:22

  • Mamba

  • Moderator

  • Posts: 11256

  • Since: 2004/4/23


Quote:
but today i add a complete pagination, sort, order to the header.

That's fantastic! It works now very well.

The only thing that I would add is to save the pagination to Preferences:

Right now it is hard coded for 100, and every time I change it in the table view, when I come back, it's back to 100.

Otherwise, AWESOME job!

And as always - you're listening to your customers, and for that I really would like to commend you!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

15
irmtfan
Re: Userlog: a new module to log user activities
  • 2013/3/2 2:54

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:

The only thing that I would add is to save the pagination to Preferences

huum. it is there or maybe i misunderstood you once more!

16
Mamba
Re: Userlog: a new module to log user activities
  • 2013/3/2 7:40

  • Mamba

  • Moderator

  • Posts: 11256

  • Since: 2004/4/23


Quote:
huum. it is there or maybe i misunderstood you once more!

It is there, but if you change it directly in the logs page (e.g. to 25), the new value is not being saved in Preferences (so if it was 100, it will stay still 100). So if I want to have permanently 25, I have to go to Preferences and change it there.

Do you think, it's better to keep "persistent" values in the Preferences, and let the user change the values on the page only temporarily? Or should we save the value permanently each time the user changes it?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

17
irmtfan
Re: Userlog: a new module to log user activities
  • 2013/3/2 13:03

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


the number per page in all forms in all modules directly come from $_GET OR $_POST (based on the form method.
eg in userlog it is $_GET["limitentry"]

so you can change it manually like this typical link.
xoops255/modules/userlog/admin/logs.php?limitentry=167

if $_GET["limitentry"] is not set in the URL some developers offered a default value.

This default value should be in preferences of module otherwise it will be too confusing.
e.g.: if the form in logs.php page change the default limitentry everytime you come to logs.php page you will see another number.

The webmaster can set that number to what he likes.

Today i have a challenge with the special permission needed for this kind of modules.
As you may guess one of the most important purposes for userlog module is logging webmasters activities.
But I need to limit all webmasters access to userlog module because i want to control it just myself(the webmaster with full access to root)

So i end up with a file permission.

I add something like this as an addon to userlog:
modules/userlog/admin/addon/perm.php

<?php
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code
 which is considered copyrighted (c) material of the original comment or credit authors.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
 *  userlog module
 *
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @package         userlog admin
 * @subpackage      addon
 * @since           1
 * @author          irmtfan (irmtfan@yahoo.com)
 * @author          The XOOPS Project <www.xoops.org> <www.xoops.ir>
 * @version         $Id: perm.php 1 2013-02-26 16:25:04Z irmtfan $
 */
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
// Here you can set ADDITIONAL permission in file for webmasters in your website, ONLY if you want to limit the access to userlog module to some of them.

// Webmasters that dont have access cannot:
// 1- go to the userllog/admin
// 2- go to the userlog preferences
// 3- installl, uninstall or update userlog
// 4- dump any table in system -> maintenance -> dump

// empty array means nothing.
// if you add uid of webmasters or those users who have admin permissions in userlog module, other admins will not have permission anymore.
$perm["super"]["uid"] = array();
// e.g.: $perm["super"]["user"] = array(1,234,23451); // it means only users with uid=1,234,23451 have access and other webmasters dont have access.
// if you add groups with admin permission in  whole site (webmasters) or admin permission in userlog module, other admin groups dont have permission
// e.g.: $perm["super"]["group"] = array(1,7,9); // it means only groups 1,7,9 have access and other groups dont have access.
$perm["super"]["group"] = array();

return 
$perm;


it is addon so it means you can just add it to the module if you need a webmaster permission from file.

then i add these codes to xoops_version.php

// START add webmaster permission from file to add additional permission check for all webmasters 
global $xoopsOption$xoopsModule;
// effective only in admin side
if ($xoopsOption['pagetype'] == "admin" && is_object($xoopsModule)) {
    
// get dirname
    
$dirname $xoopsModule->getVar('dirname');
    
// START if dirname is system
    
if($dirname == "system" && isset($_REQUEST['fct'])) {
        
$hModule =& xoops_gethandler('module');
        
// if we are in preferences of modules
        
if($_REQUEST['fct'] == "preferences" && isset($_REQUEST['mod'])) {
            
$mod intval($_REQUEST['mod']);
            
$module =& $hModule->get($mod);
            
$dirname $module->getVar('dirname');
        }
        
// if we are in modules admin - can be done with onuninstall and onupdate???
        
if($_REQUEST['fct'] == "modulesadmin" && isset($_REQUEST['module'])) {
            
$dirname $_REQUEST['module'];
        }
        
// if we are in maintenance - now all modules - how to do it for only one module?
        
if($_REQUEST['fct'] == "maintenance") {
            
$dump_modules = isset($_REQUEST['dump_modules']) ? $_REQUEST['dump_modules'] : false;
            
$dump_tables = isset($_REQUEST['dump_tables']) ? $_REQUEST['dump_tables'] : false;
            if (
$dump_tables == true || $dump_modules == true) {
                
$dirname $modversion['dirname'];
            }
        }
    }
    
// END if dirname is system
    
    // now check permission from file
    
if($dirname == $modversion['dirname']) {
        if (
file_exists($permFile XOOPS_ROOT_PATH "/modules/" $modversion['dirname'] . "/admin/addon/perm.php")) {
            
$perm = include $permFile;
            if (
count($perm["super"]["uid"]) > || count($perm["super"]["group"]) > 0) {
                global 
$xoopsUser;
                if (
is_object($xoopsUser) && 
                        !
in_array($xoopsUser->getVar("uid"), $perm["super"]["uid"]) &&
                        
count(array_intersect($xoopsUser->getGroups(),$perm["super"]["group"])) == 0
                    
) {
                    
$modversion['hasAdmin'] = 0;
                    
$modversion['system_menu'] = 0;
                    
$modversion['tables'] = null;
                    
redirect_header(XOOPS_URL "/admin.php"1sprintf(_MI_USERLOG_WEBMASTER_NOPERM,implode(","$perm["super"]["uid"]), implode(","$perm["super"]["group"])) );
                }
            }
        }
    }
}
// END add webmaster permission from file to add additional permission check for all webmasters


It is correctly do its job.

if you add some uids in the "super" permission other uids in webmasters group cannot do anything in the module.

IMO it should be in core too. because sometimes we need a super user/webmaster

18
Cesagonchu
Re: Userlog: a new module to log user activities

In help.html file,

Quote:
Userlog is a node logger which can log your user/visitor activities in your site.


I can not translate this sentence. Can you explain with other words?

19
irmtfan
Re: Userlog: a new module to log user activities
  • 2013/3/4 5:47

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


I describe node like this later in description:
Quote:

Userlog is a node logger which can log your user/visitor activities in your site from a preferred node.
This is a very useful tool for webmasters in busy sites. For example, you can log your other Admins navigation.
Current nodes for logging are: user ID, user group and visitor IP.
You can store logs in a database, in a file or both.


It means when you create a setting by a node it will log all users/visitors have that node_id = unique_id

If you can explain it better please fill free to commit!
Thank you.
today i add these:
Quote:

- add acomplete file browsing engine can accept any file, criteria, pagination, sort,order (2013/03/04)
- use json_encode instead of serialize for better performance. (2013/03/04)

Now it can browse logs from file very well.

Also Xoops core use serialize method for changing arrays to string but i found these interesting articles:
http://phpdevblog.niknovo.com/2009/11 ... xport-vs-json-encode.html

http://www.cw-internetdienste.de/2010/04/serialize-vs-json_encode/

You must uninstall the module and re-install again.

It would be nice If somebody could help and upload some screenshots from this module.

Also it would be very needed if we could test the performance of this module. Now IMO it is very customized.

IMO we are reaching to a beta version. just need to add purge(delete logs), export

IMO XOOPS Core should change this method in 2.6 for better performance

20
Mamba
Re: Userlog: a new module to log user activities
  • 2013/3/4 6:17

  • Mamba

  • Moderator

  • Posts: 11256

  • Since: 2004/4/23


Quote:
It would be nice If somebody could help and upload some screenshots from this module

What screenshots would you like to have? Just standard ones of the logs?

Quote:
Also it would be very needed if we could test the performance of this module.

Well, you could add it to the module itself, i.e. the module could have an option of being active or idle. And then you could collect data to see the difference. Otherwise it would be only a very subjective test - does the Website feels slower when the Userlog is collecting data or not?

Quote:
IMO XOOPS Core should change this method in 2.6 for better performance

You mean, using json_encode instead of serialize?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Login

Who's Online

73 user(s) are online (40 user(s) are browsing Support Forums)


Members: 0


Guests: 73


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits