Example #1
0
 protected function check_redirect()
 {
     $CurrentUrl = APF::get_instance()->get_request()->get_current_url();
     if (!$this->isBrokerDomain()) {
         APF::get_instance()->get_response()->redirect(Uri_MemberUrl::build_login_url($CurrentUrl));
     }
     if (!$this->isBrokerLogin()) {
         APF::get_instance()->get_response()->redirect(Uri_MemberUrl::build_login_url($CurrentUrl));
         return false;
     }
 }
Example #2
0
 /**
  * 基础权限判断模块
  */
 public function basicCheck()
 {
     $ajkBrokerId = $this->requestObj->getBrokerId();
     $cityId = $this->requestObj->getBrokerCityId();
     $this->ctx = $this->requestObj->get_parameters();
     // 非登陆者
     if (!$ajkBrokerId) {
         $this->responseObj->redirect(Uri_MemberUrl::build_login_url($this->currentUrl));
     }
     if (!($hzBrokerId = Model_Broker_HzMapping::get_hz_broker_id($ajkBrokerId))) {
         $this->redirect2Result(Const_PublishCode::UNKNOWN_ERROR, $this->site, $this->action);
     }
     $routeMatches = $this->requestObj->get_router_matches();
     $this->ctx['proId'] = isset($routeMatches[3]) ? (int) $routeMatches[3] : 0;
     $this->ctx['isEdit'] = (int) ($this->ctx['proId'] > 0);
     // ppc 没有计划 初始化个
     $planId = 0;
     $planStatus = 1;
     if (!($isComboCity = Bll_City::isComboCity($cityId))) {
         $validFixPlans = Bll_Plan_Fix_HzFix::getValidPlansByBrokerId($hzBrokerId);
         if (empty($validFixPlans)) {
             $createPlanResult = Bll_Plan_Fix_HzFix::createPlan($ajkBrokerId, $cityId, '定价推广组');
             if (!$createPlanResult['status']) {
                 $this->redirect2Result(Const_PublishCode::CREATE_PLAN_ERROR, $this->site, $this->action);
             }
             $planId = $createPlanResult['msg']['id'];
         } else {
             $planId = $validFixPlans[0]['id'];
             $planStatus = $validFixPlans[0]['status'];
         }
     }
     $this->ctx['hzBrokerId'] = $hzBrokerId;
     $this->ctx['ajkBrokerId'] = $ajkBrokerId;
     $this->ctx['isFixCity'] = (int) (!$isComboCity);
     $this->ctx['isComboCity'] = (int) $isComboCity;
     $this->ctx['cityId'] = $cityId;
     // 发房数判断
     $propNums = count(Bll_House_HzHouse::getValidPropsByBrokerIdEx($this->ctx['ajkBrokerId'], $this->ctx['cityId'], false));
     // 获取套餐相关
     //        $brokerLimitInfo = Bll_Broker_BrokerLimit::getPpcBrokerLimitInfo($ajkBrokerId, Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE);
     $proLimitInfo = Bll_Onoff_Prop::getPropLimit($this->ctx['cityId'], "hz");
     if (!$this->ctx['isEdit'] && $propNums >= $proLimitInfo['data']['publishLimit']) {
         $this->redirect2Result(Const_PublishCode::PUBLISH_OUT_OF_LIMIT, $this->site, $this->action);
     }
     // 伪登陆操作限制
     $managerCookie = $this->requestObj->get_cookie('manager_id');
     $this->ctx['isManagerCookie'] = $managerCookie ? true : false;
     $this->ctx['planId'] = $planId;
     $this->ctx['planStatus'] = $planStatus;
     $this->ctx['brokerLimitInfo'] = $proLimitInfo['data'];
     $this->ctx['debug'] = isset($_GET['debug']) ? trim($_GET['debug']) : false;
     return true;
 }
Example #3
0
 /**
  * 页面基础验证
  * 登录
  */
 public function basicCheck()
 {
     $brokerId = APF::get_instance()->get_request()->getBrokerId();
     if (!$brokerId) {
         APF::get_instance()->get_response()->redirect(Uri_MemberUrl::build_login_url($this->currentUrl));
         exit;
     }
     $cityId = APF::get_instance()->get_request()->getBrokerCityId();
     $jinpuOpenConfig = APF::get_instance()->get_config("jinpu_open", "ppc");
     if (!$jinpuOpenConfig[$cityId]['open']) {
         APF::get_instance()->get_response()->redirect('/user/combo/brokerhome');
         exit;
     }
     return true;
 }
Example #4
0
 public function basicCheck()
 {
     if (!$this->isBrokerLogin()) {
         APF::get_instance()->get_response()->redirect(Uri_MemberUrl::build_login_url($this->currentUrl));
         return false;
     }
     $this->request = APF::get_instance()->get_request();
     $brokerId = $this->request->getBrokerId();
     $cityId = $this->request->getBrokerCityId();
     $this->isComboBroker = Bll_Broker_HzBroker::isComboBroker($brokerId);
     $this->isPpcBroker = Bll_Broker_HzBroker::isPpcBroker($brokerId);
     $routeMatches = $this->request->get_router_matches();
     if (isset($routeMatches[3]) && is_numeric($routeMatches[3])) {
         $this->houseId = $routeMatches[3];
         $this->action = 'edit';
     }
     /** 委托房源发布 */
     $act = $this->request->get_parameter('act');
     $id = $this->request->get_parameter('cid');
     // commission  id
     if ($act == 'commission' && is_numeric($id)) {
         $this->commissionId = $id;
         $this->action = 'commission';
     }
     /** 验证发房数 */
     try {
         $brokerCanPublishHouse = Bll_Broker_HzBroker::checkEsfBrokerCanPublishHouse($cityId, $brokerId);
         if ($this->action != 'edit' && !$brokerCanPublishHouse) {
             $this->redirect2Result(Const_PublishCode::PUBLISH_OUT_OF_LIMIT, 'ajk', $this->action, 0, '发房数超出限制');
         }
     } catch (Exception $e) {
         $this->redirect2Result(Const_PublishCode::API_ERROR, 'ajk', $this->action, 0, $e->getMessage());
     }
     /** 验证房源 */
     if ($this->action == 'edit' && !Bll_House_EsfHouse::checkHouseExist($cityId, $this->houseId, $brokerId)) {
         $this->redirect2Result(Const_PublishCode::HOUSE_NOT_EXIST, 'ajk', $this->action, $this->houseId, '房源不存在');
     }
     return true;
 }
Example #5
0
 protected function check_redirect()
 {
     if (!$this->isBrokerDomain()) {
         APF::get_instance()->get_response()->redirect(Uri_MemberUrl::build_login_url($this->currentUrl));
     }
     if (!$this->isBrokerLogin()) {
         APF::get_instance()->get_response()->redirect(Uri_MemberUrl::build_login_url($this->currentUrl));
     }
     return true;
 }