vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Login log - Log successful login attempts (https://vborg.vbsupport.ru/showthread.php?t=311735)

Dave 01-13-2016 01:26 PM

Yep, Telize took the public API down. I'll update the plugin soon.

EvoDarrenshan 01-16-2016 02:42 PM

Code:

Warning: file_get_contents(http://www.telize.com/geoip/ip): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in [path]/includes/functions_login.php(204) : eval()'d code on line 10

Dave 01-16-2016 03:05 PM

I just uploaded a new version which uses a different API.

EvoDarrenshan 01-16-2016 03:15 PM

Quote:

Originally Posted by Dave (Post 2562744)
I just uploaded a new version which uses a different API.

I downloaded the latest one O.o Should i re-download?

Dave 01-16-2016 03:37 PM

Quote:

Originally Posted by EvoDarrenshan (Post 2562745)
I downloaded the latest one O.o Should i re-download?

Yes, I uploaded a new one which should work.

tareqbd 01-16-2016 05:56 PM

1 Attachment(s)
Quote:

Originally Posted by Dave (Post 2562749)
Yes, I uploaded a new one which should work.

Thanks Dave. But it is taking the cloudflare masks. How do I get the real IP.

Dave 01-16-2016 08:09 PM

Quote:

Originally Posted by tareqbd (Post 2562756)
Thanks Dave. But it is taking the cloudflare masks. How do I get the real IP.

In the "Plugin Manager", find the plugin for this product and change $_SERVER['REMOTE_ADDR'] to $_SERVER['HTTP_CF_CONNECTING_IP'] or IPADDRESS.

tareqbd 01-17-2016 12:32 PM

Quote:

Originally Posted by Dave (Post 2562775)
In the "Plugin Manager", find the plugin for this product and change $_SERVER['REMOTE_ADDR'] to $_SERVER['HTTP_CF_CONNECTING_IP'] or IPADDRESS.

Thanks. While checking the functions, I have faced some problems as below.

Quote:

Warning: Missing argument 2 for vB_Database::execute_query(), called in ..../admincp/loginlog.php on line 41 and defined in ..../includes/class_core.php on line 412

Warning: mysql_query() expects parameter 2 to be resource, null given in ..../includes/class_core.php on line 417
And sql error:

Quote:

Database error in vBulletin 4.2.2:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Request Date : Sunday, January 17th 2016 @ 02:20:47 PM
Error Date : Sunday, January 17th 2016 @ 02:20:47 PM
Script : http://www.domain.com/admincp/loginlog.php?do=purgenow
Referrer : http://www.domain.com/admincp/loginlog.php?do=purge
IP Address : xxx.xxx.xx.xx
Username : pps
Classname : vB_Database
MySQL Version :

Dave 01-17-2016 12:58 PM

Did you change anything in the code? That error is never supposed to happen.

tareqbd 01-17-2016 03:06 PM

Quote:

Originally Posted by Dave (Post 2562815)
Did you change anything in the code? That error is never supposed to happen.

Not really. I just changed the plugin code as you mentioned for bypassing the cloudflare.

Dave 01-17-2016 03:10 PM

Could you paste the whole code? You probably made a typo somewhere.

tareqbd 01-17-2016 03:12 PM

Quote:

Originally Posted by Dave (Post 2562829)
Could you paste the whole code? You probably made a typo somewhere.

Code:

if($vbulletin->options['loginlog_enable'] && !is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['loginlog_exclgroups']))){
        $json = json_decode(file_get_contents("http://ip-api.com/json/" . $_SERVER['HTTP_CF_CONNECTING_IP']));
        $vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "loginlog (userid, username, loginstamp, browser, ip, isp, country) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($vbulletin->userinfo['username']) . "', NOW(), '" . $vbulletin->db->escape_string($_SERVER['HTTP_USER_AGENT']) . "', '" . $vbulletin->db->escape_string($_SERVER['HTTP_CF_CONNECTING_IP']) . "', '" . $vbulletin->db->escape_string($json->isp) . "', '" . $vbulletin->db->escape_string($json->country) . "')");
}


Dave 01-17-2016 03:41 PM

That looks fine and works on my local test forum.
The error happens because the MySQL connection resource isn't set, which is really odd.

tareqbd 01-17-2016 04:03 PM

So, what to do now. I actually wanted to remove the logs taken with cf ips.

Iari 10-26-2016 09:16 PM

Perfect! Exactly what I needed.
Thank you so much.

Coder2016 01-14-2017 12:14 PM

I have the same error. Fix ?

Database error in vBulletin 4.2.2:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Request Date : Sunday, January 14th 2017 @ 02:20:47 PM
Error Date : Sunday, January 14th 2017 @ 02:20:47 PM
Script : http://www.domain.com/admincp/loginlog.php?do=purgenow
Referrer : http://www.domain.com/admincp/loginlog.php?do=purge
IP Address : xxx.xxx.xx.xx
Username : pps
Classname : vB_Database
MySQL Version :

Alice 07-28-2017 02:07 AM

I'm having the same issue, anyone with a fix?

edgeless 12-15-2019 01:44 PM

Same error for me (upon purge attempts):

Quote:

Database error in vBulletin 4.2.2:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Request Date : Sunday, December 15th 2019 @ 03:28:12 PM
Error Date : Sunday, December 15th 2019 @ 03:28:12 PM
Script : http://www.domain.com/dirname/adminc...hp?do=purgenow
Referrer : https://www.domain.com/dirname/admin...g.php?do=purge
IP Address : xxx.xxx.xxx.xxx
Username : username
Classname : vB_Database_MySQLi
MySQL Version :
Has anyone discovered a solution yet?

edgeless 12-15-2019 09:12 PM

OK, I believe I've fixed this. Here is what I did...

I changed (line 41) of the purgenow script:

Code:

$db->execute_query("TRUNCATE TABLE " . TABLE_PREFIX . "loginlog");

to this:

Code:

$db->query(' TRUNCATE TABLE ' . TABLE_PREFIX . 'loginlog');

Basically all you should need to do is change execute_query to query and add a space before and after TRUNCATE TABLE, after which the purges should start working correctly. In any case, this fix seems to work perfectly here. Now every time I execute a purge, the message "The login log has been purged" is properly displayed and all login entries are gone.


All times are GMT. The time now is 01:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01177 seconds
  • Memory Usage 1,764KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete