當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBC::requireTrue方法代碼示例

本文整理匯總了PHP中DBC::requireTrue方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBC::requireTrue方法的具體用法?PHP DBC::requireTrue怎麽用?PHP DBC::requireTrue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBC的用法示例。


在下文中一共展示了DBC::requireTrue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: newPost

 public function newPost($request, $response)
 {
     /*{{{*/
     $verifyOk = Captcha::verify($request->verifyStr, XIpLocation::getIp(), 'article', $request->article_id, $request->token);
     DBC::requireTrue($verifyOk, "您輸入的驗證碼有誤!");
     //禁用詞檢查
     $title = $request->title;
     $result = DoctorClient::getInstance()->getProfanityCheck($title);
     DBC::requireFalse($result['CODE'] < 0, "文章 評論添加失敗");
     DBC::requireFalse($result['CODE'] == 2, "文章 評論添加成功");
     $title = $result['CONTENT'];
     $content = htmlspecialchars($request->getRequest('content'), ENT_COMPAT | ENT_HTML401, 'ISO-8859-1');
     $result = DoctorClient::getInstance()->getProfanityCheck($content);
     DBC::requireFalse($result['CODE'] < 0, "文章 評論添加失敗");
     DBC::requireFalse($result['CODE'] == 2, "文章 評論添加成功");
     $content = $result['CONTENT'];
     $article = DAL::get()->find('article', $request->article_id);
     $feilds = array();
     $feilds['ip'] = XIpLocation::getIp();
     $feilds['ipLocation'] = XIpLocation::getLocationArea();
     $userId = $this->user->isNull() == false ? $this->user->id : '';
     $comment = ArticleClient::getInstance()->addComment($article, $userId, $title, $content, $feilds);
     squid::clean($article->getUrl(), true);
     $this->message('您發表的評論已經提交,待網站審核通過後即可展示。', $response);
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:25,代碼來源:articlecommentcontroller.php

示例2: before

    public function before($context) 
    {/*{{{*/
        parent::before($context);
        $group = DAL::get()->find_parent('FinanceInspectGroup');

        DBC::requireTrue($group->among($context->response->curInspector), '你沒有權限訪問');
    }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:7,代碼來源:financialinterceptor.php

示例3: detail

 public function detail($request, $response)
 {/*{{{*/
     $threadId = (int)$request->case_id;
     $criticalNum = 100*100*1000;
     $correctNum = 100*100*100;
     $threadId = $threadId > $criticalNum ? $threadId : $threadId-$correctNum;
     
     $proposal = DAL::get()->find('proposal', $threadId);
     if(false == $proposal->isNull())
     {
         $response->setRedirect($proposal->getTouchUrl());
         return 0;
     }
     else
     {
         $intention = DAL::get()->find('intention', $threadId);
         if(false == $intention->isNull())
         {
             $response->setRedirect($intention->getTouchUrl());
             return 0;
         }
         else
         {
             DBC::requireTrue(false, 'Êý¾ÝÎÊÌâ');
         }
     }
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:27,代碼來源:threadcontroller.php

示例4: addFlowChargeOrder

 public function addFlowChargeOrder($request, $response)
 {
     /*{{{*/
     $refId = $request->getRequest('refid', true);
     $ref = DAL::get()->find('DoctorPatientRef', $refId);
     $isdpRef = $ref instanceof DoctorPatientRef;
     $isUserSelf = $ref->user->id == $this->user->id;
     $isOpenCharge = $ref->space->isChargeOpened();
     DBC::requireTrue($isdpRef && $isUserSelf && $isOpenCharge, '對不起,您不能預充值');
     if ($this->checkCanCharge($ref)) {
         $this->message("抱歉!現在不能購買。您已經提前購買了{$ref->space->name}醫生的3次指導機會,為避免資源浪費,請在使用後再次夠買。", $response, array('text' => '點擊這裏繼續', 'url' => $ref->getUrl()));
     } else {
         $product = ProductClient::getInstance()->getDoctorChargeFlowProduct($ref->space);
         $charge = $product->salePrice;
         $cashAccount = $this->user->getCashAccount();
         if ($cashAccount->amount >= $charge) {
             $serviceOrder = ServiceOrderClient::getInstance()->create($ref, $product, $this->user);
             if (false == $serviceOrder->isNull()) {
                 ServiceOrderClient::getInstance()->pay($serviceOrder, $this->user);
                 $serviceOrder = DAL::get()->find('serviceOrder', $serviceOrder->id, true);
             }
             if ($serviceOrder->isPaid()) {
                 $response->setRedirect($serviceOrder->successUrl());
                 return parent::DIRECT_OUTPUT;
             }
         }
         $url = 'http://' . URL_PREFIX . 'passport.haodf.com/telpayment/showtelaccount';
         $this->message('您的餘額不足,不能購買,請充值後重新購買', $response, array('text' => '去充值', 'url' => $url));
     }
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:30,代碼來源:chargecontroller.php

示例5: before

	public function before($context)
	{
        $userId = UserClient::getInstance()->getCheckedSeed('id');      
        $user = DAL::get()->mustFind('user', $userId);
        $inspector = DAL::get()->find_actived('inspector', $user);
        $hasClaimPaymentPower = $inspector->isInRenLingHuiKuanGroup();
        DBC::requireTrue($hasClaimPaymentPower, '您沒有認領匯款權限');
	}
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:8,代碼來源:claimremitinterceptor.php

示例6: saveCurrentAppUrl

 public function saveCurrentAppUrl($request, $response)
 {
     if (!$this->curOperator->isOperatorAdmin()) {
         throw new TelConfException('抱歉,此座席無權限查看!');
     }
     DBC::requireTrue(in_array('haodfhw', array('byteh', 'haodfhw', 'miaoqing1983', 'zhb110good')), '沒有權限,親!');
     PhoneConferenceClient::getInstance()->updateProviderCurrentAppUrl($request->callcenterProviderId, $request->currentAppUrl);
     $response->setRedirect('callcenterprovider');
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:9,代碼來源:managercontroller.php

示例7: getPayItemList

 public function getPayItemList($pageNo, $pageSize, $startTime, $endTime)
 {
     /*{{{*/
     DBC::requireTrue(XDateTime::getSecondDiffDesc($endTime, $startTime) < 3600, "查詢時間不能超過一天");
     $parameter = array("service" => "account.page.query", "partner" => $this->partner, "_input_charset" => $this->_input_charset, "page_no" => $pageNo, "page_size" => $pageSize, "gmt_start_time" => $startTime, "gmt_end_time" => $endTime, "logon_id" => "", "trade_no" => "", "merchant_out_order_no" => "", "deposit_bank_no" => "", "trans_code" => "");
     $alipay = new alipay_service($parameter, $this->security_code, $this->sign_type);
     $url = $alipay->create_url();
     return $url;
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:9,代碼來源:alipay.php

示例8: before

 public function before($context)
 {
     parent::before($context);
     $flowGroup = DAL::get()->find_parent('FlowPostInspectGroup');
     $followupGroup = DAL::get()->find_parent('followupPostInspectGroup');
     DBC::requireTrue($flowGroup->among($context->response->curInspector) || $followupGroup->among($context->response->curInspector), '你沒有權限訪問');
     $userInfo = $context->request->getCookie('userinfo');
     $context->response->auditor = DAL::get()->find_by_userid('auditor', $userInfo['id']);
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:9,代碼來源:nfsauditinterceptor.php

示例9: checkCacheConfigs

 private function checkCacheConfigs($configs)
 {
     /*{{{*/
     foreach ($configs as $type => $servers) {
         foreach ($servers as $i => $server) {
             DBC::requireTrue(isset($server['host']), "memcache {$type} type[{$i}][host] not defined");
             DBC::requireTrue(isset($server['port']), "memcache {$type} type[{$i}][port] not defined");
         }
     }
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:10,代碼來源:cacher.php

示例10: modifyZhiJiaPost

 public function modifyZhiJiaPost($request, $response)
 {
     /*{{{*/
     $projectSupport = DAL::get()->find('ProjectSupport', $request->projectSupportId);
     DBC::requireTrue($projectSupport instanceof ProjectSupport, "不存在該支架");
     $params = $request->vars;
     ProjectInterviewClient::getInstance()->modifyZhiJia($projectSupport->id, $params);
     $preMsg = "支架 " . $projectSupport->getCodeDesc() . " 修改成功";
     $response->setRedirect($response->router->urlfor('projectsupportmgr/modifyzhijia', array('preMsg' => $preMsg, 'projectSupportId' => $projectSupport->id)));
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:10,代碼來源:projectsupportmgrcontroller.php

示例11: modifyPost

 public function modifyPost($request, $response)
 {
     /*{{{*/
     $projectAntithromboticDrug = DAL::get()->find('ProjectAntithromboticDrug', $request->projectAntithromboticDrugId);
     DBC::requireTrue($projectAntithromboticDrug instanceof ProjectAntithromboticDrug, "²»´æÔڸüÈÍù/¿¹Ë¨Ò©ÎïÖÎÁÆ");
     $params = $request->vars;
     ProjectInterviewClient::getInstance()->modifyAntithromboticDrug($projectAntithromboticDrug->id, $params);
     $preMsg = "¼ÈÍù/¿¹Ë¨Ò©ÎïÖÎÁÆ " . $projectAntithromboticDrug->getDrugNameDesc() . " Ð޸ijɹ¦";
     $response->setRedirect($response->router->urlfor('projectantithromboticdrugmgr/modify', array('preMsg' => $preMsg, 'projectAntithromboticDrugId' => $projectAntithromboticDrug->id)));
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:10,代碼來源:projectantithromboticdrugmgrcontroller.php

示例12: before

 public function before($context)
 {
     parent::before($context);
     $group = DAL::get()->find_parent('PatientClubInspectGroup');
     DBC::requireTrue($group->among($context->response->curInspector), '你沒有權限訪問');
     $userInfo = $context->request->getCookie('userinfo');
     $auditor = DAL::get()->find_by_userid('auditor', $userInfo['id']);
     if ($context->action == 'exportcontacts' && false == in_array($auditor->user->name, self::$exportContactsAuditor)) {
         throw new BizException('你沒有權限訪問');
     }
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:11,代碼來源:residentevilinterceptor.php

示例13: listOfFunpoint4Mv

 public function listOfFunpoint4Mv($request, $response)
 {
 	$deleted = $request->deleted;
 	$response->deleted = isset($deleted)?$deleted:-1;
 	 
 	$funpointid = $request->funpointid;
 	$funpoint = Funpoint::getById($funpointid);
 	 
 	DBC::requireTrue($funpoint instanceof Funpoint,'功能點不存在,id='.$funpointid);
 	$response->funpoint =  $funpoint;
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:11,代碼來源:usecasecontroller.php

示例14: before

 public function before($context)
 {
     parent::before($context);
     $userInfo = $context->request->getCookie('userinfo');
     $inspector = DAL::get()->find_by_userid('inspector', $userInfo['id']);
     $user = DAL::get()->find('user', $userInfo['id']);
     DBC::requireTrue(Inspector::isInSpector($user), '你沒有權限訪問');
     $leaderGroup = DAL::get()->queryBuAndSaleLeaderIdAndAdmin("Inspector");
     DBC::requireTrue(in_array($inspector->id, $leaderGroup), "沒有操作權限!");
     $context->response->curInspector = $inspector;
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:11,代碼來源:userfeedbackinerceptor.php

示例15: updatePost

 public function updatePost($request, $response)
 {
     /*{{{*/
     $categoryName = $request->categoryName;
     DBC::requireTrue($categoryName, "類別名不可為空!");
     $isSuccess = ArticleClient::getInstance()->modifyArticleCategory($request->categoryId, array('name' => $categoryName));
     if ($isSuccess) {
         $this->message('文章分類 ' . $categoryName . ' 修改成功', $response);
     } else {
         $this->message('修改失敗,請稍後重試', $response);
     }
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:12,代碼來源:adminarticlecategorycontroller.php


注:本文中的DBC::requireTrue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。