Authored by hf

do modify cuxiao coupon huodong js add checkout is logged

@@ -64,46 +64,8 @@ class Bootstrap extends Bootstrap_Abstract @@ -64,46 +64,8 @@ class Bootstrap extends Bootstrap_Abstract
64 */ 64 */
65 public function _initRoute(Dispatcher $dispatcher) 65 public function _initRoute(Dispatcher $dispatcher)
66 { 66 {
67 - $hostParts = explode('.', $dispatcher->getRequest()->getServer('HTTP_HOST', ''));  
68 - $level = count($hostParts) - 1;  
69 -  
70 - /* 根据域名的级别,设置默认的模块、控制器、方法 */  
71 - $module = 'Index';  
72 - $controller = 'Index';  
73 - $action = 'Index';  
74 - // 三级域名  
75 - if (3 === $level) {  
76 - $subDomain = strval($hostParts[0]);  
77 - switch (strtolower($subDomain)) {  
78 - case 'm': // 老版(到频道选择)  
79 - case 'buy': // 测试环境的域名, 以后可去掉  
80 - break;  
81 - case 'new': // 原新版(到男生首页)  
82 - $controller = 'Boys';  
83 - break;  
84 - case 'search': // 搜索  
85 - $controller = 'Search';  
86 - $action = 'List';  
87 - break;  
88 - case 'guang': // 逛  
89 - $module = 'Guang';  
90 - break;  
91 - case 'list': // 商品列表  
92 - $module = 'Product';  
93 - break;  
94 - default: // 其它(识别为品牌)  
95 - $module = 'Product';  
96 - $action = 'Brand';  
97 - $dispatcher->getRequest()->setParam('named', $subDomain);  
98 - break;  
99 - }  
100 - }  
101 - $dispatcher->getRequest()->module = $module;  
102 - $dispatcher->getRequest()->controller = $controller;  
103 - $dispatcher->getRequest()->action = $action;  
104 -  
105 /* 根据对应模块的配置,添加相应的路由规则 */ 67 /* 根据对应模块的配置,添加相应的路由规则 */
106 - $iniFile = APPLICATION_PATH . '/configs/routes.' . strtolower($module) . '.ini'; 68 + $iniFile = APPLICATION_PATH . '/configs/routes.index.ini';
107 if (file_exists($iniFile)) { 69 if (file_exists($iniFile)) {
108 $config = new Config\Ini($iniFile); 70 $config = new Config\Ini($iniFile);
109 if (isset($config->routes)) { 71 if (isset($config->routes)) {
@@ -501,32 +501,18 @@ class CouponController extends HuodongAction @@ -501,32 +501,18 @@ class CouponController extends HuodongAction
501 { 501 {
502 do { 502 do {
503 /* 判断是否有参数 */ 503 /* 判断是否有参数 */
504 - $param = $this->get();  
505 - if (empty($param)) { 504 + $uid = $this->get('uid');
  505 + if (empty($uid) || !is_numeric($uid) ) {
506 break; 506 break;
507 } 507 }
508 508
509 /* 判断参数是否有效 */ 509 /* 判断参数是否有效 */
510 - if (!isset($param['client_secret']) || empty($param['uid'])) { 510 + $secret = $this->get('client_secret');
  511 + if (!isset($secret) ) {
511 break; 512 break;
512 } 513 }
513 514
514 - /* 取消无用的参数 */  
515 - $uri = key($param);  
516 - if (false !== stripos($uri, 'cuxiao/')) {  
517 - unset($param[$uri]);  
518 - }  
519 -  
520 - /* 验证公钥是否有效 */  
521 - $clientSecret = $param['client_secret'];  
522 - $publicParam = Yohobuy::param();  
523 - $param['private_key'] = $publicParam['private_key'];  
524 - unset($param['client_secret']);  
525 - if ($clientSecret !== Sign::makeSign($param)) {  
526 - break;  
527 - }  
528 -  
529 - $this->setSession(self::SESSION_UID, $param['uid']); 515 + $this->setSession(self::SESSION_UID, $uid);
530 516
531 return true; 517 return true;
532 518