Changeset 20108
- Timestamp:
- 2011/02/07 13:27:19 (13 years ago)
- Location:
- branches/version-2_5-dev/data/class/pages/frontparts
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php
r20086 r20108 66 66 function action() { 67 67 // URLチェック 68 $this->lfCheckValidAccess(); 68 if ( !SC_Helper_Session_Ex::isValidToken() ) { 69 GC_Utils_Ex::gfPrintLog('invalid access :login_check.php $POST["url"]=' . $_POST['url']); 70 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); 71 } 69 72 70 73 // 会員管理クラス … … 84 87 switch ($this->getMode()) { 85 88 case 'login': 86 // ログイン 87 $this->lfLogin($objCustomer, $objCookie); 89 // --- ログイン 90 91 // 入力値のエラーチェック 92 $this->objFormParam->toLower('login_email'); 93 $arrErr = $this->objFormParam->checkError(); 94 95 // エラーの場合はエラー画面に遷移 96 if (count($arrErr) > 0) { 97 SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); 98 } 99 100 // 入力チェック後の値を取得 101 $arrForm = $this->objFormParam->getHashArray(); 102 103 // クッキー保存判定 104 if ($arrForm['login_memory'] == '1' && $arrForm['login_email'] != '') { 105 $objCookie->setCookie('login_email', $arrForm['login_email']); 106 } else { 107 $objCookie->setCookie('login_email', ''); 108 } 109 110 // 遷移先の制御 111 if (count($arrErr) == 0) { 112 // ログイン処理 113 if ($objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) { 114 // --- ログインに成功した場合 115 SC_Response_Ex::sendRedirect(HTTP_URL); 116 exit; 117 } else { 118 // --- ログインに失敗した場合 119 $arrForm['login_email'] = strtolower($arrForm['login_email']); 120 $objQuery = SC_Query::getSingletonInstance(); 121 $where = '(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0'; 122 $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email'])); 123 // ログインエラー表示 124 if($ret > 0) { 125 SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); 126 } else { 127 SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); 128 } 129 } 130 } else { 131 // 入力エラーの場合、元のアドレスに戻す。 132 // FIXME $_POST['url'] には、URL ではなく、url-path が渡るもよう。HTTPS 利用に関わる問題も考えられるので、URL が渡るように改善した方が良いように感じる。 133 SC_Response_Ex::sendRedirect($_POST['url']); 134 exit; 135 } 136 88 137 break; 89 138 case 'logout': 90 // ログアウト 91 $this->lfLogout($objCustomer); 139 // --- ログアウト 140 141 // ログイン情報の解放 142 $objCustomer->EndSession(); 143 // 画面遷移の制御 144 $mypage_url_search = strpos('.'.$_POST['url'], 'mypage'); 145 if ($mypage_url_search == 2) { 146 // マイページログイン中はログイン画面へ移行 147 SC_Response_Ex::sendRedirectFromUrlPath('mypage/login.php'); 148 } else { 149 // 上記以外の場合、トップへ遷移 150 SC_Response_Ex::sendRedirect(HTTP_URL); 151 } 152 exit; 153 92 154 break; 93 155 default: … … 104 166 function destroy() { 105 167 parent::destroy(); 106 }107 108 /**109 * 正常なアクセスかチェックする.110 *111 * @return void112 */113 function lfCheckValidAccess() {114 115 // 不正なURLがPOSTされた場合はエラー表示116 if (!SC_Helper_Session_Ex::isValidToken()) {117 GC_Utils_Ex::gfPrintLog('invalid access :login_check.php $POST["url"]=' . $_POST['url']);118 SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);119 }120 121 168 } 122 169 … … 151 198 } 152 199 153 /**154 * ログイン.155 *156 * @param SC_Customer $objCustomer 会員管理クラス157 * @param SC_Cookie $objCookie クッキー管理クラス158 * @return void159 */160 function lfLogin($objCustomer, $objCookie) {161 // 入力値のエラーチェック162 $this->objFormParam->toLower('login_email');163 $arrErr = $this->objFormParam->checkError();164 165 // エラーの場合はエラー画面に遷移166 if (count($arrErr) > 0) {167 SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);168 }169 170 // 入力チェック後の値を取得171 $arrForm = $this->objFormParam->getHashArray();172 173 // クッキー保存判定174 if ($arrForm['login_memory'] == '1' && $arrForm['login_email'] != '') {175 $objCookie->setCookie('login_email', $arrForm['login_email']);176 } else {177 $objCookie->setCookie('login_email', '');178 }179 180 // 遷移先の制御181 if (count($arrErr) == 0) {182 // ログイン処理183 if ($objCustomer->getCustomerDataFromEmailPass($arrForm['login_pass'], $arrForm['login_email'], true)) {184 // --- ログインに成功した場合185 SC_Response_Ex::sendRedirect(HTTP_URL);186 exit;187 } else {188 // --- ログインに失敗した場合189 $arrForm['login_email'] = strtolower($arrForm['login_email']);190 $objQuery = SC_Query::getSingletonInstance();191 $where = '(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0';192 $ret = $objQuery->count("dtb_customer", $where, array($arrForm['login_email'], $arrForm['login_email']));193 // ログインエラー表示194 if($ret > 0) {195 SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR);196 } else {197 SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR);198 }199 }200 } else {201 // 入力エラーの場合、元のアドレスに戻す。202 // FIXME $_POST['url'] には、URL ではなく、url-path が渡るもよう。HTTPS 利用に関わる問題も考えられるので、URL が渡るように改善した方が良いように感じる。203 SC_Response_Ex::sendRedirect($_POST['url']);204 exit;205 }206 }207 208 /**209 * ログアウト.210 *211 * @param SC_Customer $objCustomer 会員管理クラス212 * @return void213 */214 function lfLogout($objCustomer) {215 // ログイン情報の解放216 $objCustomer->EndSession();217 218 // 画面遷移の制御219 $mypage_url_search = strpos('.'.$_POST['url'], 'mypage');220 if ($mypage_url_search == 2) {221 // マイページログイン中はログイン画面へ移行222 SC_Response_Ex::sendRedirectFromUrlPath('mypage/login.php');223 } else {224 // 上記以外の場合、トップへ遷移225 SC_Response_Ex::sendRedirect(HTTP_URL);226 }227 228 exit;229 }230 231 200 } 232 201 ?> -
branches/version-2_5-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart.php
r20076 r20108 85 85 * @return array $arrCartList カートデータ配列 86 86 */ 87 function lfGetCartData( $objCart,$objSiteInfo) {87 function lfGetCartData(&$objCart, &$objSiteInfo) { 88 88 $arrCartKeys = $objCart->getKeys(); 89 89 foreach ($arrCartKeys as $cart_key) { -
branches/version-2_5-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php
r20086 r20108 64 64 function action() { 65 65 // モバイル判定 66 if (SC_Display::detectDevice() === true) { 67 // --- モバイルの場合 68 // メインカテゴリーの取得 69 $this->arrCat = $this->lfGetMainCat(true); 70 } else { 71 // --- PCの場合 72 // 選択中のカテゴリID 73 $this->tpl_category_id = $this->lfGetSelectedCategoryId(); 74 // カテゴリツリーの取得 75 $this->arrTree = $this->lfGetCatTree($this->tpl_category_id, true); 66 switch ( SC_Display::detectDevice() ) { 67 case DEVICE_TYPE_MOBILE: 68 // メインカテゴリーの取得 69 $this->arrCat = $this->lfGetMainCat(true); 70 break; 71 default: 72 // 選択中のカテゴリID 73 $this->tpl_category_id = $this->lfGetSelectedCategoryId($_GET); 74 // カテゴリツリーの取得 75 $this->arrTree = $this->lfGetCatTree($this->tpl_category_id, true); 76 break; 76 77 } 77 78 } … … 89 90 * 選択中のカテゴリIDを取得する. 90 91 * 92 * @param array $arrRequest リクエスト配列 91 93 * @return array $arrCategoryId 選択中のカテゴリID 92 94 */ 93 function lfGetSelectedCategoryId( ) {95 function lfGetSelectedCategoryId($arrRequest) { 94 96 // 商品ID取得 95 97 $product_id = ''; 96 if ( isset($ _GET['product_id']) && $_GET['product_id'] != '' && is_numeric($_GET['product_id']) ) {97 $product_id = $ _GET['product_id'];98 if ( isset($arrRequest['product_id']) && $arrRequest['product_id'] != '' && is_numeric($arrRequest['product_id']) ) { 99 $product_id = $arrRequest['product_id']; 98 100 } 99 101 // カテゴリID取得 100 102 $category_id = ''; 101 if ( isset($ _GET['category_id']) && $_GET['category_id'] != '' && is_numeric($_GET['category_id']) ) {102 $category_id = $ _GET['category_id'];103 if ( isset($arrRequest['category_id']) && $arrRequest['category_id'] != '' && is_numeric($arrRequest['category_id']) ) { 104 $category_id = $arrRequest['category_id']; 103 105 } 104 106 // 選択中のカテゴリIDを判定する -
branches/version-2_5-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_News.php
r20076 r20108 81 81 */ 82 82 function lfGetNews(){ 83 $objQuery = new SC_Query();83 $objQuery = SC_Query::getSingletonInstance(); 84 84 $sql = ''; 85 85 $sql .= " SELECT "; -
branches/version-2_5-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_SearchProducts.php
r20076 r20108 63 63 */ 64 64 function action() { 65 // 商品ID取得 66 $product_id = $this -> lfGetProductId(); 67 // カテゴリID取得 68 $category_id = $this -> lfGetCategoryId(); 69 // メーカーID取得 70 $maker_id = $this -> lfGetMakerId(); 65 71 // 選択中のカテゴリIDを判定する 66 $this->category_id = $this->lfGetSelectedCategoryId( );72 $this->category_id = $this->lfGetSelectedCategoryId($product_id, $category_id); 67 73 // カテゴリ検索用選択リスト 68 74 $this->arrCatList = $this->lfGetCategoryList(); 69 75 // 選択中のメーカーIDを判定する 70 $this->maker_id = $this->lfGetSelectedMakerId( );76 $this->maker_id = $this->lfGetSelectedMakerId($product_id, $maker_id); 71 77 // メーカー検索用選択リスト 72 78 $this->arrMakerList = $this->lfGetMakerList(); … … 81 87 parent::destroy(); 82 88 } 83 89 90 /** 91 * 商品IDを取得する. 92 * 93 * @return string $product_id 商品ID 94 */ 95 function lfGetProductId() { 96 $product_id = ''; 97 if ( isset($_GET['product_id']) && $_GET['product_id'] != '' && is_numeric($_GET['product_id']) ) { 98 $product_id = $_GET['product_id']; 99 } 100 return $product_id; 101 } 102 103 /** 104 * カテゴリIDを取得する. 105 * 106 * @return string $category_id カテゴリID 107 */ 108 function lfGetCategoryId() { 109 $category_id = ''; 110 if ( isset($_GET['category_id']) && $_GET['category_id'] != '' && is_numeric($_GET['category_id']) ) { 111 $category_id = $_GET['category_id']; 112 } 113 return $category_id; 114 } 115 116 /** 117 * メーカーIDを取得する. 118 * 119 * @return string $maker_id メーカーID 120 */ 121 function lfGetCategoryId() { 122 $maker_id = ''; 123 if ( isset($_GET['maker_id']) && $_GET['maker_id'] != '' && is_numeric($_GET['maker_id']) ) { 124 $maker_id = $_GET['maker_id']; 125 } 126 return $maker_id; 127 } 128 84 129 /** 85 130 * 選択中のカテゴリIDを取得する … … 87 132 * @return array $arrCategoryId 選択中のカテゴリID 88 133 */ 89 function lfGetSelectedCategoryId() { 90 // 商品ID取得 91 if ( !isset($_GET['product_id']) || $_GET['product_id'] == '' || !is_numeric($_GET['product_id']) ) { 92 return array(); 93 } 94 $product_id = $_GET['product_id']; 95 // カテゴリID取得 96 if ( !isset($_GET['category_id']) || $_GET['category_id'] == '' || !is_numeric($_GET['category_id']) ) { 97 return array(); 98 } 99 $category_id = $_GET['category_id']; 134 function lfGetSelectedCategoryId($product_id, $category_id) { 100 135 // 選択中のカテゴリIDを判定する 101 136 $objDb = new SC_Helper_DB_Ex(); … … 109 144 * @return array $arrMakerId 選択中のメーカーID 110 145 */ 111 function lfGetSelectedMakerId() { 112 // 商品ID取得 113 if ( !isset($_GET['product_id']) || $_GET['product_id'] == '' || !is_numeric($_GET['product_id']) ) { 114 return array(); 115 } 116 $product_id = $_GET['product_id']; 117 // メーカーID取得 118 if ( !isset($_GET['maker_id']) || $_GET['maker_id'] == '' || !is_numeric($_GET['maker_id']) ) { 119 return array(); 120 } 121 $maker_id = $_GET['maker_id']; 146 function lfGetSelectedMakerId($product_id, $maker_id) { 122 147 // 選択中のメーカーIDを判定する 123 148 $objDb = new SC_Helper_DB_Ex();
Note: See TracChangeset
for help on using the changeset viewer.