LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
04896User patchesInstallationpublic2011-01-22 23:492012-06-21 14:16
Reporterstarmonkey 
Assigned To 
PrioritynormalSeveritytweak 
StatusconfirmedResolutionopen 
Product Version1.90 
Target VersionFixed in Version 
Summary04896: Dynamic $rooturl to eliminate an install/config step
DescriptionHi guys, I just thought I'd share a hack with you guys, mainly to make sure I'm not doing something bad.

I prefer my php webapps to work out as much of their environment as possible, to save on configuration steps.

As such, I edited config.php with the following:

// The root web url for your limesurvey installation (without a trailing slash).
//$rooturl = "http://{$_SERVER['HTTP_HOST']}/path/to/limesurvey"; [^]
// SM 20Jan11: Dynamic rooturl, for /admin pages, set one level up
$rooturl = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); [^]
if('admin' == basename($rooturl)) { $rooturl = dirname($rooturl); }
 
Anyway, feedback welcome. I did this because my dev/staging and live environments have different paths/urls, and I got tired of maintaining different settings per environment!
Steps To Reproduce1) Edit config.php and update the line that sets $rooturl
2) Enjoy a slice of chocolate cake as you deploy to live without fear
Additional InformationOriginally I posted this as a forum thread here:

http://www.limesurvey.org/en/forum/future-features/55557-dynamic-rooturl-to-eliminate-an-installconfig-step [^]
TagsNo tags attached.
LimeSurvey build number OR git commit ID9672
Attached Files

- Relationships

-  Notes
User avatar (13959)
Mazi (developer)
2011-01-23 19:43

Thibault, what do you think about this?

Before implementing this we might also want to ping Carsten if this has any effects on Limeservice.
User avatar (14328)
lemeur (administrator)
2011-03-08 13:31

Carsten I prefer to let you decide on this one.
User avatar (14339)
c_schmitz (administrator)
2011-03-08 15:33

I looked up on PHP_SELF and I think there is no risk involved because it is tamed by the dirname() call.
HOwever the 'if 'admin' ' part is hardcoded and ignores the fact that the LimeSurvey /admin directory can be renamed.
User avatar (14580)
c_schmitz (administrator)
2011-03-28 02:27

Starmonkey, do you see a way to resolve the '/admin' issue I talked about?

- Issue History
Date Modified Username Field Change
2011-01-22 23:49 starmonkey New Issue
2011-01-23 19:42 Mazi Assigned To => lemeur
2011-01-23 19:42 Mazi Status new => assigned
2011-01-23 19:43 Mazi Note Added: 13959
2011-03-08 13:30 lemeur Assigned To lemeur => c_schmitz
2011-03-08 13:31 lemeur Note Added: 14328
2011-03-08 15:33 c_schmitz Note Added: 14339
2011-03-28 02:27 c_schmitz Note Added: 14580
2012-06-21 13:32 c_schmitz Status assigned => confirmed
2012-06-21 14:16 c_schmitz Assigned To c_schmitz =>


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker