- Timestamp:
- 2011/01/18 16:18:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php
r19911 r19957 33 33 class LC_Page_Mypage_DownLoad extends LC_Page { 34 34 35 // {{{ properties 36 37 /** フォームパラメータの配列 */ 38 var $objFormParam; 39 35 40 // }}} 36 41 // {{{ functions … … 53 58 function process() { 54 59 ob_end_clean(); 55 60 parent::process(); 61 $this->action(); 62 $this->sendResponse(); 63 } 64 65 /** 66 * Page のAction. 67 * 68 * @return void 69 */ 70 function action() { 71 // ログインチェック 72 $objCustomer = new SC_Customer(); 73 if (!$objCustomer->isLoginSuccess()){ 74 SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND,"",true); 75 } 76 77 // パラメータチェック 78 $this->objFormParam = new SC_FormParam(); 79 $this->lfInitParam(); 80 // GET、SESSION['customer']値の取得 81 $this->objFormParam->setParam($_SESSION['customer']); 82 $this->objFormParam->setParam($_GET); 83 $this->arrErr = $this->lfCheckError(); 84 if (count($this->arrErr)!=0){ 85 SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND,"",true); 86 } 87 } 88 89 /** 90 * Page のResponse. 91 * @return void 92 */ 93 function sendResponse() { 94 $this->objDisplay->noAction(); 95 96 // パラメータ取得 56 97 $customer_id = $_SESSION['customer']['customer_id']; 57 98 $order_id = $_GET['order_id']; … … 59 100 $product_class_id = $_GET['product_class_id']; 60 101 61 // ID の数値チェック62 // TODO SC_FormParam でチェックした方が良い?63 if (!is_numeric($customer_id)64 || !is_numeric($order_id)65 || !is_numeric($product_id)66 || !is_numeric($product_class_id)) {67 SC_Utils_Ex::sfDispSiteError("");68 }69 70 $objCustomer = new SC_Customer();71 //ログインしていない場合エラー72 if (!$objCustomer->isLoginSuccess()){73 SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);74 }75 76 102 //DBから商品情報の読込 77 103 $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id); … … 96 122 $sdown_filename = mb_convert_encoding($arrForm["down_filename"], $encoding, "auto"); 97 123 98 //TODO SC_Display利用に変更 124 // flushなどを利用しているので、現行のSC_Displayは利用できません。 125 // SC_DisplayやSC_Responseに大容量ファイルレスポンスが実装されたら移行可能だと思います。 126 99 127 //タイプ指定 100 128 header("Content-Type: Application/octet-stream"); … … 161 189 } 162 190 191 192 /* パラメータ情報の初期化 */ 193 function lfInitParam() { 194 $this->objFormParam->addParam("customer_id", "customer_id", INT_LEN, "n", array("EXIST_CHECK","NUM_CHECK")); 195 $this->objFormParam->addParam("order_id", "order_id", INT_LEN, "n", array("EXIST_CHECK", "NUM_CHECK")); 196 $this->objFormParam->addParam("product_id", "product_id", INT_LEN, "n", array("EXIST_CHECK","NUM_CHECK")); 197 $this->objFormParam->addParam("product_class_id", "product_class_id", INT_LEN, "n", array("EXIST_CHECK","NUM_CHECK")); 198 } 199 200 /* 入力内容のチェック */ 201 function lfCheckError() { 202 // 入力データを渡す。 203 $arrRet = $this->objFormParam->getHashArray(); 204 $objErr = new SC_CheckError($arrRet); 205 $objErr->arrErr = $this->objFormParam->checkError(); 206 return $objErr->arrErr; 207 } 208 163 209 /** 164 210 * デストラクタ.
Note: See TracChangeset
for help on using the changeset viewer.