Changeset 18293
- Timestamp:
- 2009/09/17 19:45:44 (15 years ago)
- Location:
- branches/comu-ver2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/SC_MobileUserAgent.php
r18234 r18293 147 147 } 148 148 } 149 150 /** 151 * 携帯端末の場合、モバイルサイトへリダイレクトする 152 * 153 * @return void 154 */ 155 function sfAutoRedirectMobileSite() { 156 // 携帯端末ではない場合、処理しない 157 if (SC_MobileUserAgent::isNonMobile()) return; 158 159 $url = SC_Utils_Ex::sfIsHTTPS() 160 ? MOBILE_SSL_URL 161 : MOBILE_SITE_URL 162 ; 163 164 $url .= (preg_match('|^' . URL_DIR . '(.*)$|', $_SERVER['REQUEST_URI'], $matches)) 165 ? $matches[1] 166 : '' 167 ; 168 169 header("Location: ". SC_Utils_Ex::sfRmDupSlash($url)); 170 exit; 171 } 149 172 } 150 173 ?> -
branches/comu-ver2/data/class/pages/error/LC_Page_Error_SystemError.php
r18291 r18293 56 56 57 57 $this->tpl_title = 'システムエラー'; 58 $this->adminPage = $this->isAdminPage();58 $this->adminPage = SC_Utils_Ex::sfIsAdminFunction(); 59 59 60 60 if ($this->adminPage) { … … 108 108 } 109 109 110 /**111 * 管理機能かどうかを判定する.112 *113 * @return boolean114 */115 function isAdminPage() {116 return preg_match('|/admin/|', $_SERVER['PHP_SELF']);117 }118 119 110 /** 120 111 * エラーメッセージを生成する -
branches/comu-ver2/data/class/util/SC_Utils.php
r18292 r18293 77 77 function sfInitInstall() { 78 78 // インストール済みが定義されていない。 79 if(!defined('ECCUBE_INSTALL')) { 80 if(!ereg("/install/", $_SERVER['PHP_SELF'])) { 81 header("Location: ./install/"); // TODO 絶対URL にする 82 } 83 } else { 84 $path = HTML_PATH . "install/index.php"; 85 if(file_exists($path)) { 86 SC_Utils::sfErrorHeader(">> /install/index.phpは、インストール完了後にファイルを削除してください。"); 87 } 79 if (!defined('ECCUBE_INSTALL')) { 80 header("Location: ./install/" . DIR_INDEX_URL); // TODO 絶対URL にする 81 exit; 82 } 83 $path = HTML_PATH . "install/index.php"; 84 if(file_exists($path)) { 85 SC_Utils::sfErrorHeader(">> /install/index.phpは、インストール完了後にファイルを削除してください。"); 88 86 } 89 87 } … … 2163 2161 return $string; 2164 2162 } 2163 2164 /** 2165 * 管理機能かを判定 2166 * 2167 * @return bool 管理機能か 2168 */ 2169 function sfIsAdminFunction() { 2170 return defined('ADMIN_FUNCTION') && ADMIN_FUNCTION; 2171 } 2172 2173 /** 2174 * フロント機能かを判定 2175 * 2176 * @return bool フロント機能か 2177 */ 2178 function sfIsFrontFunction() { 2179 return SC_Utils_Ex::sfIsPcSite() || SC_Utils_Ex::sfIsMobileSite(); 2180 } 2181 2182 /** 2183 * フロント機能PCサイトかを判定 2184 * 2185 * @return bool フロント機能PCサイトか 2186 */ 2187 function sfIsPcSite() { 2188 return defined('FRONT_FUNCTION_PC_SITE') && FRONT_FUNCTION_PC_SITE; 2189 } 2190 2191 /** 2192 * フロント機能モバイル機能かを判定 2193 * 2194 * @return bool フロント機能モバイル機能か 2195 */ 2196 function sfIsMobileSite() { 2197 return defined('MOBILE_SITE') && MOBILE_SITE; 2198 } 2199 2200 /** 2201 * インストール機能かを判定 2202 * 2203 * @return bool インストール機能か 2204 */ 2205 function sfIsInstallFunction() { 2206 return defined('INSTALL_FUNCTION') && INSTALL_FUNCTION; 2207 } 2165 2208 } 2166 2209 ?> -
branches/comu-ver2/data/require_base.php
r18234 r18293 46 46 $objInit->init(); 47 47 48 require_once(DATA_PATH . "include/module.inc");49 48 require_once(CLASS_EX_PATH . "util_extends/GC_Utils_Ex.php"); 50 49 require_once(CLASS_EX_PATH . "util_extends/SC_Utils_Ex.php"); … … 76 75 require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_PageLayout_Ex.php"); 77 76 require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_DB_Ex.php"); 78 require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Session_Ex.php");79 77 require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Mail_Ex.php"); 80 78 require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Mobile_Ex.php"); 79 require_once(DATA_PATH . "include/module.inc"); 81 80 include_once(DATA_PATH . "require_plugin.php"); 82 81 83 // セッションハンドラ開始 84 $objSession = new SC_Helper_Session_Ex(); 82 // インストール中で無い場合、 83 if (!SC_Utils_Ex::sfIsInstallFunction()) { 84 // インストールチェック 85 SC_Utils_Ex::sfInitInstall(); 85 86 86 // インストールチェック 87 SC_Utils_Ex::sfInitInstall(); 87 // セッションハンドラ開始 88 require_once CLASS_EX_PATH . 'helper_extends/SC_Helper_Session_Ex.php'; 89 $objSession = new SC_Helper_Session_Ex(); 88 90 89 // セッション初期化・開始 90 require_once CLASS_PATH . 'session/SC_SessionFactory.php'; 91 $sessionFactory = SC_SessionFactory::getInstance(); 92 $sessionFactory->initSession(); 91 // セッション初期化・開始 92 require_once CLASS_PATH . 'session/SC_SessionFactory.php'; 93 $sessionFactory = SC_SessionFactory::getInstance(); 94 $sessionFactory->initSession(); 95 } 93 96 94 97 // 絵文字変換 (除去) フィルターを組み込む。 -
branches/comu-ver2/html/admin/require.php
r18234 r18293 26 26 27 27 require_once HTML_PATH . 'define.php'; 28 define('ADMIN_FUNCTION', true); 28 29 require_once HTML_PATH . HTML2DATA_DIR . 'require_base.php'; 29 30 ?> -
branches/comu-ver2/html/install/index.php
r18235 r18293 21 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 22 */ 23 require_once("../require.php"); 23 // ▼require.php 相当 24 // rtrim は PHP バージョン依存対策 25 define('HTML_PATH', rtrim(realpath(rtrim(realpath(dirname(__FILE__)), '/\\') . '/../'), '/\\') . '/'); 26 27 require_once HTML_PATH . 'define.php'; 28 define('INSTALL_FUNCTION', true); 29 require_once HTML_PATH . HTML2DATA_DIR . 'require_base.php'; 30 // ▲require.php 相当 31 24 32 $INSTALL_DIR = realpath(dirname( __FILE__)); 25 33 require_once(DATA_PATH . "module/Request.php"); -
branches/comu-ver2/html/mobile/require.php
r18234 r18293 1 1 <?php 2 /** 3 * 2 /* 4 3 * This file is part of EC-CUBE 5 4 * … … 26 25 define("HTML_PATH", rtrim(realpath(rtrim(realpath(dirname(__FILE__)), '/\\') . '/../'), '/\\') . '/'); 27 26 28 require_once (HTML_PATH . "define.php");27 require_once HTML_PATH . 'define.php'; 29 28 define('MOBILE_SITE', true); 30 require_once (HTML_PATH . HTML2DATA_DIR . "require_base.php");29 require_once HTML_PATH . HTML2DATA_DIR . 'require_base.php'; 31 30 32 31 // モバイルサイトを利用しない設定の場合、落とす。 -
branches/comu-ver2/html/require.php
r18234 r18293 25 25 define("HTML_PATH", rtrim(realpath(rtrim(realpath(dirname(__FILE__)), '/\\') . '/'), '/\\') . '/'); 26 26 27 require_once(HTML_PATH . "define.php"); 28 require_once(HTML_PATH . HTML2DATA_DIR . "require_base.php"); 27 require_once HTML_PATH . 'define.php'; 28 define('FRONT_FUNCTION_PC_SITE', true); 29 require_once HTML_PATH . HTML2DATA_DIR . 'require_base.php'; 29 30 30 // 携帯端末の場合は mobile 以下へリダイレクトする。 31 if (SC_MobileUserAgent::isMobile()) { 32 $url = ""; 33 if (SC_Utils_Ex::sfIsHTTPS()) { 34 $url = MOBILE_SSL_URL; 35 } else { 36 $url = MOBILE_SITE_URL; 37 } 38 39 if (preg_match('|^' . URL_DIR . '(.*)$|', $_SERVER['REQUEST_URI'], $matches)) { 40 $path = $matches[1]; 41 } else { 42 $path = ''; 43 } 44 45 header("Location: ". SC_Utils_Ex::sfRmDupSlash($url . $path)); 46 exit; 47 } 31 // 携帯端末の場合、モバイルサイトへリダイレクトする 32 SC_MobileUserAgent::sfAutoRedirectMobileSite(); 48 33 49 34 ?>
Note: See TracChangeset
for help on using the changeset viewer.