Strict Standards: Non-static method Protector::getInstance() should not be called statically in /home/suehirogari/suehirogari.com/xoops_trust_path/modules/protector/include/precheck_functions.php on line 12

Strict Standards: Non-static method XCube_Root::getSingleton() should not be called statically in /home/suehirogari/suehirogari.com/public_html/include/common.php on line 18

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SystemModuleInstall.class.php on line 117

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SystemModuleInstall.class.php on line 168

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SystemModuleInstall.class.php on line 186

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/legacy/preload/Primary/SiteClose.class.php on line 54

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/user/preload/Primary/Primary.class.php on line 65

Deprecated: Assigning the return value of new by reference is deprecated in /home/suehirogari/suehirogari.com/public_html/modules/user/preload/Primary/Primary.class.php on line 73

Deprecated: Non-static method XCube_Root::getSingleton() should not be called statically, assuming $this from incompatible context in /home/suehirogari/suehirogari.com/public_html/modules/user/preload/Primary/Primary.class.php on line 13
xoopsでSSL対応 | 社内SEのウェブ制作

2012.03.13xoopsズープス

xoopsでSSL対応

セキュリティの警告 セキュリティでほぼされたwebページコンテンツを表示しますか。 このページは安全なHTTPS接続を使用しないで、通信されるコンテンツが含まれており、webページ全体のセキュリティを損なう恐れがあります。

セキュリティで保護されているコンテンツのみ表示されます。

ブラウザFirefoxのアドオン「Firebug」で確認しています。

 

XoopsでSSLを使うときのメモです。



// 追加
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='off') {
define('XOOPS_URL', 'https://hogehoge.com');
}
else {
define('XOOPS_URL', 'http://hogehoge.com');
}



とまあ、こんな感じに「mainfile.php」に追加して、デフォルトのDefineはコメントアウトしておくこと



// コメントアウト
//define('XOOPS_URL', 'http://hogehoge.com');

 

 

 

さくらインターネットの共有SSLde問い合わせモジュールだけSSL化


テーマ:
さくらインターネットの共有SSLを使って、XOOPSの問い合わせモジュールだけをSSL対応させる。





1)「mainfile.php」の修正


以下の記述でHTTPとHTTPSのURL定義を定め、「XOOPS_URL」定数にあてはめる。



// define('XOOPS_URL', 'http://www.hogehoge.jp');


define('HOGE_URL', 'http://www.hogehoge.jp');
define('HOGE_SSL', 'https://hogehoge.sakura.ne.jp');
if(ereg('^/modules/inquiry/', $_SERVER['REQUEST_URI'])){
define('XOOPS_URL', HOGE_SSL);
}else{
define('XOOPS_URL', HOGE_URL);
}





2)SmartyにHTTPとHTTPSのURL定義を追加


「class/template.php」の記述に追加



$this->assign(array('xoops_url' => XOOPS_URL,
'xoops_rootpath' => XOOPS_ROOT_PATH,
'xoops_langcode' => _LANGCODE,
'xoops_charset' => _CHARSET,
'xoops_version' => XOOPS_VERSION,
'xoops_upload_url' => XOOPS_UPLOAD_URL,
'hoge_url' => HOGE_URL,
'hoge_ssl' => HOGE_SSL
));





3)テーマの記述を修正


テーマの中で、<{$xoops_url}>で記述されていたリンク部分を<{$hoge_url}>に変更、問い合わせ(inquiry)モジュールへのアクセスのみ<{$hoge_ssl}>とする。


画像へのリンクについてはそのまま<{$xoops_url}>とする。



また、テーマだけでなく各ブロック内などで画像のリンクをフルパスで直記述している場合は、「暗号化されているページと・・・・混在している」とかいう警告メッセージがでるので、ここの辺も直しておくこと。





4)メインメニューのブロックを修正


問い合わせの時だけSSLへ飛ぶように修正する。



- <{$smarty.const._MB_LEGACY_HOME}>
+ <{$smarty.const._MB_LEGACY_HOME}>
<{foreach item=module from=$block.modules}>
- <{$module.name}>
+<{if $module.directory == 'inquiry'}>
+ <{$module.name}>
+<{else}>
+ <{$module.name}>
+<{/if}>





5)INQUIRYモジュールの修正


問い合わせを投稿した後にトップページに戻るが、その時にはHTTPSのままトップへ戻ってしまい、「暗号化されているページと・・・・混在している」とかいう警告メッセージがでるので、これに対応するために以下を行った。



「inquiry/index.php」内、XOOPS_URLを必要に応じてHOGE_URLへ変更
リダイレクト関数を呼び出しているあたりで、トップに戻そうとしているところを



// $view->redirect(XOOPS_URL.'/',2,'セッションが不正です。');
$view->redirect(HOGE_URL.'/',2,'セッションが不正です。');

このカテゴリの人気記事



  • コメント (0)
  • トラックバック (0)
  • 閲覧 (16632)

トラックバック

トラックバックpingアドレス http://www.suehirogari.com/modules/blog/tb.php/452

コメントの投稿

コメント投稿に関するルール : コメントは全て承認が必要

キーワードでサイト内を検索
人気のエントリ