当前位置: 首页>>代码示例>>PHP>>正文


PHP PwBaseController::beforeAction方法代码示例

本文整理汇总了PHP中PwBaseController::beforeAction方法的典型用法代码示例。如果您正苦于以下问题:PHP PwBaseController::beforeAction方法的具体用法?PHP PwBaseController::beforeAction怎么用?PHP PwBaseController::beforeAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PwBaseController的用法示例。


在下文中一共展示了PwBaseController::beforeAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('my/article/run')));
     }
 }
开发者ID:YoursBoss,项目名称:nextwind,代码行数:7,代码来源:ArticleController.php

示例2: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run', array('_type' => $this->getInput('_type'))));
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:7,代码来源:ExtendsController.php

示例3: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $spaceUid = (int) $this->getInput('uid', 'get');
     if ($spaceUid < 1) {
         $userName = $this->getInput('username', 'get');
         $user = Wekit::load('user.PwUser')->getUserByName($userName);
         $spaceUid = isset($user['uid']) ? $user['uid'] : 0;
     }
     if ($spaceUid < 1) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/'));
     }
     $this->space = new PwSpaceBo($spaceUid);
     if (!$this->space->space['uid']) {
         $user = Wekit::load('user.PwUser')->getUserByUid($spaceUid);
         if ($user) {
             Wekit::load('space.dm.PwSpaceDm');
             $dm = new PwSpaceDm($spaceUid);
             $dm->setVisitCount(0);
             Wekit::load('space.PwSpace')->addInfo($dm);
             $this->space = new PwSpaceBo($spaceUid);
         } else {
             $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/'));
         }
     }
     $this->space->setTome($spaceUid, $this->loginUser->uid);
     $this->space->setVisitUid($this->loginUser->uid);
     $this->setTheme('space', null);
     if ($this->space->allowView('space')) {
         $this->forwardRedirect(WindUrlHelper::createUrl('space/index/run', array('uid' => $spaceUid)));
     }
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:32,代码来源:BanController.php

示例4: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->showError('VOTE:user.not.login');
     }
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:7,代码来源:VoteController.php

示例5: beforeAction

	public function beforeAction($handlerAdapter) {
		parent::beforeAction($handlerAdapter);
		if (!$this->loginUser->isExists()) {
			$this->forwardAction('u/login/run',array('backurl' => WindUrlHelper::createUrl('my/follow/run')));
		}
		$this->setOutput('follow', 'li');
    }
开发者ID:healthguo,项目名称:PHP,代码行数:7,代码来源:FollowController.php

示例6: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $action = $handlerAdapter->getAction();
     if (in_array($action, array('fastreply', 'replylist'))) {
         return;
     }
     $this->post = $this->_getPost($action);
     if (($result = $this->post->check()) !== true) {
         $error = $result->getError();
         if (is_array($error) && $error[0] == 'BBS:post.forum.allow.ttype' && ($allow = $this->post->forum->getThreadType($this->post->user))) {
             $special = key($allow);
             $this->forwardAction('bbs/post/run?fid=' . $this->post->forum->fid . ($special ? '&special=' . $special : ''));
         }
         $this->showError($error);
     }
     //版块风格
     $pwforum = $this->post->forum;
     if ($pwforum->foruminfo['password']) {
         if (!$this->loginUser->isExists()) {
             $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('bbs/post/' . $action, array('fid' => ${$pwforum}->fid))));
         } elseif (Pw::getPwdCode($pwforum->foruminfo['password']) != Pw::getCookie('fp_' . $pwforum->fid)) {
             $this->forwardAction('bbs/forum/password', array('fid' => $pwforum->fid));
         }
     }
     if ($pwforum->foruminfo['style']) {
         $this->setTheme('forum', $pwforum->foruminfo['style']);
     }
     $this->setOutput($action, 'action');
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:30,代码来源:PostController.php

示例7: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->_var = $this->getRequest()->getRequest();
     $this->_conf = Wekit::C('pay');
     if (!$this->_conf['ifopen']) {
         $this->paymsg($this->_conf['reason']);
     }
     if (!$this->_conf['99bill'] || !$this->_conf['99billkey']) {
         $this->paymsg('onlinepay.settings.99bill.error');
     }
     strlen($this->_conf['99bill']) == 11 && ($this->_conf['99bill'] .= '01');
     $arr = array('payType', 'bankId', 'orderId', 'orderTime', 'orderAmount', 'dealId', 'bankDealId', 'dealTime', 'payAmount', 'fee', 'payResult', 'errCode');
     $txt = 'merchantAcctId=' . $this->_conf['99bill'] . '&version=v2.0&language=1&signType=1';
     foreach ($arr as $value) {
         $this->_var[$value] = trim($this->_var[$value]);
         if (strlen($this->_var[$value]) > 0) {
             $txt .= '&' . $value . '=' . $this->_var[$value];
         }
     }
     $mac = strtoupper(md5($txt . '&key=' . $this->_conf['99billkey']));
     if ($mac != strtoupper(trim($this->_var['signMsg']))) {
         $this->paymsg('onlinepay.auth.fail');
     }
     if ($this->_var['payResult'] != '10') {
         $this->paymsg('onlinepay.success');
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:28,代码来源:Pay99billController.php

示例8: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->_var = $this->getRequest()->getRequest();
     $this->_conf = Wekit::C('pay');
     if (!$this->_conf['ifopen']) {
         $this->paymsg($this->_conf['reason']);
     }
     if (!$this->_conf['tenpay'] || !$this->_conf['tenpaykey']) {
         $this->paymsg('onlinepay.settings.tenpay.error');
     }
     $arr = array('cmdno', 'pay_result', 'date', 'transaction_id', 'sp_billno', 'total_fee', 'fee_type', 'attach');
     $txt = '';
     foreach ($arr as $value) {
         $txt .= $value . '=' . $this->_var[$value] . '&';
     }
     $mac = strtoupper(md5($txt . 'key=' . $this->_conf['tenpaykey']));
     if ($mac != $this->_var['sign']) {
         $this->paymsg('onlinepay.auth.fail');
     }
     if ($this->_conf['tenpay'] != $this->_var['bargainor_id']) {
         $this->paymsg('onlinepay.tenpay.bargainorid.error');
     }
     if ($this->_var['pay_result'] != "0") {
         $this->paymsg('onlinepay.fail');
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:27,代码来源:TenpayController.php

示例9: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $charset = 'utf-8';
     $_windidkey = $this->getInput('windidkey', 'get');
     $_time = (int) $this->getInput('time', 'get');
     $_clientid = (int) $this->getInput('clientid', 'get');
     if (!$_time || !$_clientid) {
         $this->output(WindidError::FAIL);
     }
     $clent = $this->_getAppDs()->getApp($_clientid);
     if (!$clent) {
         $this->output(WindidError::FAIL);
     }
     if (WindidUtility::appKey($clent['id'], $_time, $clent['secretkey']) != $_windidkey) {
         $this->output(WindidError::FAIL);
     }
     $time = Windid::getTime();
     if ($time - $_time > 120) {
         $this->output(WindidError::TIMEOUT);
     }
     $charset = $clent['charset'] == 1 ? 'utf8' : 'gbk';
     $baseUrl = Wind::getApp()->getRequest()->getBaseUrl(true) . '/';
     $config = array('windid' => 'client', 'serverUrl' => $baseUrl, 'clientId' => $clent['id'], 'clientKey' => $clent['secretkey'], 'clientDb' => 'mysql', 'clientCharser' => $charset);
     WindidClientBo::getInstance($config);
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:26,代码来源:IndexController.php

示例10: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->_var = $this->getRequest()->getRequest();
     $this->_conf = Wekit::C('pay');
     if (!$this->_conf['ifopen']) {
         $this->paymsg($this->_conf['reason']);
     }
     if (!$this->_conf['alipay']) {
         $this->paymsg('onlinepay.settings.alipay.error');
     }
     $http = Wind::getComponent('httptransfer', array('http://notify.alipay.com/trade/notify_query.do'));
     $veryfy_result2 = trim($http->post(array('notify_id' => $this->_var['notify_id'], 'partner' => $this->_conf['alipaypartnerID'])), "\r\n");
     //兼容支付宝urlencode之后伪静态+号无法rawurldecode的处理方案
     isset($this->_var['notify_time']) && ($this->_var['notify_time'] = urldecode($this->_var['notify_time']));
     ksort($this->_var);
     reset($this->_var);
     $arg = '';
     foreach ($this->_var as $key => $value) {
         if ($value && !in_array($key, array('p', 'm', 'c', 'a', 'sign', 'sign_type'))) {
             $arg .= "{$key}={$value}&";
         }
     }
     $veryfy_result1 = $this->_var['sign'] == md5(substr($arg, 0, -1) . $this->_conf['alipaykey']) ? true : false;
     if (!$veryfy_result1 || !preg_match("/true/i", $veryfy_result2)) {
         $this->paymsg('onlinepay.auth.fail', 'fail');
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:28,代码来源:AlipayController.php

示例11: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if ($this->loginUser->uid < 1) {
         $this->showError('SPACE:user.not.login');
     }
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:7,代码来源:MyspaceController.php

示例12: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if ($this->loginUser->uid < 1) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/'));
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:7,代码来源:SourceController.php

示例13: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $conf = Wekit::C('app_mark');
     if (!$conf['mark.isopen']) {
         $this->showError('评分没有开启');
     }
 }
开发者ID:sanzhumu,项目名称:nextwind,代码行数:8,代码来源:MarkController.php

示例14: beforeAction

 public function beforeAction($handlerAdapter)
 {
     $this->appid = $this->getInput('appid');
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('appcenter/app/run', array('appid' => $this->appid))));
     }
 }
开发者ID:chendong0444,项目名称:phpwind,代码行数:8,代码来源:AppsController.php

示例15: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     Wekit::load('design.PwDesignPermissions');
     $permissions = $this->_getPermissionsService()->getPermissionsForUserGroup($this->loginUser->uid);
     if ($permissions < PwDesignPermissions::NEED_CHECK) {
         $this->showError("DESIGN:permissions.fail");
     }
 }
开发者ID:fanqimeng,项目名称:4tweb,代码行数:9,代码来源:PushController.php


注:本文中的PwBaseController::beforeAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。