PDA

View Full Version : Administrative and Maintenance Tools - Private Messages & Email Log


Vitaly
06-24-2010, 10:00 PM
Port of vb.3.8 version (https://vborg.vbsupport.ru/showthread.php?t=204562)

Features:
Log all PM and Emails, sent via forum forms.
Keep logs in separate table with automatic rotation of old records.
Add new menu items in topics and profiles for fast access.
Have nice dynamic menus in search results for cross-searches
Managed access for administrators (except superadmins)How to install
Upload files to your server
Import product xml
Go to ACP
Select required settings in ?Vbulletin options → Private Message Log?
Set access ?Can view PM logs? to necessary members in ?Usergroups → Administator Permissions?. Super administrators can be skipped.Notes:

This mod uses full scan for text searches, that can affect SQL-server load at really big boards. Fulltext indexes are not used intentionally, because whose can't produce sharp results and not compatible with innodb. I suppose, that if you really need this mod, you know exactly, what are you doing and what are you going to search. In my practice, ONLY exact matches were useful.

One of tradeoff to reduce SQL-server load ? make log size shorter (1-2 months instead of 6). When vB 4.0 provides refactored search framework, search method can be rewritten.

If you install this mod on your server, i recommend to clarify forum rules, and add text, that your project doesn't provide the ways of confidential communication ? only public and non public.

This mod is developped here http://github.com/rcdesign/vb-pm_log . Patches are welcome.

history

3.1
- fixed specialchars in SQL search request. Thanks to mplode

3.0
- refactoring + some fixes
- separate fields for nick & text in search form

2.5
- ported to vb4
...

2.2
- Redesigned database to improve search/paging in some cases
- Should fix conflicts with other mods, that where reported in this threads
- Sources repo is now @ github

... (not public)

1.9
- Ups... another broken link (from message list to user profiles)
- Fixed access for non superadmins, who had "Read PM Log" privilegies.

1.8
- fixed broken link in ACP popup menu
- workaround to show smiles and bbcodes

1.7
- fixed some sql-error

1.6
- first public release

Alphaforums.com
06-25-2010, 06:43 AM
Great, another way to incarnate Big Brother onto my boards. Just kidding, nice work :D

goran424
06-25-2010, 07:15 AM
This allows admin to read other member PM's too?

Vitaly
06-25-2010, 07:24 AM
This allows admin to read other member PM's too?
guess

Xencored
08-14-2010, 12:02 AM
guess
hehe :)

Thanks mate installed :)
Am flicking tho your mods you have some good ones ive not seen :D

onehost
08-17-2010, 05:17 AM
very cool. I recommend a delete option beside each log in any event we
want to delete as we go..of course I can not catch all of them, but
if there are ones we can toss, we should be able to delete them.

would also like to see an email option to send a daily PM report
to admin on a daily basis' of course with option to disable.

Vitaly
08-17-2010, 05:32 AM
IMHO, partial deleting conflicts with log concept. Log should be cleared only on time basis, when outdated. Such option already exists.

I'd better spend time for more useful things. Search filters can be improved, and need my care.

Lone Gunman
08-17-2010, 06:55 AM
you can read pms without this mod, too. this just makes it easier. go into your mysql database manager and view the private message tables. some spammers dont post the spam, they pm it. this mod can be useful for investigating pm spam. great work vitaly!

donal
08-21-2010, 02:29 AM
This gives me log of PM only. What about email logs?

Vitaly
08-21-2010, 02:43 AM
Will check later, what's up with emails.

sapphiremagus
08-21-2010, 04:16 AM
getting error

Warning: Invalid argument supplied for foreach() in [path]/admincp/rcd_pm_log.php on line 312

This error occurs for me when doing a text search.

User searches do not show errors, but also do not return results. I have tested on members (such as myself) whom I know have PMs stored.

Vitaly
08-21-2010, 04:30 AM
Have you uploaded files to server or just imported XML?

ozmazdaclub
08-21-2010, 04:49 AM
same issue and i have confirmed files have been uploaded correctly.

sapphiremagus
08-21-2010, 02:58 PM
Have you uploaded files to server or just imported XML?

I uploaded the files, and just for good measure re-uploaded them. I copied the admincp and includes folder to my root directory, merging them with the current folders of the same name.

DAMINK
08-21-2010, 10:36 PM
Confirm the error here too.
Warning: Invalid argument supplied for foreach() in [path]/ADMIN LOCATION REMOVED/rcd_pm_log.php on line 312

Ersin07
08-23-2010, 08:13 AM
Great share..Thanks..

Vitaly
08-23-2010, 09:05 AM
getting error

Warning: Invalid argument supplied for foreach() in [path]/admincp/rcd_pm_log.php on line 312

I think, you have not uploaded file from new mod version. Current file has only 248 strings, and can't generate such error.

speedylifestyle
08-24-2010, 10:34 PM
are you guys that are getting this error message putting a username and clicking text, because this seems to be the only way i get that error message

donal
08-25-2010, 11:42 AM
Working perfectly. Thanks for the great share.

ImmortalForums
08-27-2010, 03:41 PM
This mod breaks all links to PM's. This includes ones from emails and if you have any sort of feed that notifies you of PM's the links are invalid.

ppatil007
08-27-2010, 05:44 PM
I think, you have not uploaded file from new mod version. Current file has only 248 strings, and can't generate such error.

I have downloaded "vb-pm_log-2.5.zip (12.0 KB, 148 downloads)"

and tried doing the entire process 4 times i still get same issue

when i do search with user name nothing happens and when i do it for text i get

Warning: Invalid argument supplied for foreach() in [path]/admincp/rcd_pm_log.php on line 312

i think i have used the current version , probably sothing wrong with your code or you may have put the wrong file by mistake

baggo
08-29-2010, 10:55 AM
I experienced the same error when searching for a blank entry in the text option. However, after sending a test PM and searching again the error stops and the PM show up. I'm assuming the mod only records PM's made AFTER the install? Seems to be working fine for me if so.

Vitaly
08-29-2010, 11:08 AM
ppatil007: Have you given permission for admin to read PMs, as described in installation steps?

baggo: Yes, it logs pms, sent after installation. In separate table. That guarantees, that logs are intact even if members clear their mailboxes. I had no chance to test it with completely clear log. Will check it later, since bug is not critical. Thank you for report.

sapphiremagus
08-29-2010, 03:41 PM
Working for me - the error is likely that no one had sent PMs after the install, heh. Once PMs started to be sent, it worked fine. Marking installed, thanks :)

pportuese
08-31-2010, 07:04 PM
Just installed this, copied all the files over and installed with the xbl plugin. I get this on a text search:
Warning: Invalid argument supplied for foreach() in [path]/admincp/rcd_pm_log.php on line 312

And on a user search nothing shows up. Like none of my users have private messages. I know I do and I tried it, still nothing.

I also don't understand the last step. I can't find where you give people permission to see the log pm's.

BTW I have 4.0.5 if that matters.

EDIT: I found the set access part and it only says yes or no for Admins. I set myself to yes and when I search still nothing shows up.

sapphiremagus
09-01-2010, 05:34 AM
Just installed this, copied all the files over and installed with the xbl plugin. I get this on a text search:
Warning: Invalid argument supplied for foreach() in [path]/admincp/rcd_pm_log.php on line 312

And on a user search nothing shows up. Like none of my users have private messages. I know I do and I tried it, still nothing.

I also don't understand the last step. I can't find where you give people permission to see the log pm's.

BTW I have 4.0.5 if that matters.


EDIT: I found the set access part and it only says yes or no for Admins. I set myself to yes and when I search still nothing shows up.

This looks similar to the issues I was having. The problem is that the log doesn't work retroactively - only PMs sent after the install are logged. Once my users started PMing the error went away and there were logs to go through.

The error itself gives a clue - foreach is a loop. It's trying to loop through all the logs but isn't finding any (and probably is getting a null reference, hence the error instead of dying gracefully).

pportuese
09-01-2010, 12:58 PM
This looks similar to the issues I was having. The problem is that the log doesn't work retroactively - only PMs sent after the install are logged.


That explains a lot right there. Is there anyway to make it go back and get the rest of the PM's?

And can you only see these if they are in the users inbox? I don't want to save lots of copies of PM's and waste diskspace that could be used elsewhere.
Thanks!!!

Matt51723
10-17-2010, 05:41 PM
No problems with errors on my site, however I've added permission for myself to use this feature in admin permissions , but when i go to PM Logs, nothing shows up.

scottct1
10-20-2010, 02:19 PM
I just installed it but do not see Private Message Log under settings > Options...

On vBulletin 4.07.

PM log however is shown under users.

Vitaly
10-20-2010, 03:03 PM
Hm... no ideas, really. I'll publish refactored code in 1-2 weeks. Let's wait a bit

Harley D
11-05-2010, 04:51 PM
I get this error when searching using the TEXT option:
Warning: Invalid argument supplied for foreach() in [path]/admincp/rcd_pm_log.php on line 312

VB 4.08

BiZiMDiYaR
11-18-2010, 01:12 AM
Hi,

Is there an option to delete the PM's that are in the separate table at this moment. This would decrease the size of the DB a lot I assume.
I think, would be great to have an option to delete all PM's & emails ( not of the users, just the ones in the seperate table ).
Also when un-installing this mod, this option to delete all other data, should also been shown, so there is nothing left behind and have a nice cleanup of the DB ;).

Thanks.

Vitaly
11-18-2010, 01:22 AM
This mod have setting, how long to keep logs. I guess, that's enougth.

scottct1
11-24-2010, 01:39 PM
Is there any way to cache the rcd_log_pm_link template?

davidg
11-27-2010, 08:07 PM
working fine with 4.0.8
is very god addon

MaemoMeeGo
12-01-2010, 01:13 PM
This is great! Works well on v4.0.8!

SouthEastSxS
12-01-2010, 03:51 PM
Here is a funny one. I just looked at the log and it show me replying to a PM but does not show the PM that was sent to me by the user?

Any ideas?

SouthEastSxS
12-06-2010, 02:27 AM
Ok so for me this mod doesn't really work well. The log doesn't display message the registered user group send between themselves.

So, registered user to admin = logged
Admin to registered user = logged

registered user to registered user = nothing in log.

Can anyone shed any light on this. It's a great hack and helps you to understand if other forum owners are trying to poach your members however if I won't show PM's between anyon without elevated permission it makes it a little redundant.

Would love this to work properly.

Thanks

TimesOut
01-07-2011, 08:03 AM
Hi,

I installed and it was work fine but now I get this error:
Warning: require_once([path]/includes/functions_rcd_pm_log.php) [function.require-once]: failed to open stream: No such file or directory in [path]/includes/class_bootstrap.php(1280) : eval()'d code on line 223

My forum now is not work and I tried to disable the plugins for config file but it's not work

Britmovie
01-07-2011, 11:56 AM
I get

=============================================
Warning: require_once([path]/includes/functions_rcd_pm_log.php) [function.require-once]: failed to open stream: No such file or directory in [path]/member.php(609) : eval()'d code on line 7

Fatal error: require_once() [function.require]: Failed opening required '/home/cariad00/public_html/britforum/includes/functions_rcd_pm_log.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/cariad00/public_html/britforum/member.php(609) : eval()'d code on line 7

using latest stable vb

Vitaly
01-07-2011, 02:53 PM
TimesOut, Britmovies,

Checks, that you have uploaded source files to server, and set ptoper permission. That file exists in archive.

Paul.
01-15-2011, 12:32 PM
Since it has been updated after I installed it, is it necessary to download and replace all the files again? Is that how you do it? Download it again as if you never had it and let it replace what is there already?

Vitaly
01-19-2011, 03:49 AM
Yes, all files have been changed. You have to reupload all (override old ones, if any).

mplode
02-22-2011, 09:12 AM
Invalid SQL:
SELECT DISTINCT COUNT(cr.logid) AS count
FROM((SELECT
pm.logid AS logid
FROM
rcd_log_pm AS pm
WHERE
fromusername = 'Qui's World' ) UNION (SELECT
pm.logid AS logid
FROM
rcd_log_pm AS pm
WHERE
tousername = 'Qui's World' )) AS cr;

Got a bit of an SQL injection going there. Might want to fix that.

edit: two actually. You need to sanitize $user_name

Additionally, there's XSS on the search fields. You need to sanitize those for HTML usage as well. And everywhere where it lists usernames.

Vitaly
02-22-2011, 01:22 PM
Try the latest version frim github

https://github.com/shkuropat/vb-pm_log

Updated nick escapeing.

mplode
02-22-2011, 11:50 PM
Thanks for the quick response! I have some remarks, however.

Why are you applying htmlspecialchars_uni() to the usernames before using them in the query? That should be unnecessary and in fact will probably cause problems with users who have <>& or similar signs in their usernames. $db->escape_string() should be enough there.


print_input_row($vbphrase['username'], 'username', $user_name, false);
print_input_row($vbphrase['keywords'], 'keywords', $search_keywords, false);

in these lines, you have not yet sanitized the HTML on the other hand;

print_input_row($vbphrase['username'], 'username', htmlspecialchars_uni($user_name), false);
print_input_row($vbphrase['keywords'], 'keywords', htmlspecialchars_uni($search_keywords), false);

And I think you need to sanitize the username in the search results etc. as well. In case someone has a username like "<script>alert(1)</script>" or "<!--" or something.

Vitaly
02-23-2011, 03:42 AM
You could check on real data fist. Nicks in db are html-escaped.

mplode
03-05-2011, 06:45 PM
Ah. Yeah, I wasn't too sure about that one.

RedHacker
03-10-2011, 08:06 AM
Fatal error: Call to undefined function rcd_pm_log_CacheTemplates() in /home/xxxxxxx/public_html/includes/class_bootstrap.php(1312) : eval()'d code on line 363

I cant use anything with update

Vitaly
03-21-2011, 03:44 PM
Updated version to fix bug with SQL, reported by mplode.

Markco
03-21-2011, 04:10 PM
not working in Vb 4.12 error message "Nothing found"

Vitaly
03-21-2011, 04:25 PM
"not working" and "nothing found" is a big difference.

Markco
03-24-2011, 05:26 AM
not working under Vb 4.12 product Private Messages & Email Log display error message "Nothing found" while there are private messages

Vitaly
03-24-2011, 06:22 AM
- You had this product installed and it stopped working?
- Or just installed?
- Or after mod upgrade?
- Which search conditions?

Please, provide more details. I use this mod @ 4.1.2

Markco
03-24-2011, 04:43 PM
I installed for the first time your hack I have switch diverse parameter I clicked PM Log below the panel private messages a message appears Nothing found.
I search with a nick name for the same message appears Nothing found.

Vitaly
03-24-2011, 04:48 PM
This mod logs messages AFTER installation. Make a new test message for yourself and try to search it.

Markco
03-24-2011, 05:57 PM
After installation i make a PM and show a PM in PM log,
thank you.
Now, how to see before installation?

Alan_SP
03-25-2011, 11:25 PM
No way for that with this add-on. :)

You should use different add-on, maybe the one from Valter: https://vborg.vbsupport.ru/showthread.php?t=233350

With this add-on you log in users account and after that you can see their PM box. Of course, you can use it to diagnose what's troubling them as well.

nta_viking
03-31-2011, 06:34 PM
i installed this and it works fine, but my other administrators can not see the pm log link. I have enabled this for them in the admin permissions but it does not appear.

i will also add that if my admins go directly to the link it works, so its just not showing up for them in the users menu.

jnrdavo
06-03-2011, 03:39 AM
i installed this and it works fine, but my other administrators can not see the pm log link. I have enabled this for them in the admin permissions but it does not appear.

i will also add that if my admins go directly to the link it works, so its just not showing up for them in the users menu.

I have exactly the same problem. Loaded the latest version on a clean BB yesterday. I can see logs (I am userid 1), but the other admins can't see it...

Any clues?

Have modified the admin permissions so they can view pm's, but still no luck.

Luca_ITA
08-05-2011, 07:40 PM
On my forum mod works good. I'm using v4.1.5pl1.
tnx man!

MalluParadise
10-23-2011, 10:53 PM
how about working in 4.1.7 ?

Sarab
10-26-2011, 11:38 PM
Hello,

I was wondering who can see the pm? only the admin or even the mods?

Best Regards,
Sarab

Luca_ITA
12-23-2011, 08:18 PM
works on 4.1.9
+
italian translate

Alibass
06-28-2012, 09:32 PM
This mod does not work with 4.2.0 PL2. When you click on member name to read PM it redirects to the members profile. :(

CharlieDelta
06-28-2012, 10:53 PM
That is what is supposed to do. Click on the subject to read the PM.

Works fine on 4.2.

Alibass
06-29-2012, 03:56 PM
This mod does not work with 4.2.0 PL2. When you click on member name to read PM it redirects to the members profile. :(

That is what is supposed to do. Click on the subject to read the PM.

Works fine on 4.2.
My bad, I haven't used the mod in so long I'd forgot [old age] to click on subject to view PM. :o

CharlieDelta
06-29-2012, 04:32 PM
My bad, I haven't used the mod in so long I'd forgot [old age] to click on subject to view PM. :o

:eek::D
No worries. We all have bad days.

baileyjojoms
01-09-2013, 12:34 PM
No Moderators cannot view the PM's only Admins

Unfolded90
02-26-2013, 03:57 PM
Always *Nothing Found* on 4.2

fortforum
07-01-2013, 08:46 PM
We dont need a mod that can read peoples pm´s. It´s unethical. There used to be a mod called read_pms and it was not to the liking of this community. Now everybody seems to like thisone. What have changed?

killslick1
11-18-2014, 01:12 PM
Same issue