private function _get_user_urls() { $CityId = APF::get_instance()->get_request()->getBrokerCityId(); $UserId = APF::get_instance()->get_request()->getUserId(); $CurrentUrl = APF::get_instance()->get_request()->get_current_url(); $arrUrls = array('letter' => Uri_MemberUrl::build_letters_url(), 'logout' => Uri_MemberUrl::build_logout_url($CurrentUrl), 'profile' => Uri_MemberUrl::build_profile_url($UserId), 'myanjuke' => Uri_MemberUrl::build_backend_home_url(), 'bbs' => Uri_OtherUrl::build_bbs_url($CityId), 'help' => Uri_OtherUrl::build_help_url($CityId), 'editshop' => array('ajk' => Uri_MemberUrl::build_shop_edit_url('ajk'), 'zf' => Uri_MemberUrl::build_shop_edit_url('zf'), 'jp' => Uri_MemberUrl::build_shop_edit_url('jp'))); return $arrUrls; }
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; } }
/** * 基础权限判断模块 */ 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; }
public function checkLogin() { $arr['code'] = 1; if (!$this->isBrokerLogin()) { $baseDomain = APF::get_instance()->get_config('base_domain', 'common'); $baseUri = defined('BASE_URI') ? BASE_URI : ''; $joinurl = "http://my.{$baseDomain}{$baseUri}/goodbroker/join"; $arr['code'] = 2; $arr['url'] = Uri_MemberUrl::login_url($joinurl); } echo json_encode($arr); exit; }
/** * 页面基础验证 * 登录 */ 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; }
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; }
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; }
public function handle_request() { $CurrentUrl = APF::get_instance()->get_request()->get_current_url(); if (!$this->isBrokerLogin()) { APF::get_instance()->get_response()->redirect(Uri_MemberUrl::login_url($CurrentUrl)); exit; } $baseDomain = APF::get_instance()->get_config('base_domain', 'common'); $baseUri = defined('BASE_URI') ? BASE_URI : ''; $indexUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/index"; $joinUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/join"; $flag = ''; if (preg_match("/join\\/(\\d+)/", $_SERVER["REQUEST_URI"], $matches)) { if ($matches[1] && is_numeric($matches[1])) { $flag = $matches[1]; } } $request = APF::get_instance()->get_request(); $params = $request->get_parameters(); $request->set_attribute('indexUrl', $indexUrl); $broker_id = $request->getBrokerId(); //$broker_id = 100100; $user_id = $request->getUserId(); $dao = new Bll_Goodbroker(); //获取审核状态 $verify = $dao->getIsVerify($broker_id); $is_verify = $verify === false ? $verify : $verify['is_verify']; $realname = $dao->getBrokername($broker_id); $info['realname'] = $realname; $request->set_attribute('realname', $realname); if ($is_verify === '0') { //报名未审核 $request->set_attribute('code', '3'); return 'Goodbroker_Info'; } elseif ($is_verify == 1) { //审核通过 $show_url = "http://my.{$baseDomain}{$baseUri}/goodbroker/show"; $show_url .= '/' . $broker_id; $request->set_attribute('url', $show_url); $request->set_attribute('code', '1'); return 'Goodbroker_Info'; } elseif ($is_verify == 2 && $flag == '') { //审核不通过 $show_url = "http://my.{$baseDomain}{$baseUri}/goodbroker/join"; $show_url .= "/" . $broker_id; $request->set_attribute('reason', $verify['reason']); $request->set_attribute('url', $show_url); $request->set_attribute('code', '2'); return 'Goodbroker_Info'; } if ($is_verify == 2 && $flag == $broker_id) { //审核不通过重新修改资料 $info = $dao->getBrokerInfo($broker_id); $request->set_attribute('info', $info); } $info['photo'] = strlen($params['default_photo']) == 32 ? $params['default_photo'] : $params['photoes'][0]; if ($params['slogan'] && $params['story'] && $params['photoes']) { if (strlen($params['slogan']) > 100) { $error['slogan'] = '参赛口号限20字以内'; } else { $info['slogan'] = htmlentities($params['slogan'], ENT_QUOTES | ENT_IGNORE, "UTF-8"); } if (strlen($params['story']) > 2000) { $error['story'] = '个人故事限500字以内'; } else { $info['story'] = htmlentities($params['story'], ENT_QUOTES | ENT_IGNORE, "UTF-8"); } $photoes = $params['photoes']; if (count($photoes) < 3 || count($photoes) > 8) { $error['story'] = '照片数最少3张最多8张 '; } if (isset($error) && !empty($error)) { $request->set_attribute('error', $error); } else { $base = Bll_BrokerInfoApp::get_goodbroker_info($broker_id); $info['city_id'] = $base['city_id']; $info['phone'] = $base['phone']; $info['company_name'] = $base['company']; $info['store_name'] = $base['store']; //获取经纪人的注册时间以及在售房源数 $info['register_time'] = $dao->getBrokerRegtime($user_id); $info['on_sale'] = Bll_Goodbroker::getSpreadProCount($broker_id, $base['city_id']); $dao->addBrokerInfo($broker_id, $info, $photoes); $request->set_attribute('code', '3'); $this->redirect($joinUrl); //return 'Goodbroker_Info'; } } return 'Goodbroker_Join'; }