当前位置: 首页>>代码示例>>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;未经允许,请勿转载。