View Full Version : Filter User Log
hernanvarela
25-04-05, 05:33 AM
Hi,
When a User clicks con "User Log" tab, he can see all logs, including those from other users. How can this can be filtered? I just want a user to see only their logs, exept for the Admin user, who can see all logs.
Thanks,
Hernan
Hi,
Around line 89 (depends on what is your dP version) of file modules/admin/vw_ur_log.php there is a piece of code that goes like this:
if(user_id != 0) { $q->addWhere("ual.user_id='$user_id'"); }
this is wrong, notice the "if(user_id...", this isn't pointing to the $user_id variable and it should.
So dP was almost doing the user filtering, but it isn't so as you might have guessed, the line should be:
if($user_id != 0) { $q->addWhere("ual.user_id='$user_id'"); }
So only thing lacking was the $ (hey, can I have some too?)
By now the system should do the user filtering, and only show the log of each user.
Now the administrative approach. For that you will need to check permissions,
and this can be done by changing that line I spoke before to 2 lines:
$perms =& $AppUI->acl();
if($user_id != 0 && !$perms->checkModule("admin", "access")) { $q->addWhere("ual.user_id='$user_id'"); }
With these 2 lines, only an identified user with access to the admin module can see all users logs (just like it was working before). Any other user will only see their respective logs.
Pedro A.
ajdonnison
02-05-05, 08:16 PM
As usual pedroa is right on the money :) I've made this change in the CVS.
hernanvarela
04-05-05, 05:29 AM
Thanks Pedroa, excellet description and solution!
temakela
27-07-05, 10:00 PM
Thanks! I found this bug very annoying and problematic because I do not want different customer to see each others log in times or even names. There are still some problems with reporting period, obviously at least part of them has been fixed in CVS. However, this is enough for me. I'm evaluating dP. It's functionality is the best that I was able find from OS project management products but it requires fixes like this. Hopefully new stable releases will be available soon.
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.