Page 1 of 1

Sitedown - What is my IP address?

Posted: Mon Nov 02, 2009 10:11 am
by forbairt
I'm currently using the

Site Admin -> Global Settings -> Sitedown Settings

in order to lock down access to a site I'm developing however I have a bit of an issue that my IP keeps on changing so I've ended up dumping in a quick little hack to show my current IP address on this page

Into /admin/siteprefs.php I've dumped in

Code: Select all

$smarty->assign('whatismyip',getenv("REMOTE_ADDR"));
and into siteprefs.tpl

Code: Select all

     <br/>
     Your IP address is: {$whatismyip}
     <br />
     <br />
obviously a quick hack but handy for me to have it on the page there just thought I'd share

edit: corrected typo

Re: Sitedown - What is my IP address?

Posted: Tue Jul 13, 2010 12:37 pm
by Gerd
Many thanks for this feature!
Many of my collegues are working with a dynamically generated IP, so I could imagine, that it would be a usefull feature for the next release. (I don't like to edit the code each time I update the site).

Re: Sitedown - What is my IP address?

Posted: Tue Jul 13, 2010 5:18 pm
by JeremyBASS
Here is a way to do it without hacking the core.. Just put in {$smarty.server.REMOTE_ADDR} in your site down template.. Turn it on.. Visit the site and grab your IP.  Now you can use it.. This is the way so you don't have to keep hacking the core when a full upgrade for cmsms is released where there is no diffs.  Cheers -Jeremy

Re: Sitedown - What is my IP address?

Posted: Wed Jul 14, 2010 8:40 pm
by Gerd
Thanks Jeremy,
but this solution seems to be as time consumtive as looking somwere in my rooter config for my IP.
Greetings, Gerd

Re: Sitedown - What is my IP address?

Posted: Wed Jul 14, 2010 9:18 pm
by JeremyBASS
but you don't lose support and can upgrade with out core changes .. ;) it was just an FYI is all :D

But IMnsHO even going to http://www.whatsmyip.org/ is a better choice then hacking the core.. It's bad pratice as you have smarty that is just like adding php which is the same a hacking the core.

Side thought.. I wander if the input would take {$smarty.server.REMOTE_ADDR} or
$_SERVER['REMOTE_ADDR'] .. hmmm.. some thing to try..
cheers -Jeremy