public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('my/article/run')));
     }
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run', array('_type' => $this->getInput('_type'))));
     }
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if ($this->loginUser->uid < 1) {
         $this->showError('SPACE:user.not.login');
     }
 }
 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');
     }
 }
 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');
     }
 }
Exemple #6
0
	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');
    }
Exemple #7
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->showError('VOTE:user.not.login');
     }
 }
Exemple #8
0
 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)));
     }
 }
Exemple #9
0
 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);
 }
 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');
     }
 }
 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');
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if ($this->loginUser->uid < 1) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/'));
     }
 }
Exemple #13
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $conf = Wekit::C('app_mark');
     if (!$conf['mark.isopen']) {
         $this->showError('评分没有开启');
     }
 }
 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))));
     }
 }
 public function afterAction($handlerAdapter)
 {
     parent::afterAction($handlerAdapter);
     $bread = array($this->bread['left']);
     unset($this->bread['left']);
     $this->bread && ($bread = array_merge($bread, $this->bread));
     Wekit::setGlobal($bread, 'profileBread');
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if ($this->loginUser->isExists()) {
         $this->forwardRedirect(WindUrlHelper::createUrl('bbs/index/run'));
     }
     $this->isMailOpen = Wekit::C('email', 'mailOpen') ? true : false;
     $this->isMobileOpen = Wekit::C('login', 'mobieFindPasswd') ? true : false;
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $this->setOutput('用户注册', 'title');
     $config = Wekit::C('register');
     if (0 == $config['type'] && 'close' != $handlerAdapter->getAction()) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/register/close'));
     }
 }
Exemple #18
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run', array('backurl' => WindUrlHelper::createUrl('my/invite/run'))));
     }
     $this->regist = Wekit::C('register');
     $this->setOutput('invite', 'li');
 }
Exemple #19
0
 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");
     }
 }
Exemple #20
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->showError('login.not', 'u/login/run');
     }
     if (!Wekit::C('app_majia', 'isopen')) {
         $this->showError('马甲绑定没有开启');
     }
 }
 /**
  * (non-PHPdoc)
  * @see src/library/base/PwBaseController::afterAction()
  */
 public function afterAction($handlerAdapter)
 {
     $this->setTheme('space', $this->space->space['space_style']);
     //$this->addCompileDir($this->space->space['space_style'] ? $this->space->space['space_style'] : Wekit::C('site', 'theme.space.default'));
     $host = $this->space->tome == PwSpaceModel::MYSELF ? '我' : 'Ta';
     $this->setOutput($this->space, 'space');
     $this->setOutput($host, 'host');
     $this->updateSpaceOnline();
     parent::afterAction($handlerAdapter);
 }
Exemple #22
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('my/article/run')));
     }
     if (!$this->loginUser->getPermission('allow_report')) {
         $this->showError(array('report.allow', array('{grouptitle}' => $this->loginUser->getGroupInfo('name'))));
     }
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if ($this->loginUser->uid < 1) {
         $this->showError('login.not');
     }
     if ($this->loginUser->getPermission('remind_open') < 1) {
         $this->showError('bbs:remind.remind_open.error');
     }
 }
Exemple #24
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!Wekit::C('site', 'app.dongta.ifopen')) {
         $this->showError('动他一下应用,关闭了');
     }
     if (!$this->loginUser->isExists()) {
         $this->showError('login.not');
     }
 }
Exemple #25
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run', array('_type' => $this->getInput('_type'))));
     }
     $this->conf = Wekit::C('app_verify');
     if (!$this->conf['verify.isopen']) {
         $this->forwardRedirect(WindUrlHelper::createUrl('bbs/index/run'));
     }
 }
Exemple #26
0
	public function beforeAction($handlerAdapter) {
		parent::beforeAction($handlerAdapter);
		if (!$this->loginUser->isExists()) {
			$this->showError('login.not');
		}
		$this->action = $handlerAdapter->getAction();
		$this->manage = $this->_getManage($this->action);
		if (($result = $this->manage->check()) !== true) {
			$this->showError($result->getError());
		}
	}
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run'));
     }
     $action = $handlerAdapter->getAction();
     $controller = $handlerAdapter->getController();
     $this->setOutput($action, '_action');
     $this->setOutput($controller, '_controller');
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $_config_securityKey = Wekit::C()->getConfigByName('site', 'securityKey');
     $this->_securityKey = $_config_securityKey['value'];
     //
     $this->authSessionKey();
     //
     //更新来往appKey&appSecret
     $this->_getLaiWangSerivce();
 }
Exemple #29
0
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $config = Wekit::C('site');
     if (!$config['medal.isopen']) {
         $this->showError('MEDAL:medal.is.close');
     }
     if (!$this->loginUser->isExists()) {
         $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('medal/index/run')));
     }
 }
 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     if (!$this->loginUser->isExists()) {
         $this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('task/index/run')));
     }
     if (0 == Wekit::C('site', 'task.isOpen')) {
         $this->showError('TASK:app.no.open');
     }
     $this->setOutput($this->perpage, 'perpage');
 }