1
lnuxguy
SSL??
  • 2006/1/23 16:13

  • lnuxguy

  • Just popping in

  • Posts: 1

  • Since: 2006/1/23


Is there any way to run XOOPS entirely over SSL (versus just the login)?

2
TheFinni
Re: SSL??
  • 2006/1/23 17:18

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Hi,
Yes it's possible.

I have modified my mainfile.php as following:

//define('XOOPS_URL', 'http: //www.yourdomain.com');
// to the following
$port = $HTTP_SERVER_VARS['SERVER_PORT'];
if($port == "443"){
define('XOOPS_URL', 'https: //www.yourdomain.com');
} else {
define('XOOPS_URL', 'http: //www.yourdomain.com');
}

Furthermore, I have added these to mainfile.php either force https or normal http:

define('XOOPS_URL_SSL', 'https: //www.yourdomain.com');
define('XOOPS_URL_NON_SSL', 'http: //www.yourdomain.com');

and then you will need to add to the class/template.php file the above mentioned defines. Example:

//added: xoops_url_ssl and xoops_url_non_ssl
$this->assign(array('xoops_url' => XOOPS_URL, 'xoops_url_ssl' => XOOPS_URL_SSL, 'xoops_url_non_ssl' => XOOPS_URL_NON_SSL, 'xoops_rootpath' => XOOPS_ROOT_PATH, 'xoops_langcode' => _LANGCODE, 'xoops_charset' => _CHARSET, 'xoops_version' => XOOPS_VERSION, 'xoops_upload_url' => XOOPS_UPLOAD_URL));
}

In XOOPS 2.2.x it's class/theme.php in which you can edit like following:

function loadGlobalVars($loadConfig = true) {
global $xoopsConfig, $xoopsModule;
//added SSL and NONSSL to array below:
$this->tplEngine->assign(array('xoops_url' => XOOPS_URL, 'xoops_url_ssl' => XOOPS_URL_SSL, 'xoops_url_non_ssl' => XOOPS_URL_NON_SSL,
'xoops_rootpath' => XOOPS_ROOT_PATH,

Hope that helps

Now you can freely make the URL either http or https and images and such should all download securly.

Additonally, if you want to refer to links within the site you can always use : XOOPS_URL_NON_SSL or in Smarty:

<{$xoops_url_non_ssl}> OR <{$xoops_url_ssl}>

Hope that helps!

3
zioncurtain
Re: SSL??

I tried the method above, and it didn't work for me.

It's likely that I didn't follow the instructions correctly. It was a little hard to ready for me.

In XOOPS 2.2.4, do I edit both class/template.php AND class/theme.php?

Or just class/theme.php?

Does anyone have any more comprehensive instructions for nubies?

Thanks!

4
dpfresh
Re: SSL??
  • 2006/3/17 0:08

  • dpfresh

  • Just popping in

  • Posts: 27

  • Since: 2005/4/18


Hi, this worked well for me... thanks for posting the example...

Login

Who's Online

239 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits