Where can I find the display code for survey links?

More
6 years 4 weeks ago - 6 years 4 weeks ago #91733 by Sirblackadder
Hi All,

my limesurvey installation is of the http variant. However, I use mod-rewrite in .htaccess to force https for the admin subdirectory.

Unfortunately, this has limesurvey display the client link to a survey with "https", too. Such a link is displayed on the overview page for a survey, for example (./admin/survey/sa/view/surveyid/).

Where is this link generated? I'd like to add a preg_replace() to the code but don't know where to find it. Can you help?

Best wishes,
Malte
Last edit: 6 years 4 weeks ago by Sirblackadder.

Please Log in or Create an account to join the conversation.

More
6 years 3 weeks ago - 6 years 3 weeks ago #91836 by Sirblackadder
Ok, solved it. The survey summary display code is in /application/views/admin/survey/surveySummary_view.php

There are two lines in the file where survey links are generated. Both go like
<?php $tmp_url = ...?>

To change https links into http links, you can insert the statements
if (strcasecmp(substr($tmp_url, 0, 8), "https://") == 0)
{
  $tmp_url = "http://" . substr($tmp_url, 8);
}

before the trailing "?>" of said two lines.


One could shorten this by using preg_replace() but I tend to avoid regexes whenever possible.
Last edit: 6 years 3 weeks ago by Sirblackadder.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!