51
blackrx
Re: Userlog: a new module to log user activities
  • 2013/4/16 13:18

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


Quote:
what php custom pages you meant? are you using a module for creating them or not. are these custom blocks?


it is custom php page not from any module..and i have a custom hit counter with it..thats why maybe the system-root message is displayed

downloaded the latest from svn...

thank you imrtfan....fixed all the problem....no more "Module File for system-root Not Found!" is displayed


Congrats for incoming final release



52
blackrx
Re: Mylinks & thumbshots.com
  • 2013/4/13 5:47

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


thank you zyspec..

simple module but very useful..keep it up...

another suggestion
maybe in future release..will detect if website is not available anymore 404, down etc automatically



53
blackrx
Re: eXtCal 2.37 Beta 4, will this ever get out of beta?
  • 2013/4/13 5:44

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


any fix for the upcoming event block?



54
blackrx
Re: Mylinks & thumbshots.com
  • 2013/4/12 15:49

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


i would like to suggest if this is doable or a good practice

admin can choose to use either own screenshot or external
screenshot site for each link submitted..screenshot is set to same size

eg:

link A use own image
link b use thumbshots
link C use neimui

and so on

maybe some dropdown menu to choose setting



55
blackrx
Re: Mylinks & thumbshots.com
  • 2013/4/12 15:30

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


there is another site can be considered to generate thumbnail

http://capture.heartrails.com/

currently used by XOOPS taiwan module ck2_link

http://xoops.tn.edu.tw/modules/ck2_link/



56
blackrx
Re: Userlog: a new module to log user activities
  • 2013/4/12 14:28

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


thank you again for the explanation imrtfan

the logs by setting works

btw any quick fix for the "Module File for system-root Not Found!"

i just noticed it is also display in all my custom php page since i installed userlog



57
blackrx
Re: Userlog: a new module to log user activities
  • 2013/4/10 12:38

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


Quote:

irmtfan wrote:


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


is this working?

when i go here ...modules/userlog/admin/addon/perm.php

XOOPS root path not defined



58
blackrx
Re: Userlog: a new module to log user activities
  • 2013/4/10 12:01

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


ok i got it tq..still exploring with the module

thanks again...



59
blackrx
Re: Userlog: a new module to log user activities
  • 2013/4/10 10:44

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


Thank you for the detail explanation..imrtfan...great module...keep up the good work

another question/suggestion.....

in the Logs tab.....how to know which setting is the log from

it will be nice if we can custom name the setting and select it from log tab
etc so i will see only log from setting i want to monitor




60
blackrx
Re: Userlog: a new module to log user activities
  • 2013/4/9 11:36

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


i have this message in xoops admin front page after installing userlog

Module File for system-root Not Found!




TopTop
« 1 ... 3 4 5 (6) 7 8 9 ... 20 »



Login

Who's Online

189 user(s) are online (121 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

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

Latest GitHub Commits