• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Sitedown - What is my IP address?
PostPosted: Mon Nov 02, 2009 10:11 am 
Offline
Forum Members
Forum Members

Joined: Tue Feb 12, 2008 8:40 am
Posts: 24
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:
$smarty->assign('whatismyip',getenv("REMOTE_ADDR"));


and into siteprefs.tpl
Code:
     <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.

Top
 Profile  
 
 Post subject: Re: Sitedown - What is my IP address?
PostPosted: Tue Jul 13, 2010 12:37 pm 
Offline
New Member

Joined: Fri Aug 15, 2008 9:31 am
Posts: 7
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).


Top
 Profile  
 
 Post subject: Re: Sitedown - What is my IP address?
PostPosted: Tue Jul 13, 2010 5:18 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
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

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


Top
 Profile  
 
 Post subject: Re: Sitedown - What is my IP address?
PostPosted: Wed Jul 14, 2010 8:40 pm 
Offline
New Member

Joined: Fri Aug 15, 2008 9:31 am
Posts: 7
Thanks Jeremy,
but this solution seems to be as time consumtive as looking somwere in my rooter config for my IP.
Greetings, Gerd


Top
 Profile  
 
 Post subject: Re: Sitedown - What is my IP address?
PostPosted: Wed Jul 14, 2010 9:18 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
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

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


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

All times are UTC


Who is online

Users browsing this forum: No registered users


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

Search for:
Jump to:  
cron
A2 Hosting