Sitedown - What is my IP address?

Talk about new features for CMSMS and modules.
Locked
forbairt
Forum Members
Forum Members
Posts: 19
Joined: Tue Feb 12, 2008 8:40 am

Sitedown - What is my IP address?

Post 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
Last edited by forbairt on Mon Nov 02, 2009 3:19 pm, edited 1 time in total.
Gerd
New Member
New Member
Posts: 7
Joined: Fri Aug 15, 2008 9:31 am
Location: Germany

Re: Sitedown - What is my IP address?

Post 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).
JeremyBASS

Re: Sitedown - What is my IP address?

Post 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
Gerd
New Member
New Member
Posts: 7
Joined: Fri Aug 15, 2008 9:31 am
Location: Germany

Re: Sitedown - What is my IP address?

Post 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
JeremyBASS

Re: Sitedown - What is my IP address?

Post 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
Locked

Return to “Feature ideas”