The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun May 06, 2012 9:47 am 
Joomla! Intern
Joomla! Intern

Joined: Fri Aug 26, 2005 5:08 pm
Posts: 97
Location: Devon, England
I need to find a site user's IP address from within a plugin for J2.5. This code works fine:
Code:
JRequest::getVar('REMOTE_ADDR', '', 'SERVER')

but is marked deprecated in favour of "JInput::Get" (I think that should be "Use JInput::get").
I cannot find any JInput::get() type of object that will give me the client IP address - have tried things like:
Code:
JFactory::getSession()->get('session.client.address')

which returns 'uninitialised'.
Would someone please tell me the non-deprecated equivalent of
Code:
JRequest::getVar('REMOTE_ADDR', '', 'SERVER')

???

_________________
James B.


Top
 Profile  
 
PostPosted: Mon May 07, 2012 3:01 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sat Dec 06, 2008 7:07 pm
Posts: 281
Just
$_SERVER['REMOTE_ADDR']

_________________
http://www.ratmilwebsolutions.com


Top
 Profile  
 
PostPosted: Fri May 11, 2012 10:09 am 
Joomla! Intern
Joomla! Intern

Joined: Fri Aug 26, 2005 5:08 pm
Posts: 97
Location: Devon, England
I had come to the same conclusion.

Thanks!

_________________
James B.


Top
 Profile  
 
PostPosted: Tue Jun 12, 2012 9:38 am 
Joomla! Intern
Joomla! Intern

Joined: Fri Aug 26, 2005 5:08 pm
Posts: 97
Location: Devon, England
The code is now part of an extension now published on Extensions Directory:
http://extensions.joomla.org/extensions/access-a-security/site-access/authentication/21087

_________________
James B.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 



Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group